Files
BanGUI/.gitignore
Lukas 08b8f3872a fix: reload/stop jail 404 + access list simulator
Task 1 — fix Stop/Reload Jail returning 404
  Root cause: reload_jail and reload_all sent an empty config stream
  (["reload", name, [], []]).  In fail2ban's reload protocol the end-of-
  reload phase deletes every jail still in reload_state — i.e. every jail
  that received no configuration commands.  An empty stream means *all*
  affected jails are silently removed from the daemon's runtime, causing
  everything touching those jails afterwards (including stop) to receive
  UnknownJailException → HTTP 404.

  Fixes:
  - reload_jail: send ["start", name] in the config stream; startJail()
    removes the jail from reload_state so the end phase commits instead of
    deletes, and un-idles the jail.
  - reload_all: fetch current jail list first, build a ["start", name]
    entry for every active jail, then send reload --all with that stream.
  - stop_jail: made idempotent — if the jail is already gone (not-found
    error) the operation silently succeeds (200 OK) rather than returning
    404, matching the user expectation that stop = ensure-stopped.
  - Router: removed dead JailNotFoundError handler from stop endpoint.

  391 tests pass (2 new), ruff clean, mypy clean (pre-existing
  config.py error unchanged).

Task 2 — access list simulator
  - Docker/simulate_accesses.sh: writes fake HTTP-scan log lines in
    custom format (bangui-access: http scan from <IP> ...) to
    Docker/logs/access.log so the bangui-access jail detects them.
  - fail2ban/filter.d/bangui-access.conf: failregex matching the above.
  - fail2ban/jail.d/bangui-access.conf: polling jail on access.log,
    same settings as bangui-sim (maxretry=3, bantime=60s).
  - .gitignore: whitelist new bangui-access.conf files.
  - Docker/fail2ban-dev-config/README.md: added "Testing the Access
    List Feature" section with step-by-step instructions and updated
    Configuration Reference + Troubleshooting.
2026-03-06 19:49:31 +01:00

113 lines
2.6 KiB
Plaintext

# ─────────────────────────────────────────────
# BanGUI — root .gitignore
# ─────────────────────────────────────────────
# ── Python ────────────────────────────────────
__pycache__/
*.py[cod]
*.pyo
*.pyd
*.so
.Python
# Virtualenvs
.venv/
venv/
env/
ENV/
.python-version
# Distribution / packaging
dist/
build/
*.egg-info/
*.egg
MANIFEST
# Testing & coverage
.coverage
.coverage.*
htmlcov/
.pytest_cache/
.tox/
nosetests.xml
coverage.xml
*.cover
# Type checkers & linters
.mypy_cache/
.ruff_cache/
.dmypy.json
dmypy.json
pyrightconfig.json
.pytype/
# ── Node / Frontend ───────────────────────────
node_modules/
.pnp
.pnp.js
# Build output
frontend/dist/
frontend/.vite/
# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# ── Secrets / Environment ─────────────────────
.env
.env.*
!.env.example
*.pem
secrets.json
# ── Databases ─────────────────────────────────
*.sqlite3
*.db
*.db-shm
*.db-wal
# ── OS artefacts ──────────────────────────────
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# ── Editor / IDE ──────────────────────────────
.idea/
*.iml
*.sublime-project
*.sublime-workspace
.vscode/settings.json
.vscode/launch.json
.vscode/*.log
*.swp
*.swo
*~
# ── Docker dev config ─────────────────────────
# Ignore auto-generated linuxserver/fail2ban config files,
# but track our custom filter, jail, and documentation.
Docker/fail2ban-dev-config/**
!Docker/fail2ban-dev-config/README.md
!Docker/fail2ban-dev-config/fail2ban/
!Docker/fail2ban-dev-config/fail2ban/filter.d/
!Docker/fail2ban-dev-config/fail2ban/filter.d/bangui-sim.conf
!Docker/fail2ban-dev-config/fail2ban/filter.d/bangui-access.conf
!Docker/fail2ban-dev-config/fail2ban/jail.d/
!Docker/fail2ban-dev-config/fail2ban/jail.d/bangui-sim.conf
!Docker/fail2ban-dev-config/fail2ban/jail.d/bangui-access.conf
# ── Misc ──────────────────────────────────────
*.log
*.tmp
*.bak
*.orig