From 75bc0142a0021efcfdab4da7b49e8c5301f7a5b4 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 27 Jul 2024 19:51:55 +0200 Subject: [PATCH] add missing use-statement for opcacheinfo page; ease ClientConnectRate ban-filter for proftpd; allow null-mx entry in dns-editor, fixes #1263 Signed-off-by: Michael Kaufmann --- admin_opcacheinfo.php | 1 + lib/Froxlor/Api/Commands/DomainZones.php | 6 +++++- lib/configfiles/bookworm.xml | 2 +- lib/configfiles/bullseye.xml | 2 +- lib/configfiles/focal.xml | 2 +- lib/configfiles/jammy.xml | 2 +- lib/configfiles/noble.xml | 2 +- lng/de.lng.php | 2 +- lng/en.lng.php | 2 +- 9 files changed, 13 insertions(+), 8 deletions(-) diff --git a/admin_opcacheinfo.php b/admin_opcacheinfo.php index 443a11d1..c46c2534 100644 --- a/admin_opcacheinfo.php +++ b/admin_opcacheinfo.php @@ -35,6 +35,7 @@ require __DIR__ . '/lib/init.php'; use Froxlor\FroxlorLogger; use Froxlor\UI\HTML; use Froxlor\UI\Panel\UI; +use Froxlor\UI\Request; use Froxlor\UI\Response; if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') { diff --git a/lib/Froxlor/Api/Commands/DomainZones.php b/lib/Froxlor/Api/Commands/DomainZones.php index 4a3020a1..331051cf 100644 --- a/lib/Froxlor/Api/Commands/DomainZones.php +++ b/lib/Froxlor/Api/Commands/DomainZones.php @@ -227,7 +227,7 @@ class DomainZones extends ApiCommand implements ResourceEntity // remove it for checks $content = substr($content, 0, -1); } - if (!Validate::validateDomain($content)) { + if (!empty($content) && !Validate::validateDomain($content)) { $errors[] = lng('error.dns_mx_needdom'); } else { // check whether there is a CNAME-record for the same resource @@ -244,6 +244,10 @@ class DomainZones extends ApiCommand implements ResourceEntity } // append trailing dot (again) $content .= '.'; + // if content is only ".", the prio needs to be 0 which results in a "null mx" entry + if ($content == '.' && $prio != 0) { + $prio = 0; + } } elseif ($type == 'NS') { // check for trailing dot if (substr($content, -1) == '.') { diff --git a/lib/configfiles/bookworm.xml b/lib/configfiles/bookworm.xml index 2e0c78a8..d0d2697b 100644 --- a/lib/configfiles/bookworm.xml +++ b/lib/configfiles/bookworm.xml @@ -3093,7 +3093,7 @@ MaxLoginAttempts 3 BanLog /var/log/proftpd/ban.log BanTable /etc/proftpd/ban.tab BanMessage "User %u was banned." -BanOnEvent ClientConnectRate 5/00:00:02 12:00:00 "Stop connecting frequently" +BanOnEvent ClientConnectRate 10/00:00:02 02:00:00 "Stop connecting frequently" BanOnEvent MaxLoginAttempts 3/00:30:00 12:00:00 BanOnEvent AnonRejectPasswords 1/01:00:00 99:99:99 BanControlsACLs all allow user root diff --git a/lib/configfiles/bullseye.xml b/lib/configfiles/bullseye.xml index 8a0e131f..d9913f62 100644 --- a/lib/configfiles/bullseye.xml +++ b/lib/configfiles/bullseye.xml @@ -4661,7 +4661,7 @@ MaxLoginAttempts 3 BanLog /var/log/proftpd/ban.log BanTable /etc/proftpd/ban.tab BanMessage "User %u was banned." -BanOnEvent ClientConnectRate 5/00:00:02 12:00:00 "Stop connecting frequently" +BanOnEvent ClientConnectRate 10/00:00:02 02:00:00 "Stop connecting frequently" BanOnEvent MaxLoginAttempts 3/00:30:00 12:00:00 BanOnEvent AnonRejectPasswords 1/01:00:00 99:99:99 BanControlsACLs all allow user root diff --git a/lib/configfiles/focal.xml b/lib/configfiles/focal.xml index 90c47e6e..7dc03c82 100644 --- a/lib/configfiles/focal.xml +++ b/lib/configfiles/focal.xml @@ -3880,7 +3880,7 @@ MaxLoginAttempts 3 BanLog /var/log/proftpd/ban.log BanTable /etc/proftpd/ban.tab BanMessage "User %u was banned." -BanOnEvent ClientConnectRate 5/00:00:02 12:00:00 "Stop connecting frequently" +BanOnEvent ClientConnectRate 10/00:00:02 02:00:00 "Stop connecting frequently" BanOnEvent MaxLoginAttempts 3/00:30:00 12:00:00 BanOnEvent AnonRejectPasswords 1/01:00:00 99:99:99 BanControlsACLs all allow user root diff --git a/lib/configfiles/jammy.xml b/lib/configfiles/jammy.xml index d7e4cd49..3ba120b7 100644 --- a/lib/configfiles/jammy.xml +++ b/lib/configfiles/jammy.xml @@ -3872,7 +3872,7 @@ MaxLoginAttempts 3 BanLog /var/log/proftpd/ban.log BanTable /etc/proftpd/ban.tab BanMessage "User %u was banned." -BanOnEvent ClientConnectRate 5/00:00:02 12:00:00 "Stop connecting frequently" +BanOnEvent ClientConnectRate 10/00:00:02 02:00:00 "Stop connecting frequently" BanOnEvent MaxLoginAttempts 3/00:30:00 12:00:00 BanOnEvent AnonRejectPasswords 1/01:00:00 99:99:99 BanControlsACLs all allow user root diff --git a/lib/configfiles/noble.xml b/lib/configfiles/noble.xml index f5a90212..08100a43 100644 --- a/lib/configfiles/noble.xml +++ b/lib/configfiles/noble.xml @@ -2547,7 +2547,7 @@ MaxLoginAttempts 3 BanLog /var/log/proftpd/ban.log BanTable /etc/proftpd/ban.tab BanMessage "User %u was banned." -BanOnEvent ClientConnectRate 5/00:00:02 12:00:00 "Stop connecting frequently" +BanOnEvent ClientConnectRate 10/00:00:02 02:00:00 "Stop connecting frequently" BanOnEvent MaxLoginAttempts 3/00:30:00 12:00:00 BanOnEvent AnonRejectPasswords 1/01:00:00 99:99:99 BanControlsACLs all allow user root diff --git a/lng/de.lng.php b/lng/de.lng.php index 167cf8ee..2f2c74dd 100644 --- a/lng/de.lng.php +++ b/lng/de.lng.php @@ -1824,7 +1824,7 @@ Vielen Dank, Ihr Administrator', ], 'documentroot_use_default_value' => [ 'title' => 'Verwende Domainnamen im Documentroot', - 'description' => 'Wenn aktiviert wird dem standard Documentroot zusätzlich der Domain-Name angehängt.

