Chapter 20
Deployment checklist
- Serve over HTTPS only (TLS proxy in front; set
HTTPS=1; add an HSTS header at the proxy). -
NODE_ENV=production,npm run build, thennpm run start(or adaptserver.tsinto your framework). - Set
SESSION_SECRET(32+ random bytes) and keep it identical across instances. - Generate a PFE key, set
PFE_KEY_FILE, setPFE_REQUIRE_KEY=1, and keep the key in a secrets manager. - Set
PASSWORD_PEPPERfrom a secrets manager; never store it in the database. - Replace the in-memory user store, sessions and rate-limit buckets with persistent and shared stores.
- Add your domain to
ALLOWED_HOSTS(editserver.tsor useEXTRA_ALLOWED_HOSTS). - Add a CAPTCHA/Turnstile to registration and sign-in.
- Check that the CSP is delivered as a response header (frame protection doesn't work from
<meta>). - Run
npm test,npm run test:pfeand the manual QA checklist. - Plan key rotation (see
docs/ENCRYPTION.md) and log monitoring that never records request bodies.