fix: Configuration creation bug due to failed Nonetype checking
Some checks failed
Docker Build and Push / docker_build (push) Has been cancelled
Docker Build and Push / docker_scan (push) Has been cancelled

This commit is contained in:
DaanSelen
2026-02-16 18:54:10 +01:00
parent 8e08d20497
commit bb18c55003
3 changed files with 12 additions and 5 deletions

View File

@@ -176,8 +176,16 @@ set_envvars() {
set_ini Peers peer_global_dns "${global_dns}"
if [ -z "${public_ip}" ]; then
public_ip=$(curl -s ifconfig.me)
echo "Automatically detected public IP: ${public_ip}"
public_ip=$(curl -s https://ifconfig.me)
if [ -z "${public_ip}" ]; then
echo "Using fallback public IP resolution website"
public_ip=$(curl -s https://api.ipify.org)
fi
if [ -z "${public_ip}" ]; then
echo "Failed to resolve publicly. Using private address."
public_ip=$(hostname -i)
fi
echo "Automatically detected public IP: ${public_ip}"
fi
set_ini Peers remote_endpoint "${public_ip}"

View File

@@ -135,6 +135,8 @@ class DashboardConfig:
]
for table_name in tables_to_check:
if not table_name:
continue
if not inspector.has_table(table_name):
continue

View File

@@ -1,7 +1,6 @@
import configparser
import os
from sqlalchemy_utils import database_exists, create_database
from flask import current_app
def ConnectionString(database) -> str:
parser = configparser.ConfigParser(strict=False)
@@ -20,9 +19,7 @@ def ConnectionString(database) -> str:
try:
if not database_exists(cn):
create_database(cn)
current_app.logger.info(f"Database {database} created.")
except Exception as e:
current_app.logger.error("Database error. Terminating...", e)
exit(1)
return cn