Skip to content

Cloudflare Worker: drop SITE_KEY injection and ORIGIN_URL from the install guide - #116

Merged
forgetso merged 1 commit into
mainfrom
docs/cloudflare-worker-no-inject-no-origin-url
Oct 19, 2026
Merged

forgetso merged 1 commit into
mainfrom
docs/cloudflare-worker-no-inject-no-origin-url

Conversation

@forgetso

Copy link
Copy Markdown
Member

What changed

The Cloudflare Worker guide told customers to set up two things that no longer exist, and to build a DNS layout they no longer need. The worker shipped today (0.1.5, now live on packages.prosopo.io) removed both.

1. No more auto-inject. The page led with "Auto-inject (recommended)": set SITE_KEY and the worker rewrites every HTML response to add the Protect script tags for you. That mode has been removed from the worker. There is now one install — add the two tags to your own pages — and the page says the old mode is gone rather than pretending it was never there.

2. No more ORIGIN_URL, and no second hostname. The guide told customers they needed two hostnames: www orange-clouded for the worker, plus a grey-clouded origin.<domain> for the worker to forward to, with a warning about causing a loop if they got it wrong.

None of that is true now. Allowed requests leave the worker with fetch(request), which on a route goes to the origin named by the hostname's own DNS record. So the customer's existing www record is the origin: one hostname, nothing to configure, no loop to avoid. There's a new section explaining this, and the old two-hostname instructions are gone.

3. The verify commands could not have worked. They ran against a workers.dev URL. A workers.dev deployment has no origin behind it, so an allowed request re-enters the worker and Cloudflare returns Error 1042 — I hit this while testing the released tarball. The commands now run against the route, and the page explains why workers.dev can't be smoke-tested end to end.

4. Config example is now the real file. PROTECT_URL plus [secrets] required = ["CLIENT_JWT"], which is all of it. Two behaviours that were undocumented and surprising are now written down: the shipped PROTECT_URL placeholder is deliberately not a URL, so until you replace it the worker logs an error and passes traffic through rather than failing your site; and wrangler deploy now refuses to deploy until CLIENT_JWT is set.

5. Static-asset exclusion was describing a removed feature. It documented the [assets] binding and run_worker_first. Which paths get checked now comes only from the protected-path list in the portal, which the worker refreshes every 60 seconds with no redeploy. That's now a row in the portal settings checklist, with the wrangler tail line that tells you the list is working.

Smaller: the bundle tag's missing integrity attribute is explained (we replace the bundle every release, so a pinned hash would break customer pages), the CSP note moved out of the deleted auto-inject section into the install it still applies to, and worker.js is ~105 KB now rather than ~60 KB.

Test coverage

astro build passes — 417 pages. I checked the rendered HTML rather than only the source: it contains no reference to auto-inject, HTMLRewriter, run_worker_first or two hostnames, and the only SITE_KEY and ORIGIN_URL mentions are the two "this was removed" notes. The new sections and the Error 1042 note render.

Only the English page carries this config detail — no other locale has cloudflare-worker.mdx — so there are no translations to follow up.

Why now

The 0.1.5 worker is published and going to a customer. The docs were describing 0.1.1 behaviour from August, so anyone following them would have configured a var the worker ignores and built a DNS record it doesn't use.

🤖 Generated with Claude Code

…stall

The worker no longer rewrites HTML or takes an origin URL, so the guide was
telling customers to configure two things that no longer exist and to build a
DNS topology they no longer need.

- The "Deployment modes" section is gone. There is one install: add the two
  script tags to your own pages. Auto-inject, HTMLRewriter and SITE_KEY are
  removed from the product, so the page says so once and moves on.
- ORIGIN_URL and the second grey-clouded origin.<domain> record are gone.
  Allowed requests leave the worker with fetch(request), which on a route goes
  to the origin named by the hostname's own DNS record. One hostname, nothing
  to configure, no loop to avoid. A new section explains it.
- The wrangler.toml example is now the whole file: PROTECT_URL plus
  [secrets] required = ["CLIENT_JWT"]. Documents that the shipped PROTECT_URL
  placeholder is deliberately not a URL (the worker logs an error and passes
  traffic through until it is replaced), and that deploy refuses to run until
  CLIENT_JWT is set.
- The verify commands ran against workers.dev. That cannot work any more: a
  workers.dev URL has no origin behind it, so an allowed request re-enters the
  worker and Cloudflare returns Error 1042. They now run against the route.
- "Excluding static assets" described the [assets] binding and
  run_worker_first, both removed. Which paths are checked now comes only from
  the protected-path list in the portal, refreshed every 60s with no redeploy.
  Added to the portal settings checklist.
- Notes the bundle tag carries no integrity attribute on purpose, and moves
  the CSP note out of the deleted auto-inject section.
- worker.js is ~105 KB now, not ~60 KB.

Verified: astro build passes, 417 pages. The rendered page has no reference to
auto-inject, HTMLRewriter, run_worker_first or two hostnames; the only SITE_KEY
and ORIGIN_URL mentions are the two "this was removed" notes.
@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for peaceful-pothos-9e62ce ready!

Name Link
🔨 Latest commit 5236fdb
🔍 Latest deploy log https://app.netlify.com/projects/peaceful-pothos-9e62ce/deploys/6ad69ab77e1bd38f941a4c2a
😎 Deploy Preview https://deploy-preview-116--peaceful-pothos-9e62ce.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@forgetso
forgetso merged commit 9560204 into main Oct 19, 2026
5 of 6 checks passed
@forgetso
forgetso deleted the docs/cloudflare-worker-no-inject-no-origin-url branch October 19, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant