add notice for settings that might require reconfiguration of specific services

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-11-08 10:24:31 +01:00
parent b6d850dac3
commit ec8338592d
20 changed files with 124 additions and 99 deletions

View File

@@ -40,7 +40,8 @@ return [
'plausibility_check_method' => [
'\\Froxlor\\Validate\\Check',
'checkPathConflicts'
]
],
'requires_reconf' => ['http']
],
'system_documentroot_use_default_value' => [
'label' => lng('serversettings.documentroot_use_default_value'),

View File

@@ -69,7 +69,8 @@ return [
'visible' => Settings::Get('system.leenabled') && call_user_func([
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
], true)
], true),
'requires_reconf' => ['http']
],
'system_le_froxlor_redirect' => [
'label' => lng('serversettings.le_froxlor_redirect'),
@@ -166,7 +167,8 @@ return [
'visible' => Settings::Get('system.mod_fcgid') && call_user_func([
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
])
]),
'requires_reconf' => ['system:fcgid']
],
'system_mod_fcgid_httpuser' => [
'label' => lng('admin.mod_fcgid_user'),
@@ -181,7 +183,8 @@ return [
'visible' => Settings::Get('system.mod_fcgid') && call_user_func([
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
])
]),
'requires_reconf' => ['system:fcgid']
],
'system_mod_fcgid_httpgroup' => [
'label' => lng('admin.mod_fcgid_group'),
@@ -196,7 +199,8 @@ return [
'visible' => Settings::Get('system.mod_fcgid') && call_user_func([
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
])
]),
'requires_reconf' => ['system:fcgid']
],
'system_mod_fcgid_defaultini_ownvhost' => [
'label' => lng('serversettings.mod_fcgid.defaultini_ownvhost'),
@@ -230,7 +234,8 @@ return [
'visible' => Settings::Get('phpfpm.enabled') && call_user_func([
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
])
]),
'requires_reconf' => ['system:php-fpm']
],
'system_phpfpm_httpuser' => [
'label' => lng('phpfpm.vhost_httpuser'),
@@ -242,7 +247,8 @@ return [
'visible' => Settings::Get('phpfpm.enabled') && call_user_func([
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
])
]),
'requires_reconf' => ['system:php-fpm']
],
'system_phpfpm_httpgroup' => [
'label' => lng('phpfpm.vhost_httpgroup'),
@@ -254,7 +260,8 @@ return [
'visible' => Settings::Get('phpfpm.enabled') && call_user_func([
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
])
]),
'requires_reconf' => ['system:php-fpm']
],
'system_phpfpm_defaultini_ownvhost' => [
'label' => lng('serversettings.mod_fcgid.defaultini_ownvhost'),

View File

@@ -46,7 +46,8 @@ return [
'plausibility_check_method' => [
'\\Froxlor\\Validate\\Check',
'checkPhpInterfaceSetting'
]
],
'requires_reconf' => ['http']
],
'system_apache_24' => [
'label' => lng('serversettings.apache_24'),
@@ -120,7 +121,8 @@ return [
'type' => 'text',
'string_type' => 'filedir',
'default' => '/etc/apache2/sites-enabled/',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['http']
],
'system_apacheconf_diroptions' => [
'label' => lng('serversettings.apacheconf_diroptions'),
@@ -129,7 +131,8 @@ return [
'type' => 'text',
'string_type' => 'filedir',
'default' => '/etc/apache2/sites-enabled/',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['http']
],
'system_apacheconf_htpasswddir' => [
'label' => lng('serversettings.apacheconf_htpasswddir'),
@@ -147,7 +150,8 @@ return [
'type' => 'text',
'string_type' => 'dir',
'default' => '/var/customers/logs/',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['http']
],
'system_logfiles_script' => [
'label' => lng('serversettings.logfiles_script'),
@@ -252,7 +256,8 @@ return [
'string_type' => 'dir',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['http']
],
'system_default_vhostconf' => [
'label' => lng('serversettings.default_vhostconf'),

View File

@@ -39,7 +39,8 @@ return [
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField',
'overview_option' => true
'overview_option' => true,
'requires_reconf' => ['http']
],
'system_ssl_protocols' => [
'label' => lng('serversettings.ssl.ssl_protocols'),
@@ -145,7 +146,8 @@ return [
'type' => 'checkbox',
'default' => false,
'cronmodule' => 'froxlor/letsencrypt',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['http']
],
'system_acmeshpath' => [
'label' => lng('serversettings.acmeshpath'),
@@ -164,23 +166,9 @@ return [
'type' => 'text',
'string_type' => 'file',
'default' => '/etc/apache2/conf-enabled/acme.conf',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['http']
],
/**
* currently the only option anyway
*
* 'system_leapiversion' => array(
* 'label' => lng('serversettings.leapiversion'),
* 'settinggroup' => 'system',
* 'varname' => 'leapiversion',
* 'type' => 'select',
* 'default' => '2',
* 'select_var' => array(
* '2' => 'ACME v2'
* ),
* 'save_method' => 'storeSettingField'
* ),
*/
'system_letsencryptca' => [
'label' => lng('serversettings.letsencryptca'),
'settinggroup' => 'system',
@@ -204,7 +192,8 @@ return [
'string_emptyallowed' => false,
'default' => Froxlor::getInstallDir(),
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'requires_reconf' => ['http']
],
'system_letsencryptkeysize' => [
'label' => lng('serversettings.letsencryptkeysize'),

View File

@@ -44,7 +44,8 @@ return [
'\\Froxlor\\Validate\\Check',
'checkFcgidPhpFpm'
],
'overview_option' => true
'overview_option' => true,
'requires_reconf' => ['http', 'system:fcgid']
],
'system_mod_fcgid_configdir' => [
'label' => lng('serversettings.mod_fcgid.configdir'),
@@ -57,7 +58,8 @@ return [
'\\Froxlor\\Validate\\Check',
'checkPathConflicts'
],
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['system:fcgid']
],
'system_mod_fcgid_tmpdir' => [
'label' => lng('serversettings.mod_fcgid.tmpdir'),
@@ -66,7 +68,8 @@ return [
'type' => 'text',
'string_type' => 'dir',
'default' => '/var/customers/tmp/',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['http']
],
'system_mod_fcgid_peardir' => [
'label' => lng('serversettings.mod_fcgid.peardir'),

View File

@@ -42,7 +42,8 @@ return [
'\\Froxlor\\Validate\\Check',
'checkFcgidPhpFpm'
],
'overview_option' => true
'overview_option' => true,
'requires_reconf' => ['http', 'system:php-fpm']
],
'system_phpfpm_defaultini' => [
'label' => lng('serversettings.mod_fcgid.defaultini'),

View File

@@ -43,6 +43,7 @@ return [
'goaccess' => lng('serversettings.traffictool.goaccess')
],
'save_method' => 'storeSettingUpdateTrafficTool',
'requires_reconf' => ['system']
],
'system_webalizer_quiet' => [
'label' => lng('serversettings.webalizer_quiet'),
@@ -86,7 +87,8 @@ return [
'string_type' => 'dir',
'default' => '/etc/awstats/',
'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.traffictool') == 'awstats'
'visible' => Settings::Get('system.traffictool') == 'awstats',
'requires_reconf' => ['system:awstats']
],
'system_awstats_icons' => [
'label' => lng('serversettings.awstats_icons'),

View File

@@ -38,7 +38,8 @@ return [
'min' => 2,
'max' => 65535,
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'requires_reconf' => ['smtp']
],
'system_vmail_gid' => [
'label' => lng('serversettings.vmail_gid'),
@@ -49,7 +50,8 @@ return [
'min' => 2,
'max' => 65535,
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'requires_reconf' => ['smtp']
],
'system_vmail_homedir' => [
'label' => lng('serversettings.vmail_homedir'),
@@ -58,7 +60,8 @@ return [
'type' => 'text',
'string_type' => 'dir',
'default' => '/var/customers/mail/',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['smtp']
],
'system_vmail_maildirname' => [
'label' => lng('serversettings.vmail_maildirname'),

View File

@@ -23,6 +23,8 @@
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/
use Froxlor\Settings;
return [
'groups' => [
'nameserver' => [
@@ -36,7 +38,8 @@ return [
'type' => 'checkbox',
'default' => true,
'save_method' => 'storeSettingField',
'overview_option' => true
'overview_option' => true,
'requires_reconf' => ['dns']
],
'system_dnsenabled' => [
'label' => lng('serversettings.dnseditorenable'),
@@ -56,7 +59,8 @@ return [
'Bind' => 'Bind9',
'PowerDNS' => 'PowerDNS'
],
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'requires_reconf' => ['dns']
],
'system_bindconf_directory' => [
'label' => lng('serversettings.bindconf_directory'),
@@ -65,7 +69,9 @@ return [
'type' => 'text',
'string_type' => 'dir',
'default' => '/etc/bind/',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.dns_server') == 'Bind',
'requires_reconf' => ['dns:bind']
],
'system_bindreload_command' => [
'label' => lng('serversettings.bindreload_command'),
@@ -117,7 +123,8 @@ return [
'Master' => 'Master'
],
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'visible' => Settings::Get('system.dns_server') == 'PowerDNS',
],
'system_dns_createmailentry' => [
'label' => lng('serversettings.mail_also_with_mxservers'),

View File

@@ -337,6 +337,8 @@ class User
if ($field == 'diskspace' && ($customer_arr[$field] / 1024) != '-1') {
$arr[$used_field] += intval($customer_arr[$field]);
} elseif ($field == 'traffic_used') {
// no check for -1 here because we don't want the assigned traffic for admins/resellers but
// the actually used (for stats reasons)
$arr[$used_field] += intval($customer_arr[$field]);
}
}

View File

@@ -48,8 +48,6 @@
<command><![CDATA[chmod 0600 {{settings.system.apacheconf_diroptions}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.documentroot_prefix}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.logfiles_directory}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command>
<visibility mode="notempty">{{settings.system.deactivateddocroot}}
</visibility>
@@ -4671,6 +4669,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.2]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the

View File

@@ -48,8 +48,6 @@
<command><![CDATA[chmod 0600 {{settings.system.apacheconf_diroptions}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.documentroot_prefix}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.logfiles_directory}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command>
<visibility mode="notempty">{{settings.system.deactivateddocroot}}
</visibility>
@@ -3311,6 +3309,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php8.1]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the

View File

@@ -48,8 +48,6 @@
<command><![CDATA[chmod 0600 {{settings.system.apacheconf_diroptions}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.documentroot_prefix}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.logfiles_directory}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command>
<visibility mode="notempty">{{settings.system.deactivateddocroot}}
</visibility>
@@ -4882,6 +4880,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.4]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the

View File

@@ -48,8 +48,6 @@
<command><![CDATA[chmod 0600 {{settings.system.apacheconf_diroptions}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.documentroot_prefix}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.logfiles_directory}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command>
<visibility mode="notempty">{{settings.system.deactivateddocroot}}
</visibility>
@@ -4873,6 +4871,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.3]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the

View File

@@ -48,8 +48,6 @@
<command><![CDATA[chmod 0600 {{settings.system.apacheconf_diroptions}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.documentroot_prefix}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.logfiles_directory}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command>
<visibility mode="notempty">{{settings.system.deactivateddocroot}}
</visibility>
@@ -4096,6 +4094,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.4]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the

View File

@@ -57,8 +57,6 @@
<command><![CDATA[chmod 0600 {{settings.system.apacheconf_diroptions}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.documentroot_prefix}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.logfiles_directory}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command>
<visibility mode="notempty">{{settings.system.deactivateddocroot}}
</visibility>
@@ -3876,6 +3874,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command>
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>

View File

@@ -48,8 +48,6 @@
<command><![CDATA[chmod 0600 {{settings.system.apacheconf_diroptions}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.documentroot_prefix}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.logfiles_directory}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command>
<visibility mode="notempty">{{settings.system.deactivateddocroot}}
</visibility>
@@ -4096,6 +4094,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[chmod 1777 {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php8.1]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the

View File

@@ -2043,6 +2043,7 @@ Vielen Dank, Ihr Administrator',
'traffictool' => [
'toolselect' => 'Traffic Analyzer',
],
'requires_reconfiguration' => 'Änderungen an dieser Einstellungen benötigen unter Umständen eine erneute Konfiguration der folgenden Dienste: <strong>%s</strong>',
],
'spf' => [
'use_spf' => 'Aktiviere SPF für Domains?',

View File

@@ -2165,6 +2165,7 @@ Yours sincerely, your administrator',
'awstats' => 'AWStats',
'goaccess' => 'goacccess'
],
'requires_reconfiguration' => 'Changing this settings might require a reconfiguration of the following services: <strong>%s</strong>',
],
'spf' => [
'use_spf' => 'Activate SPF for domains?',

View File

@@ -16,6 +16,11 @@
{% endif %}
{% if field.label.description is defined and field.label.description is not empty %}<br><small>{{ field.label.description|raw }}</small>
{% endif %}
{% if field.requires_reconf is defined and field.requires_reconf is not empty %}
<div class="bg-info bg-opacity-25 rounded p-2 mt-2 d-flex align-items-center" role="alert">
<i class="fa-solid fa-circle-exclamation me-2"></i><p class="mb-0">{{ lng('serversettings.requires_reconfiguration', [field.requires_reconf|join(', ')])|raw }}</p>
</div>
{% endif %}
</label>
{% else %}
<label for="{{ id }}" class="col-sm-6 col-form-label pe-3">
@@ -31,6 +36,11 @@
{% endif %}
{% if field.desc is defined and field.desc is not empty %}<br><small>{{ field.desc|raw }}</small>
{% endif %}
{% if field.requires_reconf is defined and field.requires_reconf is not empty %}
<div class="bg-info bg-opacity-25 rounded p-2 mt-2 d-flex align-items-center" role="alert">
<i class="fa-solid fa-circle-exclamation me-2"></i><p class="mb-0">{{ lng('serversettings.requires_reconfiguration', [field.requires_reconf|join(', ')])|raw }}</p>
</div>
{% endif %}
</label>
{% endif %}
<div class="col-sm-6">