fix: add blocklist-import jail to dev fail2ban config

The blocklist import service targets a dedicated jail called
'blocklist-import' (BLOCKLIST_JAIL constant in blocklist_service.py),
but that jail was never defined in the dev fail2ban configuration.
Every import attempt immediately failed with UnknownJailException.

Add Docker/fail2ban-dev-config/fail2ban/jail.d/blocklist-import.conf:
a manual-ban jail with no log-based detection that accepts banip
commands only, using iptables-allports with a 1-week bantime.

Also track the new file in .gitignore (whitelist) and fix a
pre-existing blank-line-with-whitespace lint error in setup_service.py.
This commit is contained in:
2026-03-07 19:31:36 +01:00
parent cbad4ea706
commit 706d2e1df8
4 changed files with 120 additions and 2 deletions

View File

@@ -4,8 +4,21 @@ This document breaks the entire BanGUI project into development stages, ordered
---
## Remove the Access List Feature
## ✅ fix: blocklist import — Jail not found (DONE)
The "access list" feature displays individual log-line matches (the raw lines that triggered fail2ban bans) in a dedicated tab on the Dashboard and as a companion table on the World Map page. It is being removed entirely. The tasks below must be executed in order. After completion, no code, config, test, type, or documentation reference to access lists should remain.
**Problem:** Triggering a blocklist import failed with `Jail not found: 'blocklist-import'` because
the dedicated fail2ban jail did not exist in the dev configuration.
**Root cause:** `Docker/fail2ban-dev-config/fail2ban/jail.d/` had no `blocklist-import.conf` jail.
The service code (`blocklist_service.BLOCKLIST_JAIL = "blocklist-import"`) is correct, but the
matching jail was never defined.
**Fix:**
- Added `Docker/fail2ban-dev-config/fail2ban/jail.d/blocklist-import.conf` — a manual-ban jail
(no log monitoring; accepts `banip` commands only; 1-week bantime; `iptables-allports` action).
- Fixed pre-existing trailing-whitespace lint issue in `app/services/setup_service.py`.
**Verification:** All 19 blocklist service tests pass. `ruff check` and `mypy --strict` are clean.
---