.env.example 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. # Distribution endpoint
  46. # Per-policy blocklist cache TTL. Mutations to policies / manual_blocks /
  47. # allowlist invalidate explicitly; this is the cross-replica window.
  48. BLOCKLIST_CACHE_TTL_SECONDS=30
  49. # GeoIP
  50. GEOIP_ENABLED=true
  51. GEOIP_COUNTRY_DB=/data/geoip/GeoLite2-Country.mmdb
  52. GEOIP_ASN_DB=/data/geoip/GeoLite2-ASN.mmdb
  53. MAXMIND_LICENSE_KEY=
  54. # CORS — origin of the ui container (or future SPA frontend)
  55. UI_ORIGIN=http://localhost:8080
  56. # Rate limiting (public API)
  57. API_RATE_LIMIT_PER_SECOND=60
  58. # -----------------------------------------------------------------------------
  59. # ui container
  60. # -----------------------------------------------------------------------------
  61. # (APP_ENV / LOG_LEVEL above are reused; the ui reads its own copies of those.)
  62. UI_SECRET= # 32-byte hex; signs session cookies
  63. PUBLIC_URL=http://localhost:8080
  64. # Where the ui finds the api (internal docker network DNS)
  65. API_BASE_URL=http://api:8081
  66. # OIDC (Entra ID) — lives in ui only
  67. OIDC_ENABLED=true
  68. OIDC_ISSUER=https://login.microsoftonline.com/<tenant>/v2.0
  69. OIDC_CLIENT_ID=
  70. OIDC_CLIENT_SECRET=
  71. OIDC_REDIRECT_URI=https://reputation.example.com/oidc/callback
  72. # Local admin — lives in ui only
  73. LOCAL_ADMIN_ENABLED=true
  74. LOCAL_ADMIN_USERNAME=admin
  75. # Generate with: php -r "echo password_hash('s3cret', PASSWORD_ARGON2ID);"
  76. LOCAL_ADMIN_PASSWORD_HASH=