diff --git a/README.md b/README.md index 12ea39cb..99f4eeae 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,9 @@ Secrets are SOPS-encrypted per deployment (`.env.staging.enc`); decrypt them int to a file. Add migrations with `cd packages/server && npx drizzle-kit generate --name `; never edit one that a deployment has applied. +Both production Workers tail into Whistle (`tail_consumers`, `kf-whistle`), which files their +errors, limits and cron runs under `kf/underlay`; `kf.project.jsonc` names them for it. + ## License MIT. See [LICENSE](LICENSE). diff --git a/kf.project.jsonc b/kf.project.jsonc index 9d714cba..74737458 100644 --- a/kf.project.jsonc +++ b/kf.project.jsonc @@ -5,6 +5,18 @@ "name": "Underlay", "account": "kf", - // No environments yet: the console registers the project and deploys - // nothing. Add "environments" (with at least "production") to deploy. + // Deployed by hand with wrangler (README "Deployment"), so the console deploys + // nothing: it registers where each environment answers, and production with + // Whistle, whose Worker both production Workers tail into (wrangler.jsonc). + "environments": { + "production": { + "elsewhere": { "hosts": ["www.underlay.org"] }, + "services": { + "kf/whistle@1": { "workers": ["underlay-prod", "underlay-prod-bulk"] }, + }, + }, + "staging": { + "elsewhere": { "hosts": ["staging.underlay.org"] }, + }, + }, } diff --git a/packages/server/wrangler.bulk.jsonc b/packages/server/wrangler.bulk.jsonc index 0340ae51..78bdde15 100644 --- a/packages/server/wrangler.bulk.jsonc +++ b/packages/server/wrangler.bulk.jsonc @@ -118,6 +118,8 @@ }, "prod": { "name": "underlay-prod-bulk", + // Each run's errors, limits and cron runs go to Whistle (kf.project.jsonc names this Worker). + "tail_consumers": [{ "service": "kf-whistle" }], "vars": { "ROLE": "bulk", // The pool of Durable Objects the v3 queue's jobs run in (worker.ts V3Pool). diff --git a/packages/server/wrangler.jsonc b/packages/server/wrangler.jsonc index 65d65d7f..f02d1901 100644 --- a/packages/server/wrangler.jsonc +++ b/packages/server/wrangler.jsonc @@ -133,6 +133,8 @@ }, "prod": { "name": "underlay-prod", + // Each run's errors, limits and cron runs go to Whistle (kf.project.jsonc names this Worker). + "tail_consumers": [{ "service": "kf-whistle" }], // underlay.org redirects to www in a Cloudflare rule, paths kept (ARK links). "routes": [{ "pattern": "www.underlay.org", "custom_domain": true }], "vars": {