wrangler.jsonc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // codegraph telemetry dashboard — see README.md.
  2. // Secrets are NOT configured here: ADMIN_PASSWORD and SESSION_SECRET are set
  3. // via `wrangler secret put`.
  4. {
  5. "$schema": "node_modules/wrangler/config-schema.json",
  6. "name": "codegraph-telemetry-dashboard",
  7. "main": "src/index.ts",
  8. "compatibility_date": "2026-07-28",
  9. // Private admin surface. Same pattern as the ingest worker: a custom domain
  10. // that auto-provisions DNS + cert from the getcodegraph.com zone, with
  11. // workers.dev off so there is no second, undocumented way in.
  12. "routes": [{ "pattern": "stats.getcodegraph.com", "custom_domain": true }],
  13. "workers_dev": false,
  14. "observability": { "enabled": true, "head_sampling_rate": 1 },
  15. // `run_worker_first: true` is load-bearing. Without it Cloudflare serves a
  16. // matching static asset BEFORE the worker runs, which would hand out the
  17. // dashboard — and its data — to anyone who guesses a filename. With it, every
  18. // request goes through src/index.ts and only an authenticated one is proxied
  19. // on to ASSETS.
  20. "assets": {
  21. "directory": "./public",
  22. "binding": "ASSETS",
  23. "run_worker_first": true,
  24. "html_handling": "auto-trailing-slash",
  25. "not_found_handling": "none"
  26. },
  27. // The ingest worker's database, read-only from here. Migrations live with the
  28. // writer: telemetry-worker/migrations/.
  29. "d1_databases": [
  30. {
  31. "binding": "DB",
  32. "database_name": "codegraph-telemetry",
  33. "database_id": "5ed36dfb-d2d7-4e35-9e63-a1b99d0b1ed3"
  34. }
  35. ],
  36. // Brute-force cap on the shared password, keyed by client IP. Two humans sign
  37. // in roughly once a year each; 5/min is generous for a typo and useless for a
  38. // guessing attack.
  39. "ratelimits": [
  40. {
  41. "name": "LOGIN_RATE_LIMITER",
  42. "namespace_id": "2001",
  43. "simple": { "limit": 5, "period": 60 }
  44. }
  45. ]
  46. }