.env.example 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. # GeoIP
  42. GEOIP_ENABLED=true
  43. GEOIP_COUNTRY_DB=/data/geoip/GeoLite2-Country.mmdb
  44. GEOIP_ASN_DB=/data/geoip/GeoLite2-ASN.mmdb
  45. MAXMIND_LICENSE_KEY=
  46. # CORS — origin of the ui container (or future SPA frontend)
  47. UI_ORIGIN=http://localhost:8080
  48. # Rate limiting (public API)
  49. API_RATE_LIMIT_PER_SECOND=60
  50. # -----------------------------------------------------------------------------
  51. # ui container
  52. # -----------------------------------------------------------------------------
  53. # (APP_ENV / LOG_LEVEL above are reused; the ui reads its own copies of those.)
  54. UI_SECRET= # 32-byte hex; signs session cookies
  55. PUBLIC_URL=http://localhost:8080
  56. # Where the ui finds the api (internal docker network DNS)
  57. API_BASE_URL=http://api:8081
  58. # OIDC (Entra ID) — lives in ui only
  59. OIDC_ENABLED=true
  60. OIDC_ISSUER=https://login.microsoftonline.com/<tenant>/v2.0
  61. OIDC_CLIENT_ID=
  62. OIDC_CLIENT_SECRET=
  63. OIDC_REDIRECT_URI=https://reputation.example.com/oidc/callback
  64. # Local admin — lives in ui only
  65. LOCAL_ADMIN_ENABLED=true
  66. LOCAL_ADMIN_USERNAME=admin
  67. # Generate with: php -r "echo password_hash('s3cret', PASSWORD_ARGON2ID);"
  68. LOCAL_ADMIN_PASSWORD_HASH=