Compare commits

...

48 Commits

Author SHA1 Message Date
Michael Kaufmann
1d7d32130a setting version to 0.10.33 for upcoming release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-02-04 13:24:41 +01:00
Michael Kaufmann
9babcde3e5 additional mkdir/chmod parameter fixes and cron-lock file adjustments
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-02-04 10:52:12 +01:00
Kris
9ec76c9fd6 Improve composer.json syntax (#1008)
* Improve composer.json syntax

* Run composer upgrade with PHP 7.4
2022-01-26 14:10:08 +01:00
Michael Kaufmann
61dfeb947f fix incorrect parameter type for mkdir() and chmod()
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-25 15:47:37 +01:00
Michael Kaufmann
6fdf2636fc update docs url for api-documentation
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-25 14:54:52 +01:00
Michael Kaufmann
0a38d1ab5f add workflow to automatically trigger api-docs generation in Froxlor/Documentation
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-21 17:02:35 +01:00
Michael Kaufmann
7c80dc3d1d add script for php-session cleanup
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-21 16:02:21 +01:00
Manuel
5ab49e3f50 Call PHP-FPM only when file exists (#1006)
Added `<If "-f %{SCRIPT_FILENAME}">` to load only PHP files that exists. This is to prevent `File not found` error from PHP-FPM and let Apache handle the error output. It removes also unnecessary PHP-FPM calls and `AH01071: Got error ‘Primary script unknown` in PHP error log.

Usually you can find the error whenever someone goes fishing for paths like wp-login.php.

The `<If>` directive is only available in Apache 2.4+ and not 2.2 or earlier.
2022-01-21 12:25:14 +01:00
Michael Kaufmann
06849133a8 modernize parameters of Cronjob::inserttask()
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-21 10:39:32 +01:00
Oskar Eisemuth
4a912e3902 Feature/crontaskid (#1005)
* Add \Froxlor\Cron\TaskId for fixed task id naming

* Replace Cronjob::inserttask numbers with \Froxlor\Cron\TaskId constants

* Use TaskId in Froxlor\Cron\System\TasksCron

* Use TaskId in Froxlor\System\Cronjob,
simplify getOutstandingTasks.
Rename lng['tasks'] cronjob task description.
WARNING: DELETE_DOMAIN_PDNS, DELETE_DOMAIN_SSL now use %domain%

* Remove Froxlor\System\Cronjob type 3 check
2022-01-21 10:03:45 +01:00
Michael Kaufmann
bcb95e9b7d check resource-usage for Mysql.add(), thx again to zerody
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-18 23:18:54 +01:00
Michael Kaufmann
c97f5f1e29 updated README; sanitize script parameter in index.php; sanitize description fields of entities (thx to zerody for pointing these out)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-18 09:29:13 +01:00
timdeluxe
4d289e2a7f Improves text for global open basedir setting (#1004) 2022-01-13 19:50:39 +01:00
Michael Kaufmann
c491f2c03e put commands for cronjob setup at the end of the list (should be the last thing to execute)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-13 18:42:40 +01:00
Michael Kaufmann
5832346f75 set version to 0.10.32 for upcoming release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-07 15:38:12 +01:00
Michael Kaufmann
4b4770ab36 add missing change-check when ssl-specialsettings are changed
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2022-01-03 20:27:19 +01:00
Michael Kaufmann
8c998dd6f2 Update README.md 2022-01-02 14:53:59 +01:00
Michael Kaufmann
965359ec79 Update README.md 2022-01-02 14:35:36 +01:00
Michael Kaufmann
d1d42f2055 allow setting path to acme.sh installation; fixes #1002
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-12-31 10:38:49 +01:00
Michael Kaufmann
5f41b37770 test dns entry string without any whitespaces/tabs/etc.
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-12-27 16:08:46 +01:00
Michael Kaufmann
61265778a5 fix unit-test
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-12-27 16:01:45 +01:00
Michael Kaufmann
8f0f890145 fix too strict comparison for isemaildomain check in Dns-Zone generation; fixes #1003
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-12-27 15:38:59 +01:00
Michael Kaufmann
5ccae3f9bb do not check for allowed-phpconfigs if fpm/fcgid is not activated (no possibility to select a config anyway)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-12-14 11:23:36 +01:00
Michael Kaufmann
f4d9e64804 set version to 0.10.31 for upcoming release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-12-03 15:30:09 +01:00
Michael Kaufmann
149c0935fa fix Domains.update() with correct path and change_serversettings=0; refs #1001
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-27 22:06:29 +01:00
Michael Kaufmann
cb0b537f6c allow settings/updating documentroot (only relative to customer homedirectory) when change_serversettings permission is not granted; fixes #1000
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-27 18:04:36 +01:00
Michael Kaufmann
b54c012579 respect deactivated flag when createstdsubdomain's default falls back to 'true' if the customer has one (prior to deactivating); refs #998
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-15 20:24:55 +01:00
Michael Kaufmann
389d83f5a3 fix behaviour in Customers.update() in case 'createstdsubdomain' is not set when called via API (wrong default); fixes #998
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-15 20:04:01 +01:00
Michael Kaufmann
00771381e8 set correct php-version numbers for installation dependencies-check; fixes #997
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-13 20:20:05 +01:00
Michael Kaufmann
46df429909 set version to 0.10.30 for upcoming release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-05 09:27:58 +01:00
Michael Kaufmann
eb841da007 avoid possible DivisionByZeroError in APCu info page, fixes #995
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-04 07:44:03 +01:00
Michael Kaufmann
c4a2db03be enable bind for testing-scenarios explicitly
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-03 14:16:21 +01:00
Michael Kaufmann
e5838f00cf add quota-plugin parameters to dovecot-config-templates; update standardcustomer index.html; set nameserver disabled by default
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-11-03 14:08:57 +01:00
Michael Kaufmann
bcde7e93df check whether the domain to clean from pdns actually still exists there; fixes #992
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-21 12:00:36 +02:00
Michael Kaufmann
bd8327afbe soften/correct permissions on pdns configs; fixes #991
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-21 11:56:34 +02:00
Michael Kaufmann
b961eba382 fix api documentation for Domains.add() and Domains.update(); fixes #987
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-20 16:51:16 +02:00
Michael Kaufmann
a552ea878e avoid undefined index of 'wwwserveralias' field if issueing/renewing lets encrypt certificate for froxlor-hostname
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-17 11:48:40 +02:00
Michael Kaufmann
4ad2a1da1c add complete list of nameserver-ips and given axfr-servers to allow-axfr-ips list for PowerDNS; fixes #985
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-14 19:07:05 +02:00
Michael Kaufmann
37ae69f07a correct language strings in phpconfig formfield for new setting; refs #980
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-14 17:13:55 +02:00
Michael Kaufmann
9870db2560 add possibility to assign new/edited php-config to all customer accounts; fixes #980
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-14 17:09:29 +02:00
Michael Kaufmann
724a5e172a don't remove 0-value parameter values from bulk-actions
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-12 16:29:04 +02:00
Michael Kaufmann
8e166cb842 adjust debian 11 config templates, fixes #982
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-12 14:25:42 +02:00
Michael Kaufmann
5e281cf486 fix allowed-phpconfigs check in SubDomains.add() and SubDomains.update()
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-11 19:26:13 +02:00
Michael Kaufmann
5d2f44ecd8 only validate custom database name if used at all
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-11 18:59:26 +02:00
Michael Kaufmann
5009c625d8 prep.statement cannot be used for create database query; regex-validate database_name
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-11 18:55:15 +02:00
Michael Kaufmann
eb592340b0 use prepared statement for creating databases to avoid sql injections in custom db-names
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-11 18:33:48 +02:00
Michael Kaufmann
c6f556c8d9 set version to 0.10.29.1 for bugfix release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-10 14:45:17 +02:00
Michael Kaufmann
db1df84ef1 correct db-exists check in installation-process
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-10 14:32:02 +02:00
79 changed files with 1782 additions and 892 deletions

14
.github/workflows/build-apidocs.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: build-docs
on:
release:
types: [published]
jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- env:
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
run: |
gh workflow run --repo Froxlor/Documentation build-docs -f ref=${{github.ref_name}}

View File

@@ -1,6 +1,6 @@
[![Froxlor-CI](https://github.com/Froxlor/Froxlor/actions/workflows/build-mariadb.yml/badge.svg?branch=master)](https://github.com/Froxlor/Froxlor/actions/workflows/build-mariadb.yml)
[![Froxlor-CI](https://github.com/Froxlor/Froxlor/actions/workflows/build-mysql.yml/badge.svg?branch=master)](https://github.com/Froxlor/Froxlor/actions/workflows/build-mysql.yml)
[![Gitter](https://badges.gitter.im/Froxlor/community.svg)](https://gitter.im/Froxlor/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.froxlor.org)
# Froxlor
@@ -21,12 +21,16 @@ Developed by experienced server administrators, this panel simplifies the effort
9. Have fun!
### Detailed installation
https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-from-tarball
https://docs.froxlor.org/general/installation/index.html
## Help
You may find help in the following places:
### Discord
The froxlor community discord server can be found here: https://discord.froxlor.org
### IRC
froxlor may be found on libera.chat, channel #froxlor:
@@ -38,12 +42,12 @@ The community is located on https://forum.froxlor.org/
### Wiki
More documentation may be found in the froxlor - wiki:
https://github.com/Froxlor/Froxlor/wiki
More documentation may be found in the froxlor - documentation:
https://docs.froxlor.org/
## License
May be found in COPYING
May be found in [COPYING](COPYING)
## Downloads
@@ -52,7 +56,7 @@ https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.fro
### Debian repository
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-debian)
[HowTo](https://docs.froxlor.org/general/installation/aptpackage.html)
```
apt-get -y install apt-transport-https lsb-release ca-certificates
@@ -62,7 +66,7 @@ echo "deb https://deb.froxlor.org/debian $(lsb_release -sc) main" > /etc/apt/sou
### Ubuntu repository
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-ubuntu)
[HowTo](https://docs.froxlor.org/general/installation/aptpackage.html)
```
apt-get -y install apt-transport-https lsb-release ca-certificates

View File

@@ -249,7 +249,7 @@ return array(
'extras' => $lng['menue']['extras']['extras'],
'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.logger' => $lng['menue']['extras']['extras'] . " / " . $lng['admin']['loggersystem'],
'extras.backup' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['backup'],
'traffic' => $lng['menue']['traffic']['traffic'],
'traffic.http' => $lng['menue']['traffic']['traffic'] . " / HTTP",

View File

@@ -133,6 +133,15 @@ return array(
'cronmodule' => 'froxlor/letsencrypt',
'save_method' => 'storeSettingField'
),
'system_acmeshpath' => array(
'label' => $lng['serversettings']['acmeshpath'],
'settinggroup' => 'system',
'varname' => 'acmeshpath',
'type' => 'string',
'string_type' => 'file',
'default' => '/root/.acme.sh/acme.sh',
'save_method' => 'storeSettingField'
),
'system_letsencryptacmeconf' => array(
'label' => $lng['serversettings']['letsencryptacmeconf'],
'settinggroup' => 'system',

View File

@@ -67,6 +67,9 @@ if ($page == 'showinfo') {
$uptime_duration = duration($cache['start_time']);
$size_vars = bsize($cache['mem_size']);
$num_hits_and_misses = $cache['num_hits'] + $cache['num_misses'];
$num_hits_and_misses = 0 >= $num_hits_and_misses ? 1 : $num_hits_and_misses;
// check for possible empty values that are used in the templates
if (! isset($cache['file_upload_progress'])) {
$cache['file_upload_progress'] = $lng['logger']['unknown'];
@@ -84,8 +87,8 @@ if ($page == 'showinfo') {
$freemem = bsize($mem_avail) . sprintf(" (%.1f%%)", $mem_avail * 100 / $mem_size);
$usedmem = bsize($mem_used) . sprintf(" (%.1f%%)", $mem_used * 100 / $mem_size);
$hits = $cache['num_hits'] . @sprintf(" (%.1f%%)", $cache['num_hits'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
$misses = $cache['num_misses'] . @sprintf(" (%.1f%%)", $cache['num_misses'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
$hits = $cache['num_hits'] . @sprintf(" (%.1f%%)", $cache['num_hits'] * 100 / $num_hits_and_misses);
$misses = $cache['num_misses'] . @sprintf(" (%.1f%%)", $cache['num_misses'] * 100 / $num_hits_and_misses);
// Fragmentation: (freeseg - 1) / total_seg
$nseg = $freeseg = $fragsize = $freetotal = 0;

View File

@@ -38,13 +38,43 @@ if ($userinfo['change_serversettings'] == '1') {
// try to convert namserver hosts to ip's
$ns_ips = "";
$known_ns_ips = [];
if (Settings::Get('system.nameservers') != '') {
$nameservers = explode(',', Settings::Get('system.nameservers'));
foreach ($nameservers as $nameserver) {
$nameserver = trim($nameserver);
// DNS servers might be multi homed; allow transfer from all ip
// addresses of the DNS server
$nameserver_ips = \Froxlor\PhpHelper::gethostbynamel6($nameserver);
if (is_array($nameserver_ips) && count($nameserver_ips) > 0) {
$ns_ips .= implode(",", $nameserver_ips);
// append dot to hostname
if (substr($nameserver, - 1, 1) != '.') {
$nameserver .= '.';
}
// ignore invalid responses
if (! is_array($nameserver_ips)) {
// act like \Froxlor\PhpHelper::gethostbynamel6() and return unmodified hostname on error
$nameserver_ips = array(
$nameserver
);
} else {
$known_ns_ips = array_merge($known_ns_ips, $nameserver_ips);
}
if (!empty($ns_ips)) {
$ns_ips .= ',';
}
$ns_ips .= implode(",", $nameserver_ips);
}
}
// AXFR server
if (Settings::Get('system.axfrservers') != '') {
$axfrservers = explode(',', Settings::Get('system.axfrservers'));
foreach ($axfrservers as $axfrserver) {
if (!in_array(trim($axfrserver), $known_ns_ips)) {
if (!empty($ns_ips)) {
$ns_ips .= ',';
}
$ns_ips .= trim($axfrserver);
}
}
}
@@ -59,7 +89,6 @@ if ($userinfo['change_serversettings'] == '1') {
'<SERVERIP>' => Settings::Get('system.ipaddress'),
'<NAMESERVERS>' => Settings::Get('system.nameservers'),
'<NAMESERVERS_IP>' => $ns_ips,
'<AXFRSERVERS>' => Settings::Get('system.axfrservers'),
'<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'),
'<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'),
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),

View File

@@ -640,8 +640,8 @@ if ($page == 'domains' || $page == 'overview') {
// update customer/admin counters
\Froxlor\User::updateCounters(false);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
$result_str = $result['imported'] . ' / ' . $result['all'] . (! empty($result['note']) ? ' (' . $result['note'] . ')' : '');
\Froxlor\UI\Response::standard_success('domain_import_successfully', $result_str, array(

View File

@@ -66,11 +66,11 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
'page' => $page
), $_part, $settings_all, $settings_part, $only_enabledisable)) {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "rebuild configfiles due to changed setting");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
// cron.d file
\Froxlor\System\Cronjob::inserttask('99');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_CRON);
\Froxlor\UI\Response::standard_success('settingssaved', '', array(
'filename' => $filename,
@@ -146,12 +146,12 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "rebuild configfiles");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask('10');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_QUOTA);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
// cron.d file
\Froxlor\System\Cronjob::inserttask('99');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_CRON);
\Froxlor\UI\Response::standard_success('rebuildingconfigs', '', array(
'filename' => 'admin_index.php'

View File

@@ -65,7 +65,7 @@ if ($page == 'overview') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate('update/update_end') . "\";");
\Froxlor\User::updateCounters();
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
@chmod(\Froxlor\Froxlor::getInstallDir() . '/lib/userdata.inc.php', 0440);
$successful_update = true;

View File

@@ -30,7 +30,7 @@
"docs": "https://github.com/Froxlor/Froxlor/wiki"
},
"require": {
"php": ">=7.1",
"php": "^7.1 || ^8.0",
"ext-session": "*",
"ext-ctype": "*",
"ext-pdo": "*",
@@ -52,7 +52,6 @@
},
"require-dev": {
"phpunit/phpunit": "^9",
"php": ">=7.3",
"ext-pcntl": "*",
"phpcompatibility/php-compatibility": "*",
"squizlabs/php_codesniffer": "*",

615
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -378,6 +378,8 @@ if ($action == '2fa_entercode') {
$lastscript = "";
if (isset($_REQUEST['script']) && $_REQUEST['script'] != "") {
$lastscript = $_REQUEST['script'];
$lastscript = str_replace("..", "", $lastscript);
$lastscript = htmlspecialchars($lastscript, ENT_QUOTES);
if (! file_exists(__DIR__ . "/" . $lastscript)) {
$lastscript = "";

View File

@@ -495,7 +495,6 @@ opcache.load_comments
opcache.revalidate_path
opcache.save_comments
opcache.use_cwd
opcache.validate_timestamps
opcache.fast_shutdown'),
('phpfpm', 'ini_admin_values', 'cgi.redirect_status_env
date.timezone
@@ -519,7 +518,8 @@ opcache.restrict_api
opcache.revalidate_freq
opcache.max_accelerated_files
opcache.memory_consumption
opcache.interned_strings_buffer'),
opcache.interned_strings_buffer
opcache.validate_timestamps'),
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
('system', 'lastaccountnumber', '0'),
('system', 'lastguid', '9999'),
@@ -532,7 +532,7 @@ opcache.interned_strings_buffer'),
('system', 'vmail_gid', '2000'),
('system', 'vmail_homedir', '/var/customers/mail/'),
('system', 'vmail_maildirname', 'Maildir'),
('system', 'bind_enable', '1'),
('system', 'bind_enable', '0'),
('system', 'bindconf_directory', '/etc/bind/'),
('system', 'bindreload_command', '/etc/init.d/bind9 reload'),
('system', 'hostname', 'SERVERNAME'),
@@ -682,6 +682,7 @@ opcache.interned_strings_buffer'),
('system', 'createstdsubdom_default', '1'),
('system', 'froxlorusergroup', ''),
('system', 'froxlorusergroup_gid', ''),
('system', 'acmeshpath', '/root/.acme.sh/acme.sh'),
('api', 'enabled', '0'),
('2fa', 'enabled', '1'),
('panel', 'decimal_places', '4'),
@@ -722,8 +723,8 @@ opcache.interned_strings_buffer'),
('panel', 'logo_image_login', ''),
('panel', 'logo_overridetheme', '0'),
('panel', 'logo_overridecustom', '0'),
('panel', 'version', '0.10.29'),
('panel', 'db_version', '202109040');
('panel', 'version', '0.10.33'),
('panel', 'db_version', '202112310');
DROP TABLE IF EXISTS `panel_tasks`;

View File

@@ -791,48 +791,52 @@ class FroxlorInstall
$tables_exist = true;
}
if ($tables_exist && (int)$this->_data['mysql_forcecreate'] > 0) {
// set status
$content .= $this->_status_message('orange', 'exists (' . $this->_data['mysql_database'] . ')');
// tell what's going on
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']);
if ($tables_exist) {
if ((int)$this->_data['mysql_forcecreate'] > 0) {
// set status
$content .= $this->_status_message('orange', 'exists (' . $this->_data['mysql_database'] . ')');
// tell what's going on
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']);
// create temporary backup-filename
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
// create temporary backup-filename
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
// look for mysqldump
$do_backup = false;
if (file_exists("/usr/bin/mysqldump")) {
$do_backup = true;
$mysql_dump = '/usr/bin/mysqldump';
} elseif (file_exists("/usr/local/bin/mysqldump")) {
$do_backup = true;
$mysql_dump = '/usr/local/bin/mysqldump';
}
// look for mysqldump
$do_backup = false;
if (file_exists("/usr/bin/mysqldump")) {
$do_backup = true;
$mysql_dump = '/usr/bin/mysqldump';
} elseif (file_exists("/usr/local/bin/mysqldump")) {
$do_backup = true;
$mysql_dump = '/usr/local/bin/mysqldump';
}
// create temporary .cnf file
$cnffilename = "/tmp/froxlor_dump.cnf";
$dumpcnf = "[mysqldump]".PHP_EOL."password=\"".$this->_data['mysql_root_pass']."\"".PHP_EOL;
file_put_contents($cnffilename, $dumpcnf);
// create temporary .cnf file
$cnffilename = "/tmp/froxlor_dump.cnf";
$dumpcnf = "[mysqldump]" . PHP_EOL . "password=\"" . $this->_data['mysql_root_pass'] . "\"" . PHP_EOL;
file_put_contents($cnffilename, $dumpcnf);
if ($do_backup) {
$command = $mysql_dump . " --defaults-extra-file=" . $cnffilename . " " . escapeshellarg($this->_data['mysql_database']) . " -u " . escapeshellarg($this->_data['mysql_root_user']) . " --result-file=" . $filename;
$output = [];
exec($command, $output);
@unlink($cnffilename);
if (stristr(implode(" ", $output), "error") || !file_exists($filename)) {
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);
$this->_abort = true;
if ($do_backup) {
$command = $mysql_dump . " --defaults-extra-file=" . $cnffilename . " " . escapeshellarg($this->_data['mysql_database']) . " -u " . escapeshellarg($this->_data['mysql_root_user']) . " --result-file=" . $filename;
$output = [];
exec($command, $output);
@unlink($cnffilename);
if (stristr(implode(" ", $output), "error") || ! file_exists($filename)) {
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);
$this->_abort = true;
} else {
$content .= $this->_status_message('green', 'OK (' . $filename . ')');
}
} else {
$content .= $this->_status_message('green', 'OK (' . $filename . ')');
$content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
$this->_abort = true;
}
} else {
$content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
$content .= $this->_status_message('red', $this->_lng['install']['db_exists']);
$this->_abort = true;
}
} else {
$content .= $this->_status_message('red', $this->_lng['install']['db_exists']);
$this->_abort = true;
$content .= $content .= $this->_status_message('green', 'OK');
}
return $content;

View File

@@ -22,8 +22,8 @@ $lng['requirements']['not_true'] = 'no';
$lng['requirements']['notfound'] = 'not found';
$lng['requirements']['notinstalled'] = 'not installed';
$lng['requirements']['activated'] = 'enabled';
$lng['requirements']['phpversion'] = 'PHP version >= 7.0';
$lng['requirements']['newerphpprefered'] = 'Good, but php-7.1 is preferred.';
$lng['requirements']['phpversion'] = 'PHP version >= 7.1';
$lng['requirements']['newerphpprefered'] = 'Good, but php-7.4 is preferred.';
$lng['requirements']['phppdo'] = 'PHP PDO extension and PDO-MySQL driver...';
$lng['requirements']['phpsession'] = 'PHP session-extension...';
$lng['requirements']['phpctype'] = 'PHP ctype-extension...';

View File

@@ -22,7 +22,7 @@ $lng['requirements']['not_true'] = 'non';
$lng['requirements']['notfound'] = 'introuvable';
$lng['requirements']['notinstalled'] = 'non installé';
$lng['requirements']['activated'] = 'activé';
$lng['requirements']['phpversion'] = 'PHP version >= 7.0';
$lng['requirements']['phpversion'] = 'PHP version >= 7.1';
$lng['requirements']['phppdo'] = 'extension PHP PDO et pilote PDO-MySQL ...';
$lng['requirements']['phpxml'] = 'extension PHP XML...';
$lng['requirements']['phpfilter'] = 'extension PHP filter ...';

View File

@@ -22,8 +22,8 @@ $lng['requirements']['not_true'] = 'nein';
$lng['requirements']['notfound'] = 'nicht gefunden';
$lng['requirements']['notinstalled'] = 'nicht installiert';
$lng['requirements']['activated'] = 'ist aktiviert.';
$lng['requirements']['phpversion'] = 'PHP Version >= 7.0';
$lng['requirements']['newerphpprefered'] = 'Passt, aber php-7.1 wird bevorzugt.';
$lng['requirements']['phpversion'] = 'PHP Version >= 7.1';
$lng['requirements']['newerphpprefered'] = 'Passt, aber php-7.4 wird bevorzugt.';
$lng['requirements']['phppdo'] = 'PHP PDO Erweiterung und PDO-MySQL Treiber...';
$lng['requirements']['phpsession'] = 'PHP session-Erweiterung...';
$lng['requirements']['phpctype'] = 'PHP ctype-Erweiterung...';

View File

@@ -0,0 +1,31 @@
#!/usr/bin/php
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2022 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2018-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*/
// Check if we're in the CLI
if (@php_sapi_name() !== 'cli') {
die('This script will only work in the shell.');
}
require dirname(dirname(__DIR__)) . '/vendor/autoload.php';
// give control to command line handler
try {
\Froxlor\Cli\PhpSessioncleanCmd::processParameters($argc, $argv);
} catch (Exception $e) {
\Froxlor\Cli\PhpSessioncleanCmd::printerr($e->getMessage());
}

View File

@@ -843,7 +843,7 @@ if (\Froxlor\Froxlor::isDatabaseVersion('202106270')) {
throw new \Exception("img directory does not exist and cannot be created");
}
if (!is_writable($path)) {
if (!chmod($path, '0775')) {
if (!chmod($path, 0775)) {
throw new \Exception("Cannot write to img directory");
}
}
@@ -938,3 +938,35 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.28')) {
showUpdateStep("Updating from 0.10.28 to 0.10.29", false);
\Froxlor\Froxlor::updateToVersion('0.10.29');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.29')) {
showUpdateStep("Updating from 0.10.29 to 0.10.29.1", false);
\Froxlor\Froxlor::updateToVersion('0.10.29.1');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.29.1')) {
showUpdateStep("Updating from 0.10.29.1 to 0.10.30", false);
\Froxlor\Froxlor::updateToVersion('0.10.30');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.30')) {
showUpdateStep("Updating from 0.10.30 to 0.10.31", false);
\Froxlor\Froxlor::updateToVersion('0.10.31');
}
if (\Froxlor\Froxlor::isDatabaseVersion('202109040')) {
showUpdateStep("Add setting for acme.sh install location", true);
Settings::AddNew("system.acmeshpath", '/root/.acme.sh/acme.sh');
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('202112310');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.31')) {
showUpdateStep("Updating from 0.10.31 to 0.10.32", false);
\Froxlor\Froxlor::updateToVersion('0.10.32');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.32')) {
showUpdateStep("Updating from 0.10.32 to 0.10.33", false);
\Froxlor\Froxlor::updateToVersion('0.10.33');
}

View File

@@ -323,7 +323,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
));
// trigger removing of certificate from acme.sh if let's encrypt
if ($chk['letsencrypt'] == '1') {
\Froxlor\System\Cronjob::inserttask('12', $chk['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_SSL, $chk['domain']);
}
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] removed ssl-certificate for '" . $chk['domain'] . "'");
return $this->response(200, "successful", $result);
@@ -421,7 +421,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
);
Database::pexecute($stmt, $params, true, true);
// insert task to re-generate webserver-configs (#1260)
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
return true;
}
}

View File

@@ -114,7 +114,7 @@ class Cronjobs extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceE
), true, true);
// insert task to re-generate the cron.d-file
\Froxlor\System\Cronjob::inserttask('99');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_CRON);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] cronjob with description '" . $result['module'] . '/' . $result['cronfile'] . "' has been updated by '" . $this->getUserDetail('loginname') . "'");
$result = $this->apiCall('Cronjobs.get', array(
'id' => $id

View File

@@ -108,7 +108,7 @@ class CustomerBackups extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Re
'backup_web' => $backup_web
);
// schedule backup job
\Froxlor\System\Cronjob::inserttask('20', $task_data);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_CUSTOMER_BACKUP, $task_data);
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] added customer-backup job for '" . $customer['loginname'] . "'. Target directory: " . $userpath);
return $this->response(200, "successful", $task_data);

View File

@@ -645,10 +645,10 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
unset($ins_data);
// insert task to create homedir etc.
\Froxlor\System\Cronjob::inserttask('2', $loginname, $guid, $guid, $store_defaultindex);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_HOME, $loginname, $guid, $guid, $store_defaultindex);
// Using filesystem - quota, insert a task which cleans the filesystem - quota
\Froxlor\System\Cronjob::inserttask('10');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_QUOTA);
// Add htpasswd for the stats-pages
$htpasswdPassword = \Froxlor\System\Crypt::makeCryptPassword($password, true);
@@ -674,7 +674,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] automatically added " . $stats_folder . " htpasswd for user '" . $loginname . "'");
Database::pexecute($ins_stmt, $ins_data, true, true);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// add default FTP-User
// also, add froxlor-local user to ftp-group (if exists!) to
@@ -739,7 +739,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
'customerid' => $customerid
), true, true);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] automatically added standardsubdomain for user '" . $loginname . "'");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
}
}
@@ -915,7 +915,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
* @param bool $mysqls_ul
* optional, whether customer should have unlimited mysql-databases, default 0 (false)
* @param bool $createstdsubdomain
* optional, whether to create a standard-subdomain ([loginname].froxlor-hostname.tld), default 0 (false)
* optional, whether to create a standard-subdomain ([loginname].froxlor-hostname.tld), default 1 (if customer has std-subdomain) else 0 (false)
* @param bool $phpenabled
* optional, whether to allow usage of PHP, default 0 (false)
* @param array $allowed_phpconfigs
@@ -979,7 +979,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
$email_pop3 = $this->getParam('email_pop3', true, $result['pop3']);
$ftps = $this->getUlParam('ftps', 'ftps_ul', true, $result['ftps']);
$mysqls = $this->getUlParam('mysqls', 'mysqls_ul', true, $result['mysqls']);
$createstdsubdomain = $this->getBoolParam('createstdsubdomain', true, 0);
$createstdsubdomain = $this->getBoolParam('createstdsubdomain', true, ($result['standardsubdomain'] != 0 ? 1 : 0));
$password = $this->getParam('new_customer_password', true, '');
$phpenabled = $this->getBoolParam('phpenabled', true, $result['phpenabled']);
$allowed_phpconfigs = $this->getParam('allowed_phpconfigs', true, json_decode($result['allowed_phpconfigs'], true));
@@ -1051,7 +1051,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
}
if ($this->isAdmin()) {
if ($createstdsubdomain != '1') {
if ($createstdsubdomain != '1' || $deactivated) {
$createstdsubdomain = '0';
}
@@ -1088,7 +1088,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
'customerid' => $result['customerid']
), true, true);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] automatically added standardsubdomain for user '" . $result['loginname'] . "'");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
}
}
@@ -1102,11 +1102,11 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_ERR, "[API] Unable to delete standard-subdomain: " . $e->getMessage());
}
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] automatically deleted standardsubdomain for user '" . $result['loginname'] . "'");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
}
if ($phpenabled != $result['phpenabled'] || $perlenabled != $result['perlenabled'] || $email != $result['email']) {
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
}
// activate/deactivate customer services
@@ -1192,7 +1192,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
), true, true);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] " . ($deactivated ? 'deactivated' : 'reactivated') . " user '" . $result['loginname'] . "'");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
}
// Disable or enable POP3 Login for customers Mail Accounts
@@ -1304,7 +1304,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
if ($this->isAdmin()) {
// Using filesystem - quota, insert a task which cleans the filesystem - quota
\Froxlor\System\Cronjob::inserttask('10');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_QUOTA);
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` ";
@@ -1512,9 +1512,9 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
'did' => $row['id']
), true, true);
// remove domains DNS from powerDNS if used, #581
\Froxlor\System\Cronjob::inserttask('11', $row['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_PDNS, $row['domain']);
// remove domain from acme.sh / lets encrypt if used
\Froxlor\System\Cronjob::inserttask('12', $row['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_SSL, $row['domain']);
}
// remove customer domains
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid` = :id");
@@ -1643,18 +1643,18 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
}
// rebuild configs
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
if ($delete_userfiles == 1) {
// insert task to remove the customers files from the filesystem
\Froxlor\System\Cronjob::inserttask('6', $result['loginname']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_CUSTOMER_FILES, $result['loginname']);
}
// Using filesystem - quota, insert a task which cleans the filesystem - quota
\Froxlor\System\Cronjob::inserttask('10');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_QUOTA);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted customer '" . $result['loginname'] . "'");
return $this->response(200, "successful", $result);

