Changeset 09ee2bd in Klonkt for .env.example


Ignore:
Timestamp:
06/23/2026 09:25:42 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
f99bbe8
Parents:
45271b7
Message:

feat: auto-generate SESSION_SECRET if not set (zero-config Docker/manual)

If SESSION_SECRET is missing, generate a strong one on first boot and persist it
to <dataDir>/.session-secret (stable across restarts/updates). Env var still wins.
PUBLIC_BASE_URL already falls back to the request host. So Docker (B) and manual
(C) installs now run with no required .env editing. Docs + .env.example updated;
docker-compose comment translated to English.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • .env.example

    r45271b7 r09ee2bd  
    11NODE_ENV=development
    22PORT=3000
    3 SESSION_SECRET=change-me-to-a-strong-random-string-min-32-chars
     3# Secret used to sign login-session cookies. Leave EMPTY to auto-generate a strong
     4# one on first start (saved to storage/.session-secret, stays stable across
     5# restarts/updates). Or set your own: openssl rand -hex 32
     6SESSION_SECRET=
    47DATABASE_PATH=./storage/database.sqlite
    58MEDIA_PATH=./storage/media
    69
    7 # Canonical public URL of this site (scheme + host, no path/slash). Used for
    8 # links in emails (password reset) instead of request headers — prevents
    9 # host-header spoofing. Not set? Then it falls back to the request host (dev).
    10 PUBLIC_BASE_URL=https://example.com
     10# Canonical public URL of this site (scheme + host, no trailing slash), e.g.
     11# https://yourdomain.com . Used to build correct links in emails (password reset)
     12# and OAuth redirects instead of trusting request headers (anti-spoofing).
     13# Optional: leave empty and it falls back to the request host (fine for local/dev);
     14# set it for production so email/login links point at the right place.
     15PUBLIC_BASE_URL=
    1116
    1217# ── Administrator ───────────────────────────────────────────────────
Note: See TracChangeset for help on using the changeset viewer.