diff --git a/app/CHANGELOG.md b/app/CHANGELOG.md index a5f53ce..475668b 100644 --- a/app/CHANGELOG.md +++ b/app/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog — Alpinux Static +## [1.5.1] — 2026-05-06 + +### Corrigé +- Ignorer une IP : le cache 404 n'était pas invalidé dans tous les workers gunicorn — basculé sur une invalidation par `mtime` de `ignored_ips.json` +- Bannir une IP : chemins binaires complets (`/usr/bin/sudo`, `/usr/bin/fail2ban-client`) pour éviter les problèmes de `PATH` dans le contexte du service systemd +- Règle sudoers corrigée pour l'utilisateur `static-cdn` (compte de service) au lieu de `abonnelc` + +--- + ## [1.5.0] — 2026-05-06 ### Ajouté diff --git a/app/VERSION b/app/VERSION index bc80560..26ca594 100644 --- a/app/VERSION +++ b/app/VERSION @@ -1 +1 @@ -1.5.0 +1.5.1 diff --git a/app/app.py b/app/app.py index 97cb7ea..11c2b49 100644 --- a/app/app.py +++ b/app/app.py @@ -514,7 +514,8 @@ def _log_files_404(days: int = 7) -> list: def _parse_404s(days: int = 7) -> dict: global _404_CACHE, _404_CACHE_TS now = time.time() - if now - _404_CACHE_TS < _404_CACHE_TTL and _404_CACHE: + ign_mtime = _IGNORED_IPS_FILE.stat().st_mtime if _IGNORED_IPS_FILE.exists() else 0 + if now - _404_CACHE_TS < _404_CACHE_TTL and _404_CACHE and ign_mtime <= _404_CACHE_TS: return _404_CACHE ignored = _load_ignored_ips() @@ -895,7 +896,7 @@ def errors_ban(): return jsonify({"error": "IP invalide"}), 400 try: r = subprocess.run( - ["sudo", "fail2ban-client", "set", jail, "banip", ip], + ["/usr/bin/sudo", "/usr/bin/fail2ban-client", "set", jail, "banip", ip], capture_output=True, text=True, timeout=10 ) if r.returncode == 0: