.env.example 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 / ASN enrichment
  50. # Three pluggable MMDB providers — pick one. The on-disk paths below are
  51. # provider-agnostic; the refresh-geoip job atomic-replaces them with the
  52. # selected provider's files.
  53. # - dbip (default, no auth required, CC BY 4.0 — UI shows attribution)
  54. # - maxmind (opt-in, requires MAXMIND_LICENSE_KEY)
  55. # - ipinfo (opt-in, requires IPINFO_TOKEN — UI shows attribution)
  56. GEOIP_ENABLED=true
  57. GEOIP_PROVIDER=dbip
  58. GEOIP_COUNTRY_DB=/data/geoip/country.mmdb
  59. GEOIP_ASN_DB=/data/geoip/asn.mmdb
  60. MAXMIND_LICENSE_KEY=
  61. IPINFO_TOKEN=
  62. # CORS — origin of the ui container (or future SPA frontend)
  63. UI_ORIGIN=http://localhost:8080
  64. # Rate limiting (public API)
  65. API_RATE_LIMIT_PER_SECOND=60
  66. # -----------------------------------------------------------------------------
  67. # ui container
  68. # -----------------------------------------------------------------------------
  69. # (APP_ENV / LOG_LEVEL above are reused; the ui reads its own copies of those.)
  70. UI_SECRET= # 32-byte hex; signs session cookies
  71. PUBLIC_URL=http://localhost:8080
  72. # Where the ui finds the api (internal docker network DNS)
  73. API_BASE_URL=http://api:8081
  74. # OIDC (Entra ID) — lives in ui only
  75. OIDC_ENABLED=true
  76. OIDC_ISSUER=https://login.microsoftonline.com/<tenant>/v2.0
  77. OIDC_CLIENT_ID=
  78. OIDC_CLIENT_SECRET=
  79. OIDC_REDIRECT_URI=https://reputation.example.com/oidc/callback
  80. # Local admin — lives in ui only
  81. LOCAL_ADMIN_ENABLED=true
  82. LOCAL_ADMIN_USERNAME=admin
  83. # Generate with: php -r "echo password_hash('s3cret', PASSWORD_ARGON2ID);"
  84. LOCAL_ADMIN_PASSWORD_HASH=