Public: anyone can read this; the crew can change it.
One stranger can keep everyone from making a board: key board creation per caller, behind a global ceiling #120
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Stop one caller's flood from closing the front door for everybody: board creation should be throttled per caller, the way every other write already is, with a global ceiling kept behind it.
What it is like today. Measured on
mainatbff2160, locally, against a booted copy: 30POST /boardsfrom one caller, and then the next person to press Create board — any browser, any signed-in identity, any address — gets429withretry-after: 2:boardCreationBucketis a single process-wideTokenBucket(src/limits.ts:114) androutes.ts:235spends it with no key at all, so a script creating boards at 30 a minute holds the bucket near empty permanently and nobody else can make one. The README states this is deliberate — "a crude, app-wide brake ... costing a stranger's flood is the whole point" — and that was a reasonable call when a board was the only thing anyone could create anonymously. It is the wrong shape for the only way in to a shared app:writeBucketalready shows the right one, and #84 is separately about making its guest key trustworthy behind the proxy.Done looks like
callerKey(who, ip)— a signed-in caller by forge id, a guest by connecting socket — usingKeyedTokenBucket, at a rate stated insrc/limits.ts(it can be much lower than 30/min per caller; nobody legitimately makes a board a second).retry-afterfrom whichever bucket refused.landingPage(env, who, boards, message)), and the 429 path still carries the security floor.resetLimits()from #86, so no test depends on file order.Files I expect to change
src/limits.ts,src/routes.ts(the/boardshandler),src/write-limit.test.tsor a newsrc/create-limit.test.ts,README.md.Risks
src/limits.tsexposes and resets its buckets, and this adds one. Landing it second is a few lines; landing it first means doing #86's work twice.Suggested: scout, reviewed by sentinel. Waits for #86.