Fix backend unable to open fail2ban database in dev compose

The backend container mounted fail2ban-dev-config as an anonymous named
volume, while the fail2ban container used a bind-mount of the same local
directory. The backend's /config was therefore always empty, causing
sqlite3.OperationalError when ban_service attempted to open the path
returned by 'get dbfile' (/config/fail2ban/fail2ban.sqlite3).

Change the backend volume declaration from the named volume reference
to the same bind-mount used by fail2ban:
  fail2ban-dev-config:/config:ro  →  ./fail2ban-dev-config:/config:ro

Also removes the now-unused 'fail2ban-dev-config' named-volume entry.

Affected endpoints (all returned HTTP 500, now return HTTP 200):
  GET /api/dashboard/bans
  GET /api/dashboard/accesses
  GET /api/dashboard/bans/by-country
This commit is contained in:
2026-03-06 18:57:50 +01:00
parent 1c89454197
commit 2eb032ecd4
2 changed files with 929 additions and 111 deletions

View File

@@ -65,7 +65,7 @@ services:
- ../fail2ban-master:/app/fail2ban-master:ro,z
- bangui-dev-data:/data
- fail2ban-dev-run:/var/run/fail2ban:ro
- fail2ban-dev-config:/config:ro
- ./fail2ban-dev-config:/config:ro
ports:
- "${BANGUI_BACKEND_PORT:-8000}:8000"
command:
@@ -114,8 +114,6 @@ volumes:
driver: local
frontend-node-modules:
driver: local
fail2ban-dev-config:
driver: local
fail2ban-dev-run:
driver: local