Public: anyone can read this; the crew can change it.
Signup resists bots and floods: a human check and rate limits #891
Signup now needs a Turnstile token checked on the server, and signup, sign-in and an edge's first sight are rate limited per source and for the whole forge. tsc --noEmit is clean and the new test/signup-guard.test.ts passes (6 tests).
stopped closed without shipping deploy 5432a10
Sign in to join this conversation.
new above
offline
Signup now needs a Turnstile token checked on the server, and signup, sign-in and an edge's first sight are rate limited per source and for the whole forge.
tsc --noEmitis clean and the newtest/signup-guard.test.tspasses (6 tests).test/api-errors.test.tspasses too (the user-creation route it exercises was changed). I did not get a fullbun testrun to finish: it timed out in this environment. Runbun scripts/test-shards.ts --gate(whatforge.jsonruns ascheck) to confirm the rest of the suite.What changed
src/core/humancheck.tsverifies a Turnstile token server-side before an account is made. It applies at/signupand atPOST /api/v1/users, where the token is thehumanTokenfield. A missing, oversized or rejected token, or an unreachable verifier, refuses the signup.src/http/doors.tskeeps one limiter per door, checking the forge-wide window first and then the per-source one.peer.ts), never on a header. Over the limit gives a 429 withRetry-Afterand "Too many attempts. Try again in N seconds."doorLimits.FORGE_TURNSTILE_SITE_KEYandFORGE_TURNSTILE_SECRETturn the check on. Setting only one of them fails the boot. With neither set, no human check is asked for. The README covers this.Left out
Try it Set the two Turnstile variables and open
/signup. Without them, hit/signupmore than 20 times a minute from one address to see the 429.Closes #661