mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-05 07:58:20 +00:00
Merge pull request #7593 from mailcow/feat/netfilter-unban-all
[Web] Add Netfilter unban all button
This commit is contained in:
4 files changed
+27
No files matched your search
@@ -145,6 +145,28 @@ function fail2ban($_action, $_data = null, $_extra = null) {
|
|||||||
);
|
);
|
||||||
return true;
|
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
|
// Start actions in dependency of network
|
||||||
if (!empty($_data['network'])) {
|
if (!empty($_data['network'])) {
|
||||||
|
|||||||
@@ -475,6 +475,7 @@
|
|||||||
"ui_theme_default": "Standard",
|
"ui_theme_default": "Standard",
|
||||||
"ui_theme_info": "Themes sind Ordner in <code>data/web/css/themes/<name>/</code> mit folgenden Dateien:<ul class=\"mb-0\"><li><code>theme.css</code> (erforderlich)</li><li><code>dark.css</code> (optional, Darkmode)</li><li><code>bootstrap.css</code> (optional, ersetzt das Bootstrap-Basistheme)</li><li><code>theme.json</code> (optional, <code>name</code> und <code>description</code>)</li></ul>",
|
"ui_theme_info": "Themes sind Ordner in <code>data/web/css/themes/<name>/</code> mit folgenden Dateien:<ul class=\"mb-0\"><li><code>theme.css</code> (erforderlich)</li><li><code>dark.css</code> (optional, Darkmode)</li><li><code>bootstrap.css</code> (optional, ersetzt das Bootstrap-Basistheme)</li><li><code>theme.json</code> (optional, <code>name</code> und <code>description</code>)</li></ul>",
|
||||||
"ui_theme_none": "Keine Themes gefunden.",
|
"ui_theme_none": "Keine Themes gefunden.",
|
||||||
|
"unban_all": "Alle entsperren",
|
||||||
"unban_pending": "ausstehend",
|
"unban_pending": "ausstehend",
|
||||||
"unchanged_if_empty": "Unverändert, wenn leer",
|
"unchanged_if_empty": "Unverändert, wenn leer",
|
||||||
"upload": "Hochladen",
|
"upload": "Hochladen",
|
||||||
|
|||||||
@@ -485,6 +485,7 @@
|
|||||||
"ui_theme_default": "Default",
|
"ui_theme_default": "Default",
|
||||||
"ui_theme_info": "Themes are folders in <code>data/web/css/themes/<name>/</code> with the following files:<ul class=\"mb-0\"><li><code>theme.css</code> (required)</li><li><code>dark.css</code> (optional, dark mode)</li><li><code>bootstrap.css</code> (optional, replaces the Bootstrap base theme)</li><li><code>theme.json</code> (optional, <code>name</code> and <code>description</code>)</li></ul>",
|
"ui_theme_info": "Themes are folders in <code>data/web/css/themes/<name>/</code> with the following files:<ul class=\"mb-0\"><li><code>theme.css</code> (required)</li><li><code>dark.css</code> (optional, dark mode)</li><li><code>bootstrap.css</code> (optional, replaces the Bootstrap base theme)</li><li><code>theme.json</code> (optional, <code>name</code> and <code>description</code>)</li></ul>",
|
||||||
"ui_theme_none": "No themes found.",
|
"ui_theme_none": "No themes found.",
|
||||||
|
"unban_all": "Unban all",
|
||||||
"unban_pending": "unban pending",
|
"unban_pending": "unban pending",
|
||||||
"unchanged_if_empty": "If unchanged leave blank",
|
"unchanged_if_empty": "If unchanged leave blank",
|
||||||
"upload": "Upload",
|
"upload": "Upload",
|
||||||
|
|||||||
@@ -106,6 +106,9 @@
|
|||||||
<button class="btn btn-secondary" type="button" data-action="edit_selected" data-item="{{ f2b_data.banlist_id }}" data-id="f2b_banlist" data-api-url='edit/fail2ban/banlist' data-api-attr='{}'><i class="bi bi-arrow-clockwise"></i></button>
|
<button class="btn btn-secondary" type="button" data-action="edit_selected" data-item="{{ f2b_data.banlist_id }}" data-id="f2b_banlist" data-api-url='edit/fail2ban/banlist' data-api-attr='{}'><i class="bi bi-arrow-clockwise"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
{% if f2b_data.active_bans %}
|
||||||
|
<p><button class="btn btn-sm btn-secondary" data-action="edit_selected" data-item="self" data-id="f2b-quick" data-api-url='edit/fail2ban' data-api-attr='{"action":"unban-all"}' href="#"><i class="bi bi-unlock"></i> {{ lang.admin.unban_all }}</button></p>
|
||||||
|
{% endif %}
|
||||||
{% for active_ban in f2b_data.active_bans %}
|
{% for active_ban in f2b_data.active_bans %}
|
||||||
<p>
|
<p>
|
||||||
<span class="badge fs-7 bg-info d-block d-sm-inline-block">
|
<span class="badge fs-7 bg-info d-block d-sm-inline-block">
|
||||||
|
|||||||
Reference in new issue
Block a user