1
0

.env.example 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Entra ID / OIDC
  2. ENTRA_TENANT_ID=
  3. ENTRA_CLIENT_ID=
  4. ENTRA_CLIENT_SECRET=
  5. # Hard switch to disable OIDC even when ENTRA_* are populated. Useful for
  6. # dev / testing / on-prem deployments that want to keep the Entra creds in
  7. # .env but route everyone through the LOCAL_ADMIN_* fallback below. Accepted
  8. # disabling values: false / 0 / no / off (case-insensitive). Anything else,
  9. # including blank, leaves OIDC enabled.
  10. # In APP_ENV=production the bootstrap refuses to start when neither OIDC nor
  11. # LOCAL_ADMIN_* is enabled — so disabling OIDC in prod requires a working
  12. # local admin.
  13. OIDC_ENABLED=true
  14. # Base URL the app is reachable at (no trailing slash).
  15. # Used to build the OIDC redirect URI {APP_BASE_URL}/auth/callback
  16. APP_BASE_URL=http://localhost:8080
  17. # Path to the SQLite database file inside the container. Leave as-is unless
  18. # you have a specific reason to change it. The parent dir is the mounted
  19. # volume (/var/www/data).
  20. DB_PATH=/var/www/data/app.sqlite
  21. # Session handler files directory.
  22. SESSION_PATH=/var/www/data/sessions
  23. # 'production' disables verbose error output. Anything else is treated as dev.
  24. APP_ENV=production
  25. # ---------------------------------------------------------------------------
  26. # Reverse-proxy trust (R01-N05 / R01-N07). Comma-separated list of CIDRs of
  27. # the proxies in front of the app. When the immediate peer (`REMOTE_ADDR`)
  28. # matches one of these:
  29. # * `X-Forwarded-For` is walked to find the real client IP — used for the
  30. # audit log and the local-admin login throttle bucket;
  31. # * `X-Forwarded-Proto: https` is honoured for cookie `Secure` / HSTS
  32. # decisions, so a TLS-terminating proxy can mark requests as HTTPS.
  33. # Leave blank when the app is exposed directly with no reverse proxy. Examples:
  34. # TRUSTED_PROXIES=10.0.0.0/8,192.168.0.0/16
  35. # TRUSTED_PROXIES=172.16.0.5,2001:db8::/32
  36. # ---------------------------------------------------------------------------
  37. TRUSTED_PROXIES=
  38. # ---------------------------------------------------------------------------
  39. # OIDC bootstrap admin (optional) — nominate the very first administrator up
  40. # front, so a public-facing first deploy can't be land-grabbed by another
  41. # tenant member who happens to sign in before you. Auto-promotion to admin
  42. # happens via OIDC iff no admin exists yet AND the signing user matches one
  43. # of the values below (case-insensitive). With both variables blank, the
  44. # OIDC path NEVER auto-promotes — seed the first admin via the local-admin
  45. # fallback below, or by manually flipping is_admin in the database.
  46. # Set BOOTSTRAP_ADMIN_OID to the Entra `oid` claim (a GUID, immutable) when
  47. # you know it; BOOTSTRAP_ADMIN_EMAIL is accepted as a fallback when you only
  48. # have the email.
  49. # ---------------------------------------------------------------------------
  50. BOOTSTRAP_ADMIN_OID=
  51. BOOTSTRAP_ADMIN_EMAIL=
  52. # ---------------------------------------------------------------------------
  53. # Local admin (optional) — lets you sign in without Entra, e.g. during initial
  54. # setup or for a fully on-prem deployment. Set BOTH email and the password
  55. # hash to enable; leave blank to disable. The password is verified with PHP's
  56. # password_verify() against LOCAL_ADMIN_PASSWORD_HASH, so .env never contains
  57. # the password itself. Generate the hash with:
  58. # docker run --rm php:8.3-cli php -r \
  59. # 'echo password_hash(readline("Password: "), PASSWORD_DEFAULT), PHP_EOL;'
  60. # (Or `php -r '...'` directly if you have PHP 8 on the host.) Paste the
  61. # resulting `$2y$...` string verbatim. Single quotes recommended in .env so
  62. # the `$` in the hash isn't interpreted by the shell.
  63. # The resulting user is stored with entra_oid = "local:<email>" and is_admin=1.
  64. # This path is itself an explicit env-bootstrap and does not require the
  65. # BOOTSTRAP_ADMIN_* variables above.
  66. # ---------------------------------------------------------------------------
  67. LOCAL_ADMIN_EMAIL=
  68. LOCAL_ADMIN_PASSWORD_HASH=
  69. LOCAL_ADMIN_NAME=Local Admin