From e8f12cd061d18c58dbf573fecd066f44d6f78a47 Mon Sep 17 00:00:00 2001
From: FreddleSpl0it <75116288+FreddleSpl0it@users.noreply.github.com>
Date: Wed, 4 Nov 2026 22:23:16 +0100
Subject: [PATCH] [Web] Add Netfilter unban all button
---
data/web/inc/functions.fail2ban.inc.php | 22 ++++++++++++++++++++
data/web/lang/lang.de-de.json | 1 +
data/web/lang/lang.en-gb.json | 1 +
data/web/templates/admin/tab-config-f2b.twig | 3 +++
4 files changed, 27 insertions(+)
diff --git a/data/web/inc/functions.fail2ban.inc.php b/data/web/inc/functions.fail2ban.inc.php
index cce7304b2..617b0c393 100644
--- a/data/web/inc/functions.fail2ban.inc.php
+++ b/data/web/inc/functions.fail2ban.inc.php
@@ -145,6 +145,28 @@ function fail2ban($_action, $_data = null, $_extra = null) {
);
return true;
}
+ // Queue all automatic bans for unbanning, the denylist stays
+ elseif ($_data['action'] == "unban-all") {
+ try {
+ foreach ($redis->hKeys('F2B_ACTIVE_BANS') as $network) {
+ $redis->hSet('F2B_QUEUE_UNBAN', $network, 1);
+ }
+ }
+ catch (RedisException $e) {
+ $_SESSION['return'][] = array(
+ 'type' => 'danger',
+ 'log' => array(__FUNCTION__, $_action, $_data_log),
+ 'msg' => array('redis_error', $e)
+ );
+ return false;
+ }
+ $_SESSION['return'][] = array(
+ 'type' => 'success',
+ 'log' => array(__FUNCTION__, $_action, $_data_log),
+ 'msg' => 'f2b_modified'
+ );
+ return true;
+ }
// Start actions in dependency of network
if (!empty($_data['network'])) {
diff --git a/data/web/lang/lang.de-de.json b/data/web/lang/lang.de-de.json
index c2079b33c..60c84cc34 100644
--- a/data/web/lang/lang.de-de.json
+++ b/data/web/lang/lang.de-de.json
@@ -475,6 +475,7 @@
"ui_theme_default": "Standard",
"ui_theme_info": "Themes sind Ordner in data/web/css/themes/<name>/ mit folgenden Dateien:
theme.css (erforderlich)dark.css (optional, Darkmode)bootstrap.css (optional, ersetzt das Bootstrap-Basistheme)theme.json (optional, name und description)data/web/css/themes/<name>/ with the following files:theme.css (required)dark.css (optional, dark mode)bootstrap.css (optional, replaces the Bootstrap base theme)theme.json (optional, name and description)