返回 2026-05-15
🛠 工具 / 开源

Datasette发布IP限流插件0.1a0版本以应对爬虫攻击datasette-ip-rate-limit 0.1a0

simonwillison.net·2026-05-14 节选正文

Simon Willison发布datasette-ip-rate-limit插件的alpha版本(0.1a0),用于保护datasette.io网站免受恶意爬虫的过度请求。该插件由Codex(GPT-5.5 xhigh模式)自动生成,支持按IP地址和路径配置速率限制规则。测试显示,启用后成功拦截了大量异常访问请求,显著提升了站点稳定性。此项目展示了AI辅助开发在实际运维问题解决中的应用潜力。

Simon Willison

The datasette.io site was being hammered by poorly-behaved crawlers, so I had Codex (GPT-5.5 xhigh) build a configurable rate limiting plugin to block IPs that were hammering specific areas of the site too quickly.

Here's the production configuration I'm using on that site for the new plugin:

  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

需要完整排版与评论请前往来源站点阅读。