View File

@@ -123,7 +123,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
Database::pexecute($stmt, $params, true, true);
$id = Database::lastInsertId();
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] added directory-option for '" . $userpath . "'");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$result = $this->apiCall('DirOptions.get', array(
'id' => $id
@@ -248,7 +248,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
}
if (($options_indexes != $result['options_indexes']) || ($error404path != $result['error404path']) || ($error403path != $result['error403path']) || ($error500path != $result['error500path']) || ($options_cgi != $result['options_cgi'])) {
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_HTACCESS . "`
SET `options_indexes` = :options_indexes,
@@ -413,7 +413,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
"id" => $id
), true, true);
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted directory-option for '" . str_replace($customer_data['documentroot'], '/', $result['path']) . "'");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
return $this->response(200, "successful", $result);
}

View File

@@ -106,7 +106,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
Database::pexecute($stmt, $params, true, true);
$id = Database::lastInsertId();
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] added directory-protection for '" . $username . " (" . $path . ")'");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$result = $this->apiCall('DirProtections.get', array(
'id' => $id
@@ -251,7 +251,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET " . $upd_query . " WHERE `id` = :id AND `customerid`= :cid
");
Database::pexecute($upd_stmt, $upd_params, true, true);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
}
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] updated directory-protection '" . $result['username'] . " (" . $result['path'] . ")'");
@@ -385,7 +385,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
));
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] deleted htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
return $this->response(200, "successful", $result);
}
}

View File

@@ -336,7 +336,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$dom_entries[] = $new_entry;
// re-generate bind configs
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
$result = $this->apiCall('DomainZones.get', array(
'id' => $id
@@ -542,7 +542,7 @@ class DomainZones extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
), true, true);
if ($del_stmt->rowCount() > 0) {
// re-generate bind configs
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
return $this->response(200, "successful", true);
}
return $this->response(304, "successful", true);

View File

