From 8b25020737cce2d63eae6c9c2e9c1ef247f93f69 Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 9 Nov 2026 22:31:07 +0100 Subject: [PATCH] Document SECRET_KEY_BASE requirements --- deploy/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/deploy/README.md b/deploy/README.md index 155372c..48df37d 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -150,6 +150,27 @@ openssl rand -base64 64 # SECRET_KEY_BASE 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 `/etc/chesstrainer/postgres.env`: