mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-12-15 09:00:26 +08:00
Allow /0 to whitelist all, push f2b version in yml
This commit is contained in:
parent
a6677983af
commit
433e0c8f9a
@ -1503,10 +1503,10 @@ function edit_f2b_parameters($postarray) {
|
|||||||
if (is_array($wl_array)) {
|
if (is_array($wl_array)) {
|
||||||
foreach ($wl_array as $wl_item) {
|
foreach ($wl_array as $wl_item) {
|
||||||
$cidr = explode('/', $wl_item);
|
$cidr = explode('/', $wl_item);
|
||||||
if (filter_var($cidr[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) && (!isset($cidr[1]) || ($cidr[1] >= 8 && $cidr[1] <= 32))) {
|
if (filter_var($cidr[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) && (!isset($cidr[1]) || ($cidr[1] >= 0 && $cidr[1] <= 32))) {
|
||||||
$redis->hSet('F2B_WHITELIST', $wl_item, 1);
|
$redis->hSet('F2B_WHITELIST', $wl_item, 1);
|
||||||
}
|
}
|
||||||
elseif (filter_var($cidr[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) && (!isset($cidr[1]) || ($cidr[1] >= 16 && $cidr[1] <= 128))) {
|
elseif (filter_var($cidr[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) && (!isset($cidr[1]) || ($cidr[1] >= 0 && $cidr[1] <= 128))) {
|
||||||
$redis->hSet('F2B_WHITELIST', $wl_item, 1);
|
$redis->hSet('F2B_WHITELIST', $wl_item, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ services:
|
|||||||
- acme
|
- acme
|
||||||
|
|
||||||
fail2ban-mailcow:
|
fail2ban-mailcow:
|
||||||
image: mailcow/fail2ban:1.2
|
image: mailcow/fail2ban:1.3
|
||||||
build: ./data/Dockerfiles/fail2ban
|
build: ./data/Dockerfiles/fail2ban
|
||||||
depends_on:
|
depends_on:
|
||||||
- dovecot-mailcow
|
- dovecot-mailcow
|
||||||
|
Loading…
Reference in New Issue
Block a user