[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F6PYS23CPNV41SP1HRE4F7":3,"skill-same:01M7F6PYS23CPNV41SP1HRE4F7":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":14,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M7F6PYS23CPNV41SP1HRE4F7","cloudflare-workers-deployment",null,"Use when deploying a Cloudflare Worker with Wrangler.","chaorenex1\u002Fhermes-home-content","chaorenex1","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F23194925?v=4","01M7F5NA1D1D02R2MEMYQN2NZT","chan chan","01M7F5NA20KTHMTY2015CYM1TZ",0,"MIT","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcloudflare-workers-deployment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\r\nname: cloudflare-workers-deployment\r\ndescription: \"Use when deploying a Cloudflare Worker with Wrangler.\"\r\nversion: 1.0.0\r\nauthor: Masia\r\nlicense: MIT\r\nmetadata:\r\n  hermes:\r\n    tags: [cloudflare, workers, wrangler, deployment, devops]\r\n    related_skills: [ssr-web-app-development, github]\r\n---\r\n\r\n# Cloudflare Workers Deployment\r\n\r\nA Worker deploy is four operations, not one command: authenticate the right account, create or bind the account's resources, build the client with production values, then prove the custom domain serves the app. Most failures happen before or after `wrangler deploy`, so run each gate explicitly.\r\n\r\n## When to Use\r\n\r\n- First deploy of a Worker, or a deploy after a fork or rebrand.\r\n- `wrangler whoami` reports an expired or missing token.\r\n- A Worker needs a KV namespace, R2 bucket, or custom domain.\r\n- A deploy succeeded but the live URL needs independent verification.\r\n\r\n## Workflow\r\n\r\n1. Preflight the account.\r\n   - Use the project-local binary when a package-manager shim is unreliable: `node node_modules\u002Fwrangler\u002Fbin\u002Fwrangler.js whoami`.\r\n   - A cached OAuth token can still be expired. The non-interactive error is `Not logged in. Your auth token has expired and could not be refreshed`.\r\n   - Confirm the account ID and scopes; do not assume the token belongs to the account that owns the domain.\r\n\r\n2. Log in with an IPv4 callback on Windows.\r\n   - Run in a PTY: `node node_modules\u002Fwrangler\u002Fbin\u002Fwrangler.js login --callback-host 127.0.0.1`.\r\n   - The default may bind the temporary callback server to `[::1]:8976` while the browser resolves `localhost` to `127.0.0.1`; the consent page then redirects to `localhost` and shows `localhost refused to connect`. The explicit IPv4 host fixes it.\r\n   - In a container or remote session where the browser cannot reach the host port, use `wrangler login --device` or forward port 8976 to the host.\r\n   - The consent page is a real account authorization. If an automated click is denied, ask the user to click **Authorize** in the opened browser and wait for their confirmation; do not retry a denied click.\r\n   - Re-run `whoami` and confirm the account before creating resources.\r\n\r\n3. Inventory before creating.\r\n   - `wrangler kv namespace list`\r\n   - `wrangler r2 bucket list`\r\n   - `wrangler d1 list`\r\n   - Match existing resources by title\u002Fname. Creating a second namespace or bucket because the list was not checked leaves the config pointing at one resource and the app at another.\r\n   - A forked config usually carries the upstream author's D1 `database_id`. If that id is not in `wrangler d1 list`, the first deploy fails with `database not found`; create the database in this account and replace the id.\r\n\r\n4. Create and bind resources.\r\n   - `wrangler kv namespace create \u003Ctitle>` prints the new `id`.\r\n   - Put that id in the existing binding in `wrangler.toml`; keep the binding name unchanged because the code imports it by name.\r\n   - `wrangler r2 bucket create \u003Cname>`; the bucket name in `wrangler.toml` must match exactly.\r\n   - `wrangler d1 create \u003Cname>` prints the new `database_id`; put it in `d1_databases[0].database_id`, then apply the schema with `wrangler d1 migrations apply \u003Cname> --remote` before the first deploy.\r\n   - A template or fork often carries the upstream author's KV id. Replace it before the first deploy instead of deploying against a namespace that does not exist in this account.\r\n\r\n5. Validate the deploy config.\r\n   - `name` is the Worker name that will appear in the account.\r\n   - `[[routes]]` with `pattern` and `custom_domain = true` attaches the hostname.\r\n   - `DEPLOY_URL` must equal the public origin, including scheme and no trailing slash.\r\n   - `[assets]` must point at the client output directory, and `run_worker_first` must match the app's routing model.\r\n   - `workers_dev = false` means the custom domain is the only public entry point. Confirm the zone is active in the same Cloudflare account before deploying; a custom-domain route cannot attach a zone from another account.\r\n   - The OAuth token may lack DNS-record read even when `zone:read` is present. After deploy, inspect `GET \u002Faccounts\u002F{account_id}\u002Fworkers\u002Fdomains` for the hostname, service, and certificate rather than assuming DNS changes are visible.\r\n\r\n6. Build production, then deploy.\r\n   - Build the client in production mode first, for example `pnpm build:frontend`. A development build bakes `localhost` into `DEPLOY_URL` and API calls.\r\n   - Verify the bundle contains the public origin and no local dev origin.\r\n   - Run `wrangler deploy`, not `wrangler deploy --dry-run`, and record the printed version id and custom-domain line.\r\n   - Rebuild after any `wrangler.toml`\u002F`wrangler.jsonc` edit, not only after code edits: a vite plugin writes `dist\u002F\u003Cworker>\u002Fwrangler.json` with the resolved binding ids and `wrangler deploy` follows that redirect. A stale `dist\u002F` ships the previous `database_id` and fails with `database not found` while the config file looks correct.\r\n\r\n7. Verify the live surface separately.\r\n   - A local TUN\u002FVPN may return a fake or sinkhole IP for a new hostname. `curl` then fails the TLS handshake even though the deployment is healthy. Do not diagnose the Worker from that error.\r\n   - Resolve to a real Cloudflare edge address with `curl --resolve \u003Chost>:443:\u003Ccloudflare-ip> ...` and request the HTML with a browser User-Agent.\r\n   - If the user's own browser must open the hostname, fix the local route instead of stopping at `--resolve`. A broad `DOMAIN-KEYWORD,\u003Capex>,DIRECT` rule can catch the new subdomain and reset TLS; add an exact `DOMAIN,\u003Cfqdn>,\u003Cproxy-group>` above it in the client's rules profile and reload. Use `references\u002Flocal-tun-routing.md`.\r\n   - Assert the page title or a stable component marker, not just HTTP 200.\r\n   - Exercise the real API: upload a text paste and an image, inspect `Content-Type`, `Content-Disposition`, and CORS, read metadata, delete the pastes, and confirm 404 afterward. Use `references\u002Flive-smoke-tests.md`.\r\n\r\n8. Clean up.\r\n   - Delete smoke-test pastes and scratch files.\r\n   - Kill temporary forwarders and dev servers by process tree; confirm the port is closed.\r\n   - Never print or commit the OAuth token, API token, or cookies.\r\n\r\n## Secrets and Inbound Mail for a New Worker\r\n\r\n- Set secrets after the first successful deploy: a Worker that does not exist yet has no secret surface, and `wrangler secret list` fails with `worker not found`. A later `secret put` creates a new version on its own.\r\n- Generate a secret the human can actually use, keep it out of the transcript, and make it usable: 32 random bytes as base64url → write to a file outside the repo → `wrangler secret put SECRET \u003C temp.txt` → delete the temp copy. Report the file path, never the value.\r\n- A Worker with an `email()` handler receives nothing until Email Routing points at it. Catch-all with a `worker` action is the usual wiring, and the API recipe plus the proof-by-self-send loop lives in `references\u002Femail-routing-to-worker.md`.\r\n\r\nA Worker that both receives and sends mail needs the outbound side wired separately: `send_email` binding, validation before the capability check, outbound archiving with `direction = 'out'`, and token-scoped read\u002Fsend APIs. Use `references\u002Foutbound-mail-and-tokens.md`.\r\n\r\n## Local Verification Before Deploy\r\n\r\nA dry-run proves the bundle; it does not prove the Worker. Run the changed paths against a local server first.\r\n\r\n1. Build before any Wrangler config check. A vite-plugin project injects `assets`, so `wrangler deploy --dry-run` reads the generated redirect (`dist\u002F\u003Cworker>\u002Fwrangler.json`). With no `dist\u002F`, it fails complaining that the `assets` property is missing the required `directory` property — a stale-build error, not a config bug.\r\n2. Apply D1 migrations locally: `wrangler d1 migrations apply \u003Cdatabase_name> --local`. New columns and tables must exist before the dev server writes rows; re-running is a no-op.\r\n3. Put dev secrets in `.dev.vars` (gitignored), then start the server on IPv4: `npx vite --host 127.0.0.1 --port \u003Cport> --strictPort`. Without `--host`, Vite listens on `[::1]` and `curl http:\u002F\u002Flocalhost:\u003Cport>` is refused on Windows.\r\n4. Drive the real API with a cookie jar after authenticating through the app's own endpoint, and assert status codes plus the stored rows. A 200 from a local proxy is not proof of behavior.\r\n5. Exercise the Worker's `email()` handler through miniflare's test endpoint — recipe and traps in `references\u002Flocal-worker-email-testing.md`.\r\n6. Tear down: kill the dev server by PID (`netstat -ano | grep :\u003Cport>`, then `taskkill \u002FF \u002FPID \u003Cpid>`), delete `.dev.vars`, `.wrangler`, and `dist`. Test accounts otherwise persist in local D1 and surprise the next run.\r\n\r\n## Pitfalls\r\n\r\n- **IPv6 callback mismatch**: a browser on IPv4 can fail the OAuth callback while Wrangler listens only on `[::1]:8976`. Use `--callback-host 127.0.0.1`.\r\n- **Expired cached token**: `wrangler whoami` can fail non-interactively even though a token file exists. Log in in a PTY; do not treat the file's presence as authentication.\r\n- **Dev build deployed**: production and development builds bake different `DEPLOY_URL` and page titles. Rebuild after any config change and check the bundle.\r\n- **Inherited resource ids**: a fork or template may carry another account's KV id. Replace it and create the R2 bucket in the current account.\r\n- **Custom domain hides workers.dev**: adding a `routes` entry with `custom_domain: true` flips `workers_dev` off automatically, so the workers.dev URL printed by an earlier deploy stops serving. Verify the custom hostname from then on.\r\n- **No workers.dev fallback**: with `workers_dev = false`, a broken custom domain leaves no alternate URL. Confirm the zone and certificate before declaring the deploy live.\r\n- **Local fake IP**: Mihomo\u002FTUN or another resolver can return `198.18.x.x`; a local TLS failure is not proof the Worker is down. Verify through a Cloudflare edge IP.\r\n- **Broad local DIRECT rule**: a `DOMAIN-KEYWORD,\u003Capex>,DIRECT` rule can override a new subdomain and reset TLS. Add an exact proxy rule above it; see `references\u002Flocal-tun-routing.md`.\r\n- **Placeholder contact values**: a rebrand cannot infer a support mailbox. Mark it as a placeholder and report it; do not present an invented address as working.\r\n- **Secret before the Worker exists**: `wrangler secret put` and `wrangler secret list` need a deployed Worker. Deploy first, set the secret, confirm with `wrangler secret list`.\r\n- **Code deployed before its migration**: a Worker that inserts a new column fails every write until `wrangler d1 migrations apply \u003Cdatabase_name> --remote` has run. Migrate first, then deploy.\r\n- **`send_email` blocks locally**: the binding is remote, so without `wrangler login` a local send waits until the client times out. Temporarily remove the binding to assert input validation and the missing-binding 503, restore it, and confirm the restored config with a dry-run. Never report sending as verified from a local run.\r\n- **`email()` HTTP 200 is not acceptance**: miniflare answers `Worker successfully processed email` even when the handler called `setReject`. Assert the effect in D1 or through the app API, never the status line.\r\n\r\n## Verification Checklist\r\n\r\n- [ ] `wrangler whoami` shows the intended account\r\n- [ ] KV namespace and R2 bucket exist and match `wrangler.toml`\r\n- [ ] Production client bundle contains the public origin, not localhost\r\n- [ ] `wrangler deploy` printed the version id and custom domain\r\n- [ ] Custom domain returns the app marker with valid TLS through a real edge IP\r\n- [ ] Text and image upload, metadata, delete, and post-delete 404 all pass\r\n- [ ] Temporary pastes, files, forwarders, and dev servers are gone\r\n\r\n## References\r\n\r\n- `references\u002Flive-smoke-tests.md` - exact curl sequence for proving a deployed paste\u002Ffile API and its headers.\r\n- `references\u002Flocal-tun-routing.md` - fix a host browser that resolves a new hostname to a TUN fake IP and hits a broad DIRECT rule.\r\n- `references\u002Flocal-worker-email-testing.md` - drive a Worker `email()` handler locally through miniflare, with the MIME template and the verdict-by-database rule.\r\n- `references\u002Femail-routing-to-worker.md` - point a zone's Email Routing (catch-all or literal addresses) at a Worker and prove inbound delivery end to end.\r\n- `references\u002Foutbound-mail-and-tokens.md` - `send_email` binding, outbound archiving, hashed scoped tokens, and the request matrix for verifying a handed-over token.\r\n","# Cloudflare Workers Deployment\r\n\r\nA Worker deploy is four operations, not one command: authenticate the right account, create or bind the account's resources, build the client with production values, then prove the custom domain serves the app. Most failures happen before or after `wrangler deploy`, so run each gate explicitly.\r\n\r\n## When to Use\r\n\r\n- First deploy of a Worker, or a deploy after a fork or rebrand.\r\n- `wrangler whoami` reports an expired or missing token.\r\n- A Worker needs a KV namespace, R2 bucket, or custom domain.\r\n- A deploy succeeded but the live URL needs independent verification.\r\n\r\n## Workflow\r\n\r\n1. Preflight the account.\r\n   - Use the project-local binary when a package-manager shim is unreliable: `node node_modules\u002Fwrangler\u002Fbin\u002Fwrangler.js whoami`.\r\n   - A cached OAuth token can still be expired. The non-interactive error is `Not logged in. Your auth token has expired and could not be refreshed`.\r\n   - Confirm the account ID and scopes; do not assume the token belongs to the account that owns the domain.\r\n\r\n2. Log in with an IPv4 callback on Windows.\r\n   - Run in a PTY: `node node_modules\u002Fwrangler\u002Fbin\u002Fwrangler.js login --callback-host 127.0.0.1`.\r\n   - The default may bind the temporary callback server to `[::1]:8976` while the browser resolves `localhost` to `127.0.0.1`; the consent page then redirects to `localhost` and shows `localhost refused to connect`. The explicit IPv4 host fixes it.\r\n   - In a container or remote session where the browser cannot reach the host port, use `wrangler login --device` or forward port 8976 to the host.\r\n   - The consent page is a real account authorization. If an automated click is denied, ask the user to click **Authorize** in the opened browser and wait for their confirmation; do not retry a denied click.\r\n   - Re-run `whoami` and confirm the account before creating resources.\r\n\r\n3. Inventory before creating.\r\n   - `wrangler kv namespace list`\r\n   - `wrangler r2 bucket list`\r\n   - `wrangler d1 list`\r\n   - Match existing resources by title\u002Fname. Creating a second namespace or bucket because the list was not checked leaves the config pointing at one resource and the app at another.\r\n   - A forked config usually carries the upstream author's D1 `database_id`. If that id is not in `wrangler d1 list`, the first deploy fails with `database not found`; create the database in this account and replace the id.\r\n\r\n4. Create and bind resources.\r\n   - `wrangler kv namespace create \u003Ctitle>` prints the new `id`.\r\n   - Put that id in the existing binding in `wrangler.toml`; keep the binding name unchanged because the code imports it by name.\r\n   - `wrangler r2 bucket create \u003Cname>`; the bucket name in `wrangler.toml` must match exactly.\r\n   - `wrangler d1 create \u003Cname>` prints the new `database_id`; put it in `d1_databases[0].database_id`, then apply the schema with `wrangler d1 migrations apply \u003Cname> --remote` before the first deploy.\r\n   - A template or fork often carries the upstream author's KV id. Replace it before the first deploy instead of deploying against a namespace that does not exist in this account.\r\n\r\n5. Validate the deploy config.\r\n   - `name` is the Worker name that will appear in the account.\r\n   - `[[routes]]` with `pattern` and `custom_domain = true` attaches the hostname.\r\n   - `DEPLOY_URL` must equal the public origin, including scheme and no trailing slash.\r\n   - `[assets]` must point at the client output directory, and `run_worker_first` must match the app's routing model.\r\n   - `workers_dev = false` means the custom domain is the only public entry point. Confirm the zone is active in the same Cloudflare account before deploying; a custom-domain route cannot attach a zone from another account.\r\n   - The OAuth token may lack DNS-record read even when `zone:read` is present. After deploy, inspect `GET \u002Faccounts\u002F{account_id}\u002Fworkers\u002Fdomains` for the hostname, service, and certificate rather than assuming DNS changes are visible.\r\n\r\n6. Build production, then deploy.\r\n   - Build the client in production mode first, for example `pnpm build:frontend`. A development build bakes `localhost` into `DEPLOY_URL` and API calls.\r\n   - Verify the bundle contains the public origin and no local dev origin.\r\n   - Run `wrangler deploy`, not `wrangler deploy --dry-run`, and record the printed version id and custom-domain line.\r\n   - Rebuild after any `wrangler.toml`\u002F`wrangler.jsonc` edit, not only after code edits: a vite plugin writes `dist\u002F\u003Cworker>\u002Fwrangler.json` with the resolved binding ids and `wrangler deploy` follows that redirect. A stale `dist\u002F` ships the previous `database_id` and fails with `database not found` while the config file looks correct.\r\n\r\n7. Verify the live surface separately.\r\n   - A local TUN\u002FVPN may return a fake or sinkhole IP for a new hostname. `curl` then fails the TLS handshake even though the deployment is healthy. Do not diagnose the Worker from that error.\r\n   - Resolve to a real Cloudflare edge address with `curl --resolve \u003Chost>:443:\u003Ccloudflare-ip> ...` and request the HTML with a browser User-Agent.\r\n   - If the user's own browser must open the hostname, fix the local route instead of stopping at `--resolve`. A broad `DOMAIN-KEYWORD,\u003Capex>,DIRECT` rule can catch the new subdomain and reset TLS; add an exact `DOMAIN,\u003Cfqdn>,\u003Cproxy-group>` above it in the client's rules profile and reload. Use `references\u002Flocal-tun-routing.md`.\r\n   - Assert the page title or a stable component marker, not just HTTP 200.\r\n   - Exercise the real API: upload a text paste and an image, inspect `Content-Type`, `Content-Disposition`, and CORS, read metadata, delete the pastes, and confirm 404 afterward. Use `references\u002Flive-smoke-tests.md`.\r\n\r\n8. Clean up.\r\n   - Delete smoke-test pastes and scratch files.\r\n   - Kill temporary forwarders and dev servers by process tree; confirm the port is closed.\r\n   - Never print or commit the OAuth token, API token, or cookies.\r\n\r\n## Secrets and Inbound Mail for a New Worker\r\n\r\n- Set secrets after the first successful deploy: a Worker that does not exist yet has no secret surface, and `wrangler secret list` fails with `worker not found`. A later `secret put` creates a new version on its own.\r\n- Generate a secret the human can actually use, keep it out of the transcript, and make it usable: 32 random bytes as base64url → write to a file outside the repo → `wrangler secret put SECRET \u003C temp.txt` → delete the temp copy. Report the file path, never the value.\r\n- A Worker with an `email()` handler receives nothing until Email Routing points at it. Catch-all with a `worker` action is the usual wiring, and the API recipe plus the proof-by-self-send loop lives in `references\u002Femail-routing-to-worker.md`.\r\n\r\nA Worker that both receives and sends mail needs the outbound side wired separately: `send_email` binding, validation before the capability check, outbound archiving with `direction = 'out'`, and token-scoped read\u002Fsend APIs. Use `references\u002Foutbound-mail-and-tokens.md`.\r\n\r\n## Local Verification Before Deploy\r\n\r\nA dry-run proves the bundle; it does not prove the Worker. Run the changed paths against a local server first.\r\n\r\n1. Build before any Wrangler config check. A vite-plugin project injects `assets`, so `wrangler deploy --dry-run` reads the generated redirect (`dist\u002F\u003Cworker>\u002Fwrangler.json`). With no `dist\u002F`, it fails complaining that the `assets` property is missing the required `directory` property — a stale-build error, not a config bug.\r\n2. Apply D1 migrations locally: `wrangler d1 migrations apply \u003Cdatabase_name> --local`. New columns and tables must exist before the dev server writes rows; re-running is a no-op.\r\n3. Put dev secrets in `.dev.vars` (gitignored), then start the server on IPv4: `npx vite --host 127.0.0.1 --port \u003Cport> --strictPort`. Without `--host`, Vite listens on `[::1]` and `curl http:\u002F\u002Flocalhost:\u003Cport>` is refused on Windows.\r\n4. Drive the real API with a cookie jar after authenticating through the app's own endpoint, and assert status codes plus the stored rows. A 200 from a local proxy is not proof of behavior.\r\n5. Exercise the Worker's `email()` handler through miniflare's test endpoint — recipe and traps in `references\u002Flocal-worker-email-testing.md`.\r\n6. Tear down: kill the dev server by PID (`netstat -ano | grep :\u003Cport>`, then `taskkill \u002FF \u002FPID \u003Cpid>`), delete `.dev.vars`, `.wrangler`, and `dist`. Test accounts otherwise persist in local D1 and surprise the next run.\r\n\r\n## Pitfalls\r\n\r\n- **IPv6 callback mismatch**: a browser on IPv4 can fail the OAuth callback while Wrangler listens only on `[::1]:8976`. Use `--callback-host 127.0.0.1`.\r\n- **Expired cached token**: `wrangler whoami` can fail non-interactively even though a token file exists. Log in in a PTY; do not treat the file's presence as authentication.\r\n- **Dev build deployed**: production and development builds bake different `DEPLOY_URL` and page titles. Rebuild after any config change and check the bundle.\r\n- **Inherited resource ids**: a fork or template may carry another account's KV id. Replace it and create the R2 bucket in the current account.\r\n- **Custom domain hides workers.dev**: adding a `routes` entry with `custom_domain: true` flips `workers_dev` off automatically, so the workers.dev URL printed by an earlier deploy stops serving. Verify the custom hostname from then on.\r\n- **No workers.dev fallback**: with `workers_dev = false`, a broken custom domain leaves no alternate URL. Confirm the zone and certificate before declaring the deploy live.\r\n- **Local fake IP**: Mihomo\u002FTUN or another resolver can return `198.18.x.x`; a local TLS failure is not proof the Worker is down. Verify through a Cloudflare edge IP.\r\n- **Broad local DIRECT rule**: a `DOMAIN-KEYWORD,\u003Capex>,DIRECT` rule can override a new subdomain and reset TLS. Add an exact proxy rule above it; see `references\u002Flocal-tun-routing.md`.\r\n- **Placeholder contact values**: a rebrand cannot infer a support mailbox. Mark it as a placeholder and report it; do not present an invented address as working.\r\n- **Secret before the Worker exists**: `wrangler secret put` and `wrangler secret list` need a deployed Worker. Deploy first, set the secret, confirm with `wrangler secret list`.\r\n- **Code deployed before its migration**: a Worker that inserts a new column fails every write until `wrangler d1 migrations apply \u003Cdatabase_name> --remote` has run. Migrate first, then deploy.\r\n- **`send_email` blocks locally**: the binding is remote, so without `wrangler login` a local send waits until the client times out. Temporarily remove the binding to assert input validation and the missing-binding 503, restore it, and confirm the restored config with a dry-run. Never report sending as verified from a local run.\r\n- **`email()` HTTP 200 is not acceptance**: miniflare answers `Worker successfully processed email` even when the handler called `setReject`. Assert the effect in D1 or through the app API, never the status line.\r\n\r\n## Verification Checklist\r\n\r\n- [ ] `wrangler whoami` shows the intended account\r\n- [ ] KV namespace and R2 bucket exist and match `wrangler.toml`\r\n- [ ] Production client bundle contains the public origin, not localhost\r\n- [ ] `wrangler deploy` printed the version id and custom domain\r\n- [ ] Custom domain returns the app marker with valid TLS through a real edge IP\r\n- [ ] Text and image upload, metadata, delete, and post-delete 404 all pass\r\n- [ ] Temporary pastes, files, forwarders, and dev servers are gone\r\n\r\n## References\r\n\r\n- `references\u002Flive-smoke-tests.md` - exact curl sequence for proving a deployed paste\u002Ffile API and its headers.\r\n- `references\u002Flocal-tun-routing.md` - fix a host browser that resolves a new hostname to a TUN fake IP and hits a broad DIRECT rule.\r\n- `references\u002Flocal-worker-email-testing.md` - drive a Worker `email()` handler locally through miniflare, with the MIME template and the verdict-by-database rule.\r\n- `references\u002Femail-routing-to-worker.md` - point a zone's Email Routing (catch-all or literal addresses) at a Worker and prove inbound delivery end to end.\r\n- `references\u002Foutbound-mail-and-tokens.md` - `send_email` binding, outbound archiving, hashed scoped tokens, and the request matrix for verifying a handed-over token.\r\n",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"description":7},"Masia","1.0.0",{"hermes":27},{"tags":28,"related_skills":34},[29,30,31,32,33],"cloudflare","workers","wrangler","deployment","devops",[35,36],"ssr-web-app-development","github","main","a3f3199bb87ec3c91248f68a39d88527e1847ae9","skills\u002Fdevops\u002Fcloudflare-workers-deployment","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content","https:\u002F\u002Fgithub.com\u002Fchaorenex1","https:\u002F\u002Fblog.aduib.com","A programmer whose only hobby in life is coding","2026-10-20 00:34:32",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add chaorenex1\u002Fhermes-home-content --skill cloudflare-workers-deployment",{"tool":51,"command":52},"bunx","bunx skills add chaorenex1\u002Fhermes-home-content --skill cloudflare-workers-deployment",{"tool":54,"command":55},"pnpm","pnpm dlx skills add chaorenex1\u002Fhermes-home-content --skill cloudflare-workers-deployment","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcloudflare-workers-deployment\u002FSKILL.md",true,[59,65,69,73,77],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Femail-routing-to-worker.md","REFERENCE","参考文档",3671,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcloudflare-workers-deployment\u002Freferences\u002Femail-routing-to-worker.md",{"path":66,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Flive-smoke-tests.md",3356,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcloudflare-workers-deployment\u002Freferences\u002Flive-smoke-tests.md",{"path":70,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Flocal-tun-routing.md",3374,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcloudflare-workers-deployment\u002Freferences\u002Flocal-tun-routing.md",{"path":74,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Flocal-worker-email-testing.md",3237,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcloudflare-workers-deployment\u002Freferences\u002Flocal-worker-email-testing.md",{"path":78,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Foutbound-mail-and-tokens.md",3342,"https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fcloudflare-workers-deployment\u002Freferences\u002Foutbound-mail-and-tokens.md",[82,89,96,103,110,117],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7F8GF32YD5MBQW2TGSRH1YP","web-retrieval-resilience","Web tools fail or search rules break: repair or fall back.","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fweb-retrieval-resilience\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7F8FP46QESQMCZ1KBT3TW3R","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall.","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7F8ER6VXHBNVRQBZS7X08SE","verification-loop","Run a six-phase verification of a Claude Code session's work — build, type check, lint, tests with coverage, security grep, and diff review — then produce a PASS\u002FFAIL verification report. Use when verifying work after completing a feature or refactor, before creating a PR, or when quality gates must pass.","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M7F8E4BQJ38KVQVM3MT20PYV","unreal-world-builder","开放世界与环境专家——精通 UE5 World Partition、Landscape、程序化植被、HLOD 和大规模关卡流式加载，打造无缝开放世界体验","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Funreal-engine\u002Funreal-world-builder\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M7F8D747SQW2FTP7GBSX38BR","unreal-technical-artist","Unreal Engine 视觉管线专家——精通材质编辑器、Niagara 特效、程序化内容生成和 UE5 项目的美术到引擎管线","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Funreal-engine\u002Funreal-technical-artist\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M7F8CKHYJVZVBTN0321J88T2","unreal-systems-engineer","性能与混合架构专家——精通 C++\u002FBlueprint 边界、Nanite 几何体、Lumen GI 和 Gameplay Ability System，面向 AAA 级 Unreal Engine 项目","https:\u002F\u002Fgithub.com\u002Fchaorenex1\u002Fhermes-home-content\u002Fblob\u002Fmain\u002Fskills\u002Funreal-engine\u002Funreal-systems-engineer\u002FSKILL.md",[],[]]