🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!
Security: remove built-in database credential defaults
Omega (QA)5c666eb79393
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex cd0f7a6..9e8ff2e 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -30,6 +30,8 @@ jobs:DB_NAME: warranty_test_suiteDB_USER: warranty_userDB_PASSWORD: ci-test-password+ DB_ADMIN_USER: warranty_user+ DB_ADMIN_PASSWORD: ci-test-passwordSECRET_KEY: ci-test-secret-keyUPLOAD_FOLDER: /tmp/warracker-test-uploadsdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex 06c9552..a4065d9 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,10 @@# Changelog+## 1.0.7 - Unreleased++- **Database credential defaults removed (#221, by Nam0101):** the built-in defaults for `DB_USER`, `DB_PASSWORD`, `DB_ADMIN_USER`, and `DB_ADMIN_PASSWORD` are gone, completing the deprecation announced in 1.0.5. The app, the migration runner, and the permissions script now stop with a clear message naming any missing variable instead of falling back to known credentials. `DATABASE_URL` still works as before: a URL containing a username and password supplies the app credentials, and the two admin variables remain required because migrations use them. Both shipped Docker Compose files, the env examples, and the Unraid template set all four explicitly, so installs that follow them need no action. The Unraid template also no longer prefills a default admin password.+ - _Files: `backend/config.py`, `backend/db_handler.py`, `backend/fix_permissions.py`, `backend/migrations/apply_migrations.py`, `Docker/entrypoint.sh`, `env.example`, `unraid/warracker.xml`, `tests/conftest.py`, `.github/workflows/tests.yml`, `tests/test_db_credentials_required.py`_+## 1.0.6 - 2026-11-10- **Docker image fails to start, fixed (#293):** the 1.0.5 image crashes on boot with "ModuleNotFoundError: No module named 'packaging'" and gunicorn never starts. The gevent worker class gunicorn loads imports the packaging module, but gunicorn declares packaging only in its optional "gevent" extra, and the requirements file installs plain gunicorn, so pip never installed it. The 1.0.4 image worked because it copied the builder's whole /usr/local, which happened to carry packaging along; the 1.0.5 image diet copies only the virtualenv, which exposed the missing pin. packaging is now pinned explicitly in the requirements file, and a regression test guards the pin. Verified in clean virtualenvs built from the old and new requirements: the old set reproduces the ModuleNotFoundError on worker load, the new set loads the worker.diff --git a/Docker/entrypoint.sh b/Docker/entrypoint.shindex 370901a..7f6901f 100644--- a/Docker/entrypoint.sh+++ b/Docker/entrypoint.sh@@ -23,7 +23,7 @@ echo "=== Warracker ${APP_VERSION} ==="DB_DISPLAY_HOST="${DB_HOST:-localhost}"DB_DISPLAY_PORT="${DB_PORT:-5432}"DB_DISPLAY_NAME="${DB_NAME:-warranty_db}"-DB_DISPLAY_USER="${DB_USER:-warranty_user}"+DB_DISPLAY_USER="${DB_USER:-not set}"log "Database: ${DB_DISPLAY_HOST}:${DB_DISPLAY_PORT}, database ${DB_DISPLAY_NAME}, user ${DB_DISPLAY_USER}"if [ "${DISABLE_NGINX:-false}" = "true" ]; thenlog "Web: nginx disabled, gunicorn serves directly on port 5000"diff --git a/backend/config.py b/backend/config.pyindex bb444e2..220220a 100644--- a/backend/config.py+++ b/backend/config.py@@ -2,6 +2,7 @@import osimport loggingfrom datetime import timedelta+from urllib.parse import unquote, urlparselogger = logging.getLogger(__name__)@@ -38,10 +39,10 @@ class Config:# Database ConfigurationDB_HOST = os.environ.get('DB_HOST', 'warrackerdb')DB_NAME = os.environ.get('DB_NAME', 'warranty_db')- DB_USER = os.environ.get('DB_USER', 'warranty_user')- DB_PASSWORD = os.environ.get('DB_PASSWORD', 'warranty_password')- DB_ADMIN_USER = os.environ.get('DB_ADMIN_USER', 'warracker_admin')- DB_ADMIN_PASSWORD = os.environ.get('DB_ADMIN_PASSWORD', 'default_admin_password')+ DB_USER = os.environ.get('DB_USER')+ DB_PASSWORD = os.environ.get('DB_PASSWORD')+ DB_ADMIN_USER = os.environ.get('DB_ADMIN_USER')+ DB_ADMIN_PASSWORD = os.environ.get('DB_ADMIN_PASSWORD')# File Upload ConfigurationUPLOAD_FOLDER = os.environ.get('UPLOAD_FOLDER', '/data/uploads')@@ -81,30 +82,47 @@ class Config:MAX_COOKIE_SIZE = 4093 # Slightly under 4KB limitUSE_X_SENDFILE = False # Serve files directly via Flask; nginx is not configured to handle X-Sendfile+ DB_VARS = ('DB_USER', 'DB_PASSWORD', 'DB_ADMIN_USER', 'DB_ADMIN_PASSWORD')+@staticmethod- def _warn_unset_db_vars(app):- # Built-in DB credential defaults are deprecated: installs should set- # all four variables explicitly. Warn for one release cycle (1.0.5);- # the defaults are removed and the variables become required in 1.0.7.+ def _missing_db_vars(app):+ """Return required database credential variables with no value.++ DATABASE_URL can supply the application user and password, as it+ already takes precedence in the database handlers. The separate+ admin credentials remain required because migrations use them to+ manage the application role.+ """if app.config.get('TESTING'):- return- unset_vars = [- var for var in ('DB_USER', 'DB_PASSWORD', 'DB_ADMIN_USER', 'DB_ADMIN_PASSWORD')- if not os.environ.get(var)- ]- if unset_vars:- logger.warning(- "DEPRECATION WARNING: %s not set explicitly, so built-in default "- "database credentials are in use. These defaults are deprecated and "- "will be removed in version 1.0.7, when all four variables will be "- "required. Set them in your environment or .env file.",- ', '.join(unset_vars))+ return []++ values = {var: app.config.get(var) for var in Config.DB_VARS}+ database_url = os.environ.get('DATABASE_URL')+ if database_url:+ parsed = urlparse(database_url)+ if parsed.username and not values['DB_USER']:+ values['DB_USER'] = unquote(parsed.username)+ if parsed.password and not values['DB_PASSWORD']:+ values['DB_PASSWORD'] = unquote(parsed.password)++ return [var for var, value in values.items() if not value]++ @staticmethod+ def _validate_db_vars(app):+ missing_vars = Config._missing_db_vars(app)+ if missing_vars:+ raise RuntimeError(+ "Missing required database environment variables: "+ + ', '.join(missing_vars)+ + ". Set DB_USER, DB_PASSWORD, DB_ADMIN_USER, and "+ "DB_ADMIN_PASSWORD in your environment or .env file."+ )@staticmethoddef init_app(app):"""Initialize configuration-specific settings."""+ Config._validate_db_vars(app)Config._check_secret_key()- Config._warn_unset_db_vars(app)if not os.path.exists(Config.UPLOAD_FOLDER):try:diff --git a/backend/db_handler.py b/backend/db_handler.pyindex a85a8e1..5a9a711 100644--- a/backend/db_handler.py+++ b/backend/db_handler.py@@ -16,11 +16,19 @@ DATABASE_URL = os.environ.get('DATABASE_URL')DB_HOST = os.environ.get('DB_HOST', 'warrackerdb')DB_PORT = os.environ.get('DB_PORT', '5432')DB_NAME = os.environ.get('DB_NAME', 'warranty_db')-DB_USER = os.environ.get('DB_USER', 'warranty_user')-DB_PASSWORD = os.environ.get('DB_PASSWORD', 'warranty_password')+DB_USER = os.environ.get('DB_USER')+DB_PASSWORD = os.environ.get('DB_PASSWORD')++def _require_db_credentials():+ if not DATABASE_URL and (not DB_USER or not DB_PASSWORD):+ raise RuntimeError(+ "Missing required database environment variables: "+ "DB_USER and DB_PASSWORD must be set when DATABASE_URL is not used."+ )def _connection_kwargs():"""psycopg2 connection kwargs: DATABASE_URL wins over DB_* parts."""+ _require_db_credentials()if DATABASE_URL:return {'dsn': DATABASE_URL}return {@@ -68,6 +76,8 @@ def init_db_pool(max_retries=5, retry_delay=5):logger.info("[DB_HANDLER] Database connection pool already initialized for this process.")return connection_pool+ _require_db_credentials()+while attempt < max_retries:try:logger.info(f"[DB_HANDLER] Attempting to initialize database pool (attempt {attempt+1}/{max_retries})")diff --git a/backend/fix_permissions.py b/backend/fix_permissions.pyindex e2c7f38..276d990 100644--- a/backend/fix_permissions.py+++ b/backend/fix_permissions.py@@ -18,11 +18,16 @@ logger = logging.getLogger(__name__)DB_HOST = os.environ.get('DB_HOST', 'warrackerdb')DB_PORT = os.environ.get('DB_PORT', '5432')DB_NAME = os.environ.get('DB_NAME', 'warranty_db')-DB_USER = os.environ.get('DB_USER', 'warranty_user')-DB_PASSWORD = os.environ.get('DB_PASSWORD', 'warranty_password')+DB_USER = os.environ.get('DB_USER')+DB_PASSWORD = os.environ.get('DB_PASSWORD')def create_db_connection(max_retries=5, retry_delay=5):"""Create a database connection with retry logic"""+ if not DB_USER or not DB_PASSWORD:+ raise RuntimeError(+ "Missing required database environment variables: "+ "DB_USER and DB_PASSWORD must be set."+ )attempt = 0last_exception = Nonediff --git a/backend/migrations/apply_migrations.py b/backend/migrations/apply_migrations.pyindex 32f1814..8fa8ec5 100644--- a/backend/migrations/apply_migrations.py+++ b/backend/migrations/apply_migrations.py@@ -38,8 +38,8 @@ def _db_parts():'host': p.hostname or 'localhost','port': str(p.port) if p.port else '5432','name': (p.path or '').lstrip('/') or 'warranty_db',- 'user': unquote(p.username) if p.username else 'warranty_user',- 'password': unquote(p.password) if p.password else 'warranty_password',+ 'user': unquote(p.username) if p.username else None,+ 'password': unquote(p.password) if p.password else None,}# Preserve URL query options (e.g. ?sslmode=require) instead of# silently dropping them (issue #108 follow-up).@@ -51,8 +51,8 @@ def _db_parts():'host': os.environ.get('DB_HOST', 'localhost'),'port': os.environ.get('DB_PORT', '5432'),'name': os.environ.get('DB_NAME', 'warranty_db'),- 'user': os.environ.get('DB_USER', 'warranty_user'),- 'password': os.environ.get('DB_PASSWORD', 'warranty_password'),+ 'user': os.environ.get('DB_USER'),+ 'password': os.environ.get('DB_PASSWORD'),}_DB = _db_parts()@@ -61,11 +61,31 @@ DB_PORT = _DB['port']DB_NAME = _DB['name']DB_USER = _DB['user']DB_PASSWORD = _DB['password']-DB_ADMIN_USER = os.environ.get('DB_ADMIN_USER', 'warracker_admin')-DB_ADMIN_PASSWORD = os.environ.get('DB_ADMIN_PASSWORD', 'change_this_password_in_production')+DB_ADMIN_USER = os.environ.get('DB_ADMIN_USER')+DB_ADMIN_PASSWORD = os.environ.get('DB_ADMIN_PASSWORD')++def _validate_db_credentials():+ missing = []+ if not DB_USER:+ missing.append('DB_USER')+ if not DB_PASSWORD:+ missing.append('DB_PASSWORD')+ if not DB_ADMIN_USER:+ missing.append('DB_ADMIN_USER')+ if not DB_ADMIN_PASSWORD:+ missing.append('DB_ADMIN_PASSWORD')+ if missing:+ raise RuntimeError(+ "Missing required database environment variables: "+ + ', '.join(missing)+ + ". Set all four variables in your environment or .env file; "+ "DATABASE_URL must include a username and password when it is "+ "used instead of DB_USER and DB_PASSWORD."+ )def get_db_connection(max_attempts=5, attempt_delay=5):"""Get a connection to the PostgreSQL database with retry logic"""+ _validate_db_credentials()for attempt in range(1, max_attempts + 1):try:logger.info(f"Attempting to connect to database (attempt {attempt}/{max_attempts})")diff --git a/env.example b/env.exampleindex c51057e..2f8c1eb 100644--- a/env.example+++ b/env.example@@ -2,10 +2,8 @@# Copy this file to .env and modify the values as needed# Database Configuration-# Set all four variables explicitly. Built-in defaults still apply-# when they are unset, but those defaults are deprecated: the app-# logs a warning naming any that are missing, and they will be-# removed in 1.0.7, when all four become required.+# Set all four variables explicitly. There are no built-in defaults:+# startup fails if any required database credential is missing.DB_USER=warranty_userDB_PASSWORD=your_secure_database_passwordDB_ADMIN_USER=warracker_admindiff --git a/tests/conftest.py b/tests/conftest.pyindex 9a3db35..0fe33ad 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -32,6 +32,8 @@ os.environ.setdefault("DB_PORT", "5432")os.environ.setdefault("DB_NAME", "warranty_test_suite")os.environ.setdefault("DB_USER", "warranty_user")os.environ.setdefault("DB_PASSWORD", "warranty_password")+os.environ.setdefault("DB_ADMIN_USER", os.environ["DB_USER"])+os.environ.setdefault("DB_ADMIN_PASSWORD", os.environ["DB_PASSWORD"])os.environ.setdefault("SECRET_KEY", "warracker-test-secret-key-0123456789")# Cap uploads at 1 MB so the 413 path is testable with a small file.os.environ.setdefault("MAX_UPLOAD_MB", "1")diff --git a/tests/test_config_deprecation.py b/tests/test_config_deprecation.pydeleted file mode 100644index caab2d7..0000000--- a/tests/test_config_deprecation.py+++ /dev/null@@ -1,112 +0,0 @@-"""Deprecation of the built-in database credential defaults (#221).--1.0.5 keeps the defaults working but warns at startup about any of-DB_USER / DB_PASSWORD / DB_ADMIN_USER / DB_ADMIN_PASSWORD that are not-set explicitly; 1.0.7 removes the defaults and makes them required.-These tests pin the softened behavior so the 1.0.7 flip is a-deliberate change, not a surprise.-"""-import logging--import pytest-from flask import Flask--from backend.config import Config, ProductionConfig--DB_VARS = ("DB_USER", "DB_PASSWORD", "DB_ADMIN_USER", "DB_ADMIN_PASSWORD")---def bare_app():- return Flask(__name__)---def _clear_db_env(monkeypatch):- for var in DB_VARS:- monkeypatch.delenv(var, raising=False)---def test_warns_naming_all_unset_vars(bare_app, monkeypatch, caplog):- _clear_db_env(monkeypatch)- with caplog.at_level(logging.WARNING, logger="backend.config"):- Config._warn_unset_db_vars(bare_app)- messages = [r.getMessage() for r in caplog.records- if "DEPRECATION WARNING" in r.getMessage()]- assert len(messages) == 1- for var in DB_VARS:- assert var in messages[0]- assert "1.0.7" in messages[0]---def test_warns_only_for_the_unset_vars(bare_app, monkeypatch, caplog):- _clear_db_env(monkeypatch)- monkeypatch.setenv("DB_USER", "alice")- monkeypatch.setenv("DB_PASSWORD", "secret")- with caplog.at_level(logging.WARNING, logger="backend.config"):- Config._warn_unset_db_vars(bare_app)- messages = [r.getMessage() for r in caplog.records- if "DEPRECATION WARNING" in r.getMessage()]- assert len(messages) == 1- assert "DB_ADMIN_USER" in messages[0]- assert "DB_ADMIN_PASSWORD" in messages[0]- assert "DB_USER" not in messages[0].split(":", 1)[1].split("not set")[0]---def test_no_warning_when_all_set(bare_app, monkeypatch, caplog):- for var in DB_VARS:- monkeypatch.setenv(var, "set-value")- with caplog.at_level(logging.WARNING, logger="backend.config"):- Config._warn_unset_db_vars(bare_app)- assert not [r for r in caplog.records- if "DEPRECATION WARNING" in r.getMessage()]---def test_no_warning_in_testing(bare_app, monkeypatch, caplog):- _clear_db_env(monkeypatch)- bare_app.config["TESTING"] = True- with caplog.at_level(logging.WARNING, logger="backend.config"):- Config._warn_unset_db_vars(bare_app)- assert not [r for r in caplog.records- if "DEPRECATION WARNING" in r.getMessage()]---def test_production_init_starts_on_defaults(bare_app, monkeypatch, caplog):- """The softened #221: production init must not refuse to start."""- _clear_db_env(monkeypatch)- with caplog.at_level(logging.WARNING, logger="backend.config"):- ProductionConfig.init_app(bare_app)- assert any("DEPRECATION WARNING" in r.getMessage()- for r in caplog.records)---def test_builtin_defaults_still_present():- """Pins the 1.0.5 state; 1.0.7 removes these defaults on purpose.-- The class attributes are bound from the environment at import- time, so read them in a subprocess with the four variables- removed from the environment.- """- import json- import os- import subprocess- import sys-- env = {k: v for k, v in os.environ.items() if k not in DB_VARS}- code = (- "import json; from backend.config import Config; "- "print(json.dumps([Config.DB_USER, Config.DB_PASSWORD, "- "Config.DB_ADMIN_USER, Config.DB_ADMIN_PASSWORD]))"- )- result = subprocess.run(- [sys.executable, "-c", code], env=env,- capture_output=True, text=True, timeout=60,- cwd=os.path.dirname(os.path.dirname(os.path.abspath(__file__))),- )- assert result.returncode == 0, result.stderr- values = json.loads(result.stdout.strip().splitlines()[-1])- assert values == [- "warranty_user",- "warranty_password",- "warracker_admin",- "default_admin_password",- ]diff --git a/tests/test_db_credentials_required.py b/tests/test_db_credentials_required.pynew file mode 100644index 0000000..98b95ee--- /dev/null+++ b/tests/test_db_credentials_required.py@@ -0,0 +1,163 @@+"""Required database credentials for 1.0.7 (#221).++The built-in defaults for DB_USER, DB_PASSWORD, DB_ADMIN_USER, and+DB_ADMIN_PASSWORD are gone. Startup and the standalone database scripts+must fail with a clear message naming what is missing, instead of+silently falling back to known credentials.+"""+import importlib.util+import json+import os+import subprocess+import sys++import pytest+from flask import Flask++from backend.config import Config++DB_VARS = ("DB_USER", "DB_PASSWORD", "DB_ADMIN_USER", "DB_ADMIN_PASSWORD")+REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+++def _app_with_db_values(**values):+ app = Flask(__name__)+ app.config["TESTING"] = False+ for var in DB_VARS:+ app.config[var] = values.get(var)+ return app+++def test_missing_all_db_vars_are_named(monkeypatch):+ monkeypatch.delenv("DATABASE_URL", raising=False)+ app = _app_with_db_values()+ assert Config._missing_db_vars(app) == list(DB_VARS)+ with pytest.raises(RuntimeError) as excinfo:+ Config.init_app(app)+ for var in DB_VARS:+ assert var in str(excinfo.value)+++def test_missing_only_admin_vars_are_named(monkeypatch):+ monkeypatch.delenv("DATABASE_URL", raising=False)+ app = _app_with_db_values(DB_USER="alice", DB_PASSWORD="secret")+ assert Config._missing_db_vars(app) == ["DB_ADMIN_USER", "DB_ADMIN_PASSWORD"]+++def test_database_url_can_supply_app_credentials(monkeypatch):+ app = _app_with_db_values(+ DB_ADMIN_USER="admin", DB_ADMIN_PASSWORD="admin-secret")+ monkeypatch.setenv(+ "DATABASE_URL", "postgresql://alice:secret@db:5432/warranty_db")+ assert Config._missing_db_vars(app) == []++ monkeypatch.setenv(+ "DATABASE_URL", "postgresql://alice@db:5432/warranty_db")+ assert Config._missing_db_vars(app) == ["DB_PASSWORD"]+++def test_testing_config_skips_db_validation(monkeypatch):+ monkeypatch.delenv("DATABASE_URL", raising=False)+ app = _app_with_db_values()+ app.config["TESTING"] = True+ assert Config._missing_db_vars(app) == []+++def test_init_app_succeeds_when_all_db_vars_are_set(monkeypatch):+ monkeypatch.delenv("DATABASE_URL", raising=False)+ app = _app_with_db_values(+ DB_USER="alice", DB_PASSWORD="secret",+ DB_ADMIN_USER="admin", DB_ADMIN_PASSWORD="admin-secret")+ Config.init_app(app)+ assert app.config["MAX_CONTENT_LENGTH"] > 0+++def test_no_builtin_defaults_in_a_clean_process():+ env = {k: v for k, v in os.environ.items()+ if k not in DB_VARS and k != "DATABASE_URL"}+ env["SECRET_KEY"] = "test-secret"+ code = """+import importlib.util+import json++from backend.config import Config+from backend import db_handler++spec = importlib.util.spec_from_file_location(+ "apply_migrations", "backend/migrations/apply_migrations.py")+migrations = importlib.util.module_from_spec(spec)+spec.loader.exec_module(migrations)++print(json.dumps([+ Config.DB_USER, Config.DB_PASSWORD,+ Config.DB_ADMIN_USER, Config.DB_ADMIN_PASSWORD,+ db_handler.DB_USER, db_handler.DB_PASSWORD,+ migrations.DB_USER, migrations.DB_PASSWORD,+ migrations.DB_ADMIN_USER, migrations.DB_ADMIN_PASSWORD,+]))+"""+ result = subprocess.run(+ [sys.executable, "-c", code], env=env,+ capture_output=True, text=True, timeout=60, cwd=REPO_ROOT)+ assert result.returncode == 0, result.stderr+ values = json.loads(result.stdout.strip().splitlines()[-1])+ assert values == [None] * 10+++def test_db_handler_rejects_missing_app_credentials(monkeypatch):+ from backend import db_handler++ monkeypatch.setattr(db_handler, "DATABASE_URL", None)+ monkeypatch.setattr(db_handler, "DB_USER", None)+ monkeypatch.setattr(db_handler, "DB_PASSWORD", "secret")+ with pytest.raises(RuntimeError, match="DB_USER and DB_PASSWORD"):+ db_handler._connection_kwargs()+++def test_fix_permissions_rejects_missing_app_credentials(monkeypatch):+ from backend import fix_permissions++ monkeypatch.setattr(fix_permissions, "DB_USER", "alice")+ monkeypatch.setattr(fix_permissions, "DB_PASSWORD", None)+ with pytest.raises(RuntimeError, match="DB_USER and DB_PASSWORD"):+ fix_permissions.create_db_connection(max_retries=1, retry_delay=0)+++def test_apply_migrations_rejects_missing_admin_credentials():+ spec = importlib.util.spec_from_file_location(+ "apply_migrations_under_test",+ os.path.join(REPO_ROOT, "backend", "migrations", "apply_migrations.py"))+ migrations = importlib.util.module_from_spec(spec)+ spec.loader.exec_module(migrations)+ migrations.DB_USER = "alice"+ migrations.DB_PASSWORD = "secret"+ migrations.DB_ADMIN_USER = None+ migrations.DB_ADMIN_PASSWORD = None+ with pytest.raises(RuntimeError) as excinfo:+ migrations._validate_db_credentials()+ assert "DB_ADMIN_USER" in str(excinfo.value)+ assert "DB_ADMIN_PASSWORD" in str(excinfo.value)+++def test_no_credential_fallbacks_remain_in_runtime_sources():+ runtime_files = [+ "backend/config.py",+ "backend/db_handler.py",+ "backend/fix_permissions.py",+ "backend/migrations/apply_migrations.py",+ ]+ forbidden = [+ "os.environ.get('DB_USER',",+ "os.environ.get('DB_PASSWORD',",+ "os.environ.get('DB_ADMIN_USER',",+ "os.environ.get('DB_ADMIN_PASSWORD',",+ "else 'warranty_user'",+ "else 'warranty_password'",+ ]+ for relative_path in runtime_files:+ source = open(os.path.join(REPO_ROOT, relative_path)).read()+ for snippet in forbidden:+ assert snippet not in source, f"{snippet} remains in {relative_path}"++ unraid_template = open(os.path.join(REPO_ROOT, "unraid", "warracker.xml")).read()+ assert "default_admin_password" not in unraid_templatediff --git a/unraid/warracker.xml b/unraid/warracker.xmlindex 23860a0..0382f05 100644--- a/unraid/warracker.xml+++ b/unraid/warracker.xml@@ -51,12 +51,12 @@Display="always" Required="true" Mask="true"></Config><Config Name="DB_ADMIN_USER" Target="DB_ADMIN_USER" Default="warracker_admin" Mode=""- Description="PostgreSQL admin username, used for database migrations. Set it explicitly: the built-in default is deprecated and will be removed in 1.0.7. Pre-filled with the value Warracker assumes by default; change it if your PostgreSQL admin user differs." Type="Variable"+ Description="PostgreSQL admin username, used for database migrations. Required: Warracker has no built-in default. Pre-filled with the example value; change it if your PostgreSQL admin user differs." Type="Variable"Display="always" Required="true" Mask="false">warracker_admin</Config>- <Config Name="DB_ADMIN_PASSWORD" Target="DB_ADMIN_PASSWORD" Default="default_admin_password" Mode=""- Description="PostgreSQL admin password, used for database migrations. Set it explicitly: the built-in default is deprecated and will be removed in 1.0.7. Pre-filled with the value Warracker assumes by default; change it to your PostgreSQL admin password." Type="Variable"- Display="always" Required="true" Mask="true">default_admin_password</Config>+ <Config Name="DB_ADMIN_PASSWORD" Target="DB_ADMIN_PASSWORD" Default="" Mode=""+ Description="PostgreSQL admin password, used for database migrations. Required: Warracker has no built-in default. Set it to your PostgreSQL admin password." Type="Variable"+ Display="always" Required="true" Mask="true"></Config><Config Name="SECRET_KEY" Target="SECRET_KEY" Default="" Mode=""Description="Secret key for Flask sessions and JWT. Generate a random string (e.g. openssl rand -hex 32)." Type="Variable"