.env.example 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Broad-Announce M0 env defaults. Copy to .env if you want docker
  2. # compose to pick them up; otherwise the compose file's inline
  3. # values are used.
  4. BA_ENV=dev
  5. BA_LOG_LEVEL=info
  6. # HTTP addrs
  7. BA_INGESTD_HTTP_ADDR=:8800
  8. BA_ROUTERD_HTTP_ADDR=:8801
  9. BA_DELIVERD_HTTP_ADDR=:8802
  10. BA_ADMIND_HTTP_ADDR=:8803
  11. # Data tier
  12. BA_NATS_URL=nats://localhost:4222
  13. BA_REDIS_URL=redis://localhost:6379/0
  14. BA_POSTGRES_DSN=postgres://ba:ba@localhost:5432/ba?sslmode=disable
  15. # Ingestd source protection defaults (SPEC §22)
  16. BA_INGESTD_MAX_PAYLOAD_BYTES=262144
  17. BA_INGESTD_RATE_LIMIT_PER_SOURCE=100
  18. BA_INGESTD_RATE_LIMIT_PER_COMPANY=10000
  19. BA_INGESTD_MAX_CONCURRENT_PER_IP=64
  20. BA_INGESTD_DEDUPE_TTL_SECONDS=300
  21. BA_INGESTD_QUARANTINE_HITS_THRESHOLD=100
  22. # M6.5: router-level dedupe collapse. A burst of identical
  23. # alerts is held for up to this many ms, then a single
  24. # delivery is fanned out with the final dedupe_count.
  25. BA_ROUTERD_DEDUPE_FLUSH_MS=2000
  26. # M8: in-process retry knobs shared by deliverd-fcm and
  27. # deliverd-telegram. See internal/retry/retry.go.
  28. # - MAX_ATTEMPTS: total tries including the first
  29. # - RETRY_BASE_MS: wait before the SECOND attempt;
  30. # doubles each subsequent attempt, capped at MAX_MS
  31. # - RETRY_MAX_MS: cap on the per-attempt wait
  32. # - RETRY_BUDGET_MS: wall-clock cap across all attempts;
  33. # the loop bails early if the next wait would exceed it
  34. # With the defaults below, a fully-failing target
  35. # terminates in ~12s — fast enough for the smoke test
  36. # to be practical, slow enough that transient blips
  37. # recover cleanly.
  38. BA_DELIVERD_MAX_ATTEMPTS=10
  39. BA_DELIVERD_RETRY_BASE_MS=100
  40. BA_DELIVERD_RETRY_MAX_MS=2000
  41. BA_DELIVERD_RETRY_BUDGET_MS=30000
  42. # M7: archiver cadence + retention cutoff. The Timescale
  43. # retention policy does the same at 7d; the archiver just
  44. # runs ahead so ClickHouse has the data before TS drops it.
  45. BA_ARCHIVERD_RUN_EVERY_SECONDS=3600
  46. BA_ARCHIVERD_OLDER_THAN_HOURS=168
  47. BA_ARCHIVERD_BATCH_SIZE=10000
  48. BA_ARCHIVERD_CLICKHOUSE_URL=http://clickhouse:8123
  49. BA_INGESTD_QUARANTINE_WINDOW_SECONDS=60
  50. BA_INGESTD_QUARANTINE_DURATION_SECONDS=300
  51. # M0 source registry (env-only; M2 swaps for DB)
  52. # Format: comma-separated company:source:secret triples
  53. BA_INGESTD_SOURCES=acme-001:prom-prod:s3cret-acme,globex-002:grafana:s3cret-globex
  54. # M4 MQTT subscriber (ingestd).
  55. # - MQTT_USERNAME/PASSWORD authenticate the subscriber with EMQX
  56. # using the built-in-db row "ingestd" / "ingestd-broker-only".
  57. # - MQTT_SUBSCRIBE is the topic pattern the subscriber joins.
  58. # The + wildcards are the EMQX single-level wildcard; ba/+/+/incoming
  59. # matches every (company, source) pair.
  60. # - Set BA_INGESTD_MQTT_BROKER to "" to disable the MQTT path entirely.
  61. BA_INGESTD_MQTT_BROKER=tcp://emqx:1883
  62. BA_INGESTD_MQTT_USERNAME=ingestd
  63. BA_INGESTD_MQTT_PASSWORD=ingestd-broker-only
  64. BA_INGESTD_MQTT_SUBSCRIBE=ba/+/+/incoming
  65. # Optional override; default is "ingestd-mqtt-<hostname>".
  66. # BA_INGESTD_MQTT_CLIENT_ID=ingestd-mqtt-1
  67. # Shutdown
  68. BA_SHUTDOWN_GRACE_SEC=15