Document SECRET_KEY_BASE requirements

This commit is contained in:
2026-11-09 22:31:07 +01:00
parent 56d51347b9
commit 8b25020737
+21
View File
@@ -150,6 +150,27 @@ openssl rand -base64 64 # SECRET_KEY_BASE
openssl rand -hex 32 # Postgres password openssl rand -hex 32 # Postgres password
``` ```
### Secret key base
`SECRET_KEY_BASE` is required in production; the release raises at boot without
it. It signs cookies, session tokens, LiveView tokens, and mailing-list
confirmation links.
Generate it with `mix phx.gen.secret` or:
```sh
openssl rand -base64 64
```
Keep it stable. Rotating it signs every user out and invalidates outstanding
confirmation and unsubscribe links. Never reuse the dev/test value or commit it.
Verify it is set without printing it:
```sh
sudo awk -F= '/^SECRET_KEY_BASE=/{print length($2)}' /etc/chesstrainer/env
```
## Postgres env file ## Postgres env file
`/etc/chesstrainer/postgres.env`: `/etc/chesstrainer/postgres.env`: