Simon Willison · 博客

datasette-ip-rate-limit 0.1a0

datasette-ip-rate-limit 0.1a0

二〇二六年六月六日 · 英文原文

Datasette 发布 datasette-ip-rate-limit 0.1a0 插件,用于应对站点爬虫攻击。该插件基于 GPT-5.5 xhigh 模型(Codex)构建,支持可配置的 IP 速率限制。生产配置示例中设置 header 为 Fly-Client-IP,max_keys 为 10000,exempt_paths 排除静态文件和 Turnstile 路径,rules 定义对 /global-power-plants/ 和 /legislators/ 等路径在 60 秒窗口内最多 60 次请求,超限后封禁 20 秒。

发布:datasette-ip-rate-limit 0.1a0
datasette.io 站点正遭受行为不当的爬虫攻击,因此我让 Codex(GPT-5.5 xhigh)构建了一个可配置的速率限制插件,用于阻止那些在站点特定区域请求过快的 IP。以下是我在该站点上为新插件使用的生产配置:

datasette-ip-rate-limit :
header : Fly-Client-IP
max_keys : 10000
exempt_paths :
- " /static/* "
- " /-/turnstile* "
rules :
- name : demo-databases
paths :
- " /global-power-plants/* "
- " /legislators/* "
window_seconds : 60
max_requests : 60
block_seconds : 20

标签:datasette,速率限制,codex

译自 Simon Willison · 博客 · 录于 二〇二六年六月六日