Configure secrets and deploy
Choose where your Worker lives, generate the relay key, set the three Worker secrets, and deploy.
The relay's runtime configuration lives in three Cloudflare Worker secrets. Nothing secret goes into the repository, and nothing needs to live in any particular directory on your machine. If you deploy through GitHub Actions, the only other secrets are the Cloudflare deploy credentials, stored as GitHub repository secrets.
All commands below run from the repository root unless they say cd app.
1. Choose where your Worker lives
The API Worker's hostname comes from app/. The file in the repository points at the maintainer's own domain, so change it before your first deploy. Pick one:
Your own custom domain. Replace the
patternin the[[routes]]block with a hostname on a zone in your Cloudflare account:[[routes]] pattern = "notify.example.com" custom_domain = trueA
workers.devsubdomain. Setworkers_dev = truenear the top of the file, and delete the whole[[routes]]block. The Worker is then served athttps:./ / zudo- slack- notify- app. <your- subdomain>. workers. dev
Keep top-level settings above the tables
In wrangler.toml, a top-level setting such as workers_dev must come before any [table] like [observability] or [[routes]], or TOML treats it as part of that table.
The rest of this guide calls your origin https:. Substitute your own.
2. Generate the relay key
The relay key is the shared bearer secret your scripts present to the Worker: 32 to 256 printable ASCII characters with no spaces. Generate 64 hex characters:
openssl rand -hex 32Keep your own copy wherever you keep secrets: a password manager, an ignored env file outside the checkout, or similar. You need it again for every sender.
3. Set the Worker secrets
The Worker reads three secrets. Set each one from app/; wrangler secret put prompts for the value, so it never appears on the command line or in your shell history.
cd app
pnpm exec wrangler secret put NOTIFY_API_KEY
pnpm exec wrangler secret put SLACK_BOT_TOKEN
pnpm exec wrangler secret put SLACK_TARGETSNOTIFY_API_KEY: the relay key from step 2.SLACK_BOT_TOKEN: thexoxb-…Bot User OAuth Token from Create the Slack app.SLACK_TARGETS: a JSON object mapping each target alias to a Slack channel ID, on one line:{ "dev": "C0123456789", "releases": "C0123456789" }Aliases are lowercase kebab-case (at most 64 characters); channel IDs start with
C,G, orD. The map holds 1 to 100 aliases. It is a secret rather than a plain variable so that your channel IDs stay out of git.
If the Worker does not exist yet, wrangler offers to create it when you set the first secret. You can also deploy first (step 4) and set the secrets afterwards; the order does not matter. Secrets persist across later deploys.
Set all three at once
pnpm ops:push-secrets --env-file <path> reads NOTIFY_API_KEY, SLACK_BOT_TOKEN, and SLACK_TARGETS from a KEY=value file, validates them with the same rules the Worker applies, and uploads them in one go without printing values. Instead of --env-file, you can set ZUDO_SLACK_NOTIFY_WORKER_ENV to the file's path. Add --dry-run to validate only. See Secrets and rotation.
4. Deploy
Deploy the API Worker straight from your machine:
cd app
pnpm exec wrangler deployWrangler asks you to log in to Cloudflare the first time. Redeploy the same way after you pull changes.
The repository includes deploy workflows that run on every push to main of your fork, and on manual dispatch. In your fork's Settings → Secrets and variables → Actions, add:
| Kind | Name | Value |
|---|---|---|
| Secret | CLOUDFLARE_API_TOKEN | A Cloudflare API token that can deploy Workers |
| Secret | CLOUDFLARE_ACCOUNT_ID | Your Cloudflare account ID |
| Variable | APP_BASE_URL | Your API origin, no path, e.g. https: |
| Variable | DOC_BASE_URL | Your docs origin, no path; only if you deploy the docs site |
The "Deploy app" workflow deploys the API Worker and then runs a smoke check against APP_BASE_URL. Without the two Cloudflare secrets, or on any branch other than main, the workflows skip cleanly and stay green.
The "Deploy doc" workflow deploys this documentation site as its own Worker. If you want your own copy, replace the route in doc/ with your hostname and set DOC_BASE_URL. If you don't, disable the "Deploy doc" workflow in your fork's Actions tab.
The workflows never set the Worker runtime secrets. Set those once as in step 3; they survive every deploy.
Fail closed until wired
Until all three secrets exist and are valid, POST /v1/notify answers 503 server_misconfigured before authentication and before any Slack request. GET /healthz still answers 200, so you can confirm the deploy itself worked.
Next: send the first message.