From df6f32dec656a0439eb67a5597a57034b737aa54 Mon Sep 17 00:00:00 2001 From: pstruebi Date: Fri, 31 Oct 2025 10:44:02 +0100 Subject: [PATCH] feat: centralize frontend auth credentials storage - Changed frontend password storage location from ~/.config/auracast to server directory for better organization - Renamed password file from frontend_pw.json to credentials.json to match server conventions - Updated .gitignore to exclude credentials.json from version control - Removed environment variable AURACAST_STATE_DIR support since storage location is now fixed --- .gitignore | 1 + src/auracast/utils/frontend_auth.py | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0cbe8da..60d0bd9 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ src/auracast/server/stream_settings.json src/auracast/server/certs/per_device/ src/auracast/.env src/auracast/server/certs/ca/ca_cert.srl +src/auracast/server/credentials.json diff --git a/src/auracast/utils/frontend_auth.py b/src/auracast/utils/frontend_auth.py index e1d4111..5bd989b 100644 --- a/src/auracast/utils/frontend_auth.py +++ b/src/auracast/utils/frontend_auth.py @@ -25,17 +25,15 @@ def is_pw_disabled() -> bool: return str(val).strip().lower() in ("1", "true", "yes", "on") -# Storage paths and permissions +# Storage paths and permissions (store next to multicast_frontend.py) def state_dir() -> Path: - custom = os.getenv("AURACAST_STATE_DIR") - if custom: - return Path(custom).expanduser() - return Path.home() / ".config" / "auracast" + # utils/ -> auracast/ -> server/ + return Path(__file__).resolve().parents[1] / "server" def pw_file_path() -> Path: - return state_dir() / "frontend_pw.json" + return state_dir() / "credentials.json" def ensure_state_dir() -> None: