Skip to content

Commit

Permalink
Merge branch '2.1.x' of https://github.com/froxlor/Froxlor into 2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
netcarlos committed Jul 28, 2023
2 parents 99c1182 + bb60df0 commit 61df87a
Show file tree
Hide file tree
Showing 157 changed files with 5,067 additions and 1,530 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ logs/*
*~
.well-known
.idea
.DS_Store
*.iml
img/
vendor/
Expand Down
2 changes: 1 addition & 1 deletion actions/admin/settings/100.panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
'extras.directoryprotection' => lng('menue.extras.extras') . " / " . lng('menue.extras.directoryprotection'),
'extras.pathoptions' => lng('menue.extras.extras') . " / " . lng('menue.extras.pathoptions'),
'extras.logger' => lng('menue.extras.extras') . " / " . lng('menue.logger.logger'),
'extras.backup' => lng('menue.extras.extras') . " / " . lng('menue.extras.backup'),
'extras.export' => lng('menue.extras.extras') . " / " . lng('menue.extras.export'),
'traffic' => lng('menue.traffic.traffic'),
'traffic.http' => lng('menue.traffic.traffic') . " / HTTP",
'traffic.ftp' => lng('menue.traffic.traffic') . " / FTP",
Expand Down
8 changes: 4 additions & 4 deletions actions/admin/settings/110.accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@
'onlyif' => 1
]
],
'system_backupenabled' => [
'label' => lng('serversettings.backupenabled'),
'system_exportenabled' => [
'label' => lng('serversettings.exportenabled'),
'settinggroup' => 'system',
'varname' => 'backupenabled',
'varname' => 'exportenabled',
'type' => 'checkbox',
'default' => false,
'cronmodule' => 'froxlor/backup',
'cronmodule' => 'froxlor/export',
'save_method' => 'storeSettingField'
],
'system_createstdsubdom_default' => [
Expand Down
3 changes: 2 additions & 1 deletion actions/admin/settings/120.system.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
'varname' => 'enabled',
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'api_customer_default' => [
'label' => lng('serversettings.api_customer_default'),
Expand Down
9 changes: 6 additions & 3 deletions actions/admin/settings/125.cronjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
'type' => 'text',
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
'default' => '/usr/bin/nice -n 5 /usr/bin/php -q',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_crondreload' => [
'label' => lng('serversettings.system_crondreload'),
Expand All @@ -55,15 +56,17 @@
'type' => 'text',
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
'default' => '/etc/init.d/cron reload',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_cron_allowautoupdate' => [
'label' => lng('serversettings.system_cron_allowautoupdate'),
'settinggroup' => 'system',
'varname' => 'cron_allowautoupdate',
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
]
]
]
Expand Down
9 changes: 6 additions & 3 deletions actions/admin/settings/130.webserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@
'label' => lng('serversettings.logfiles_format'),
'settinggroup' => 'system',
'varname' => 'logfiles_format',
'type' => 'text',
'type' => (strpos(Settings::Get('system.logfiles_format'), '"') !== false ? 'textarea' : 'text'),
'string_regexp' => '/^[^\0\r\n<>]*$/i',
'default' => '',
'string_emptyallowed' => true,
'save_method' => 'storeSettingField',
Expand Down Expand Up @@ -307,7 +308,8 @@
'type' => 'text',
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
'default' => '/etc/init.d/apache2 reload',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_phpreload_command' => [
'label' => lng('serversettings.phpreload_command'),
Expand All @@ -319,7 +321,8 @@
'save_method' => 'storeSettingField',
'websrv_avail' => [
'nginx'
]
],
'required_otp' => true
],
'system_nginx_php_backend' => [
'label' => lng('serversettings.nginx_php_backend'),
Expand Down
3 changes: 2 additions & 1 deletion actions/admin/settings/131.ssl.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@
'string_type' => 'file',
'default' => '/root/.acme.sh/acme.sh',
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
'system_letsencryptacmeconf' => [
'label' => lng('serversettings.letsencryptacmeconf'),
Expand Down
12 changes: 8 additions & 4 deletions actions/admin/settings/136.phpfpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
'type' => 'textarea',
'default' => '',
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
'phpfpm_ini_values' => [
'label' => lng('phpfpm.ini_values'),
Expand All @@ -135,7 +136,8 @@
'type' => 'textarea',
'default' => '',
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
'phpfpm_ini_admin_flags' => [
'label' => lng('phpfpm.ini_admin_flags'),
Expand All @@ -144,7 +146,8 @@
'type' => 'textarea',
'default' => '',
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
'phpfpm_ini_admin_values' => [
'label' => lng('phpfpm.ini_admin_values'),
Expand All @@ -153,7 +156,8 @@
'type' => 'textarea',
'default' => '',
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
]
]
]
Expand Down
6 changes: 4 additions & 2 deletions actions/admin/settings/160.nameserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
'type' => 'text',
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
'default' => '/etc/init.d/bind9 reload',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_nameservers' => [
'label' => lng('serversettings.nameservers'),
Expand Down Expand Up @@ -111,7 +112,8 @@
'string_delimiter' => ',',
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_powerdns_mode' => [
'label' => lng('serversettings.powerdns_mode'),
Expand Down
3 changes: 2 additions & 1 deletion actions/admin/settings/180.dkim.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@
'type' => 'text',
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
'default' => '/etc/init.d/dkim-filter restart',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
]
]
]
Expand Down
24 changes: 16 additions & 8 deletions actions/admin/settings/210.security.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
'varname' => 'unix_names',
'type' => 'checkbox',
'default' => true,
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_mailpwcleartext' => [
'label' => lng('serversettings.mailpwcleartext'),
Expand All @@ -46,7 +47,8 @@
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
'system_passwordcryptfunc' => [
'label' => lng('serversettings.passwordcryptfunc'),
Expand All @@ -59,23 +61,26 @@
'getAvailablePasswordHashes'
],
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
'system_allow_error_report_admin' => [
'label' => lng('serversettings.allow_error_report_admin'),
'settinggroup' => 'system',
'varname' => 'allow_error_report_admin',
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_allow_error_report_customer' => [
'label' => lng('serversettings.allow_error_report_customer'),
'settinggroup' => 'system',
'varname' => 'allow_error_report_customer',
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_allow_customer_shell' => [
'label' => lng('serversettings.allow_allow_customer_shell'),
Expand All @@ -84,7 +89,8 @@
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
'system_available_shells' => [
'label' => lng('serversettings.available_shells'),
Expand All @@ -94,7 +100,8 @@
'string_emptyallowed' => true,
'default' => '',
'save_method' => 'storeSettingField',
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
'system_froxlorusergroup' => [
'label' => lng('serversettings.froxlorusergroup'),
Expand All @@ -108,7 +115,8 @@
'checkLocalGroup'
],
'visible' => Settings::Get('system.nssextrausers'),
'advanced_mode' => true
'advanced_mode' => true,
'required_otp' => true
],
]
]
Expand Down
12 changes: 9 additions & 3 deletions actions/admin/settings/220.quota.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,30 @@
'settinggroup' => 'system',
'varname' => 'diskquota_repquota_path',
'type' => 'text',
'string_type' => 'file',
'default' => '/usr/sbin/repquota',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_diskquota_quotatool_path' => [
'label' => lng('serversettings.diskquota_quotatool_path.description'),
'settinggroup' => 'system',
'varname' => 'diskquota_quotatool_path',
'type' => 'text',
'string_type' => 'file',
'default' => '/usr/bin/quotatool',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
],
'system_diskquota_customer_partition' => [
'label' => lng('serversettings.diskquota_customer_partition.description'),
'settinggroup' => 'system',
'varname' => 'diskquota_customer_partition',
'type' => 'text',
'string_type' => 'file',
'default' => '/dev/root',
'save_method' => 'storeSettingField'
'save_method' => 'storeSettingField',
'required_otp' => true
]
]
]
Expand Down
87 changes: 87 additions & 0 deletions actions/admin/settings/230.backup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php

/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you can also view it online at
* https://files.froxlor.org/misc/COPYING.txt
*
* @copyright the authors
* @author Froxlor team <[email protected]>
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
*/