Beispiel:
/var/customers/customer_name/example.tld/
/var/customers/customer_name/subdomain.example.tld/', + 'description' => 'Wenn aktiviert wird dem standard Documentroot zusätzlich der Domain-Name angehängt.

Beispiel:
/var/customers/webs/customer_name/example.tld/
/var/customers/webs/customer_name/subdomain.example.tld/', ], 'panel_phpconfigs_hidesubdomains' => [ 'title' => 'Verstecke Subdomains in PHP-Konfigurations-Übersicht', diff --git a/lng/en.lng.php b/lng/en.lng.php index d51a4506..e784528e 100644 --- a/lng/en.lng.php +++ b/lng/en.lng.php @@ -1946,7 +1946,7 @@ Yours sincerely, your administrator', ], 'documentroot_use_default_value' => [ 'title' => 'Use domain name as default value for DocumentRoot path', - 'description' => 'If enabled and DocumentRoot path is empty, default value will be the (sub)domain name.

Examples:
/var/customers/customer_name/example.com/
/var/customers/customer_name/subdomain.example.com/', + 'description' => 'If enabled and DocumentRoot path is empty, default value will be the (sub)domain name.

Examples:
/var/customers/webs/customer_name/example.com/
/var/customers/webs/customer_name/subdomain.example.com/', ], 'panel_phpconfigs_hidesubdomains' => [ 'title' => 'Hide subdomains in PHP-configuration overview',