.env.example 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. # Host port the docker-compose stack publishes (container side is fixed at
  18. # Apache:80). Pick any free port on the host. Keep APP_BASE_URL in sync —
  19. # the OIDC redirect URI registered in Entra must match exactly.
  20. HTTP_PORT=8080
  21. # Path to the SQLite database file inside the container. Leave as-is unless
  22. # you have a specific reason to change it. The parent dir is the mounted
  23. # volume (/var/www/data).
  24. DB_PATH=/var/www/data/app.sqlite
  25. # Session handler files directory.
  26. SESSION_PATH=/var/www/data/sessions
  27. # 'production' disables verbose error output. Anything else is treated as dev.
  28. APP_ENV=production
  29. # ---------------------------------------------------------------------------
  30. # Reverse-proxy trust (R01-N05 / R01-N07). Comma-separated list of CIDRs of
  31. # the proxies in front of the app. When the immediate peer (`REMOTE_ADDR`)
  32. # matches one of these:
  33. # * `X-Forwarded-For` is walked to find the real client IP — used for the
  34. # audit log and the local-admin login throttle bucket;
  35. # * `X-Forwarded-Proto: https` is honoured for cookie `Secure` / HSTS
  36. # decisions, so a TLS-terminating proxy can mark requests as HTTPS.
  37. # Leave blank when the app is exposed directly with no reverse proxy. Examples:
  38. # TRUSTED_PROXIES=10.0.0.0/8,192.168.0.0/16
  39. # TRUSTED_PROXIES=172.16.0.5,2001:db8::/32
  40. # ---------------------------------------------------------------------------
  41. TRUSTED_PROXIES=
  42. # ---------------------------------------------------------------------------
  43. # OIDC bootstrap admin (optional) — nominate the very first administrator up
  44. # front, so a public-facing first deploy can't be land-grabbed by another
  45. # tenant member who happens to sign in before you. Auto-promotion to admin
  46. # happens via OIDC iff no admin exists yet AND the signing user matches one
  47. # of the values below (case-insensitive). With both variables blank, the
  48. # OIDC path NEVER auto-promotes — seed the first admin via the local-admin
  49. # fallback below, or by manually flipping is_admin in the database.
  50. # Set BOOTSTRAP_ADMIN_OID to the Entra `oid` claim (a GUID, immutable) when
  51. # you know it; BOOTSTRAP_ADMIN_EMAIL is accepted as a fallback when you only
  52. # have the email.
  53. # ---------------------------------------------------------------------------
  54. BOOTSTRAP_ADMIN_OID=
  55. BOOTSTRAP_ADMIN_EMAIL=
  56. # ---------------------------------------------------------------------------
  57. # Local admin (optional) — lets you sign in without Entra, e.g. during initial
  58. # setup or for a fully on-prem deployment. Set BOTH email and the password
  59. # hash to enable; leave blank to disable. The password is verified with PHP's
  60. # password_verify() against LOCAL_ADMIN_PASSWORD_HASH, so .env never contains
  61. # the password itself. Generate the hash with:
  62. # docker run --rm php:8.3-cli php -r \
  63. # 'echo password_hash(readline("Password: "), PASSWORD_DEFAULT), PHP_EOL;'
  64. # (Or `php -r '...'` directly if you have PHP 8 on the host.) Paste the
  65. # resulting `$2y$...` string verbatim. Single quotes recommended in .env so
  66. # the `$` in the hash isn't interpreted by the shell.
  67. # The resulting user is stored with entra_oid = "local:<email>" and is_admin=1.
  68. # This path is itself an explicit env-bootstrap and does not require the
  69. # BOOTSTRAP_ADMIN_* variables above.
  70. # ---------------------------------------------------------------------------
  71. LOCAL_ADMIN_EMAIL=
  72. LOCAL_ADMIN_PASSWORD_HASH=
  73. LOCAL_ADMIN_NAME=Local Admin