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

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

- per minute: off;
- per hour: 30000, passed by a crawler that keeps up 10 a second;
- per day: 300000, passed by one that keeps up 4 a second.

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

Judgement call: the ban alert example in docs/alerts.md now shows the
hour limit, since the minute limit is off by default.

Model: opus-5-5
This commit is contained in:
2026-11-04 19:18:40 +00:00
parent fdabf4974b
commit 1f71568d02
8 changed files with 71 additions and 47 deletions
+6 -6
View File
@@ -42,7 +42,7 @@ on one line:
"asn": "",
"as_name": "",
"country": "",
"reason": "requests per minute over the limit of 6000",
"reason": "requests per hour over the limit of 30000",
"detail": {
"ban_expires": "2026-10-06T13:00:00.123Z",
"cause": "limit",
@@ -51,9 +51,9 @@ on one line:
"as_name": "",
"country": "",
"kind": "requests",
"limit": 6000,
"window": "minute",
"count": 6001,
"limit": 30000,
"window": "hour",
"count": 30001,
"request": {
"time": "2026-10-06T12:00:00.123456789Z",
"method": "GET",
@@ -62,7 +62,7 @@ on one line:
"status": 403,
"user_agent": "scraper/1.0"
},
"requests": 8210,
"requests": 30001,
"refused": 0,
"earlier_bans": {
"limit": 0,
@@ -89,7 +89,7 @@ on one line:
- `asn`, `as_name` and `country`: the client's, as known when the alert was
raised. They are empty when GeoJS had not answered yet.
- `reason`: a short sentence, such as
`requests per minute over the limit of 6000` or `listed by a blocklist`.
`requests per hour over the limit of 30000` or `listed by a blocklist`.
- `detail`: what is particular to the event:
- for a ban, its `cause`, `ban_expires` and `notes` (the notes are listed
under `bans.json` in [`state-files.md`](state-files.md));