Default request limits per minute, hour and day, sized for API use (closes #176)
check / check (push) Successful in 5m15s

The default request limits now suit programmatic use of an API, such
as an automation fleet on another host, and still catch abusive bots:

- per minute: 300, passed within seconds by a client firing as fast
  as it can;
- per hour: 30000;
- per day: 300000, passed by a crawler that keeps up 4 a second.

At the default minute limit no client reaches the hour limit: 300 a
minute is at most 18,000 an hour.

The byte limits and ban lengths are unchanged. SPEC.md, README.md and
docs/settings.md give the reasons; docs/gitea.md redoes the Actions
runner sums.

Judgement call: the docs/alerts.md ban example shows the minute limit.

Model: opus-5-5
This commit is contained in:
2026-11-04 20:16:50 +00:00
parent fdabf4974b
commit 3b9afd5ec4
8 changed files with 85 additions and 51 deletions
+11 -5
View File
@@ -17,11 +17,17 @@ reference documents under [`docs/`](docs/) are listed under "Documents" below.
## What it protects against
- Scrapers that fetch every page of a site, all day. Rate limiting gives each
client 6000 requests a minute, 100,000 an hour and 1,000,000 a day. Byte
limits give it 4 GiB a minute, 20 GiB an hour and 200 GiB a day. A client over
a limit is refused and banned. The first ban lasts an hour. Each repeat within
a day makes the next ban three times as long. A ban that would last more than
seven days is permanent.
client 300 requests a minute, 30,000 an hour and 300,000 a day. That leaves
room for programmatic use of an API, such as an automation fleet on another
host. The minute limit catches, within seconds, a client firing requests as
fast as it can. With the minute limit raised or off, the hour limit catches
one that keeps up 10 a second. The day limit catches one that keeps up 4 a
second around the clock. Counting cannot catch a client that stays under all
three limits, such as one that keeps up 3 a second; only the protections below
can. Byte limits give each client 4 GiB a minute, 20 GiB an hour and 200 GiB a
day. A client over a limit is refused and banned. The first ban lasts an hour.
Each repeat within a day makes the next ban three times as long. A ban that
would last more than seven days is permanent.
- Scanners that probe for secrets, such as `/.env` or `/.git/config`. The
default rule file bans such a client for seven days at its first probe. Its
next request during the ban makes the ban permanent. The default rule file