Skip to content

Correct the docs that said beta has no captcha - #249

Merged
adamjohnwright merged 2 commits into
mainfrom
feat/chat-requires-human
Sep 18, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
feat/chat-requires-human

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Follow-on from #248, which merged before this landed. Documentation only.

Beta now enforces Turnstile on /chat/guest/ using production's keys, so two places that said otherwise were wrong:

  • deploy/beta/README.md: "Leaving CLOUDFLARE_SECRET_KEY unset makes the captcha middleware bypass itself, which is what we want." Wrong twice over — beta now has the keys, and after Require a human check on the chat, and stop absence meaning "off" #248 an unset key refuses to start rather than bypassing.
  • ~/update-beta-chat.sh (not in the repo): its closing line told the operator "captcha are absent on beta by design" after every deploy.

From the adversarial review of the deploy

Three things it turned up, all now handled:

The script could not apply an environment-only change. It short-circuits when the running tag matches, so editing .env.beta and redeploying did nothing — and docker restart doesn't help, because a container keeps the environment it was created with. Added --force, which is what actually turned the captcha on.

Rolling back would silently un-gate the chat. A restored container carries its original environment, and the rollback target predates the keys — so --rollback would serve an ungated chat with nothing in the output saying so. It now warns and names the fix. Verified the warning fires against the real saved container.

I tested the wrong URL first. /chat/ is a landing page with links, not a gated path; the app is /chat/guest/. My first check found no Turnstile on /chat/ and looked like a failure. The real path redirects to verify_captcha_page and serves the widget, with data-sitekey matching the configured key.

Verified live on beta

/chat/guest/ → verify_captcha_page, real Turnstile widget
rendered sitekey matches the configured one
captcha_configured in container True
answer endpoint still refused in 0.0s — not captcha-redirected

That last row matters most: the endpoint's captcha exemption is a deliberate hole in an authentication boundary, and it still behaves.

🤖 Generated with Claude Code

adamjohnwright and others added 2 commits September 18, 2026 07:29
Beta now enforces Turnstile on /chat/guest/, using production's keys, so two
places that said otherwise were wrong: the beta README's "leaving the secret
unset makes the middleware bypass itself, which is what we want", and the deploy
script's closing line telling an operator the captcha is absent by design.

The README line was doubly wrong after this branch: unset no longer bypasses, it
refuses to start.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 018e80b into main Sep 18, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the feat/chat-requires-human branch September 18, 2026 07:38
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