"""Application configuration via environment variables.""" import os DB_PATH: str = os.getenv("TEN31_DB_PATH", "/data/ten31portal/portal.db") SESSION_SECRET: str = os.getenv("TEN31_SESSION_SECRET", "change-me-in-production") DOCS_DIR: str = os.getenv("TEN31_DOCS_DIR", "/data/ten31portal/documents") # Cap on a single uploaded document. The docs dir shares the data volume with the DB, so an # unbounded upload could fill the disk and take the portal down. Default 50 MB. The same cap # also bounds spreadsheet imports (which must be read fully into memory to parse). MAX_UPLOAD_SIZE: int = int(os.getenv("TEN31_MAX_UPLOAD_SIZE", str(50 * 1024 * 1024))) # Where start.sh records the randomly-generated initial admin password on first boot, so the # operator can retrieve it once (via the "Show Initial Admin Password" service action) and then # change it. Lives next to the DB on the 0600 data volume; removed once the password is reset. ADMIN_PASSWORD_FILE: str = os.path.join(os.path.dirname(DB_PATH) or ".", ".admin-password")