@@ -239,7 +239,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* optional, whether to create an exclusive web-logfile for this domain, default 0 (false)
* @param int $alias
* optional, domain-id of a domain that the new domain should be an alias of, default 0 (none)
* @param bool $issubof
* @param int $issubof
* optional, domain-id of a domain this domain is a subdomain of (required for webserver-cronjob to generate the correct order), default 0 (none)
* @param string $registration_date
* optional, date of domain registration in form of YYYY-MM-DD, default empty (none)
@@ -427,6 +427,20 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
}
$_documentroot = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . $path_suffix);
$documentroot = \Froxlor\Validate\Validate::validate($documentroot, 'documentroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
// set default path to subdomain or domain name
if (! empty($documentroot)) {
if (substr($documentroot, 0, 1) != '/' && ! preg_match('/^https?\:\/\//', $documentroot)) {
$documentroot = $_documentroot . '/' . $documentroot;
} elseif (substr($documentroot, 0, 1) == '/' && $this->getUserDetail('change_serversettings') != '1') {
\Froxlor\UI\Response::standard_error('pathmustberelative', '', true);
}
} else {
$documentroot = $_documentroot;
}
$registration_date = \Froxlor\Validate\Validate::validate($registration_date, 'registration_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array(
'0000-00-00',
'0',
@@ -454,17 +468,6 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
}
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $specialsettings), 'specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
\Froxlor\Validate\Validate::validate($documentroot, 'documentroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
// set default path to subdomain or domain name
if (! empty($documentroot)) {
if (substr($documentroot, 0, 1) != '/' && ! preg_match('/^https?\:\/\//', $documentroot)) {
$documentroot = $_documentroot . '/' . $documentroot;
}
} else {
$documentroot = $_documentroot;
}
$ssl_protocols = array();
if (! empty($p_ssl_protocols) && is_numeric($p_ssl_protocols)) {
@@ -507,7 +510,6 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$notryfiles = '0';
$writeaccesslog = '1';
$writeerrorlog = '1';
$documentroot = $_documentroot;
$override_tls = '0';
$ssl_protocols = array();
}
@@ -855,9 +857,9 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
\Froxlor\Domain\Domain::triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $this->logger());
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] added domain '" . $domain . "'");
@@ -901,7 +903,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* optional, when setting $speciallogfile to false, this needs to be set to true to confirm the action, default 0 (false)
* @param int $alias
* optional, domain-id of a domain that the new domain should be an alias of, default 0 (none)
* @param bool $issubof
* @param int $issubof
* optional, domain-id of a domain this domain is a subdomain of (required for webserver-cronjob to generate the correct order), default 0 (none)
* @param string $registration_date
* optional, date of domain registration in form of YYYY-MM-DD, default empty (none)
@@ -1187,6 +1189,38 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$serveraliasoption = $p_serveraliasoption;
}
$documentroot = \Froxlor\Validate\Validate::validate($documentroot, 'documentroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
if (! empty($documentroot) && $documentroot != $result['documentroot'] && substr($documentroot, 0, 1) == '/' && substr($documentroot, 0, strlen($customer['documentroot'])) != $customer['documentroot'] && $this->getUserDetail('change_serversettings') != '1') {
\Froxlor\UI\Response::standard_error('pathmustberelative', '', true);
}
// when moving customer and no path is specified, update would normally reuse the current document-root
// which would point to the wrong customer, therefore we will re-create that directory
if (! empty($documentroot) && $customerid > 0 && $customerid != $result['customerid'] && Settings::Get('panel.allow_domain_change_customer') == '1') {
if (Settings::Get('system.documentroot_use_default_value') == 1) {
$_documentroot = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $result['domain']);
} else {
$_documentroot = $customer['documentroot'];
}
// set the customers default docroot
$documentroot = $_documentroot;
}
if ($documentroot == '') {
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
// set default path to subdomain or domain name
if (Settings::Get('system.documentroot_use_default_value') == 1) {
$documentroot = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $result['domain']);
} else {
$documentroot = $customer['documentroot'];
}
}
if (! preg_match('/^https?\:\/\//', $documentroot) && strstr($documentroot, ":") !== false) {
\Froxlor\UI\Response::standard_error('pathmaynotcontaincolon', '', true);
}
if ($this->getUserDetail('change_serversettings') == '1') {
if (Settings::Get('system.bind_enable') == '1') {
@@ -1201,33 +1235,6 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
}
$specialsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $specialsettings), 'specialsettings', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
$documentroot = \Froxlor\Validate\Validate::validate($documentroot, 'documentroot', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
// when moving customer and no path is specified, update would normally reuse the current document-root
// which would point to the wrong customer, therefore we will re-create that directory
if (! empty($documentroot) && $customerid > 0 && $customerid != $result['customerid'] && Settings::Get('panel.allow_domain_change_customer') == '1') {
if (Settings::Get('system.documentroot_use_default_value') == 1) {
$_documentroot = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $result['domain']);
} else {
$_documentroot = $customer['documentroot'];
}
// set the customers default docroot
$documentroot = $_documentroot;
}
if ($documentroot == '') {
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
// set default path to subdomain or domain name
if (Settings::Get('system.documentroot_use_default_value') == 1) {
$documentroot = \Froxlor\FileDir::makeCorrectDir($customer['documentroot'] . '/' . $result['domain']);
} else {
$documentroot = $customer['documentroot'];
}
}
if (! preg_match('/^https?\:\/\//', $documentroot) && strstr($documentroot, ":") !== false) {
\Froxlor\UI\Response::standard_error('pathmaynotcontaincolon', '', true);
}
$ssl_protocols = array();
if (! empty($p_ssl_protocols) && is_numeric($p_ssl_protocols)) {
@@ -1267,7 +1274,6 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$notryfiles = $result['notryfiles'];
$writeaccesslog = $result['writeaccesslog'];
$writeerrorlog = $result['writeerrorlog'];
$documentroot = $result['documentroot'];
$ssl_protocols = $p_ssl_protocols;
$override_tls = $result['override_tls'];
}
@@ -1458,8 +1464,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$wwwserveralias = ($serveraliasoption == '1') ? '1' : '0';
$iswildcarddomain = ($serveraliasoption == '0') ? '1' : '0';
if ($documentroot != $result['documentroot'] || $ssl_redirect != $result['ssl_redirect'] || $wwwserveralias != $result['wwwserveralias'] || $iswildcarddomain != $result['iswildcarddomain'] || $phpenabled != $result['phpenabled'] || $openbasedir != $result['openbasedir'] || $phpsettingid != $result['phpsettingid'] || $mod_fcgid_starter != $result['mod_fcgid_starter'] || $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] || $specialsettings != $result['specialsettings'] || $notryfiles != $result['notryfiles'] || $writeaccesslog != $result['writeaccesslog'] || $writeerrorlog != $result['writeerrorlog'] || $aliasdomain != $result['aliasdomain'] || $issubof != $result['ismainbutsubto'] || $email_only != $result['email_only'] || ($speciallogfile != $result['speciallogfile'] && $speciallogverified == '1') || $letsencrypt != $result['letsencrypt'] || $http2 != $result['http2'] || $hsts_maxage != $result['hsts'] || $hsts_sub != $result['hsts_sub'] || $hsts_preload != $result['hsts_preload'] || $ocsp_stapling != $result['ocsp_stapling']) {
\Froxlor\System\Cronjob::inserttask('1');
if ($documentroot != $result['documentroot'] || $ssl_redirect != $result['ssl_redirect'] || $wwwserveralias != $result['wwwserveralias'] || $iswildcarddomain != $result['iswildcarddomain'] || $phpenabled != $result['phpenabled'] || $openbasedir != $result['openbasedir'] || $phpsettingid != $result['phpsettingid'] || $mod_fcgid_starter != $result['mod_fcgid_starter'] || $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] || $specialsettings != $result['specialsettings'] || $ssl_specialsettings != $result['ssl_specialsettings'] || $notryfiles != $result['notryfiles'] || $writeaccesslog != $result['writeaccesslog'] || $writeerrorlog != $result['writeerrorlog'] || $aliasdomain != $result['aliasdomain'] || $issubof != $result['ismainbutsubto'] || $email_only != $result['email_only'] || ($speciallogfile != $result['speciallogfile'] && $speciallogverified == '1') || $letsencrypt != $result['letsencrypt'] || $http2 != $result['http2'] || $hsts_maxage != $result['hsts'] || $hsts_sub != $result['hsts_sub'] || $hsts_preload != $result['hsts_preload'] || $ocsp_stapling != $result['ocsp_stapling']) {
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
}
if ($speciallogfile != $result['speciallogfile'] && $speciallogverified != '1') {
@@ -1467,11 +1473,11 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
}
if ($isbinddomain != $result['isbinddomain'] || $zonefile != $result['zonefile'] || $dkim != $result['dkim'] || $isemaildomain != $result['isemaildomain']) {
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
}
// check whether nameserver has been disabled, #581
if ($isbinddomain != $result['isbinddomain'] && $isbinddomain == 0) {
\Froxlor\System\Cronjob::inserttask('11', $result['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_PDNS, $result['domain']);
}
if ($isemaildomain == '0' && $result['isemaildomain'] == '1') {
@@ -1500,7 +1506,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
'id' => $id
), true, true);
// remove domain from acme.sh / lets encrypt if used
\Froxlor\System\Cronjob::inserttask('12', $result['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_SSL, $result['domain']);
}
$updatechildren = '';
@@ -1978,16 +1984,16 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
\Froxlor\Domain\Domain::triggerLetsEncryptCSRForAliasDestinationDomain($result['aliasdomain'], $this->logger());
// remove domains DNS from powerDNS if used, #581
\Froxlor\System\Cronjob::inserttask('11', $result['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_PDNS, $result['domain']);
// remove domain from acme.sh / lets encrypt if used
\Froxlor\System\Cronjob::inserttask('12', $result['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_SSL, $result['domain']);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] deleted domain/subdomains (#" . $result['id'] . ")");
\Froxlor\User::updateCounters();
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
return $this->response(200, "successful", $result);
}
throw new \Exception("Not allowed to execute given command.", 403);

View File

@@ -499,7 +499,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
}
if ($delete_userfiles) {
\Froxlor\System\Cronjob::inserttask('7', $customer['loginname'], $result['email_full']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_EMAIL_DATA, $customer['loginname'], $result['email_full']);
}
// decrease usage for customer

View File

@@ -178,9 +178,9 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$custom_config = $this->getParam('custom_config', true, '');
// validation
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate($description, 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT, '', array(), true);
$reload_cmd = \Froxlor\Validate\Validate::validate($reload_cmd, 'reload_cmd', '', '', array(), true);
$config_dir = \Froxlor\Validate\Validate::validate($config_dir, 'config_dir', '', '', array(), true);
$config_dir = \Froxlor\Validate\Validate::validate($config_dir, 'config_dir', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
if (! in_array($pmanager, array(
'static',
'dynamic',
@@ -229,7 +229,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
Database::pexecute($ins_stmt, $ins_data);
$id = Database::lastInsertId();
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] fpm-daemon with description '" . $description . "' has been created by '" . $this->getUserDetail('loginname') . "'");
$result = $this->apiCall('FpmDaemons.get', array(
'id' => $id
@@ -299,9 +299,9 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$custom_config = $this->getParam('custom_config', true, $result['custom_config']);
// validation
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate($description, 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT, '', array(), true);
$reload_cmd = \Froxlor\Validate\Validate::validate($reload_cmd, 'reload_cmd', '', '', array(), true);
$config_dir = \Froxlor\Validate\Validate::validate($config_dir, 'config_dir', '', '', array(), true);
$config_dir = \Froxlor\Validate\Validate::validate($config_dir, 'config_dir', \Froxlor\Validate\Validate::REGEX_DIR, '', array(), true);
if (! in_array($pmanager, array(
'static',
'dynamic',
@@ -351,7 +351,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
);
Database::pexecute($upd_stmt, $upd_data, true, true);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] fpm-daemon with description '" . $description . "' has been updated by '" . $this->getUserDetail('loginname') . "'");
$result = $this->apiCall('FpmDaemons.get', array(
'id' => $id
@@ -400,7 +400,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
'id' => $id
), true, true);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] fpm-daemon setting '" . $result['description'] . "' has been deleted by '" . $this->getUserDetail('loginname') . "'");
return $this->response(200, "successful", $result);
}

View File

@@ -123,12 +123,12 @@ class Froxlor extends \Froxlor\Api\ApiCommand
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "User " . $this->getUserDetail('loginname') . " imported settings");
try {
\Froxlor\SImExporter::import($json_str);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask('10');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_QUOTA);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
// cron.d file
\Froxlor\System\Cronjob::inserttask('99');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_CRON);
return $this->response(200, "successful", true);
} catch (\Exception $e) {
throw new \Exception($e->getMessage(), 406);

View File

@@ -79,7 +79,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
// validation
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
$password = \Froxlor\System\Crypt::validatePassword($password, true);
$description = \Froxlor\Validate\Validate::validate(trim($description), 'description', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate(trim($description), 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT, '', array(), true);
if (Settings::Get('system.allow_customer_shell') == '1') {
$shell = \Froxlor\Validate\Validate::validate(trim($shell), 'shell', '', '', array(), true);
@@ -234,7 +234,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
}
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] added ftp-account '" . $username . " (" . $path . ")'");
\Froxlor\System\Cronjob::inserttask(5);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_FTP);
if ($sendinfomail == 1) {
$replace_arr = array(
@@ -396,7 +396,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
// validation
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate(trim($description), 'description', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate(trim($description), 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT, '', array(), true);
if (Settings::Get('system.allow_customer_shell') == '1') {
$shell = \Froxlor\Validate\Validate::validate(trim($shell), 'shell', '', '', array(), true);
@@ -450,7 +450,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
}
// it's the task for "new ftp" but that will
// create all directories and correct their permissions
\Froxlor\System\Cronjob::inserttask(5);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_FTP);
$stmt = Database::prepare("
UPDATE `" . TABLE_FTP_USERS . "`
@@ -628,11 +628,11 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
// refs #293
if ($delete_userfiles == 1) {
\Froxlor\System\Cronjob::inserttask('8', $customer_data['loginname'], $result['homedir']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_FTP_DATA, $customer_data['loginname'], $result['homedir']);
} else {
if (Settings::Get('system.nssextrausers') == 1) {
// this is used so that the libnss-extrausers cron is fired
\Froxlor\System\Cronjob::inserttask(5);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_FTP);
}
}

View File

@@ -216,7 +216,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
// validation
$name = \Froxlor\Validate\Validate::validate(trim($name), 'name', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $description), 'description', '/^[^\0]*$/');
$description = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $description), 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT);
if (Settings::Get('system.mail_quota_enabled') != '1') {
$value_arr['email_quota'] = - 1;
@@ -361,7 +361,7 @@ class HostingPlans extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
// validation
$name = \Froxlor\Validate\Validate::validate(trim($name), 'name', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $description), 'description', '/^[^\0]*$/');
$description = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $description), 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT);
if (Settings::Get('system.mail_quota_enabled') != '1') {
$value_arr['email_quota'] = - 1;

View File

@@ -298,9 +298,9 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
Database::pexecute($ins_stmt, $ins_data);
$ins_data['id'] = Database::lastInsertId();
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$ip = '[' . $ip . ']';
@@ -511,9 +511,9 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
);
Database::pexecute($upd_stmt, $upd_data);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] changed IP/port from '" . $result['ip'] . ":" . $result['port'] . "' to '" . $ip . ":" . $port . "'");
@@ -584,9 +584,9 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
'id' => $id
), true, true);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted IP/port '" . $result['ip'] . ":" . $result['port'] . "'");
return $this->response(200, "successful", $result);

View File

@@ -1,4 +1,5 @@
<?php
namespace Froxlor\Api\Commands;
use Froxlor\Database\Database;
@@ -46,139 +47,144 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
*/
public function add()
{
// required parameters
$password = $this->getParam('mysql_password');
if (($this->getUserDetail('mysqls_used') < $this->getUserDetail('mysqls') || $this->getUserDetail('mysqls') == '-1') || $this->isAdmin()) {
// required parameters
$password = $this->getParam('mysql_password');
// parameters
$dbserver = $this->getParam('mysql_server', true, 0);
$databasedescription = $this->getParam('description', true, '');
$databasename = $this->getParam('custom_suffix', true, '');
$sendinfomail = $this->getBoolParam('sendinfomail', true, 0);
// get needed customer info to reduce the mysql-usage-counter by one
$customer = $this->getCustomerData('mysqls');
// parameters
$dbserver = $this->getParam('mysql_server', true, 0);
$databasedescription = $this->getParam('description', true, '');
$databasename = $this->getParam('custom_suffix', true, '');
$sendinfomail = $this->getBoolParam('sendinfomail', true, 0);
// get needed customer info to reduce the mysql-usage-counter by one
$customer = $this->getCustomerData('mysqls');
// validation
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
$password = \Froxlor\System\Crypt::validatePassword($password, true);
$databasedescription = \Froxlor\Validate\Validate::validate(trim($databasedescription), 'description', '', '', array(), true);
$databasename = \Froxlor\Validate\Validate::validate(trim($databasename), 'database_name', '', '', array(), true);
// validate whether the dbserver exists
$dbserver = \Froxlor\Validate\Validate::validate($dbserver, html_entity_decode($this->lng['mysql']['mysql_server']), '', '', 0, true);
Database::needRoot(true, $dbserver);
Database::needSqlData();
$sql_root = Database::getSqlData();
Database::needRoot(false);
if (! isset($sql_root) || ! is_array($sql_root)) {
throw new \Exception("Database server with index #" . $dbserver . " is unknown", 404);
}
if ($sendinfomail != 1) {
$sendinfomail = 0;
}
$newdb_params = array(
'loginname' => ($this->isAdmin() ? $customer['loginname'] : $this->getUserDetail('loginname')),
'mysql_lastaccountnumber' => ($this->isAdmin() ? $customer['mysql_lastaccountnumber'] : $this->getUserDetail('mysql_lastaccountnumber'))
);
// create database, user, set permissions, etc.pp.
$dbm = new \Froxlor\Database\DbManager($this->logger());
if(strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME' && !empty($databasename)) {
$username = $dbm->createDatabase($newdb_params['loginname'].'_'.$databasename, $password);
} else {
$username = $dbm->createDatabase($newdb_params['loginname'], $password, $newdb_params['mysql_lastaccountnumber']);
}
// we've checked against the password in dbm->createDatabase
if ($username == false) {
\Froxlor\UI\Response::standard_error('passwordshouldnotbeusername', '', true);
}
// add database info to froxlor
$stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_DATABASES . "`
SET
`customerid` = :customerid,
`databasename` = :databasename,
`description` = :description,
`dbserver` = :dbserver
");
$params = array(
"customerid" => $customer['customerid'],
"databasename" => $username,
"description" => $databasedescription,
"dbserver" => $dbserver
);
Database::pexecute($stmt, $params, true, true);
$databaseid = Database::lastInsertId();
$params['id'] = $databaseid;
// update customer usage
Customers::increaseUsage($customer['customerid'], 'mysqls_used');
Customers::increaseUsage($customer['customerid'], 'mysql_lastaccountnumber');
// send info-mail?
if ($sendinfomail == 1) {
$pma = $this->lng['admin']['notgiven'];
if (Settings::Get('panel.phpmyadmin_url') != '') {
$pma = Settings::Get('panel.phpmyadmin_url');
// validation
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
$password = \Froxlor\System\Crypt::validatePassword($password, true);
$databasedescription = \Froxlor\Validate\Validate::validate(trim($databasedescription), 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT, '', array(), true);
if (!empty($databasename)) {
$databasename = \Froxlor\Validate\Validate::validate(trim($databasename), 'database_name', '/^[A-Za-z0-9][A-Za-z0-9\-_]+$/i', '', array(), true);
}
// validate whether the dbserver exists
$dbserver = \Froxlor\Validate\Validate::validate($dbserver, html_entity_decode($this->lng['mysql']['mysql_server']), '', '', 0, true);
Database::needRoot(true, $dbserver);
Database::needSqlData();
$sql_root = Database::getSqlData();
Database::needRoot(false);
$userinfo = $customer;
if (!isset($sql_root) || !is_array($sql_root)) {
throw new \Exception("Database server with index #" . $dbserver . " is unknown", 404);
}
$replace_arr = array(
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($userinfo),
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($userinfo), // < keep this for compatibility
'NAME' => $userinfo['name'],
'FIRSTNAME' => $userinfo['firstname'],
'COMPANY' => $userinfo['company'],
'CUSTOMER_NO' => $userinfo['customernumber'],
'DB_NAME' => $username,
'DB_PASS' => htmlentities(htmlentities($password)),
'DB_DESC' => $databasedescription,
'DB_SRV' => $sql_root['host'],
'PMA_URI' => $pma
if ($sendinfomail != 1) {
$sendinfomail = 0;
}
$newdb_params = array(
'loginname' => ($this->isAdmin() ? $customer['loginname'] : $this->getUserDetail('loginname')),
'mysql_lastaccountnumber' => ($this->isAdmin() ? $customer['mysql_lastaccountnumber'] : $this->getUserDetail('mysql_lastaccountnumber'))
);
// create database, user, set permissions, etc.pp.
$dbm = new \Froxlor\Database\DbManager($this->logger());
// get template for mail subject
$mail_subject = $this->getMailTemplate($userinfo, 'mails', 'new_database_by_customer_subject', $replace_arr, $this->lng['mails']['new_database_by_customer']['subject']);
// get template for mail body
$mail_body = $this->getMailTemplate($userinfo, 'mails', 'new_database_by_customer_mailbody', $replace_arr, $this->lng['mails']['new_database_by_customer']['mailbody']);
$_mailerror = false;
$mailerr_msg = "";
try {
$this->mailer()->Subject = $mail_subject;
$this->mailer()->AltBody = $mail_body;
$this->mailer()->msgHTML(str_replace("\n", "<br />", $mail_body));
$this->mailer()->addAddress($userinfo['email'], \Froxlor\User::getCorrectUserSalutation($userinfo));
$this->mailer()->send();
} catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (\Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
if (strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME' && !empty($databasename)) {
$username = $dbm->createDatabase($newdb_params['loginname'] . '_' . $databasename, $password);
} else {
$username = $dbm->createDatabase($newdb_params['loginname'], $password, $newdb_params['mysql_lastaccountnumber']);
}
if ($_mailerror) {
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_ERR, "[API] Error sending mail: " . $mailerr_msg);
\Froxlor\UI\Response::standard_error('errorsendingmail', $userinfo['email'], true);
// we've checked against the password in dbm->createDatabase
if ($username == false) {
\Froxlor\UI\Response::standard_error('passwordshouldnotbeusername', '', true);
}
$this->mailer()->clearAddresses();
// add database info to froxlor
$stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_DATABASES . "`
SET
`customerid` = :customerid,
`databasename` = :databasename,
`description` = :description,
`dbserver` = :dbserver
");
$params = array(
"customerid" => $customer['customerid'],
"databasename" => $username,
"description" => $databasedescription,
"dbserver" => $dbserver
);
Database::pexecute($stmt, $params, true, true);
$databaseid = Database::lastInsertId();
$params['id'] = $databaseid;
// update customer usage
Customers::increaseUsage($customer['customerid'], 'mysqls_used');
Customers::increaseUsage($customer['customerid'], 'mysql_lastaccountnumber');
// send info-mail?
if ($sendinfomail == 1) {
$pma = $this->lng['admin']['notgiven'];
if (Settings::Get('panel.phpmyadmin_url') != '') {
$pma = Settings::Get('panel.phpmyadmin_url');
}
Database::needRoot(true, $dbserver);
Database::needSqlData();
$sql_root = Database::getSqlData();
Database::needRoot(false);
$userinfo = $customer;
$replace_arr = array(
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($userinfo),
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($userinfo), // < keep this for compatibility
'NAME' => $userinfo['name'],
'FIRSTNAME' => $userinfo['firstname'],
'COMPANY' => $userinfo['company'],
'CUSTOMER_NO' => $userinfo['customernumber'],
'DB_NAME' => $username,
'DB_PASS' => htmlentities(htmlentities($password)),
'DB_DESC' => $databasedescription,
'DB_SRV' => $sql_root['host'],
'PMA_URI' => $pma
);
// get template for mail subject
$mail_subject = $this->getMailTemplate($userinfo, 'mails', 'new_database_by_customer_subject', $replace_arr, $this->lng['mails']['new_database_by_customer']['subject']);
// get template for mail body
$mail_body = $this->getMailTemplate($userinfo, 'mails', 'new_database_by_customer_mailbody', $replace_arr, $this->lng['mails']['new_database_by_customer']['mailbody']);
$_mailerror = false;
$mailerr_msg = "";
try {
$this->mailer()->Subject = $mail_subject;
$this->mailer()->AltBody = $mail_body;
$this->mailer()->msgHTML(str_replace("\n", "<br />", $mail_body));
$this->mailer()->addAddress($userinfo['email'], \Froxlor\User::getCorrectUserSalutation($userinfo));
$this->mailer()->send();
} catch (\PHPMailer\PHPMailer\Exception $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (\Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
}
if ($_mailerror) {
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_ERR, "[API] Error sending mail: " . $mailerr_msg);
\Froxlor\UI\Response::standard_error('errorsendingmail', $userinfo['email'], true);
}
$this->mailer()->clearAddresses();
}
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] added mysql-database '" . $username . "'");
$result = $this->apiCall('Mysqls.get', array(
'dbname' => $username
));
return $this->response(200, "successful", $result);
}
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] added mysql-database '" . $username . "'");
$result = $this->apiCall('Mysqls.get', array(
'dbname' => $username
));
return $this->response(200, "successful", $result);
throw new \Exception("No more resources available", 406);
}
/**
@@ -200,7 +206,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$id = $this->getParam('id', true, 0);
$dn_optional = ($id <= 0 ? false : true);
$dbname = $this->getParam('dbname', $dn_optional, '');
$dbserver = $this->getParam('mysql_server', true, - 1);
$dbserver = $this->getParam('mysql_server', true, -1);
if ($this->isAdmin()) {
if ($this->getUserDetail('customers_see_all') != 1) {
@@ -300,7 +306,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$id = $this->getParam('id', true, 0);
$dn_optional = ($id <= 0 ? false : true);
$dbname = $this->getParam('dbname', $dn_optional, '');
$dbserver = $this->getParam('mysql_server', true, - 1);
$dbserver = $this->getParam('mysql_server', true, -1);
$customer = $this->getCustomerData();
if ($this->isAdmin() == false && Settings::IsInList('panel.customer_hide_options', 'mysql')) {
@@ -320,7 +326,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
// validation
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
$databasedescription = \Froxlor\Validate\Validate::validate(trim($databasedescription), 'description', '', '', array(), true);
$databasedescription = \Froxlor\Validate\Validate::validate(trim($databasedescription), 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT, '', array(), true);
if ($password != '') {
// validate password
@@ -387,7 +393,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
public function listing()
{
$result = array();
$dbserver = $this->getParam('mysql_server', true, - 1);
$dbserver = $this->getParam('mysql_server', true, -1);
$customer_ids = $this->getAllowedCustomerIds('mysql');
$query_fields = array();
$result_stmt = Database::prepare("
@@ -484,7 +490,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$id = $this->getParam('id', true, 0);
$dn_optional = ($id <= 0 ? false : true);
$dbname = $this->getParam('dbname', $dn_optional, '');
$dbserver = $this->getParam('mysql_server', true, - 1);
$dbserver = $this->getParam('mysql_server', true, -1);
$customer = $this->getCustomerData();
if ($this->isAdmin() == false && Settings::IsInList('panel.customer_hide_options', 'mysql')) {

View File

@@ -217,6 +217,8 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
* optional number of seconds for idle-timeout if FPM is used, default is fpm-daemon-value
* @param string $limit_extensions
* optional limitation of php-file-extensions if FPM is used, default is fpm-daemon-value
* @param bool $allow_all_customers
* optional add this configuration to the list of every existing customer's allowed-fpm-config list, default is false (no)
*
* @access admin
* @throws \Exception
@@ -261,9 +263,10 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$max_requests = $this->getParam('max_requests', true, $def_fpmconfig['max_requests']);
$idle_timeout = $this->getParam('idle_timeout', true, $def_fpmconfig['idle_timeout']);
$limit_extensions = $this->getParam('limit_extensions', true, $def_fpmconfig['limit_extensions']);
$allow_all_customers = $this->getBoolParam('allow_all_customers', true, 0);
// validation
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate($description, 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT, '', array(), true);
$phpsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $phpsettings), 'phpsettings', '/^[^\0]*$/', '', array(), true);
if (Settings::Get('system.mod_fcgid') == 1) {
$binary = \Froxlor\FileDir::makeCorrectFile(\Froxlor\Validate\Validate::validate($binary, 'binary', '', '', array(), true));
@@ -361,12 +364,14 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
Database::pexecute($ins_stmt, $ins_data, true, true);
$ins_data['id'] = Database::lastInsertId();
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] php setting with description '" . $description . "' has been created by '" . $this->getUserDetail('loginname') . "'");
$result = $this->apiCall('PhpSettings.get', array(
'id' => $ins_data['id']
));
$this->addForAllCustomers($allow_all_customers, $ins_data['id']);
return $this->response(200, "successful", $result);
}
throw new \Exception("Not allowed to execute given command.", 403);
@@ -418,6 +423,8 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
* optional number of seconds for idle-timeout if FPM is used, default is fpm-daemon-value
* @param string $limit_extensions
* optional limitation of php-file-extensions if FPM is used, default is fpm-daemon-value
* @param bool $allow_all_customers
* optional add this configuration to the list of every existing customer's allowed-fpm-config list, default is false (no)
*
* @access admin
* @throws \Exception
@@ -456,9 +463,10 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$max_requests = $this->getParam('max_requests', true, $result['max_requests']);
$idle_timeout = $this->getParam('idle_timeout', true, $result['idle_timeout']);
$limit_extensions = $this->getParam('limit_extensions', true, $result['limit_extensions']);
$allow_all_customers = $this->getBoolParam('allow_all_customers', true, 0);
// validation
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
$description = \Froxlor\Validate\Validate::validate($description, 'description', \Froxlor\Validate\Validate::REGEX_DESC_TEXT, '', array(), true);
$phpsettings = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $phpsettings), 'phpsettings', '/^[^\0]*$/', '', array(), true);
if (Settings::Get('system.mod_fcgid') == 1) {
$binary = \Froxlor\FileDir::makeCorrectFile(\Froxlor\Validate\Validate::validate($binary, 'binary', '', '', array(), true));
@@ -557,12 +565,14 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
);
Database::pexecute($upd_stmt, $upd_data, true, true);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] php setting with description '" . $description . "' has been updated by '" . $this->getUserDetail('loginname') . "'");
$result = $this->apiCall('PhpSettings.get', array(
'id' => $id
));
$this->addForAllCustomers($allow_all_customers, $id);
return $this->response(200, "successful", $result);
}
throw new \Exception("Not allowed to execute given command.", 403);
@@ -612,10 +622,44 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
'id' => $id
), true, true);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "[API] php setting '" . $result['description'] . "' has been deleted by '" . $this->getUserDetail('loginname') . "'");
return $this->response(200, "successful", $result);
}
throw new \Exception("Not allowed to execute given command.", 403);
}
/**
* add given php-config id to the list of allowed php-config to all currently existing customers
* if allow_all_customers parameter is true in PhpSettings::add() or PhpSettings::update()
*
* @param bool $allow_all_customers
* @param int $config_id
*/
private function addForAllCustomers(bool $allow_all_customers, int $config_id)
{
// should this config be added to the allowed list of all existing customers?
if ($allow_all_customers) {
$sel_stmt = Database::prepare("SELECT customerid, allowed_phpconfigs FROM `" . TABLE_PANEL_CUSTOMERS . "`");
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET allowed_phpconfigs = :ap WHERE customerid = :cid");
Database::pexecute($sel_stmt);
while ($cust = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
// get existing entries of customer
$ap = json_decode($cust['allowed_phpconfigs'], true);
// initialize array if it's empty
if (empty($ap)) {
$ap = [];
}
// add this config
$ap[] = $config_id;
// check for duplicates and force value-type to be int
$ap = array_map('intval', array_unique($ap));
// update customer-entry
Database::pexecute($upd_stmt, [
'ap' => json_encode($ap),
'cid' => $cust['customerid']
]);
}
}
}
}

View File

@@ -262,6 +262,19 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$phpsid_result['phpsettingid'] = intval($phpsettingid);
}
$allowed_phpconfigs = $customer['allowed_phpconfigs'];
if (! empty($allowed_phpconfigs)) {
$allowed_phpconfigs = json_decode($allowed_phpconfigs, true);
} else {
$allowed_phpconfigs = [];
}
// only with fcgid/fpm enabled will it be possible to select a php-setting
if ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) {
if (! in_array($phpsid_result['phpsettingid'], $allowed_phpconfigs)) {
\Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true);
}
}
// actually insert domain
$stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
@@ -346,9 +359,9 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
\Froxlor\Domain\Domain::addRedirectToDomain($subdomain_id, $redirectcode);
}
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
Customers::increaseUsage($customer['customerid'], 'subdomains_used');
@@ -616,7 +629,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
// We can't enable let's encrypt for wildcard-domains
if ($iswildcarddomain == '1' && $letsencrypt == '1') {
\Froxlor\UI\Response::standard_error('nowildcardwithletsencrypt');
\Froxlor\UI\Response::standard_error('nowildcardwithletsencrypt', '', true);
}
// Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
@@ -638,6 +651,19 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] automatically deleted mail-table entries for '" . $idna_convert->decode($result['domain']) . "'");
}
$allowed_phpconfigs = $customer['allowed_phpconfigs'];
if (! empty($allowed_phpconfigs)) {
$allowed_phpconfigs = json_decode($allowed_phpconfigs, true);
} else {
$allowed_phpconfigs = [];
}
// only with fcgid/fpm enabled will it be possible to select a php-setting
if ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) {
if (! in_array($phpsettingid, $allowed_phpconfigs)) {
\Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true);
}
}
// handle redirect
if ($_doredirect) {
\Froxlor\Domain\Domain::updateRedirectOfDomain($id, $redirectcode);
@@ -707,11 +733,11 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
'id' => $id
), true, true);
// remove domain from acme.sh / lets encrypt if used
\Froxlor\System\Cronjob::inserttask('12', $result['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_SSL, $result['domain']);
}
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_INFO, "[API] edited domain '" . $idna_convert->decode($result['domain']) . "'");
}
@@ -993,13 +1019,13 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
'domainid' => $id
), true, true);
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// Using nameserver, insert a task which rebuilds the server config
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
// remove domains DNS from powerDNS if used, #581
\Froxlor\System\Cronjob::inserttask('11', $result['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_PDNS, $result['domain']);
// remove domain from acme.sh / lets encrypt if used
\Froxlor\System\Cronjob::inserttask('12', $result['domain']);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::DELETE_DOMAIN_SSL, $result['domain']);
// reduce subdomain-usage-counter
Customers::decreaseUsage($customer['customerid'], 'subdomains_used');

View File

@@ -133,7 +133,7 @@ abstract class BulkAction
$new_data = array();
foreach ($this->api_params as $idx => $param) {
if (isset($data_array[$idx]) && ! empty($data_array[$idx])) {
if (isset($data_array[$idx])) {
$new_data[$param] = $data_array[$idx];
}
}

View File

@@ -85,8 +85,8 @@ class ConfigServicesAction extends \Froxlor\Cli\Action
$distributions_select_data = array();
//set default os.
$os_dist = array('ID' => 'buster');
$os_version = array('0' => '10');
$os_dist = array('ID' => 'bullseye');
$os_version = array('0' => '11');
$os_default = $os_dist['ID'];
//read os-release
@@ -341,13 +341,43 @@ class ConfigServicesAction extends \Froxlor\Cli\Action
// try to convert namserver hosts to ip's
$ns_ips = "";
$known_ns_ips = [];
if (Settings::Get('system.nameservers') != '') {
$nameservers = explode(',', Settings::Get('system.nameservers'));
foreach ($nameservers as $nameserver) {
$nameserver = trim($nameserver);
// DNS servers might be multi homed; allow transfer from all ip
// addresses of the DNS server
$nameserver_ips = \Froxlor\PhpHelper::gethostbynamel6($nameserver);
if (is_array($nameserver_ips) && count($nameserver_ips) > 0) {
$ns_ips .= implode(",", $nameserver_ips);
// append dot to hostname
if (substr($nameserver, - 1, 1) != '.') {
$nameserver .= '.';
}
// ignore invalid responses
if (! is_array($nameserver_ips)) {
// act like \Froxlor\PhpHelper::gethostbynamel6() and return unmodified hostname on error
$nameserver_ips = array(
$nameserver
);
} else {
$known_ns_ips = array_merge($known_ns_ips, $nameserver_ips);
}
if (!empty($ns_ips)) {
$ns_ips .= ',';
}
$ns_ips .= implode(",", $nameserver_ips);
}
}
// AXFR server
if (Settings::Get('system.axfrservers') != '') {
$axfrservers = explode(',', Settings::Get('system.axfrservers'));
foreach ($axfrservers as $axfrserver) {
if (!in_array(trim($axfrserver), $known_ns_ips)) {
if (!empty($ns_ips)) {
$ns_ips .= ',';
}
$ns_ips .= trim($axfrserver);
}
}
}
@@ -365,7 +395,6 @@ class ConfigServicesAction extends \Froxlor\Cli\Action
'<SERVERIP>' => Settings::Get('system.ipaddress'),
'<NAMESERVERS>' => Settings::Get('system.nameservers'),
'<NAMESERVERS_IP>' => $ns_ips,
'<AXFRSERVERS>' => Settings::Get('system.axfrservers'),
'<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'),
'<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'),
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),

