Prepara ambiente XWMS isolato e documenta gli stati UDC

This commit is contained in:
2026-10-29 16:13:27 +01:00
parent a874d09e40
commit f96da60231
44 changed files with 2047 additions and 274 deletions

View File

@@ -20,10 +20,10 @@ __version__ = module_version(__name__)
CONFIG_PATH = Path(__file__).with_name("db_connection.json")
DEFAULT_DB_CONFIG: dict[str, Any] = {
"server": r"mde3\gesterp",
"database": "Mediseawall",
"user": "sa",
"password": "1Password1",
"server": "HOMESERVER",
"database": "Xwmsdb",
"user": "xwms_local_app",
"password": "",
"driver": "ODBC Driver 17 for SQL Server",
"trust_server_certificate": True,
"encrypt": "",
@@ -60,6 +60,10 @@ def save_db_config(config: dict[str, Any], path: Path = CONFIG_PATH) -> None:
def build_dsn_from_config(config: dict[str, Any]) -> str:
"""Build the SQLAlchemy DSN from the saved configuration."""
if str(config.get("database", "")).strip().lower() != "xwmsdb":
raise ValueError("XWMS TEST: e' consentito soltanto il database Xwmsdb")
if str(config.get("server", "")).strip().lower() != "homeserver":
raise ValueError("XWMS TEST: e' consentita soltanto l'istanza locale HOMESERVER")
return make_mssql_dsn(
server=str(config.get("server") or "").strip(),
database=str(config.get("database") or "").strip(),