* feat(security): site-wide rate limit for every request the Worker sees
Only the /api groups were rate-limited; pages, /media, /ext-img and the
search index had no limit at all (a 200-request burst against production
answered 200 every time). A new RL_SITE binding (100 requests per 10 s per
client, IPv6 per /64) is checked by the Worker entry right after the IP
denylist. Over it: the 429 page, no-store, Retry-After: 10, its countdown
rewritten to 10 s. The admin host is exempt (behind Access, RL_ADMIN per
account). A throwing limiter fails open without skipping the Turnstile gate.
- tests: worker spam/keys/exemptions/fail-open; Retry-After constants are
checked against the periods in wrangler.jsonc
- smoke: a fourth phase spams the built Worker until the limit answers
- scripts/probe-ratelimit.mjs: tell the Worker's 429 from the WAF's 1015
- docs 06/07/02/09/00: three layers (WAF → RL_SITE → /api groups) and the
Free plan's real WAF limits; CHANGELOG 2.1.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(sonar): project version 2.1.0 for the release
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(worker): stay a 429 if the rate-limit page can't be built
Review follow-ups on the site-wide limit:
- If fetching or rewriting the 429 page threw, the error reached the edge
fail-open path, which hands the request to the Astro app and skips the
Turnstile gate. It now answers a plain-text 429 (no-store, Retry-After).
- Drop Last-Modified and Content-Length with the ETag, as the gate does:
the countdown rewrite only kept the length by luck ("60" vs "10").
- Docs: the WAF rule can't filter by host on Free, so it counts admin.*
too; 09 lists the worker entry as a 429 source and the probe checks;
CHANGELOG says what was unlimited before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>