.env.example 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # =============================================================================
  2. # IRDB — IP Reputation Database — environment configuration
  3. # =============================================================================
  4. # Copy this file to `.env` and fill in the blanks.
  5. # Generate 32-byte hex secrets with: openssl rand -hex 32
  6. # =============================================================================
  7. # -----------------------------------------------------------------------------
  8. # Shared (consumed by both api and ui containers)
  9. # -----------------------------------------------------------------------------
  10. # IRDB-format service token. The api uses this to authenticate the ui's
  11. # calls; the ui presents it on every API request together with
  12. # X-Acting-User-Id. Format: irdb_svc_<32 base32 chars>. Generate one with:
  13. # docker compose run --rm -T api php -r 'require "/app/vendor/autoload.php";
  14. # echo (new App\Domain\Auth\TokenIssuer())->issue(App\Domain\Auth\TokenKind::Service);'
  15. UI_SERVICE_TOKEN=
  16. # -----------------------------------------------------------------------------
  17. # api container
  18. # -----------------------------------------------------------------------------
  19. APP_ENV=production # development | production
  20. LOG_LEVEL=info
  21. APP_SECRET= # 32-byte hex; used internally for signing things like ETags
  22. # Database
  23. DB_DRIVER=sqlite # sqlite | mysql
  24. DB_SQLITE_PATH=/data/irdb.sqlite
  25. DB_MYSQL_HOST=
  26. DB_MYSQL_PORT=3306
  27. DB_MYSQL_DATABASE=
  28. DB_MYSQL_USERNAME=
  29. DB_MYSQL_PASSWORD=
  30. # OIDC role mapping (defaults applied if no group mapping matches)
  31. OIDC_DEFAULT_ROLE=viewer # viewer | none
  32. # Reputation engine
  33. SCORE_RECOMPUTE_INTERVAL_SECONDS=300
  34. SCORE_REPORT_HARD_CUTOFF_DAYS=365
  35. # Internal jobs
  36. INTERNAL_JOB_TOKEN= # 32-byte hex
  37. JOB_RECOMPUTE_MAX_RUNTIME_SECONDS=240
  38. JOB_RECOMPUTE_MAX_ROWS_PER_TICK=5000
  39. JOB_AUDIT_RETENTION_DAYS=180
  40. JOB_GEOIP_REFRESH_INTERVAL_DAYS=7
  41. # Manual blocks / allowlist evaluator
  42. # In-process cache TTL for the CidrEvaluator. Mutations invalidate explicitly,
  43. # so this only matters for cross-replica visibility (per replica is fine).
  44. CIDR_EVALUATOR_TTL_SECONDS=60
  45. # GeoIP
  46. GEOIP_ENABLED=true
  47. GEOIP_COUNTRY_DB=/data/geoip/GeoLite2-Country.mmdb
  48. GEOIP_ASN_DB=/data/geoip/GeoLite2-ASN.mmdb
  49. MAXMIND_LICENSE_KEY=
  50. # CORS — origin of the ui container (or future SPA frontend)
  51. UI_ORIGIN=http://localhost:8080
  52. # Rate limiting (public API)
  53. API_RATE_LIMIT_PER_SECOND=60
  54. # -----------------------------------------------------------------------------
  55. # ui container
  56. # -----------------------------------------------------------------------------
  57. # (APP_ENV / LOG_LEVEL above are reused; the ui reads its own copies of those.)
  58. UI_SECRET= # 32-byte hex; signs session cookies
  59. PUBLIC_URL=http://localhost:8080
  60. # Where the ui finds the api (internal docker network DNS)
  61. API_BASE_URL=http://api:8081
  62. # OIDC (Entra ID) — lives in ui only
  63. OIDC_ENABLED=true
  64. OIDC_ISSUER=https://login.microsoftonline.com/<tenant>/v2.0
  65. OIDC_CLIENT_ID=
  66. OIDC_CLIENT_SECRET=
  67. OIDC_REDIRECT_URI=https://reputation.example.com/oidc/callback
  68. # Local admin — lives in ui only
  69. LOCAL_ADMIN_ENABLED=true
  70. LOCAL_ADMIN_USERNAME=admin
  71. # Generate with: php -r "echo password_hash('s3cret', PASSWORD_ARGON2ID);"
  72. LOCAL_ADMIN_PASSWORD_HASH=