View File

@@ -0,0 +1,100 @@
<?php
namespace Froxlor\Cli\Action;
use Froxlor\Database\Database;
use Froxlor\Settings;
use Froxlor\Cli\PhpSessioncleanCmd;
class PhpSessioncleanAction extends \Froxlor\Cli\Action
{
public function __construct($args)
{
parent::__construct($args);
}
public function run()
{
$this->validate();
if ((int) Settings::Get('phpfpm.enabled') == 1) {
if (isset($this->_args["max-lifetime"]) && is_numeric($this->_args["max-lifetime"]) && $this->_args["max-lifetime"] > 0) {
$this->cleanSessionfiles((int)$this->_args["max-lifetime"]);
} else {
// use default max-lifetime value
$this->cleanSessionfiles();
}
}
}
/**
* validates the parsed command line parameters
*
* @throws \Exception
*/
private function validate()
{
global $lng;
$this->checkConfigParam(true);
$this->parseConfig();
require FROXLOR_INSTALL_DIR . '/lib/tables.inc.php';
}
private function cleanSessionfiles(int $maxlifetime = 1440)
{
// store paths to clean up
$paths_to_clean = [];
// get all pool-config directories configured
$sel_stmt = Database::prepare("SELECT DISTINCT `config_dir` FROM `" . TABLE_PANEL_FPMDAEMONS . "`");
Database::pexecute($sel_stmt);
while ($fpmd = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
$poolfiles = glob(\Froxlor\FileDir::makeCorrectFile($fpmd['config_dir'] . '/*.conf'));
foreach ($poolfiles as $cf) {
$contents = file_get_contents($cf);
$pattern = preg_quote('session.save_path', '/');
$pattern = "/" . $pattern . ".+?\=(.*)/";
if (preg_match_all($pattern, $contents, $matches)) {
$paths_to_clean[] = \Froxlor\FileDir::makeCorrectDir(trim($matches[1][0]));
}
}
}
// every path is just needed once
$paths_to_clean = array_unique($paths_to_clean);
if (count($paths_to_clean) > 0) {
foreach ($paths_to_clean as $ptc) {
// find all files older then maxlifetime and delete them
\Froxlor\FileDir::safe_exec("find -O3 \"" . $ptc . "\" -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin \"+" . $maxlifetime . "\" -delete");
}
}
}
private function parseConfig()
{
define('FROXLOR_INSTALL_DIR', $this->_args['froxlor-dir']);
if (!class_exists('\\Froxlor\\Database\\Database')) {
throw new \Exception("Could not find froxlor's Database class. Is froxlor really installed to '" . FROXLOR_INSTALL_DIR . "'?");
}
if (!file_exists(FROXLOR_INSTALL_DIR . '/lib/userdata.inc.php')) {
throw new \Exception("Could not find froxlor's userdata.inc.php file. You should use this script only with a fully installed and setup froxlor system.");
}
}
private function checkConfigParam($needed = false)
{
if ($needed) {
if (!isset($this->_args["froxlor-dir"])) {
$this->_args["froxlor-dir"] = \Froxlor\Froxlor::getInstallDir();
} elseif (!is_dir($this->_args["froxlor-dir"])) {
throw new \Exception("Given --froxlor-dir parameter is not a directory");
} elseif (!file_exists($this->_args["froxlor-dir"])) {
throw new \Exception("Given froxlor directory cannot be found ('" . $this->_args["froxlor-dir"] . "')");
} elseif (!is_readable($this->_args["froxlor-dir"])) {
throw new \Exception("Given froxlor directory cannot be read ('" . $this->_args["froxlor-dir"] . "')");
}
}
}
}

View File

@@ -0,0 +1,64 @@
<?php
namespace Froxlor\Cli;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2022 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2018-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*/
class PhpSessioncleanCmd extends CmdLineHandler
{
/**
* list of valid switches
*
* @var array
*/
public static $switches = array(
'h'
);
/**
* list of valid parameters
*
* @var array
*/
public static $params = array(
'froxlor-dir',
'max-lifetime',
'help'
);
public static $action_class = '\\Froxlor\\Cli\\Action\\PhpSessioncleanAction';
public static function printHelp()
{
self::println("");
self::println("Help / command line parameters:");
self::println("");
// commands
self::println("--froxlor-dir\t\tpath to froxlor installation");
self::println("\t\t\tExample: --froxlor-dir=/var/www/froxlor/");
self::println("");
self::println("--max-lifetime\t\tThe number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Defaults to '1440'");
self::println("\t\t\tExample: --max-lifetime=2000");
self::println("");
self::println("--help\t\t\tshow help screen (this)");
self::println("");
// switches
self::println("-h\t\t\tsame as --help");
self::println("");
die(); // end of execution
}
}

View File

