Auto-generate SESSION_SECRET_KEY when not provided

If the env var is unset, a random key is generated at startup. This
removes a manual setup step. The README and .env.example are updated
to reflect that the variable is now optional (but recommended in
production for session persistence across restarts).

https://claude.ai/code/session_018iMt5qm4j9bk8wzytLC3E6
This commit is contained in:
Claude
2026-02-27 22:12:31 +00:00
parent 003792f744
commit bf6b1180de
3 changed files with 6 additions and 4 deletions

View File

@@ -25,5 +25,6 @@ LIDARR_QUALITY_PROFILE_ID=1
LIDARR_ROOT_FOLDER=/music
# App
SESSION_SECRET_KEY=change-me-to-a-random-secret
# SESSION_SECRET_KEY is auto-generated if omitted. Set it explicitly so sessions survive restarts.
# SESSION_SECRET_KEY=
DATABASE_PATH=bellhop.db