return [
'groups' => [
'backup' => [
'title' => lng('backup'),
'icon' => 'fa-solid fa-sliders',
'advanced_mode' => true,
'fields' => [
'backup_enabled' => [
'label' => lng('serversettings.backup_enabled'),
'settinggroup' => 'backup',
'varname' => 'enabled',
'type' => 'checkbox',
'default' => false,
'save_method' => 'storeSettingField',
'overview_option' => true,
'cronmodule' => 'froxlor/backup'
],
'backup_default_storage' => [
'label' => lng('serversettings.backup_default_storage'),
'settinggroup' => 'backup',
'varname' => 'default_storage',
'type' => 'select',
'default' => '1',
'option_options_method' => [
'\\Froxlor\\Backup\\Backup',
'getBackupStorages'
],
'save_method' => 'storeSettingField'
],
'backup_default_retention' => [
'label' => lng('serversettings.backup_default_retention'),
'settinggroup' => 'backup',
'varname' => 'default_retention',
'type' => 'number',
'default' => 3,
'min' => 0,
'save_method' => 'storeSettingField',
],
'backup_default_customer_access' => [
'label' => lng('serversettings.backup_default_customer_access'),
'settinggroup' => 'backup',
'varname' => 'default_customer_access',
'type' => 'checkbox',
'default' => true,
'save_method' => 'storeSettingField',
],
'backup_default_pgp_public_key' => [
'label' => lng('serversettings.backup_default_pgp_public_key'),
'settinggroup' => 'backup',
'varname' => 'default_pgp_public_key',
'type' => 'textarea',
'default' => '',
'save_method' => 'storeSettingField',
'plausibility_check_method' => [
'\\Froxlor\\Validate\\Check',
'checkPgpPublicKeySetting'
],
],
]
]
]
];
2 changes: 1 addition & 1 deletion admin_apcuinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
}

if (!function_exists('apcu_cache_info') || !function_exists('apcu_sma_info')) {
Response::standardError(lng('error.no_apcuinfo'));
Response::standardError('no_apcuinfo');
}

if ($page == 'showinfo' && $userinfo['change_serversettings'] == '1') {
Expand Down
Loading

0 comments on commit 61df87a

Please sign in to comment.