@@ -99,30 +99,32 @@ class PowerDNS extends DnsBase
));
$pdns_domain = $pdns_domains_stmt->fetch(\PDO::FETCH_ASSOC);
$del_rec_stmt->execute(array(
'did' => $pdns_domain['id']
));
$del_meta_stmt->execute(array(
'did' => $pdns_domain['id']
));
$del_dom_stmt->execute(array(
'did' => $pdns_domain['id']
));
if ($pdns_domain && ! empty($pdns_domain['id'])) {
$del_rec_stmt->execute(array(
'did' => $pdns_domain['id']
));
$del_meta_stmt->execute(array(
'did' => $pdns_domain['id']
));
$del_dom_stmt->execute(array(
'did' => $pdns_domain['id']
));
}
}
}
private function insertZone($domainname, $serial = 0)
{
$ins_stmt = \Froxlor\Dns\PowerDNS::getDB()->prepare("
$ins_stmt = \Froxlor\Dns\PowerDNS::getDB()->prepare("
INSERT INTO domains set `name` = :domainname, `notified_serial` = :serial, `type` = :type
");
$ins_stmt->execute(array(
'domainname' => $domainname,
'serial' => $serial,
'type' => strtoupper(Settings::Get('system.powerdns_mode'))
));
$lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId();
return $lastid;;
$ins_stmt->execute(array(
'domainname' => $domainname,
'serial' => $serial,
'type' => strtoupper(Settings::Get('system.powerdns_mode'))
));
$lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId();
return $lastid;
}
private function insertRecords($domainid = 0, $records = array(), $origin = "")

View File

@@ -56,7 +56,9 @@ class ApacheFcgi extends Apache
// start block, cut off last pipe and close block
$filesmatch = '(' . str_replace(".", "\.", substr($filesmatch, 0, - 1)) . ')';
$php_options_text .= ' <FilesMatch \.' . $filesmatch . '$>' . "\n";
$php_options_text .= ' SetHandler proxy:unix:' . $domain['fpm_socket'] . '|fcgi://localhost' . "\n";
$php_options_text .= ' <If "-f %{SCRIPT_FILENAME}">' . "\n";
$php_options_text .= ' SetHandler proxy:unix:' . $domain['fpm_socket'] . '|fcgi://localhost' . "\n";
$php_options_text .= ' </If>' . "\n";
$php_options_text .= ' </FilesMatch>' . "\n";
$mypath_dir = new \Froxlor\Http\Directory($domain['documentroot']);

View File

@@ -131,7 +131,8 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
'ssl_key_file' => null,
'ssl_ca_file' => null,
'ssl_csr_file' => null,
'id' => null
'id' => null,
'wwwserveralias' => 0
);
// add to queue
@@ -165,7 +166,8 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
'ssl_key_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_key_file'] : null,
'ssl_ca_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_ca_file'] : null,
'ssl_csr_file' => is_array($renew_froxlor) ? $renew_froxlor['ssl_csr_file'] : null,
'id' => is_array($renew_froxlor) ? $renew_froxlor['id'] : null
'id' => is_array($renew_froxlor) ? $renew_froxlor['id'] : null,
'wwwserveralias' => 0
);
$renew_domains[] = $certrow;
}
@@ -308,7 +310,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
{
if (! empty($domains)) {
$acmesh_cmd = self::$acmesh . " --server " . self::$apiserver . " --issue -d " . implode(" -d ", $domains);
$acmesh_cmd = self::getAcmeSh() . " --server " . self::$apiserver . " --issue -d " . implode(" -d ", $domains);
// challenge path
$acmesh_cmd .= " -w " . Settings::Get('system.letsencryptchallengepath');
if (Settings::Get('system.leecc') > 0) {
@@ -528,7 +530,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
if (Settings::Get('system.leecc') > 0 && ! $forced_noecc) {
$domain .= "_ecc";
}
$env_file = FileDir::makeCorrectFile(dirname(self::$acmesh) . '/acme.sh.env');
$env_file = FileDir::makeCorrectFile(dirname(self::getAcmeSh()) . '/acme.sh.env');
if (file_exists($env_file)) {
$output = [];
$cut = <<<EOC
@@ -539,11 +541,15 @@ EOC;
return FileDir::makeCorrectDir($output[0] . "/" . $domain);
}
}
return FileDir::makeCorrectDir(dirname(self::$acmesh) . "/" . $domain);
return FileDir::makeCorrectDir(dirname(self::getAcmeSh()) . "/" . $domain);
}
public static function getAcmeSh()
{
$from_settings = Settings::Get('system.acmeshpath');
if (file_exists($from_settings)) {
return $from_settings;
}
return self::$acmesh;
}
@@ -597,16 +603,24 @@ EOC;
*/
private static function checkInstall($tries = 0)
{
if (! file_exists(self::$acmesh) && $tries > 0) {
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Download/installation of acme.sh seems to have failed. Re-run cronjob to try again or install manually to '" . self::$acmesh . "'");
echo PHP_EOL . "Download/installation of acme.sh seems to have failed. Re-run cronjob to try again or install manually to '" . self::$acmesh . "'" . PHP_EOL;
if (! file_exists(self::getAcmeSh()) && $tries > 0) {
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_ERR, "Download/installation of acme.sh seems to have failed. Re-run cronjob to try again or install manually to '" . self::getAcmeSh() . "'");
echo PHP_EOL . "Download/installation of acme.sh seems to have failed. Re-run cronjob to try again or install manually to '" . self::getAcmeSh() . "'" . PHP_EOL;
return false;
} else if (! file_exists(self::$acmesh)) {
} else if (! file_exists(self::getAcmeSh())) {
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Could not find acme.sh - installing it to /root/.acme.sh/");
$return = false;
\Froxlor\FileDir::safe_exec("wget -O - https://get.acme.sh | sh", $return, array(
\Froxlor\FileDir::safe_exec("wget -O - https://get.acme.sh | sh -s email=" . Settings::Get('panel.adminmail'), $return, array(
'|'
));
$set_path = self::getAcmeSh();
// after this, regardless of what the user specified, the acme.sh installation will be in /root/.acme.sh
if ($set_path != '/root/.acme.sh/acme.sh') {
Settings::Set('system.acmeshpath', '/root/.acme.sh/acme.sh', true);
// let the user know
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_WARNING, "Acme.sh could not be found in '" . $set_path . "' so froxlor installed it to the default location, which is '/root/.acme.sh/'");
echo PHP_EOL . "Acme.sh could not be found in '" . $set_path . "' so froxlor installed it to the default location, which is '/root/.acme.sh/'" . PHP_EOL;
}
// check whether the installation worked
return self::checkInstall(++ $tries);
}
@@ -618,9 +632,9 @@ EOC;
*/
private static function checkUpgrade()
{
$acmesh_result = \Froxlor\FileDir::safe_exec(self::$acmesh . " --upgrade --auto-upgrade 0");
$acmesh_result = \Froxlor\FileDir::safe_exec(self::getAcmeSh() . " --upgrade --auto-upgrade 0");
// check for activated cron
$acmesh_result2 = \Froxlor\FileDir::safe_exec(self::$acmesh . " --install-cronjob");
$acmesh_result2 = \Froxlor\FileDir::safe_exec(self::getAcmeSh() . " --install-cronjob");
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Checking for LetsEncrypt client upgrades before renewing certificates:\n" . implode("\n", $acmesh_result) . "\n" . implode("\n", $acmesh_result2));
}
}

View File

@@ -24,6 +24,13 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
private static $debugHandler = null;
private static $noncron_params = [
'force',
'debug',
'no-fork',
'run-task'
];
public static function setArguments($argv = null)
{
self::$argv = $argv;
@@ -47,6 +54,7 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
echo "--run-task\t\trun a specific task [1 = re-generate configs, 4 = re-generate dns zones, 10 = re-set quotas, 99 = re-create cron.d-file]\n";
echo "--debug\t\t\toutput debug information about what is going on to STDOUT.\n";
echo "--no-fork\t\tdo not fork to backkground (traffic cron only).\n\n";
exit();
}
/**
@@ -63,13 +71,13 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
if (strtolower($argv[$x]) == '--force') {
// really force re-generating of config-files by
// inserting task 1
\Froxlor\System\Cronjob::inserttask('1');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
// bind (if enabled, \Froxlor\System\Cronjob::inserttask() checks this)
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
// set quotas (if enabled)
\Froxlor\System\Cronjob::inserttask('10');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_QUOTA);
// also regenerate cron.d-file
\Froxlor\System\Cronjob::inserttask('99');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_CRON);
array_push($jobs_to_run, 'tasks');
define('CRON_IS_FORCED', 1);
} elseif (strtolower($argv[$x]) == '--debug') {
@@ -161,7 +169,7 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
$crontype = "";
if (isset(self::$argv) && is_array(self::$argv) && count(self::$argv) > 1) {
for ($x = 1; $x < count(self::$argv); $x ++) {
if (substr(strtolower(self::$argv[$x]), 0, 2) == '--' && strlen(self::$argv[$x]) > 3) {
if (substr(self::$argv[$x], 0, 2) == '--' && strlen(self::$argv[$x]) > 3 && !in_array(substr(strtolower(self::$argv[$x]), 2),self::$noncron_params)) {
$crontype = substr(strtolower(self::$argv[$x]), 2);
$basename .= "-" . $crontype;
break;

View File

@@ -4,6 +4,8 @@ namespace Froxlor\Cron\System;
use Froxlor\Database\Database;
use Froxlor\Settings;
use Froxlor\Cron\TaskId;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
@@ -45,55 +47,55 @@ class TasksCron extends \Froxlor\Cron\FroxlorCron
$row['data'] = json_decode($row['data'], true);
}
if ($row['type'] == '1') {
if ($row['type'] == TaskId::REBUILD_VHOST) {
/**
* TYPE=1 MEANS TO REBUILD APACHE VHOSTS.CONF
*/
self::rebuildWebserverConfigs();
} elseif ($row['type'] == '2') {
} elseif ($row['type'] == TaskId::CREATE_HOME) {
/**
* TYPE=2 MEANS TO CREATE A NEW HOME AND CHOWN
*/
self::createNewHome($row);
} elseif ($row['type'] == '4' && (int) Settings::Get('system.bind_enable') != 0) {
} elseif ($row['type'] == TaskId::REBUILD_DNS && (int) Settings::Get('system.bind_enable') != 0) {
/**
* TYPE=4 MEANS THAT SOMETHING IN THE BIND CONFIG HAS CHANGED.
* REBUILD froxlor_bind.conf IF BIND IS ENABLED
*/
self::rebuildDnsConfigs();
} elseif ($row['type'] == '5') {
} elseif ($row['type'] == TaskId::CREATE_FTP) {
/**
* TYPE=5 MEANS THAT A NEW FTP-ACCOUNT HAS BEEN CREATED, CREATE THE DIRECTORY
*/
self::createNewFtpHome($row);
} elseif ($row['type'] == '6') {
} elseif ($row['type'] == TaskId::DELETE_CUSTOMER_FILES) {
/**
* TYPE=6 MEANS THAT A CUSTOMER HAS BEEN DELETED AND THAT WE HAVE TO REMOVE ITS FILES
*/
self::deleteCustomerData($row);
} elseif ($row['type'] == '7') {
} elseif ($row['type'] == TaskId::DELETE_EMAIL_DATA) {
/**
* TYPE=7 Customer deleted an email account and wants the data to be deleted on the filesystem
*/
self::deleteEmailData($row);
} elseif ($row['type'] == '8') {
} elseif ($row['type'] == TaskId::DELETE_FTP_DATA) {
/**
* TYPE=8 Customer deleted a ftp account and wants the homedir to be deleted on the filesystem
* refs #293
*/
self::deleteFtpData($row);
} elseif ($row['type'] == '10' && (int) Settings::Get('system.diskquota_enabled') != 0) {
} elseif ($row['type'] == TaskId::CREATE_QUOTA && (int) Settings::Get('system.diskquota_enabled') != 0) {
/**
* TYPE=10 Set the filesystem - quota
*/
self::setFilesystemQuota();
} elseif ($row['type'] == '11' && Settings::Get('system.dns_server') == 'PowerDNS') {
} elseif ($row['type'] == TaskId::DELETE_DOMAIN_PDNS && Settings::Get('system.dns_server') == 'PowerDNS') {
/**
* TYPE=11 domain has been deleted, remove from pdns database if used
*/
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_NOTICE, "Removing PowerDNS entries for domain " . $row['data']['domain']);
\Froxlor\Dns\PowerDNS::cleanDomainZone($row['data']['domain']);
} elseif ($row['type'] == '12') {
} elseif ($row['type'] == TaskId::DELETE_DOMAIN_SSL) {
/**
* TYPE=12 domain has been deleted, remove from acme.sh/let's encrypt directory if used
*/

105
lib/Froxlor/Cron/TaskId.php Normal file
View File

@@ -0,0 +1,105 @@
<?php
namespace Froxlor\Cron;
class TaskId {
/**
* TYPE=1 MEANS TO REBUILD APACHE VHOSTS.CONF
*/
const REBUILD_VHOST = 1;
/**
* TYPE=2 MEANS TO CREATE A NEW HOME AND CHOWN
*/
const CREATE_HOME = 2;
/**
* TYPE=4 MEANS THAT SOMETHING IN THE DNS CONFIG HAS CHANGED.
* REBUILD froxlor_bind.conf IF BIND IS ENABLED, UPDATE DKIM KEYS
*/
const REBUILD_DNS = 4;
/**
* TYPE=5 MEANS THAT A NEW FTP-ACCOUNT HAS BEEN CREATED, CREATE THE DIRECTORY
*/
const CREATE_FTP = 5;
/**
* TYPE=6 MEANS THAT A CUSTOMER HAS BEEN DELETED AND THAT WE HAVE TO REMOVE ITS FILES
*/
const DELETE_CUSTOMER_FILES = 6;
/**
* TYPE=7 Customer deleted an email account and wants the data to be deleted on the filesystem
*/
const DELETE_EMAIL_DATA = 7;
/**
* TYPE=8 Customer deleted a ftp account and wants the homedir to be deleted on the filesystem
* refs #293
*/
const DELETE_FTP_DATA = 8;
/**
* TYPE=10 Set the filesystem - quota
*/
const CREATE_QUOTA = 10;
/**
* TYPE=11 domain has been deleted, remove from pdns database if used
*/
const DELETE_DOMAIN_PDNS = 11;
/**
* TYPE=12 domain has been deleted, remove from acme.sh/let's encrypt directory if used
*/
const DELETE_DOMAIN_SSL = 12;
/**
* TYPE=20 COSTUMERBACKUP
*/
const CREATE_CUSTOMER_BACKUP = 20;
/**
* TYPE=99 REGENERATE CRON
*/
const REBUILD_CRON = 99;
/**
* Return if a cron task id is valid
* @param int|string $id cron task id (legacy string support)
* @return boolean
*/
public static function isValid($id) {
static $reflContants;
if (!is_numeric($id)) {
return false;
}
$numericid = (int)$id;
if (!is_array($reflContants)) {
$reflClass = new \ReflectionClass(get_called_class());
$reflContants = $reflClass->getConstants();
}
return in_array($numericid, $reflContants, true);
}
/**
* Get constant name by id
* @param int|string $id cron task id (legacy string support)
* @return string|false constant name or false if not found
*/
public static function convertToConstant($id) {
static $reflContants;
if (!is_numeric($id)) {
return false;
}
$numericid = (int)$id;
if (!is_array($reflContants)) {
$reflClass = new \ReflectionClass(get_called_class());
$reflContants = $reflClass->getConstants();
}
return array_search($numericid, $reflContants, true);
}
}

View File

@@ -75,7 +75,7 @@ class Dns
if (! $isMainButSubTo) {
self::addRequiredEntry('@', 'NS', $required_entries);
}
if ($domain['isemaildomain'] === '1') {
if ($domain['isemaildomain'] == '1') {
self::addRequiredEntry('@', 'MX', $required_entries);
if (Settings::Get('system.dns_createmailentry')) {
foreach (array(

View File

@@ -16,7 +16,7 @@ class FileDir
* @param array $allowedChars
* optional array of allowed characters in path/command
*
* @return string result of exec()
* @return array result of exec()
*/
public static function safe_exec($exec_string, &$return_value = false, $allowedChars = null)
{

View File

@@ -7,10 +7,10 @@ final class Froxlor
{
// Main version variable
const VERSION = '0.10.29';
const VERSION = '0.10.33';
// Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202109040';
const DBVERSION = '202112310';
// Distribution branding-tag (used for Debian etc.)
const BRANDING = '';

View File

@@ -145,13 +145,13 @@ class SImExporter
// Catch image_data and save it
if (isset($index_split[2]) && $index_split[2] === 'image_data' && !empty($_data[$index_split[0].'.'.$index_split[1]])) {
$path = \Froxlor\Froxlor::getInstallDir().'/img/';
if (!is_dir($path) && !mkdir($path, '0775')) {
if (!is_dir($path) && !mkdir($path, 0775)) {
throw new \Exception("img directory does not exist and cannot be created");
}
// Make sure we can write to the upload directory
if (!is_writable($path)) {
if (!chmod($path, '0775')) {
if (!chmod($path, 0775)) {
throw new \Exception("Cannot write to img directory");
}
}

View File

@@ -2,6 +2,7 @@
namespace Froxlor\Settings;
use Froxlor\Database\Database;
use Froxlor\FileDir;
use Froxlor\Settings;
class Store
@@ -174,7 +175,7 @@ class Store
$returnvalue = self::storeSettingField($fieldname, $fielddata, $newfieldvalue);
if ($returnvalue !== false) {
\Froxlor\System\Cronjob::inserttask('4');
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
}
return $returnvalue;
}
@@ -373,17 +374,18 @@ class Store
if (isset($fielddata['settinggroup'], $fielddata['varname']) && is_array($fielddata) && $fielddata['settinggroup'] !== '' && $fielddata['varname'] !== '') {
$save_to = null;
$path = \Froxlor\Froxlor::getInstallDir().'/img/';
$path = \Froxlor\FileDir::makeCorrectDir($path);
// New file?
if (isset($_FILES[$fieldname]) && $_FILES[$fieldname]['tmp_name']) {
// Make sure upload directory exists
if (!is_dir($path) && !mkdir($path, '0775')) {
if (!is_dir($path) && !mkdir($path, 0775)) {
throw new \Exception("img directory does not exist and cannot be created");
}
// Make sure we can write to the upload directory
if (!is_writable($path)) {
if (!chmod($path, '0775')) {
if (!chmod($path, 0775)) {
throw new \Exception("Cannot write to img directory");
}
}

View File

@@ -4,6 +4,8 @@ namespace Froxlor\System;
use Froxlor\Settings;
use Froxlor\Database\Database;
use Froxlor\Cron\TaskId;
class Cronjob
{
@@ -93,29 +95,25 @@ class Cronjob
* @param
* int Type of task
* @param
* string Parameter 1
* @param
* string Parameter 2
* @param
* string Parameter 3
* string Parameter (possible to pass multiple times)
*
* @author Florian Lippert <flo@syscp.org>
* @author Froxlor team <team@froxlor.org>
*/
public static function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '')
public static function inserttask($type, ...$params)
{
// prepare the insert-statement
$ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = :type, `data` = :data
");
if ($type == '1' || $type == '3' || $type == '4' || $type == '5' || $type == '10' || $type == '99') {
if ($type == TaskId::REBUILD_VHOST || $type == TaskId::REBUILD_DNS || $type == TaskId::CREATE_FTP || $type == TaskId::CREATE_QUOTA || $type == TaskId::REBUILD_CRON) {
// 4 = bind -> if bind disabled -> no task
if ($type == '4' && Settings::Get('system.bind_enable') == '0') {
if ($type == TaskId::REBUILD_DNS && Settings::Get('system.bind_enable') == '0') {
return;
}
// 10 = quota -> if quota disabled -> no task
if ($type == '10' && Settings::Get('system.diskquota_enabled') == '0') {
if ($type == TaskId::CREATE_QUOTA && Settings::Get('system.diskquota_enabled') == '0') {
return;
}
@@ -132,64 +130,64 @@ class Cronjob
'type' => $type,
'data' => ''
));
} elseif ($type == '2' && $param1 != '' && $param2 != '' && $param3 != '' && ($param4 == 0 || $param4 == 1)) {
} elseif ($type == TaskId::CREATE_HOME && count($params) == 4 && $params[0] != '' && $params[1] != '' && $params[2] != '' && ($params[3] == 0 || $params[3] == 1)) {
$data = array();
$data['loginname'] = $param1;
$data['uid'] = $param2;
$data['gid'] = $param3;
$data['store_defaultindex'] = $param4;
$data['loginname'] = $params[0];
$data['uid'] = $params[1];
$data['gid'] = $params[2];
$data['store_defaultindex'] = $params[3];
$data = json_encode($data);
Database::pexecute($ins_stmt, array(
'type' => '2',
'type' => TaskId::CREATE_HOME,
'data' => $data
));
} elseif ($type == '6' && $param1 != '') {
} elseif ($type == TaskId::DELETE_CUSTOMER_FILES && isset($params[0]) && $params[0] != '') {
$data = array();
$data['loginname'] = $param1;
$data['loginname'] = $params[0];
$data = json_encode($data);
Database::pexecute($ins_stmt, array(
'type' => '6',
'type' => TaskId::DELETE_CUSTOMER_FILES,
'data' => $data
));
} elseif ($type == '7' && $param1 != '' && $param2 != '') {
} elseif ($type == TaskId::DELETE_EMAIL_DATA && count($params) == 2 && $params[0] != '' && $params[1] != '') {
$data = array();
$data['loginname'] = $param1;
$data['email'] = $param2;
$data['loginname'] = $params[0];
$data['email'] = $params[1];
$data = json_encode($data);
Database::pexecute($ins_stmt, array(
'type' => '7',
'type' => TaskId::DELETE_EMAIL_DATA,
'data' => $data
));
} elseif ($type == '8' && $param1 != '' && $param2 != '') {
} elseif ($type == TaskId::DELETE_FTP_DATA && count($params) == 2 && $params[0] != '' && $params[1] != '') {
$data = array();
$data['loginname'] = $param1;
$data['homedir'] = $param2;
$data['loginname'] = $params[0];
$data['homedir'] = $params[1];
$data = json_encode($data);
Database::pexecute($ins_stmt, array(
'type' => '8',
'type' => TaskId::DELETE_FTP_DATA,
'data' => $data
));
} elseif ($type == '11' && $param1 != '' && Settings::Get('system.bind_enable') == '1' && Settings::Get('system.dns_server') == 'PowerDNS') {
} elseif ($type == TaskId::DELETE_DOMAIN_PDNS && isset($params[0]) && $params[0] != '' && Settings::Get('system.bind_enable') == '1' && Settings::Get('system.dns_server') == 'PowerDNS') {
// -> if bind disabled or dns-server not PowerDNS -> no task
$data = array();
$data['domain'] = $param1;
$data['domain'] = $params[0];
$data = json_encode($data);
Database::pexecute($ins_stmt, array(
'type' => '11',
'type' => TaskId::DELETE_DOMAIN_PDNS,
'data' => $data
));
} elseif ($type == '12' && $param1 != '') {
} elseif ($type == TaskId::DELETE_DOMAIN_SSL && isset($params[0]) && $params[0] != '') {
$data = array();
$data['domain'] = $param1;
$data['domain'] = $params[0];
$data = json_encode($data);
Database::pexecute($ins_stmt, array(
'type' => '12',
'type' => TaskId::DELETE_DOMAIN_SSL,
'data' => $data
));
} elseif ($type == '20' && is_array($param1)) {
$data = json_encode($param1);
} elseif ($type == TaskId::CREATE_CUSTOMER_BACKUP && isset($params[0]) && is_array($params[0])) {
$data = json_encode($params[0]);
Database::pexecute($ins_stmt, array(
'type' => '20',
'type' => TaskId::CREATE_CUSTOMER_BACKUP,
'data' => $data
));
}
@@ -248,57 +246,23 @@ class Cronjob
$row['data'] = json_decode($row['data'], true);
}
// rebuilding webserver-configuration
if ($row['type'] == '1') {
$task_desc = $lng['tasks']['rebuild_webserverconfig'];
} elseif ($row['type'] == '2') {
// adding new user/
$loginname = '';
$task_id = $row['type'];
if (\Froxlor\Cron\TaskId::isValid($task_id)) {
$task_constname = \Froxlor\Cron\TaskId::convertToConstant($task_id);
$task_desc = isset($lng['tasks'][$task_constname]) ? $lng['tasks'][$task_constname] : $task_constname;
if (is_array($row['data'])) {
$loginname = $row['data']['loginname'];
// task includes loginname
if (isset($row['data']['loginname'])) {
$loginname = $row['data']['loginname'];
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
}
// task includes domain data
if (isset($row['data']['domain'])) {
$domain = $row['data']['domain'];
$task_desc = str_replace('%domain%', $domain, $task_desc);
}
}
$task_desc = $lng['tasks']['adding_customer'];
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
} elseif ($row['type'] == '4') {
// rebuilding bind-configuration
$task_desc = $lng['tasks']['rebuild_bindconfig'];
} elseif ($row['type'] == '5') {
// creating ftp-user directory
$task_desc = $lng['tasks']['creating_ftpdir'];
} elseif ($row['type'] == '6') {
// deleting user-files
$loginname = '';
if (is_array($row['data'])) {
$loginname = $row['data']['loginname'];
}
$task_desc = $lng['tasks']['deleting_customerfiles'];
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
} elseif ($row['type'] == '7') {
// deleting email-account
$task_desc = $lng['tasks']['remove_emailacc_files'];
} elseif ($row['type'] == '8') {
// deleting ftp-account
$task_desc = $lng['tasks']['remove_ftpacc_files'];
} elseif ($row['type'] == '10') {
// Set FS - quota
$task_desc = $lng['tasks']['diskspace_set_quota'];
} elseif ($row['type'] == '11') {
// remove domain from pdns database if used
$task_desc = sprintf($lng['tasks']['remove_pdns_domain'], $row['data']['domain']);
} elseif ($row['type'] == '12') {
// remove domains ssl files
$task_desc = sprintf($lng['tasks']['remove_ssl_domain'], $row['data']['domain']);
} elseif ($row['type'] == '20') {
// deleting user-files
$loginname = '';
if (is_array($row['data'])) {
$loginname = $row['data']['loginname'];
}
$task_desc = $lng['tasks']['backup_customerfiles'];
$task_desc = str_replace('%loginname%', $loginname, $task_desc);
} elseif ($row['type'] == '99') {
// re-generating of cron.d-file
$task_desc = $lng['tasks']['regenerating_crond'];
} else {
// unknown
$task_desc = "ERROR: Unknown task type '" . $row['type'] . "'";

View File

@@ -269,7 +269,7 @@ class HTML
}
$text = strtr($text, array(
'%s' => $targetname
'%s' => htmlspecialchars($targetname)
));
eval("echo \"" . Template::getTemplate('misc/question_yesno', '1') . "\";");
exit();
@@ -302,7 +302,7 @@ class HTML
}
$text = strtr($text, array(
'%s' => $targetname
'%s' => htmlspecialchars($targetname)
));
eval("echo \"" . Template::getTemplate('misc/question_yesno_checkbox', '1') . "\";");
exit();

View File

@@ -10,6 +10,8 @@ class Validate
const REGEX_CONF_TEXT = '/^[^\0]*$/';
const REGEX_DESC_TEXT = '/^[^\0\r\n<>]*$/';
/**
* Validates the given string by matching against the pattern, prints an error on failure and exits
*

View File

@@ -382,13 +382,12 @@ exit "$RETVAL"
</daemon>
<daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -907,7 +906,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -927,13 +926,12 @@ gmysql-password=
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1453,7 +1451,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# Bind backend configuration
@@ -3879,6 +3877,15 @@ plugin {
# (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0
}
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
@@ -4538,12 +4545,6 @@ UPLOADGID=
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -4671,6 +4672,12 @@ aliases: files
dirty work -->
<command><![CDATA[php {{const.install_dir}}scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -75,7 +75,7 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}
]]>
</content>
</file>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
<command><![CDATA[service apache2 restart]]></command>
</daemon>
<!-- HTTP Lighttpd -->
<daemon name="lighttpd" title="LigHTTPd">
@@ -139,7 +139,7 @@ include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
</command>
<command><![CDATA[lighty-disable-mod cgi]]></command>
<command><![CDATA[lighty-disable-mod fastcgi]]></command>
<command><![CDATA[/etc/init.d/lighttpd restart]]></command>
<command><![CDATA[service lighttpd restart]]></command>
</daemon>
<!-- HTTP Nginx -->
<daemon name="nginx" title="nginx">
@@ -355,7 +355,7 @@ exit "$RETVAL"
</visibility>
<content><![CDATA[/etc/init.d/php-fcgi restart]]></content>
</command>
<command><![CDATA[/etc/init.d/nginx restart]]></command>
<command><![CDATA[service nginx restart]]></command>
</daemon>
</service>
<!--DNS -->
@@ -367,17 +367,16 @@ exit "$RETVAL"
<command><![CDATA[touch {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
<command><![CDATA[chown bind:0 {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
<command><![CDATA[chmod 0644 {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
<command><![CDATA[/etc/init.d/bind9 restart]]></command>
<command><![CDATA[service bind9 restart]]></command>
</daemon>
<daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -881,7 +880,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -896,18 +895,17 @@ gmysql-password=
]]>
</content>
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
<command><![CDATA[service pdns restart]]></command>
</daemon>
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1412,7 +1410,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# Bind backend configuration
@@ -1428,7 +1426,7 @@ bind-check-interval=180
]]>
</content>
</file>
<command><![CDATA[/etc/init.d/pdns restart]]></command>
<command><![CDATA[service pdns restart]]></command>
</daemon>
</service>
<!-- SMTP services -->
@@ -1551,7 +1549,7 @@ root: root@<SERVERNAME>
</files>
<commands index="3">
<command><![CDATA[newaliases]]></command>
<command><![CDATA[/etc/init.d/postfix restart]]></command>
<command><![CDATA[service postfix restart]]></command>
</commands>
</general>
<!-- postfix with dovecot -->
@@ -4086,12 +4084,21 @@ plugin {
# the source line numbers.
#sieve_trace_addresses = no
}
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
</files>
<commands index="1">
<command><![CDATA[/etc/init.d/dovecot restart]]></command>
<command><![CDATA[service dovecot restart]]></command>
</commands>
</general>
<!-- Dovecot with postfix -->
@@ -4518,7 +4525,7 @@ TLSVerifyClient off
]]>
</content>
</file>
<command><![CDATA[/etc/init.d/proftpd restart]]></command>
<command><![CDATA[service proftpd restart]]></command>
</daemon>
<!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd">
@@ -4744,17 +4751,11 @@ UPLOADGID=
]]>
</content>
</file>
<command><![CDATA[/etc/init.d/pure-ftpd-mysql restart]]></command>
<command><![CDATA[service pure-ftpd-mysql restart]]></command>
</daemon>
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -4838,7 +4839,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[a2dismod php7.3]]></command>
<command><![CDATA[a2dismod php7.4]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
@@ -4871,17 +4872,23 @@ aliases: files
</visibility>
<visibility mode="true">{{settings.phpfpm.enabled_ownvhost}}
</visibility>
<command><![CDATA[a2dismod php7.3]]></command>
<command><![CDATA[a2dismod php7.4]]></command>
</commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
<command><![CDATA[service apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.install_dir}}scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -371,13 +371,12 @@ exit "$RETVAL"
</daemon>
<daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -881,7 +880,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -901,13 +900,12 @@ gmysql-password=
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1412,7 +1410,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# Bind backend configuration
@@ -4081,6 +4079,15 @@ plugin {
# the source line numbers.
#sieve_trace_addresses = no
}
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
@@ -4740,12 +4747,6 @@ UPLOADGID=
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -4873,6 +4874,12 @@ aliases: files
dirty work -->
<command><![CDATA[php {{const.install_dir}}scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -1712,6 +1712,15 @@ plugin {
# (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0
}
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
@@ -2332,12 +2341,6 @@ ControlsLog /var/log/proftpd/controls.log
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -2475,6 +2478,12 @@ aliases: files nisplus
</content>
</file>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -1713,6 +1713,15 @@ plugin {
# (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0
}
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
@@ -2334,12 +2343,6 @@ ControlsLog /var/log/proftpd/controls.log
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -2478,6 +2481,12 @@ aliases: files nisplus
</content>
</file>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -369,13 +369,12 @@ exit "$RETVAL"
</daemon>
<daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -894,7 +893,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -914,13 +913,12 @@ gmysql-password=
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1440,7 +1438,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# Bind backend configuration
@@ -3295,6 +3293,15 @@ plugin {
# (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0
}
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
@@ -3954,12 +3961,6 @@ UPLOADGID=
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -4095,6 +4096,12 @@ aliases: files
dirty work -->
<command><![CDATA[php {{const.install_dir}}scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -391,14 +391,13 @@ mail IN A <SERVERIP>
</daemon>
<daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[emerge net-dns/pdns]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
# Autogenerated configuration file template
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -902,7 +901,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -922,14 +921,13 @@ gmysql-password=
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[emerge net-dns/pdns]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
# Autogenerated configuration file template
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1433,7 +1431,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
#local-ipv6=YOUR_IPv6_(if_any)
bind-config=<BIND_CONFIG_PATH>named.conf
@@ -2347,6 +2345,15 @@ plugin {
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
<command><![CDATA[rc-update add dovecot default]]></command>
<command><![CDATA[/etc/init.d/dovecot restart]]></command>
</daemon>
@@ -3656,12 +3663,6 @@ account required pam_mysql.so user=<SQL_UNPRIVILEGED_USER> passwd=<SQL_UN
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -3868,6 +3869,12 @@ aliases: files
dirty work -->
<command><![CDATA[php {{const.install_dir}}scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -371,13 +371,12 @@ exit "$RETVAL"
</daemon>
<daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -896,7 +895,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -916,13 +915,12 @@ gmysql-password=
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1442,7 +1440,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# Bind backend configuration
@@ -3868,6 +3866,15 @@ plugin {
# (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0
}
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
@@ -4527,12 +4534,6 @@ UPLOADGID=
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -4660,6 +4661,12 @@ aliases: files
dirty work -->
<command><![CDATA[php {{const.install_dir}}scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -382,13 +382,12 @@ exit "$RETVAL"
</daemon>
<daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -907,7 +906,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql
@@ -927,13 +926,12 @@ gmysql-password=
<daemon name="powerdns_bind"
title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install>
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
<file name="/etc/powerdns/pdns.conf" backup="true" chown="root:pdns" chmod="640">
<content><![CDATA[
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
# add these entries to the list if any specified: <AXFRSERVERS>
#################################
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1453,7 +1451,7 @@ include-dir=/etc/powerdns/froxlor/
</file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600">
chown="root:pdns" chmod="640">
<content><![CDATA[
# Bind backend configuration
@@ -3879,6 +3877,15 @@ plugin {
# (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0
}
]]>
</content>
</file>
<file name="/etc/dovecot/conf.d/90-quota.conf" chown="root:0"
chmod="0644" backup="true">
<content><![CDATA[
plugin {
quota = maildir:User quota
}
]]>
</content>
</file>
@@ -4538,12 +4545,6 @@ UPLOADGID=
</service>
<!-- System tools/services -->
<service type="system" title="{{lng.admin.configfiles.etc}}">
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
<!-- AWstats -->
<daemon name="awstats"
title="Awstats (webalizer alternative)">
@@ -4671,6 +4672,12 @@ aliases: files
dirty work -->
<command><![CDATA[php {{const.install_dir}}scripts/froxlor_master_cronjob.php --force]]></command>
</daemon>
<!-- Cronjob -->
<daemon name="cron" title="Cronjob for froxlor"
mandatory="true">
<command><![CDATA[/usr/bin/php <BASE_PATH>scripts/froxlor_master_cronjob.php --run-task 99]]></command>
<command><![CDATA[{{settings.system.crondreload}}]]></command>
</daemon>
</service>
</services>
</distribution>

View File

@@ -179,6 +179,18 @@ return array(
'cols' => 80,
'rows' => 20,
'value' => $result['phpsettings']
),
'allow_all_customers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)
)
)

View File

@@ -187,6 +187,18 @@ return array(
'cols' => 80,
'rows' => 20,
'value' => $result['phpsettings']
),
'allow_all_customers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['allow_all_customers']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)
)
)

View File

@@ -44,7 +44,8 @@ return array(
'show_element' => (\Froxlor\Settings::Get('api.enabled') == true)
),
array(
'url' => 'https://api.froxlor.org/doc/?v='.\Froxlor\Froxlor::getVersion(),
'url' => 'https://docs.froxlor.org/apiguide/index.html',
'new_window' => true,
'label' => $lng['menue']['main']['apihelp'],
'show_element' => (\Froxlor\Settings::Get('api.enabled') == true)
),
@@ -195,7 +196,8 @@ return array(
'show_element' => (\Froxlor\Settings::Get('api.enabled') == true)
),
array(
'url' => 'https://api.froxlor.org/doc/?v='.\Froxlor\Froxlor::getVersion(),
'url' => 'https://docs.froxlor.org/apiguide/index.html',
'new_window' => true,
'label' => $lng['menue']['main']['apihelp'],
'show_element' => (\Froxlor\Settings::Get('api.enabled') == true)
),

View File

@@ -954,11 +954,11 @@ $lng['update']['noupdatesavail'] = '<strong>You already have the latest Froxlor
$lng['admin']['specialsettingsforsubdomains'] = 'Apply specialsettings to all subdomains (*.example.com)';
$lng['serversettings']['specialsettingsforsubdomains']['description'] = 'If yes these custom vHost-settings will be added to all subdomains; if no subdomain-specialsettings are being removed.';
$lng['tasks']['outstanding_tasks'] = 'Outstanding cron-tasks';
$lng['tasks']['rebuild_webserverconfig'] = 'Rebuilding webserver-configuration';
$lng['tasks']['adding_customer'] = 'Adding new customer %loginname%';
$lng['tasks']['rebuild_bindconfig'] = 'Rebuilding bind-configuration';
$lng['tasks']['creating_ftpdir'] = 'Creating directory for new ftp-user';
$lng['tasks']['deleting_customerfiles'] = 'Deleting customer-files %loginname%';
$lng['tasks']['REBUILD_VHOST'] = 'Rebuilding webserver-configuration';
$lng['tasks']['CREATE_HOME'] = 'Adding new customer %loginname%';
$lng['tasks']['REBUILD_DNS'] = 'Rebuilding bind-configuration';
$lng['tasks']['CREATE_FTP'] = 'Creating directory for new ftp-user';
$lng['tasks']['DELETE_CUSTOMER_FILES'] = 'Deleting customer-files %loginname%';
$lng['tasks']['noneoutstanding'] = 'There are currently no outstanding tasks for Froxlor';
// ADDED IN FROXLOR 0.9.1
@@ -1524,7 +1524,7 @@ $lng['serversettings']['diskquota_enabled'] = 'Kvóta aktivována?';
$lng['serversettings']['diskquota_repquota_path']['description'] = 'Path to repquota';
$lng['serversettings']['diskquota_quotatool_path']['description'] = 'Path to quotatool';
$lng['serversettings']['diskquota_customer_partition']['description'] = 'Partition, on which the customer files are stored';
$lng['tasks']['diskspace_set_quota'] = 'Set quota on filesystem';
$lng['tasks']['CREATE_QUOTA'] = 'Set quota on filesystem';
$lng['error']['session_timeout'] = 'Moc nízká hodnota';
$lng['error']['session_timeout_desc'] = 'You should not set the session timeout lower than 1 minute.';
@@ -1554,7 +1554,7 @@ $lng['admin']['speciallogwarning'] = 'WARNING: By changing this setting you will
// ADDED IN 0.9.28-svn2
$lng['serversettings']['vmail_maildirname']['title'] = 'Maildir name';
$lng['serversettings']['vmail_maildirname']['description'] = 'Maildir directory into user\'s account. Normally \'Maildir\', in some implementations \'.maildir\', and directly into user\'s directory if left blank.';
$lng['tasks']['remove_emailacc_files'] = 'Delete customer e-mail data.';
$lng['tasks']['DELETE_EMAIL_DATA'] = 'Delete customer e-mail data.';
// ADDED IN 0.9.28-svn5
$lng['error']['operationnotpermitted'] = 'Operace nepovolena!';
@@ -1683,8 +1683,8 @@ $lng['panel']['ftpdesc'] = 'FTP description';
$lng['admin']['cronsettings'] = 'Cronjob settings';
$lng['serversettings']['system_cronconfig']['title'] = 'Cron configuration file';
$lng['serversettings']['system_cronconfig']['description'] = 'Path to the cron-service configuration-file. This file will be updated regularly and automatically by froxlor.<br />Note: Please <b>be sure</b> to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)!<br><br>If you are using <b>FreeBSD</b>, please specify <i>/etc/crontab</i> here!';
$lng['tasks']['remove_ftpacc_files'] = 'Delete customer ftp-account data.';
$lng['tasks']['regenerating_crond'] = 'Rebuilding the cron.d-file';
$lng['tasks']['DELETE_FTP_DATA'] = 'Delete customer ftp-account data.';
$lng['tasks']['REBUILD_CRON'] = 'Rebuilding the cron.d-file';
$lng['serversettings']['system_crondreload']['title'] = 'Cron-daemon reload command';
$lng['serversettings']['system_crondreload']['description'] = 'Specify the command to execute in order to reload your systems cron-daemon';
$lng['admin']['integritycheck'] = 'Ověření databáze';
@@ -1889,7 +1889,7 @@ $lng['serversettings']['backupenabled']['title'] = "Povolit zálohy pro zákazn
$lng['serversettings']['backupenabled']['description'] = "If activated, the customer will be able to schedule backup jobs (cron-backup) which generates an archive within his docroot (subdirectory chosable by customer)";
$lng['extras']['path_protection_label'] = '<strong class="red">Important</strong>';
$lng['extras']['path_protection_info'] = '<strong class="red">We strongly recommend protecting the given path, see "Extras" -> "Directory protection"</strong>';
$lng['tasks']['backup_customerfiles'] = 'Backup job for customer %loginname%';
$lng['tasks']['CREATE_CUSTOMER_BACKUP'] = 'Backup job for customer %loginname%';
$lng['error']['dns_domain_nodns'] = 'DNS pro tuto doménu je vypnuto';
$lng['error']['dns_content_empty'] = 'No content given';
@@ -2032,7 +2032,7 @@ $lng['apikeys']['allowed_from_help'] = 'Comma separated list of ip addresses. De
$lng['apikeys']['valid_until'] = 'Platné do';
$lng['apikeys']['valid_until_help'] = 'Date until valid, format YYYY-MM-DD';
$lng['serversettings']['enable_api']['title'] = 'Enable external API usage';
$lng['serversettings']['enable_api']['description'] = 'In order to use the froxlor API you need to activate this option. For more detailed information see <a href="https://api.froxlor.org/" target="_new">https://api.froxlor.org/</a>';
$lng['serversettings']['enable_api']['description'] = 'In order to use the froxlor API you need to activate this option. For more detailed information see <a href="https://docs.froxlor.org/apiguide/index.html" target="_new">https://docs.froxlor.org/</a>';
$lng['serversettings']['dhparams_file']['title'] = 'DHParams file (DiffieHellman key exchange)';
$lng['serversettings']['dhparams_file']['description'] = 'If a dhparams.pem file is specified here it will be included in the webserver configuration. Leave empty to disable.<br>Example: /etc/apache2/ssl/dhparams.pem<br><br>If the file does not exist, it will be created automatically with the following command: <em>openssl dhparam -out /etc/apache2/ssl/dhparams.pem 4096<em>. It is recommended to create the file prior to specifying it here as the creation takes quite a while and blocks the cronjob.';
$lng['2fa']['2fa'] = '2FA možnosti';
@@ -2057,8 +2057,8 @@ $lng['panel']['ihave_configured'] = 'I have configured the services';
$lng['panel']['system_is_configured'] = 'System is already set as configured';
$lng['panel']['settings_before_configuration'] = 'Please be sure you adjusted the settings prior to configuring the services here';
$lng['panel']['alternative_cmdline_config'] = 'Alternatively, just run the following command as root-user in your shell to configure the services automatically';
$lng['tasks']['remove_pdns_domain'] = 'Delete domain %s from PowerDNS database';
$lng['tasks']['remove_ssl_domain'] = 'Delete ssl files of domain %s';
$lng['tasks']['DELETE_DOMAIN_PDNS'] = 'Delete domain %domain% from PowerDNS database';
$lng['tasks']['DELETE_DOMAIN_SSL'] = 'Delete ssl files of domain %domain%';
$lng['admin']['novhostcontainer'] = '<br><br><small class="red">None of the IPs and ports has the "' . $lng['admin']['ipsandports']['create_vhostcontainer'] . '" option enabled, many settings here will not be available</small>';
$lng['serversettings']['errorlog_level']['title'] = 'Error log-level';
$lng['serversettings']['errorlog_level']['description'] = 'Specify the error log level. Default is "warn" for apache-users and "error" for nginx-users.';

View File

@@ -862,11 +862,11 @@ $lng['update']['noupdatesavail'] = '<strong>U gebruikt reeds de meest recente ve
$lng['admin']['specialsettingsforsubdomains'] = 'Speciale instellingen toepassen op alle subdomeinen (*.example.com)';
$lng['serversettings']['specialsettingsforsubdomains']['description'] = 'Indien "Ja" zullen deze aangepaste VHost-instellingen worden toegepast op alle subdomeinen.';
$lng['tasks']['outstanding_tasks'] = 'Uitstaande cron-taken';
$lng['tasks']['rebuild_webserverconfig'] = 'Bezig met opnieuw opbouwen van de configuratie van de webserver';
$lng['tasks']['adding_customer'] = 'Klant met naam %loginname% wordt toegevoegd';
$lng['tasks']['rebuild_bindconfig'] = 'Opnieuw opbouwen bind-configuratie';
$lng['tasks']['creating_ftpdir'] = 'Map aanmaken voor nieuwe FTP-gebruiker';
$lng['tasks']['deleting_customerfiles'] = 'Verwijderen klantbestanden van %loginname%';
$lng['tasks']['REBUILD_VHOST'] = 'Bezig met opnieuw opbouwen van de configuratie van de webserver';
$lng['tasks']['CREATE_HOME'] = 'Klant met naam %loginname% wordt toegevoegd';
$lng['tasks']['REBUILD_DNS'] = 'Opnieuw opbouwen bind-configuratie';
$lng['tasks']['CREATE_FTP'] = 'Map aanmaken voor nieuwe FTP-gebruiker';
$lng['tasks']['DELETE_CUSTOMER_FILES'] = 'Verwijderen klantbestanden van %loginname%';
$lng['tasks']['noneoutstanding'] = 'Er zijn op dit moment geen uitstaande taken voor Froxlor';
// ADDED IN FROXLOR 0.9.1

View File

@@ -851,7 +851,7 @@ $lng['admin']['phpconfig']['pear_dir'] = 'Will be replaced with the global setti
$lng['admin']['phpconfig']['open_basedir_c'] = 'Will insert a ; (semicolon) to comment-out/disable open_basedir when set';
$lng['admin']['phpconfig']['open_basedir'] = 'Will be replaced with the open_basedir setting of the domain.';
$lng['admin']['phpconfig']['tmp_dir'] = 'Will be replaced with the temporary directory of the domain.';
$lng['admin']['phpconfig']['open_basedir_global'] = 'Will be replaced with the global value of the path which will be attached to the open_basedir.';
$lng['admin']['phpconfig']['open_basedir_global'] = 'Will be replaced with the global value of the path which will be attached to the open_basedir (see webserver settings).';
$lng['admin']['phpconfig']['customer_email'] = 'Will be replaced with the e-mail address of the customer who owns this domain.';
$lng['admin']['phpconfig']['admin_email'] = 'Will be replaced with e-mail address of the admin who owns this domain.';
$lng['admin']['phpconfig']['domain'] = 'Will be replaced with the domain.';
@@ -957,11 +957,11 @@ $lng['update']['noupdatesavail'] = '<strong>You already have the latest Froxlor
$lng['admin']['specialsettingsforsubdomains'] = 'Apply specialsettings to all subdomains (*.example.com)';
$lng['serversettings']['specialsettingsforsubdomains']['description'] = 'If yes these custom vHost-settings will be added to all subdomains; if no subdomain-specialsettings are being removed.';
$lng['tasks']['outstanding_tasks'] = 'Outstanding cron-tasks';
$lng['tasks']['rebuild_webserverconfig'] = 'Rebuilding webserver-configuration';
$lng['tasks']['adding_customer'] = 'Adding new customer %loginname%';
$lng['tasks']['rebuild_bindconfig'] = 'Rebuilding bind-configuration';
$lng['tasks']['creating_ftpdir'] = 'Creating directory for new ftp-user';
$lng['tasks']['deleting_customerfiles'] = 'Deleting customer-files %loginname%';
$lng['tasks']['REBUILD_VHOST'] = 'Rebuilding webserver-configuration';
$lng['tasks']['CREATE_HOME'] = 'Adding new customer %loginname%';
$lng['tasks']['REBUILD_DNS'] = 'Rebuilding bind-configuration';
$lng['tasks']['CREATE_FTP'] = 'Creating directory for new ftp-user';
$lng['tasks']['DELETE_CUSTOMER_FILES'] = 'Deleting customer-files %loginname%';
$lng['tasks']['noneoutstanding'] = 'There are currently no outstanding tasks for Froxlor';
// ADDED IN FROXLOR 0.9.1
@@ -1527,7 +1527,7 @@ $lng['serversettings']['diskquota_enabled'] = 'Quota activated?';
$lng['serversettings']['diskquota_repquota_path']['description'] = 'Path to repquota';
$lng['serversettings']['diskquota_quotatool_path']['description'] = 'Path to quotatool';
$lng['serversettings']['diskquota_customer_partition']['description'] = 'Partition, on which the customer files are stored';
$lng['tasks']['diskspace_set_quota'] = 'Set quota on filesystem';
$lng['tasks']['CREATE_QUOTA'] = 'Set quota on filesystem';
$lng['error']['session_timeout'] = 'Value too low';
$lng['error']['session_timeout_desc'] = 'You should not set the session timeout lower than 1 minute.';
@@ -1557,7 +1557,7 @@ $lng['admin']['speciallogwarning'] = 'WARNING: By changing this setting you will
// ADDED IN 0.9.28-svn2
$lng['serversettings']['vmail_maildirname']['title'] = 'Maildir name';
$lng['serversettings']['vmail_maildirname']['description'] = 'Maildir directory into user\'s account. Normally \'Maildir\', in some implementations \'.maildir\', and directly into user\'s directory if left blank.';
$lng['tasks']['remove_emailacc_files'] = 'Delete customer e-mail data.';
$lng['tasks']['DELETE_EMAIL_DATA'] = 'Delete customer e-mail data.';
// ADDED IN 0.9.28-svn5
$lng['error']['operationnotpermitted'] = 'Operation not permitted!';
@@ -1688,8 +1688,8 @@ $lng['panel']['ftpdesc'] = 'FTP description';
$lng['admin']['cronsettings'] = 'Cronjob settings';
$lng['serversettings']['system_cronconfig']['title'] = 'Cron configuration file';
$lng['serversettings']['system_cronconfig']['description'] = 'Path to the cron-service configuration-file. This file will be updated regularly and automatically by froxlor.<br />Note: Please <b>be sure</b> to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)!<br><br>If you are using <b>FreeBSD</b>, please specify <i>/etc/crontab</i> here!';
$lng['tasks']['remove_ftpacc_files'] = 'Delete customer ftp-account data.';
$lng['tasks']['regenerating_crond'] = 'Rebuilding the cron.d-file';
$lng['tasks']['DELETE_FTP_DATA'] = 'Delete customer ftp-account data.';
$lng['tasks']['REBUILD_CRON'] = 'Rebuilding the cron.d-file';
$lng['serversettings']['system_crondreload']['title'] = 'Cron-daemon reload command';
$lng['serversettings']['system_crondreload']['description'] = 'Specify the command to execute in order to reload your systems cron-daemon';
$lng['admin']['integritycheck'] = 'Database validation';
@@ -1722,7 +1722,7 @@ $lng['serversettings']['panel_password_special_char_required']['description'] =
$lng['serversettings']['panel_password_special_char']['title'] = 'Special characters list';
$lng['serversettings']['panel_password_special_char']['description'] = 'One of these characters is required if the above option is set.';
$lng['phpfpm']['use_mod_proxy']['title'] = 'Use mod_proxy / mod_proxy_fcgi';
$lng['phpfpm']['use_mod_proxy']['description'] = '<strong class="red">Must be enabled when using Debian 9.x (Stretch)</strong>. Activate to use php-fpm via mod_proxy_fcgi. Requires at least apache-2.4.9';
$lng['phpfpm']['use_mod_proxy']['description'] = '<strong class="red">Must be enabled when using Debian 9.x (Stretch) or newer</strong>. Activate to use php-fpm via mod_proxy_fcgi. Requires at least apache-2.4.9';
$lng['error']['no_phpinfo'] = 'Sorry, unable to read phpinfo()';
$lng['admin']['movetoadmin'] = 'Move customer';
@@ -1894,7 +1894,7 @@ $lng['serversettings']['backupenabled']['title'] = "Enable backup for customers"
$lng['serversettings']['backupenabled']['description'] = "If activated, the customer will be able to schedule backup jobs (cron-backup) which generates an archive within his docroot (subdirectory chosable by customer)";
$lng['extras']['path_protection_label'] = '<strong class="red">Important</strong>';
$lng['extras']['path_protection_info'] = '<strong class="red">We strongly recommend protecting the given path, see "Extras" -> "Directory protection"</strong>';
$lng['tasks']['backup_customerfiles'] = 'Backup job for customer %loginname%';
$lng['tasks']['CREATE_CUSTOMER_BACKUP'] = 'Backup job for customer %loginname%';
$lng['error']['dns_domain_nodns'] = 'DNS is not enabled for this domain';
$lng['error']['dns_content_empty'] = 'No content given';
@@ -2038,7 +2038,7 @@ $lng['apikeys']['allowed_from_help'] = 'Comma separated list of ip addresses. De
$lng['apikeys']['valid_until'] = 'Valid until';
$lng['apikeys']['valid_until_help'] = 'Date until valid, format YYYY-MM-DD';
$lng['serversettings']['enable_api']['title'] = 'Enable external API usage';
$lng['serversettings']['enable_api']['description'] = 'In order to use the froxlor API you need to activate this option. For more detailed information see <a href="https://api.froxlor.org/" target="_new">https://api.froxlor.org/</a>';
$lng['serversettings']['enable_api']['description'] = 'In order to use the froxlor API you need to activate this option. For more detailed information see <a href="https://docs.froxlor.org/apiguide/index.html" target="_new">https://docs.froxlor.org/</a>';
$lng['serversettings']['dhparams_file']['title'] = 'DHParams file (DiffieHellman key exchange)';
$lng['serversettings']['dhparams_file']['description'] = 'If a dhparams.pem file is specified here it will be included in the webserver configuration. Leave empty to disable.<br>Example: /etc/ssl/webserver/dhparams.pem<br><br>If the file does not exist, it will be created automatically with the following command: <em>openssl dhparam -out /etc/ssl/webserver/dhparams.pem 4096<em>. It is recommended to create the file prior to specifying it here as the creation takes quite a while and blocks the cronjob.';
$lng['2fa']['2fa'] = '2FA options';
@@ -2063,8 +2063,8 @@ $lng['panel']['ihave_configured'] = 'I have configured the services';
$lng['panel']['system_is_configured'] = 'System is already set as configured';
$lng['panel']['settings_before_configuration'] = 'Please be sure you adjusted the settings prior to configuring the services here';
$lng['panel']['alternative_cmdline_config'] = 'Alternatively, just run the following command as root-user in your shell to configure the services automatically';
$lng['tasks']['remove_pdns_domain'] = 'Delete domain %s from PowerDNS database';
$lng['tasks']['remove_ssl_domain'] = 'Delete ssl files of domain %s';
$lng['tasks']['DELETE_DOMAIN_PDNS'] = 'Delete domain %domain% from PowerDNS database';
$lng['tasks']['DELETE_DOMAIN_SSL'] = 'Delete ssl files of domain %domain%';
$lng['admin']['novhostcontainer'] = '<br><br><small class="red">None of the IPs and ports has the "' . $lng['admin']['ipsandports']['create_vhostcontainer'] . '" option enabled, many settings here will not be available</small>';
$lng['serversettings']['errorlog_level']['title'] = 'Error log-level';
$lng['serversettings']['errorlog_level']['description'] = 'Specify the error log level. Default is "warn" for apache-users and "error" for nginx-users.';
@@ -2131,3 +2131,10 @@ $lng['serversettings']['froxlorusergroup']['description'] = 'Usage of libnss-ext
$lng['error']['local_group_exists'] = 'The given group already exists on the system.';
$lng['error']['local_group_invalid'] = 'The given group name is invalid';
$lng['error']['invaliddnsforletsencrypt'] = 'The domains DNS does not include any of the chosen IP addresses. Let\'s Encrypt certificate generation not possible.';
$lng['error']['notallowedphpconfigused'] = 'Trying to use php-config which is not assigned to customer';
$lng['serversettings']['phpfpm_settings']['allow_all_customers']['title'] = 'Assign this configuration to all currently existing customers';
$lng['serversettings']['phpfpm_settings']['allow_all_customers']['description'] = 'Set this to "true" if you want to assign this configuration to all currently existing customers so it can be used by them. This setting is not permanent but can be run multiple times.';
$lng['error']['pathmustberelative'] = 'The user does not have the permission to specify directories outside the customers home-directory. Please specify a relative path (no leading /).';
$lng['serversettings']['acmeshpath']['title'] = 'Path to acme.sh';
$lng['serversettings']['acmeshpath']['description'] = 'Set this to where acme.sh is installed to, including the acme.sh script<br>Default is <b>/root/.acme.sh/acme.sh</b>';

View File

@@ -843,7 +843,7 @@ $lng['admin']['phpconfig']['pear_dir'] = 'Wird mit dem globalen Wert für das In
$lng['admin']['phpconfig']['open_basedir_c'] = 'Wird mit einem ; (Semikolon) ersetzt, um open_basedir auszukommentieren/deaktivieren, wenn eingestellt.';
$lng['admin']['phpconfig']['open_basedir'] = 'Wird mit der open_basedir-Einstellung der Domain ersetzt.';
$lng['admin']['phpconfig']['tmp_dir'] = 'Wird mit der Einstellung für das temporäre Verzeichnis der Domain ersetzt.';
$lng['admin']['phpconfig']['open_basedir_global'] = 'Wird mit der globalen Einstellung des Pfades ersetzt, der dem open_basedir hinzugefügt wird.';
$lng['admin']['phpconfig']['open_basedir_global'] = 'Wird mit der globalen Einstellung des Pfades ersetzt, der dem open_basedir hinzugefügt wird (siehe Webserver Einstellungen).';
$lng['admin']['phpconfig']['customer_email'] = 'Wird mit der E-Mail-Adresse des Kunden ersetzt, dem die Domain gehört.';
$lng['admin']['phpconfig']['admin_email'] = 'Wird mit der E-Mail-Adresse des Admins ersetzt, dem die Domain gehört.';
$lng['admin']['phpconfig']['domain'] = 'Wird mit der Domain ersetzt.';
@@ -928,11 +928,11 @@ $lng['update']['noupdatesavail'] = '<strong>Ihre Froxlor-Version ist aktuell.</s
$lng['admin']['specialsettingsforsubdomains'] = 'Übernehme Einstellungen für alle Subdomains (*.beispiel.de)';
$lng['serversettings']['specialsettingsforsubdomains']['description'] = 'Wenn ja, werden die individuellen Einstellungen für alle Subdomains übernommen.<br />Wenn nein, werden Subdomain-Specialsettings entfernt.';
$lng['tasks']['outstanding_tasks'] = 'Ausstehende Cron-Aufgaben';
$lng['tasks']['rebuild_webserverconfig'] = 'Neuerstellung der Webserver-Konfiguration';
$lng['tasks']['adding_customer'] = 'Erstelle neuen Kunden %loginname%';
$lng['tasks']['rebuild_bindconfig'] = 'Neuerstellung der Bind-Konfiguration';
$lng['tasks']['creating_ftpdir'] = 'Erstelle Verzeichnis für neuen FTP-Benutzer';
$lng['tasks']['deleting_customerfiles'] = 'Löschen von Kunden-Dateien %loginname%';
$lng['tasks']['REBUILD_VHOST'] = 'Neuerstellung der Webserver-Konfiguration';
$lng['tasks']['CREATE_HOME'] = 'Erstelle neuen Kunden %loginname%';
$lng['tasks']['REBUILD_DNS'] = 'Neuerstellung der Bind-Konfiguration';
$lng['tasks']['CREATE_FTP'] = 'Erstelle Verzeichnis für neuen FTP-Benutzer';
$lng['tasks']['DELETE_CUSTOMER_FILES'] = 'Löschen von Kunden-Dateien %loginname%';
$lng['tasks']['noneoutstanding'] = 'Zur Zeit gibt es keine ausstehenden Aufgaben für Froxlor';
// ADDED IN FROXLOR 0.9.1
@@ -1252,7 +1252,7 @@ $lng['serversettings']['diskquota_enabled'] = 'Quota aktiviert?';
$lng['serversettings']['diskquota_repquota_path']['description'] = 'Pfad zu repquota';
$lng['serversettings']['diskquota_quotatool_path']['description'] = 'Pfad zu quotatool';
$lng['serversettings']['diskquota_customer_partition']['description'] = 'Partition, auf welcher die Kundendaten liegen';
$lng['tasks']['diskspace_set_quota'] = 'Quota auf dem Dateisystem setzen';
$lng['tasks']['CREATE_QUOTA'] = 'Quota auf dem Dateisystem setzen';
$lng['error']['session_timeout'] = 'Wert zu niedrig';
$lng['error']['session_timeout_desc'] = 'Der Wert der Session-Timeout sollte nicht unter einer Minute liegen.';
@@ -1281,7 +1281,7 @@ $lng['admin']['speciallogwarning'] = 'ACHTUNG: Durch diese Einstellungen werden
// ADDED IN 0.9.28-svn2
$lng['serversettings']['vmail_maildirname']['title'] = 'Maildir-(Unter-)Ordner';
$lng['serversettings']['vmail_maildirname']['description'] = 'Der Maildir-Ordner innerhalb des Kontos des Benutzers (normalerweise \'Maildir\', in manchen Fällen auch \'.maildir\'). Sollen die E-Mails direkt in das Verzeichnis, diese Option leer lassen.';
$lng['tasks']['remove_emailacc_files'] = 'E-Mail-Dateien des Kunden löschen';
$lng['tasks']['DELETE_EMAIL_DATA'] = 'E-Mail-Dateien des Kunden löschen';
// ADDED IN 0.9.28-svn5
$lng['error']['operationnotpermitted'] = 'Diese Aktion ist nicht erlaubt!';
@@ -1411,8 +1411,8 @@ $lng['panel']['ftpdesc'] = 'FTP-Beschreibung';
$lng['admin']['cronsettings'] = 'Cronjob-Einstellungen';
$lng['serversettings']['system_cronconfig']['title'] = 'Cron-Konfigurationsdatei';
$lng['serversettings']['system_cronconfig']['description'] = 'Pfad zur Konfigurationsdatei des Cron-Dienstes. Diese Datei wird von Froxlor automatisch aktualisiert.<br />Hinweis: Bitte verwenden Sie <strong>exakt</strong> die gleiche Datei wie für den Froxlor-Haupt-Cronjob (Standard: /etc/cron.d/froxlor)!<br><br>Wird <b>FreeBSD</b> verwendet, sollte hier <i>/etc/crontab</i> angegeben werden!';
$lng['tasks']['remove_ftpacc_files'] = 'Kunden FTP-Konto Dateien löschen';
$lng['tasks']['regenerating_crond'] = 'Neuerstellung der cron.d-Datei';
$lng['tasks']['DELETE_FTP_DATA'] = 'Kunden FTP-Konto Dateien löschen';
$lng['tasks']['REBUILD_CRON'] = 'Neuerstellung der cron.d-Datei';
$lng['serversettings']['system_crondreload']['title'] = 'Cron-Daemon reload Befehl';
$lng['serversettings']['system_crondreload']['description'] = 'Geben Sie hier den Befehl zum Neuladen des Cron-Daemons an';
$lng['admin']['integritycheck'] = 'Datenbankpr&uuml;fung';
@@ -1445,7 +1445,7 @@ $lng['serversettings']['panel_password_special_char_required']['description'] =
$lng['serversettings']['panel_password_special_char']['title'] = 'Sonderzeichen-Liste';
$lng['serversettings']['panel_password_special_char']['description'] = 'Mindestens eines dieser Sonderzeichen muss in dem Passwort vorkommen, sofern die Sonderzeichen-Option aktiviert ist.';
$lng['phpfpm']['use_mod_proxy']['title'] = 'Verwende mod_proxy / mod_proxy_fcgi';
$lng['phpfpm']['use_mod_proxy']['description'] = '<strong class="red">Muss gesetzt sein bei Debian 9.x (Stretch)</strong>. Diese Option kann aktiviert werden, um php-fpm via mod_proxy_fcgi einzubinden. Dies setzt mindestens apache-2.4.9 voraus';
$lng['phpfpm']['use_mod_proxy']['description'] = '<strong class="red">Muss gesetzt sein bei Debian 9.x (Stretch) oder neuer</strong>. Diese Option kann aktiviert werden, um php-fpm via mod_proxy_fcgi einzubinden. Dies setzt mindestens apache-2.4.9 voraus';
$lng['error']['no_phpinfo'] = 'Entschuldigung, es ist nicht möglich die phpinfo() auszulesen.';
$lng['admin']['movetoadmin'] = 'Kunde verschieben';
@@ -1544,7 +1544,7 @@ $lng['serversettings']['backupenabled']['title'] = "Backup für Kunden aktiviere
$lng['serversettings']['backupenabled']['description'] = "Wenn dies aktiviert ist, kann der Kunde Sicherungen planen (cron-backup) welche ein Archiv in sein Heimatverzeichnis ablegt (Unterordner vom Kunden wählbar)";
$lng['extras']['path_protection_label'] = '<strong class="red">Wichtig</strong>';
$lng['extras']['path_protection_info'] = '<strong class="red">Wir raten dringend dazu den angegebenen Pfad zu schützen, siehe "Extras" -> "Verzeichnisschutz"</strong>';
$lng['tasks']['backup_customerfiles'] = 'Datensicherung für Kunde %loginname%';
$lng['tasks']['CREATE_CUSTOMER_BACKUP'] = 'Datensicherung für Kunde %loginname%';
$lng['error']['dns_domain_nodns'] = 'DNS ist für diese Domain nicht aktiviert';
$lng['error']['dns_content_empty'] = 'Keinen Inhalt angegeben';
@@ -1684,7 +1684,7 @@ $lng['apikeys']['allowed_from_help'] = 'Komma getrennte Liste von IPs. Standard
$lng['apikeys']['valid_until'] = 'Gültig bis';
$lng['apikeys']['valid_until_help'] = 'Datum Gültigkeitsende, Format JJJJ-MM-TT';
$lng['serversettings']['enable_api']['title'] = 'Aktiviere externe API Nutzung';
$lng['serversettings']['enable_api']['description'] = 'Um die froxlor API nutzen zu können, muss diese Option aktiviert sein. Für detaillierte Informationen siehe <a href="https://api.froxlor.org/" target="_new">https://api.froxlor.org/</a>';
$lng['serversettings']['enable_api']['description'] = 'Um die froxlor API nutzen zu können, muss diese Option aktiviert sein. Für detaillierte Informationen siehe <a href="https://docs.froxlor.org/apiguide/index.html" target="_new">https://docs.froxlor.org/</a>';
$lng['serversettings']['dhparams_file']['title'] = 'DHParams Datei (DiffieHellman key exchange)';
$lng['serversettings']['dhparams_file']['description'] = 'Wird eine dhparams.pem Datei hier angegeben, wir sie in die Webserver Konfiguration mit eingefügt.<br>Beispiel: /etc/ssl/webserver/dhparams.pem<br><br>Existiert die Datei nicht, wird sie wie folgt erstellt: <em>openssl dhparam -out /etc/ssl/webserver/dhparams.pem 4096<em>. Es wird empfohlen die Datei zu erstellen, bevor sie hier angegeben wird, da die Erstellung längere Zeit in Anspruch nimmt und den Cronjob blockiert.';
$lng['2fa']['2fa'] = '2FA Optionen';
@@ -1709,8 +1709,8 @@ $lng['panel']['ihave_configured'] = 'Ich habe die Dienste konfiguriert';
$lng['panel']['system_is_configured'] = 'Das System ist bereits konfiguriert';
$lng['panel']['settings_before_configuration'] = 'Stelle sicher, dass die Einstellungen angepasst wurden bevor die Dienste konfiguriert werden.';
$lng['panel']['alternative_cmdline_config'] = 'Alternativ, führe den folgenden Befehl als root-Benutzer auf der Shell aus, um die Dienste automatisch zu konfigurieren.';
$lng['tasks']['remove_pdns_domain'] = 'Lösche Domain %s von PowerDNS Datenbank';
$lng['tasks']['remove_ssl_domain'] = 'Lösche SSL Dateien von Domain %s';
$lng['tasks']['DELETE_DOMAIN_PDNS'] = 'Lösche Domain %domain% von PowerDNS Datenbank';
$lng['tasks']['DELETE_DOMAIN_SSL'] = 'Lösche SSL Dateien von Domain %domain%';
$lng['admin']['novhostcontainer'] = '<br><br><small class="red">Keine der IPs und Ports hat die Option "' . $lng['admin']['ipsandports']['create_vhostcontainer'] . '" aktiviert, einige Einstellungen sind daher nicht verfügbar.</small>';
$lng['serversettings']['errorlog_level']['title'] = 'Ausführlichkeit des Fehlerprotokolls';
$lng['serversettings']['errorlog_level']['description'] = 'Steuert die Ausführlichkeit des Fehlerprotokolls. Voreinstellung ist "warn" bei Apache und "error" bei Nginx.';
@@ -1777,3 +1777,10 @@ $lng['serversettings']['froxlorusergroup']['description'] = 'Voraussetzung hierf
$lng['error']['local_group_exists'] = 'Die angegebene Gruppe existiert bereits auf dem System';
$lng['error']['local_group_invalid'] = 'Der angegebene Gruppen-Name ist nicht gültig';
$lng['error']['invaliddnsforletsencrypt'] = 'Die DNS-Einträge der Domain enhalten keine der gewählten IP Adressen. Let\'s Encrypt Zertifikats-Erstellung ist nicht möglich.';
$lng['error']['notallowedphpconfigused'] = 'Nutzung einer PHP-Konfiguration welche nicht dem Kunden zugeordnet ist';
$lng['serversettings']['phpfpm_settings']['allow_all_customers']['title'] = 'Für aktuelle Kunden automatisch hinzufügen';
$lng['serversettings']['phpfpm_settings']['allow_all_customers']['description'] = 'Ist diese Einstellung aktiv, wird die Konfiguration automatisch allen aktuell existierenden Kunden-Accounts zugewiesen. Diese Einstellung ist nicht permanent, kann aber mehrfach / nach Bedarf ausgeführt werden.';
$lng['error']['pathmustberelative'] = 'Der Benutzer hat nicht die benötigten Berechtigungen, um Pfade außerhalb des Kunden-Heimatverzeichnisses anzugeben. Bitte einen relativen Pfad angeben (kein führendes /).';
$lng['serversettings']['acmeshpath']['title'] = 'Pfad zu acme.sh';
$lng['serversettings']['acmeshpath']['description'] = 'Installationspfad zu acme.sh, inklusive acme.sh Script<br>Standard ist <b>/root/.acme.sh/acme.sh</b>';

View File

@@ -884,11 +884,11 @@ $lng['update']['noupdatesavail'] = '<strong>È già presente l\'ultima versione
$lng['admin']['specialsettingsforsubdomains'] = 'Applica le impostazioni speciali a tutti i sottodomini (*.esempio.com)';
$lng['serversettings']['specialsettingsforsubdomains']['description'] = 'Se si queste impostazioni personalizzate dei vhost saranno aggiunte a tutti sottodomini; se no le impostazioni speciali dei sottodomini verranno rimosse.';
$lng['tasks']['outstanding_tasks'] = 'Processi Cron in sospeso';
$lng['tasks']['rebuild_webserverconfig'] = 'Ricostruzione della configurazione del webserver';
$lng['tasks']['adding_customer'] = 'Aggiunto il nuovo cliente %loginname%';
$lng['tasks']['rebuild_bindconfig'] = 'Ricostruzione della configurazione di bind';
$lng['tasks']['creating_ftpdir'] = 'Creazione delle cartelle per i nuovi utenti ftp';
$lng['tasks']['deleting_customerfiles'] = 'Eliminazione dei file del cliente %loginname%';
$lng['tasks']['REBUILD_VHOST'] = 'Ricostruzione della configurazione del webserver';
$lng['tasks']['CREATE_HOME'] = 'Aggiunto il nuovo cliente %loginname%';
$lng['tasks']['REBUILD_DNS'] = 'Ricostruzione della configurazione di bind';
$lng['tasks']['CREATE_FTP'] = 'Creazione delle cartelle per i nuovi utenti ftp';
$lng['tasks']['DELETE_CUSTOMER_FILES'] = 'Eliminazione dei file del cliente %loginname%';
$lng['tasks']['noneoutstanding'] = 'Attualmente non ci sono processi in sospeso per Froxlor';
// ADDED IN FROXLOR 0.9.1
@@ -1486,7 +1486,7 @@ $lng['serversettings']['diskquota_enabled'] = 'Quota attivita?';
$lng['serversettings']['diskquota_repquota_path']['description'] = 'Percorso a repquota';
$lng['serversettings']['diskquota_quotatool_path']['description'] = 'Percorso al quotatool';
$lng['serversettings']['diskquota_customer_partition']['description'] = 'Partizione, sulla quale sono salvati i dati dei clienti';
$lng['tasks']['diskspace_set_quota'] = 'Setta quota al filesystem';
$lng['tasks']['CREATE_QUOTA'] = 'Setta quota al filesystem';
$lng['error']['session_timeout'] = 'Valore troppo basso';
$lng['error']['session_timeout_desc'] = 'Non dovresti settare il timeout della sessione ad un valore minore di 1 minuto.';
$lng['admin']['assignedmax'] = 'Assegnato / Max';
@@ -1506,7 +1506,7 @@ $lng['admin']['delete_statistics'] = 'Elimina Statistiche';
$lng['admin']['speciallogwarning'] = 'AVVISO: Cambiando questa impostazione perderai tutte le vecchie statistiche per questo dominio. Se sei sicuro che vuoi cambiare questo digita "%s" nel campo sottostante e clicca il bottone "elimina".<br /><br />';
$lng['serversettings']['vmail_maildirname']['title'] = 'nome Maildir';
$lng['serversettings']['vmail_maildirname']['description'] = 'cartella Maildir nell account utente. Normalmente \'Maildir\', in alcune implementazioni \'.maildir\', e direttamente nella cartella utente se lasciato vuoto.';
$lng['tasks']['remove_emailacc_files'] = 'Elimina i dati di posta elettronica del cliente.';
$lng['tasks']['DELETE_EMAIL_DATA'] = 'Elimina i dati di posta elettronica del cliente.';
$lng['error']['operationnotpermitted'] = 'Operazione non permessa!';
$lng['error']['featureisdisabled'] = 'Funzionalità %s è disabilitata. Perfavore contatta il tuo fornitore di servizi.';
$lng['serversettings']['catchall_enabled']['title'] = 'Usa Catchall';
@@ -1616,8 +1616,8 @@ $lng['admin']['cronsettings'] = 'Impostazioni Cronjob';
$lng['serversettings']['system_cronconfig']['title'] = 'File di configurazione Cron';
$lng['serversettings']['system_cronconfig']['description'] = 'Percorso al file di configurazione del servizio cron. Questo file verrà aggiornato regolarmente ed automaticamente da froxlor.<br />
Nota: Perfavore <b>sii sicuro</b> di usare lo stesso nome di file come per il cronjob principale di froxlor (predefinito: /etc/cron.d/froxlor)!<br><br>Se usi <b>FreeBSD</b>, qui specifica: <i>/etc/crontab</i>!';
$lng['tasks']['remove_ftpacc_files'] = 'Elimina i dati account-ftp del cliente.';
$lng['tasks']['regenerating_crond'] = 'Ricostruisci il file cron.d';
$lng['tasks']['DELETE_FTP_DATA'] = 'Elimina i dati account-ftp del cliente.';
$lng['tasks']['REBUILD_CRON'] = 'Ricostruisci il file cron.d';
$lng['serversettings']['system_crondreload']['title'] = 'Commando per riavviare il servizio Cron';
$lng['serversettings']['system_crondreload']['description'] = 'Specifica il commando da eseguire per riavviare il servizio cron del tuo sistema';
$lng['admin']['integritycheck'] = 'Validazione Database';

View File

@@ -30,6 +30,7 @@
<directory>tests/PhpAndFpm</directory>
<directory>tests/Traffic</directory>
<directory>tests/Froxlor</directory>
<directory>tests/Cron</directory>
</testsuite>
</testsuites>
<logging>

View File

@@ -63,7 +63,7 @@
</if>
<if \Froxlor\Settings::Get('api.enabled') == 1>
<li><a href="{$linker->getLink(array('section' => 'index', 'page' => 'apikeys'))}">{$lng['menue']['main']['apikeys']}</a></li>
<li><a href="https://api.froxlor.org/doc/?v={$version}" rel="external">{$lng['menue']['main']['apihelp']}</a></li>
<li><a href="https://docs.froxlor.org/apiguide/index.html" rel="external">{$lng['menue']['main']['apihelp']}</a></li>
</if>
</ul>
</li>

View File

@@ -67,7 +67,7 @@ a:hover {
<span> <img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAAAQCAYAAAC1MDndAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAy1JREFUeNrs1muIVlUUBuBnvqZkoswudKErZFOG0kWt6WpN0wWCDMOsgX4UmVS/KovKhIKYLhRBJvV1o/5VlJCmYEmUFYijaBYhSRQVBVE0ZnRBJ/vzfnA4nDN+wTh/pgWHc/baa6+z97v3et/d0Ww24SQ8ij5MNL7tN6zBvdjWiZOxDpP8b3JA5qAXPQ0MtAnOm9jZBvqbsQHbsGsMFrQLv+KPUc47CQONlFXZPsNfJd/buBrDFfHDWIDDcAZmohsPjwFAD+EQnL8Xcl/WqOGc+/FJyXcxVuHJivjX8Hx2cwGeweO4fIxOkL10Wg9o1HSsxUcl30V5P1JxnFuxp+M53I67cQ5mYwZexj2YlnarJBdl3BE4FfPxdfofSOwNhX+uwgXxf1Uz/024DpNxFHrwRIEiPs74XnyIq3A8Xion6qxIvj0TX1vyb8x7CJ/jrELfjrx/zgmS0p2bCWzHzejAQTgmO35J+OpInIcv8GLKeROuzcI24lAsRH/yzcGJFfMfDIB/B/ipeD8bNojX8W1hPR+gCxPwTzsAdaGRgTeGrAZLJXd4zc59l1Jr2dzC91S8g+PSXhFwGgGxO4s6Bd9gaQRkAHdhSQHso/FCzRweS56ezLmB1bgCb+DBCg67rwaLSud+uDAAvVLRfw1OqCO18JEKbusvgNMqA/F153sCpgegT+O7Iwt8NwrZwKsh5irbUuDMFoXMquhv2eKRSKiOg54OUFXSt3SEfPvi4Dz77IEAW/8uH+vdpf6dkXGF+F9GyNtRkXe4or8tqwNoWrigbDeFTEfDZhbKckuBy9blu0XkC1Pi++PK+Objy5q80/NeXSDl9wrgnDkaAIlyzCj5zh1FCb00JL07Jd2LKfgBx+LWXE6XJP6pcMiUiMg8/FmRd3GEYHNiZ+H6wgZP/i+T7MzPJo5wkjYU2t01cWfjp6hH2WZn0adVbM7KALAS3weYftwZIVgTIHtxS8YtD6kOYX2Uqi8iIKCsD6CDhXnNi+iI+vXhwD3g83tHs9l8K5JZZbfh2UL7x0jyeLFljVzUhtoc0DWOwBnCoga25s6wrHDhG8+2I1j0YOu/AwBUU7aBHvM/ZwAAAABJRU5ErkJggg=="
style="height: 13px; margin: 0 2px 3px 0; vertical-align: middle;" />
&copy; 2009-2018 by <a href="http://www.froxlor.org">the Froxlor
&copy; 2009-2021 by <a href="http://www.froxlor.org">the Froxlor
Team</a>
</span>
</footer>

84
tests/Cron/TaskIdTest.php Normal file
View File

@@ -0,0 +1,84 @@
<?php
use PHPUnit\Framework\TestCase;
use Froxlor\Cron\TaskId;
/**
*
* @covers \Froxlor\Cron\TaskId
*/
class TaskIDTest extends TestCase
{
private $fixedids = array(
'REBUILD_VHOST' => 1,
'CREATE_HOME' => 2,
'REBUILD_DNS' => 4,
'CREATE_FTP' => 5,
'DELETE_CUSTOMER_FILES' => 6,
'DELETE_EMAIL_DATA' => 7,
'DELETE_FTP_DATA' => 8,
'CREATE_QUOTA' => 10,
'DELETE_DOMAIN_PDNS' => 11,
'DELETE_DOMAIN_SSL' => 12,
'CREATE_CUSTOMER_BACKUP' => 20,
'REBUILD_CRON' => 99,
);
public function testValidTaskId()
{
$isId99Valid = TaskId::isValid(99);
$this->assertTrue($isId99Valid, "Task id 99 must be valid");
$isIdStringValid = TaskId::isValid('99');
$this->assertTrue($isIdStringValid, "String task ids should be valid");
$isNegativeValid = TaskId::isValid(-1);
$this->assertFalse($isNegativeValid, "Negative task should be invalid");
}
public function testAcceptNewTaskId()
{
$isTESTTASKValid = TaskIdExtended::isValid(10101010);
$this->assertTrue($isTESTTASKValid);
}
public function testFixedTaskIdTable()
{
$isTESTTASKValid = TaskIdExtended::isValid(10101010);
$this->assertTrue($isTESTTASKValid);
}
public function testIdMappingCorrect() {
foreach($this->fixedids as $name => $expected) {
$result = constant("\Froxlor\Cron\TaskId::$name");
$this->assertEquals( $expected, $result, "Task $name has bad mapping");
}
}
public function testConvertToConstant() {
foreach($this->fixedids as $name => $taskid) {
$result = TaskId::convertToConstant($taskid);
$this->assertEquals( $name, $result, "Task $name has bad mapping from id to name");
}
$unknownIDResult = TaskId::isValid(10101010);
$this->assertFalse($unknownIDResult);
}
}
class TaskIdExtended extends TaskId {
const TESTTASK = 10101010;
}

View File

@@ -21,6 +21,7 @@ class DomainZonesTest extends TestCase
global $admin_userdata;
Settings::Set('system.dnsenabled', 1, true);
Settings::Set('system.mxservers', 'mx.hostname.tld', true);
// get customer
$json_result = Customers::getLocal($admin_userdata, array(
@@ -35,6 +36,9 @@ class DomainZonesTest extends TestCase
$result = json_decode($json_result, true)['data'];
$this->assertTrue(count($result) > 1);
$this->assertEquals('$ORIGIN test2.local.', $result[1]);
$resstr = preg_replace('/\s+/', '', $result[count($result)-2]);
$against = preg_replace('/\s+/', '', '@ 604800 IN MX 10 mx.hostname.tld.');
$this->assertEquals($against, $resstr);
}
/**

View File

@@ -138,6 +138,25 @@ class DomainsTest extends TestCase
$this->assertEquals(2, $result['subcanemaildomain']);
}
public function testResellerDomainsAddWithAbsolutePathNoChangeServerSettings()
{
global $admin_userdata;
// get reseller
$json_result = Admins::getLocal($admin_userdata, array(
'loginname' => 'reseller'
))->get();
$reseller_userdata = json_decode($json_result, true)['data'];
$reseller_userdata['adminsession'] = 1;
$data = [
'domain' => 'test3.local',
'customerid' => 1,
'documentroot' => '/some/absolute/directory/the_reseller/cannot/set/',
'ipandport' => 4
];
$this->expectExceptionMessage("The user does not have the permission to specify directories outside the customers home-directory. Please specify a relative path (no leading /).");
$json_result = Domains::getLocal($reseller_userdata, $data)->add();
}
/**
*
* @depends testAdminDomainsAdd
@@ -153,12 +172,35 @@ class DomainsTest extends TestCase
$reseller_userdata['adminsession'] = 1;
$data = [
'domainname' => 'test2.local',
'ssl_protocols' => 'TLSv1'
'ssl_protocols' => 'TLSv1',
'documentroot' => '/var/customers/webs/test1/sub/'
];
$json_result = Domains::getLocal($reseller_userdata, $data)->update();
$result = json_decode($json_result, true)['data'];
$this->assertEmpty($result['ssl_protocols']);
$this->assertEquals('test2.local', $result['domain']);
$this->assertEquals('/var/customers/webs/test1/sub/', $result['documentroot']);
}
/**
*
* @depends testResellerDomainsUpdate
*/
public function testResellerDomainsUpdateAboslutePathNotAllowed()
{
global $admin_userdata;
// get reseller
$json_result = Admins::getLocal($admin_userdata, array(
'loginname' => 'reseller'
))->get();
$reseller_userdata = json_decode($json_result, true)['data'];
$reseller_userdata['adminsession'] = 1;
$data = [
'domainname' => 'test2.local',
'documentroot' => '/some/other/dir'
];
$this->expectExceptionMessage("The user does not have the permission to specify directories outside the customers home-directory. Please specify a relative path (no leading /).");
$json_result = Domains::getLocal($reseller_userdata, $data)->update();
}
public function testAdminDomainsAddSysHostname()
@@ -402,6 +444,7 @@ class DomainsTest extends TestCase
}
/**
*
* @refs https://github.com/Froxlor/Froxlor/issues/899
*/
public function testAdminIdn2DomainsAdd()

View File

@@ -97,4 +97,34 @@ class PhpSettingsText extends TestCase
'id' => 1
))->get();
}
/**
* @depends testAdminPhpSettingsAdd
*/
public function testAdminPhpSettingsAddForAll()
{
global $admin_userdata;
$data = [
'description' => 'test php #2',
'phpsettings' => 'error_reporting=E_ALL',
'fpmconfig' => Settings::Get('phpfpm.defaultini'),
'allow_all_customers' => true
];
$json_result = PhpSettings::getLocal($admin_userdata, $data)->add();
$result = json_decode($json_result, true)['data'];
$required_id = $result['id'];
$json_result = Customers::getLocal($admin_userdata)->listing();
$result = json_decode($json_result, true)['data'];
$allowed_cnt = 0;
foreach ($result['list'] as $customer) {
$cust_phpconfigsallowed = json_decode($customer['allowed_phpconfigs'], true);
if (!in_array($required_id, $cust_phpconfigsallowed)) {
$this->fail("Customer does not have php-config assigned which was added for all customers");
}
$allowed_cnt++;
}
$this->assertTrue($allowed_cnt == $result['count']);
}
}

View File

@@ -43,14 +43,25 @@ require dirname(__DIR__) . '/lib/tables.inc.php';
use Froxlor\Database\Database;
use Froxlor\Settings;
Database::needRoot(true);
if (TRAVIS_CI == 0) {
Database::needRoot(true);
Database::query("DROP DATABASE IF EXISTS `froxlor010`;");
Database::query("CREATE DATABASE `froxlor010`;");
exec("mysql -u root -p" . $rpwd . " froxlor010 < " . dirname(__DIR__) . "/install/froxlor.sql");
Database::query("DROP USER IF EXISTS 'test1sql1'@'localhost';");
Database::query("DROP USER IF EXISTS 'test1sql1'@'127.0.0.1';");
Database::query("DROP USER IF EXISTS 'test1sql1'@'172.17.0.1';");
Database::query("DROP USER IF EXISTS 'test1sql1'@'82.149.225.46';");
Database::query("DROP USER IF EXISTS 'test1sql1'@'2a01:440:1:12:82:149:225:46';");
Database::query("DROP USER IF EXISTS 'test1_abc123'@'localhost';");
Database::query("DROP USER IF EXISTS 'test1_abc123'@'127.0.0.1';");
Database::query("DROP USER IF EXISTS 'test1_abc123'@'172.17.0.1';");
Database::query("DROP USER IF EXISTS 'test1_abc123'@'82.149.225.46';");
Database::query("DROP USER IF EXISTS 'test1_abc123'@'2a01:440:1:12:82:149:225:46';");
Database::query("DROP DATABASE IF EXISTS `test1sql1`;");
Database::query("DROP DATABASE IF EXISTS `test1_abc123`;");
Database::needRoot(false);
}
Database::query("DROP DATABASE IF EXISTS `test1sql1`;");
Database::needRoot(false);
// clear all tables
Database::query("TRUNCATE TABLE `" . TABLE_PANEL_CUSTOMERS . "`;");
@@ -162,6 +173,7 @@ Settings::Set('system.mysql_access_host', 'localhost,127.0.0.1,172.17.0.1,2a01:4
Settings::Set('system.use_ssl', '1', true);
Settings::Set('system.froxlordirectlyviahostname', '1', true);
Settings::Set('system.dns_createhostnameentry', '1', true);
Settings::Set('system.bind_enable', '1', true);
Settings::Set('system.dnsenabled', '1', true);
Settings::Set('system.dns_server', 'PowerDNS', true);
Settings::Set('phpfpm.enabled', '1', true);