feat: switch from reCAPTCHA to the CF turnstile - #5166
Conversation
Greptile SummaryMigrates registration anti-bot protection from reCAPTCHA to Cloudflare Turnstile.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "chore: add missing file" | Re-trigger Greptile |
There was a problem hiding this comment.
Minor: When the turnstile verification fails, the fields get cleared out. On a short password failure, the fields remain filled in.
| CLOUDFLARE_API_TOKEN= | ||
| CLOUDFLARE_ZONE_ID= | ||
| CLOUDFLARE_TURNSTILE_SITE_KEY= | ||
| CLOUDFLARE_TURNSTILE_SECRET_KEY= |
There was a problem hiding this comment.
Is there any reason not to leave the success and failure keys in here and just comment them out?
I don't expect to be testing this functionality again once the PR is merged, but if I had to, I don't know if I'd be able to find the keys.
There was a problem hiding this comment.
Unrelated (also happens on master): On success, the page reloads, which triggers another human-validation. Consider redirecting to the main page, or the login page.
Google is billing us for reCAPTCHA. There are alternatives; reCAPTCHA isn't worth spending donor money on.
We still need deeper protection on this specific page than Cloudflare WAF. WAF doesn't guard against things like headless browsers using residential IP addresses.
This PR migrates account registration's anti-bot protection measure from reCAPTCHA to the Cloudflare Turnstile, operating in managed mode.
Prod env vars are already set via Forge. For security reasons, they do not work locally. If no env vars are set, the turnstile control does not appear. For testing locally, you can use the following in your
.env: