🐍 Python Rewrite
"I'd recommend converting to a language with less pitfalls and that is easier to read than bash. Maybe Python, but I'm biased."
— @gaelj
This release is dedicated to @gaelj, who not only suggested the Python rewrite but also told our AI assistant to stop approving his PR so many times. 😅
Ironically, the Python rewrite was done entirely by the same AI he found "unpleasant when overly present." We hope he finds this version easier to maintain — even by an LLM. 🤖
What's New
- LAPI Mode Only: Direct HTTP API calls, no Docker socket needed
- Memory Efficient: Streaming downloads, line-by-line processing (~50-100MB even with 500K+ IPs)
- Batch Processing: Configurable batch size (default 1000 IPs)
- Full IPv4/IPv6 Support: Uses Python's
ipaddressmodule - Automatic Deduplication: Skips existing CrowdSec decisions
- Retry Logic: Exponential backoff for failed requests
- Type Hints: Full type annotations for IDE support
- Per-feed Control: Enable/disable individual blocklist sources via
ENABLE_*env vars
Breaking Changes
- Requires Python 3.11+
- No longer uses
csclior Docker socket — LAPI credentials required - New environment variables for authentication (see README)
Docker
docker pull ghcr.io/wolffcatskyy/crowdsec-blocklist-import-python:latestRequirements
- CrowdSec machine credentials (
CROWDSEC_MACHINE_ID,CROWDSEC_MACHINE_PASSWORD) - CrowdSec bouncer API key (
CROWDSEC_LAPI_KEY)
See README for full setup instructions.
🤖 Release notes generated by Claude AI — yes, the same one