Compare commits

...

29 Commits

Author SHA1 Message Date
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
Michael Kaufmann
52135a1d3a set version to 0.10.29 for upcoming release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-08 08:46:58 +02:00
Michael Kaufmann
7f13bd09da add optional ssl parameters to powerdns-config-template
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-08 08:39:22 +02:00
Nick Ufer
7ccbb37c4e feat: adds mysql tls support (#979) 2021-10-08 08:28:32 +02:00
Michael Kaufmann
7feddf0aec generate unpredictable unique session ids
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-10-02 12:38:17 +02:00
Michael Kaufmann
e73523531a let user decide whether an existing database should be backup'ed and removed when installing froxlor; dont rely on parse_ini_file for OS check; enhance mysqldump so there is no issues with complex passwords and bash-escaping
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-09-24 10:49:57 +02:00
Michael Kaufmann
a47b790e19 actually integrate the new czech language file; refs #976
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-09-04 09:30:44 +02:00
Michael Kaufmann
319eec6124 fix session for 2fa enabled logins
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-08-27 13:17:05 +02:00
Michael Kaufmann
21983f27b6 secure commonly used filename-variable against url manipulation
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-08-25 16:36:09 +02:00
Michael Kaufmann
5d375b784d login action always goes to index.php
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-08-25 16:30:56 +02:00
Michael Kaufmann
4b22470872 set php session security related settings (correctly in every case)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2021-08-25 16:21:33 +02:00
45 changed files with 590 additions and 179 deletions

View File

@@ -129,7 +129,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
'userid' => $userinfo['userid'] 'userid' => $userinfo['userid']
)); ));
$s = md5(uniqid(microtime(), 1)); $s = \Froxlor\Froxlor::genSessionId();
$ins_stmt = Database::prepare(" $ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_SESSIONS . "` SET INSERT INTO `" . TABLE_PANEL_SESSIONS . "` SET
`hash` = :hash, `userid` = :userid, `ipaddress` = :ip, `hash` = :hash, `userid` = :userid, `ipaddress` = :ip,

View File

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

View File

@@ -38,13 +38,43 @@ if ($userinfo['change_serversettings'] == '1') {
// try to convert namserver hosts to ip's // try to convert namserver hosts to ip's
$ns_ips = ""; $ns_ips = "";
$known_ns_ips = [];
if (Settings::Get('system.nameservers') != '') { if (Settings::Get('system.nameservers') != '') {
$nameservers = explode(',', Settings::Get('system.nameservers')); $nameservers = explode(',', Settings::Get('system.nameservers'));
foreach ($nameservers as $nameserver) { foreach ($nameservers as $nameserver) {
$nameserver = trim($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); $nameserver_ips = \Froxlor\PhpHelper::gethostbynamel6($nameserver);
if (is_array($nameserver_ips) && count($nameserver_ips) > 0) { // append dot to hostname
$ns_ips .= implode(",", $nameserver_ips); 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'), '<SERVERIP>' => Settings::Get('system.ipaddress'),
'<NAMESERVERS>' => Settings::Get('system.nameservers'), '<NAMESERVERS>' => Settings::Get('system.nameservers'),
'<NAMESERVERS_IP>' => $ns_ips, '<NAMESERVERS_IP>' => $ns_ips,
'<AXFRSERVERS>' => Settings::Get('system.axfrservers'),
'<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'), '<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'),
'<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'), '<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'),
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'), '<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),

View File

@@ -178,7 +178,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
'hash' => $s 'hash' => $s
)); ));
$s = md5(uniqid(microtime(), 1)); $s = \Froxlor\Froxlor::genSessionId();
$insert = Database::prepare(" $insert = Database::prepare("
INSERT INTO `" . TABLE_PANEL_SESSIONS . "` SET INSERT INTO `" . TABLE_PANEL_SESSIONS . "` SET
`hash` = :hash, `hash` = :hash,

View File

@@ -28,6 +28,12 @@ if ($action == '') {
} }
if (session_status() == PHP_SESSION_NONE) { if (session_status() == PHP_SESSION_NONE) {
ini_set("session.name", "s");
ini_set("url_rewriter.tags", "");
ini_set("session.use_cookies", false);
ini_set("session.cookie_httponly", true);
ini_set("session.cookie_secure", $is_ssl);
session_id('login');
session_start(); session_start();
} }
@@ -669,7 +675,7 @@ function finishLogin($userinfo)
global $version, $dbversion, $remote_addr, $http_user_agent, $languages; global $version, $dbversion, $remote_addr, $http_user_agent, $languages;
if (isset($userinfo['userid']) && $userinfo['userid'] != '') { if (isset($userinfo['userid']) && $userinfo['userid'] != '') {
$s = md5(uniqid(microtime(), 1)); $s = \Froxlor\Froxlor::genSessionId();
if (isset($_POST['language'])) { if (isset($_POST['language'])) {
$language = \Froxlor\Validate\Validate::validate($_POST['language'], 'language'); $language = \Froxlor\Validate\Validate::validate($_POST['language'], 'language');

View File

@@ -532,7 +532,7 @@ opcache.interned_strings_buffer'),
('system', 'vmail_gid', '2000'), ('system', 'vmail_gid', '2000'),
('system', 'vmail_homedir', '/var/customers/mail/'), ('system', 'vmail_homedir', '/var/customers/mail/'),
('system', 'vmail_maildirname', 'Maildir'), ('system', 'vmail_maildirname', 'Maildir'),
('system', 'bind_enable', '1'), ('system', 'bind_enable', '0'),
('system', 'bindconf_directory', '/etc/bind/'), ('system', 'bindconf_directory', '/etc/bind/'),
('system', 'bindreload_command', '/etc/init.d/bind9 reload'), ('system', 'bindreload_command', '/etc/init.d/bind9 reload'),
('system', 'hostname', 'SERVERNAME'), ('system', 'hostname', 'SERVERNAME'),
@@ -722,8 +722,8 @@ opcache.interned_strings_buffer'),
('panel', 'logo_image_login', ''), ('panel', 'logo_image_login', ''),
('panel', 'logo_overridetheme', '0'), ('panel', 'logo_overridetheme', '0'),
('panel', 'logo_overridecustom', '0'), ('panel', 'logo_overridecustom', '0'),
('panel', 'version', '0.10.28'), ('panel', 'version', '0.10.30'),
('panel', 'db_version', '202108180'); ('panel', 'db_version', '202109040');
DROP TABLE IF EXISTS `panel_tasks`; DROP TABLE IF EXISTS `panel_tasks`;
@@ -822,7 +822,8 @@ INSERT INTO `panel_languages` (`id`, `language`, `iso`, `file`) VALUES
(4, 'Portugu&ecirc;s', 'pt', 'lng/portugues.lng.php'), (4, 'Portugu&ecirc;s', 'pt', 'lng/portugues.lng.php'),
(5, 'Italiano', 'it', 'lng/italian.lng.php'), (5, 'Italiano', 'it', 'lng/italian.lng.php'),
(6, 'Nederlands', 'nl', 'lng/dutch.lng.php'), (6, 'Nederlands', 'nl', 'lng/dutch.lng.php'),
(7, 'Svenska', 'sv', 'lng/swedish.lng.php'); (7, 'Svenska', 'sv', 'lng/swedish.lng.php'),
(8, '&#268;esk&aacute; republika', 'cs', 'lng/czech.lng.php');
DROP TABLE IF EXISTS `panel_syslog`; DROP TABLE IF EXISTS `panel_syslog`;

View File

@@ -163,10 +163,13 @@ class FroxlorInstall
$this->_getPostField('mysql_host', '127.0.0.1'); $this->_getPostField('mysql_host', '127.0.0.1');
$this->_getPostField('mysql_database', 'froxlor'); $this->_getPostField('mysql_database', 'froxlor');
$this->_getPostField('mysql_forcecreate', '0');
$this->_getPostField('mysql_unpriv_user', 'froxlor'); $this->_getPostField('mysql_unpriv_user', 'froxlor');
$this->_getPostField('mysql_unpriv_pass'); $this->_getPostField('mysql_unpriv_pass');
$this->_getPostField('mysql_root_user', 'root'); $this->_getPostField('mysql_root_user', 'root');
$this->_getPostField('mysql_root_pass'); $this->_getPostField('mysql_root_pass');
$this->_getPostField('mysql_ssl_ca_file');
$this->_getPostField('mysql_ssl_verify_server_certificate', 0);
$this->_getPostField('admin_user', 'admin'); $this->_getPostField('admin_user', 'admin');
$this->_getPostField('admin_pass1'); $this->_getPostField('admin_pass1');
$this->_getPostField('admin_pass2'); $this->_getPostField('admin_pass2');
@@ -212,6 +215,12 @@ class FroxlorInstall
$options = array( $options = array(
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8' 'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
); );
if (!empty($this->_data['mysql_ssl_ca_file'])) {
$options[\PDO::MYSQL_ATTR_SSL_CA] = $this->_data['mysql_ssl_ca_file'];
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = (bool) $this->_data['mysql_ssl_verify_server_certificate'];
}
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";"; $dsn = "mysql:host=" . $this->_data['mysql_host'] . ";";
$fatal_fail = false; $fatal_fail = false;
try { try {
@@ -246,15 +255,23 @@ class FroxlorInstall
$content .= $this->_status_message('green', "OK"); $content .= $this->_status_message('green', "OK");
// check for existing db and create backup if so // check for existing db and create backup if so
$content .= $this->_backupExistingDatabase($db_root); $content .= $this->_backupExistingDatabase($db_root);
// create unprivileged user and the database itself if (!$this->_abort) {
$content .= $this->_createDatabaseAndUser($db_root); // create unprivileged user and the database itself
// importing data to new database $content .= $this->_createDatabaseAndUser($db_root);
$content .= $this->_importDatabaseData(); // importing data to new database
$content .= $this->_importDatabaseData();
}
if (! $this->_abort) { if (! $this->_abort) {
// create DB object for new database // create DB object for new database
$options = array( $options = array(
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8' 'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
); );
if (!empty($this->_data['mysql_ssl_ca_file'])) {
$options[\PDO::MYSQL_ATTR_SSL_CA] = $this->_data['mysql_ssl_ca_file'];
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = (bool) $this->_data['mysql_ssl_verify_server_certificate'];
}
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";"; $dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
$another_fail = false; $another_fail = false;
try { try {
@@ -324,10 +341,14 @@ class FroxlorInstall
$userdata .= "\$sql['user']='" . addcslashes($this->_data['mysql_unpriv_user'], "'\\") . "';\n"; $userdata .= "\$sql['user']='" . addcslashes($this->_data['mysql_unpriv_user'], "'\\") . "';\n";
$userdata .= "\$sql['password']='" . addcslashes($this->_data['mysql_unpriv_pass'], "'\\") . "';\n"; $userdata .= "\$sql['password']='" . addcslashes($this->_data['mysql_unpriv_pass'], "'\\") . "';\n";
$userdata .= "\$sql['db']='" . addcslashes($this->_data['mysql_database'], "'\\") . "';\n"; $userdata .= "\$sql['db']='" . addcslashes($this->_data['mysql_database'], "'\\") . "';\n";
$userdata .= "\$sql['ssl']['caFile']='" . addcslashes($this->_data['mysql_ssl_ca_file'], "'\\") . "';\n";
$userdata .= "\$sql['ssl']['verifyServerCertificate']='" . addcslashes($this->_data['mysql_ssl_verify_server_certificate'], "'\\") . "';\n";
$userdata .= "\$sql_root[0]['caption']='Default';\n"; $userdata .= "\$sql_root[0]['caption']='Default';\n";
$userdata .= "\$sql_root[0]['host']='" . addcslashes($this->_data['mysql_host'], "'\\") . "';\n"; $userdata .= "\$sql_root[0]['host']='" . addcslashes($this->_data['mysql_host'], "'\\") . "';\n";
$userdata .= "\$sql_root[0]['user']='" . addcslashes($this->_data['mysql_root_user'], "'\\") . "';\n"; $userdata .= "\$sql_root[0]['user']='" . addcslashes($this->_data['mysql_root_user'], "'\\") . "';\n";
$userdata .= "\$sql_root[0]['password']='" . addcslashes($this->_data['mysql_root_pass'], "'\\") . "';\n"; $userdata .= "\$sql_root[0]['password']='" . addcslashes($this->_data['mysql_root_pass'], "'\\") . "';\n";
$userdata .= "\$sql_root[0]['ssl']['caFile']='" . addcslashes($this->_data['mysql_ssl_ca_file'], "'\\") . "';\n";
$userdata .= "\$sql_root[0]['ssl']['verifyServerCertificate']='" . addcslashes($this->_data['mysql_ssl_verify_server_certificate'], "'\\") . "';\n";
$userdata .= "// enable debugging to browser in case of SQL errors\n"; $userdata .= "// enable debugging to browser in case of SQL errors\n";
$userdata .= "\$sql['debug'] = false;\n"; $userdata .= "\$sql['debug'] = false;\n";
$userdata .= "?>"; $userdata .= "?>";
@@ -360,6 +381,30 @@ class FroxlorInstall
return $content; return $content;
} }
/**
* generate safe unique token
*
* @param int $length
* @return string
*/
private function genUniqueToken(int $length = 16)
{
if(!isset($length) || intval($length) <= 8 ){
$length = 16;
}
if (function_exists('random_bytes')) {
return bin2hex(random_bytes($length));
}
if (function_exists('mcrypt_create_iv')) {
return bin2hex(mcrypt_create_iv($length, MCRYPT_DEV_URANDOM));
}
if (function_exists('openssl_random_pseudo_bytes')) {
return bin2hex(openssl_random_pseudo_bytes($length));
}
// if everything else fails, use unsafe fallback
return md5(uniqid(microtime(), 1));
}
/** /**
* create corresponding entries in froxlor database * create corresponding entries in froxlor database
* *
@@ -403,8 +448,8 @@ class FroxlorInstall
$content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']); $content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']);
$ins_data = array( $ins_data = array(
'loginname' => $this->_data['admin_user'], 'loginname' => $this->_data['admin_user'],
/* use SHA256 default crypt */ /* use SHA256 default crypt */
'password' => crypt($this->_data['admin_pass1'], '$5$' . md5(uniqid(microtime(), 1)) . md5(uniqid(microtime(), 1))), 'password' => crypt($this->_data['admin_pass1'], '$5$' . $this->genUniqueToken() . $this->genUniqueToken()),
'email' => 'admin@' . $this->_data['servername'], 'email' => 'admin@' . $this->_data['servername'],
'deflang' => $this->_languages[$this->_activelng] 'deflang' => $this->_languages[$this->_activelng]
); );
@@ -555,6 +600,12 @@ class FroxlorInstall
$options = array( $options = array(
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8' 'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
); );
if (!empty($this->_data['mysql_ssl_ca_file'])) {
$options[\PDO::MYSQL_ATTR_SSL_CA] = $this->_data['mysql_ssl_ca_file'];
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = (bool) $this->_data['mysql_ssl_verify_server_certificate'];
}
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";"; $dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
$fatal_fail = false; $fatal_fail = false;
try { try {
@@ -733,39 +784,59 @@ class FroxlorInstall
)); ));
$rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn(); $rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn();
$content .= $this->_status_message('begin', $this->_lng['install']['check_db_exists']);
// check result // check result
if ($result_stmt !== false && $rows > 0) { if ($result_stmt !== false && $rows > 0) {
$tables_exist = true; $tables_exist = true;
} }
if ($tables_exist) { if ($tables_exist) {
// tell what's going on if ((int)$this->_data['mysql_forcecreate'] > 0) {
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']); // 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 // create temporary backup-filename
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql"; $filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
// look for mysqldump // look for mysqldump
$do_backup = false; $do_backup = false;
if (file_exists("/usr/bin/mysqldump")) { if (file_exists("/usr/bin/mysqldump")) {
$do_backup = true; $do_backup = true;
$mysql_dump = '/usr/bin/mysqldump'; $mysql_dump = '/usr/bin/mysqldump';
} elseif (file_exists("/usr/local/bin/mysqldump")) { } elseif (file_exists("/usr/local/bin/mysqldump")) {
$do_backup = true; $do_backup = true;
$mysql_dump = '/usr/local/bin/mysqldump'; $mysql_dump = '/usr/local/bin/mysqldump';
} }
if ($do_backup) { // create temporary .cnf file
$command = $mysql_dump . " " . escapeshellarg($this->_data['mysql_database']) . " -u " . escapeshellarg($this->_data['mysql_root_user']) . " --password='" . escapeshellarg($this->_data['mysql_root_pass']) . "' --result-file=" . $filename; $cnffilename = "/tmp/froxlor_dump.cnf";
$output = exec($command); $dumpcnf = "[mysqldump]" . PHP_EOL . "password=\"" . $this->_data['mysql_root_pass'] . "\"" . PHP_EOL;
if (stristr($output, "error")) { file_put_contents($cnffilename, $dumpcnf);
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);
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 { } else {
$content .= $this->_status_message('green', 'OK (' . $filename . ')'); $content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
$this->_abort = true;
} }
} else { } 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 .= $content .= $this->_status_message('green', 'OK');
} }
return $content; return $content;
@@ -801,6 +872,8 @@ class FroxlorInstall
$formdata .= $this->_getSectionItemString('mysql_host', true); $formdata .= $this->_getSectionItemString('mysql_host', true);
// database // database
$formdata .= $this->_getSectionItemString('mysql_database', true); $formdata .= $this->_getSectionItemString('mysql_database', true);
// database overwrite if exists?
$formdata .= $this->_getSectionItemYesNo('mysql_forcecreate', false);
// unpriv-user has to be different from root // unpriv-user has to be different from root
if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) { if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) {
$style = 'blue'; $style = 'blue';
@@ -830,6 +903,9 @@ class FroxlorInstall
} }
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password'); $formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
$formdata .= $this->_getSectionItemString('mysql_ssl_ca_file', false, $style);
$formdata .= $this->_getSectionItemYesNo('mysql_ssl_verify_server_certificate', false, $style);
/** /**
* admin data * admin data
*/ */
@@ -1363,7 +1439,14 @@ class FroxlorInstall
// read os-release // read os-release
if (file_exists('/etc/os-release')) { if (file_exists('/etc/os-release')) {
$os_dist = parse_ini_file('/etc/os-release', false); $os_dist_content = file_get_contents('/etc/os-release');
$os_dist_arr = explode("\n", $os_dist_content);
$os_dist = [];
foreach ($os_dist_arr as $os_dist_line) {
if (empty(trim($os_dist_line))) continue;
$tmp = explode("=", $os_dist_line);
$os_dist[$tmp[0]] = str_replace('"', "", trim($tmp[1]));
}
if (is_array($os_dist) && array_key_exists('ID', $os_dist) && array_key_exists('VERSION_ID', $os_dist)) { if (is_array($os_dist) && array_key_exists('ID', $os_dist) && array_key_exists('VERSION_ID', $os_dist)) {
$os_version = explode('.', $os_dist['VERSION_ID'])[0]; $os_version = explode('.', $os_dist['VERSION_ID'])[0];
} }

View File

@@ -53,10 +53,13 @@ $lng['install']['welcometext'] = 'Thank you for choosing Froxlor. Please fill ou
$lng['install']['database'] = 'Database connection'; $lng['install']['database'] = 'Database connection';
$lng['install']['mysql_host'] = 'MySQL-Hostname'; $lng['install']['mysql_host'] = 'MySQL-Hostname';
$lng['install']['mysql_database'] = 'Database name'; $lng['install']['mysql_database'] = 'Database name';
$lng['install']['mysql_forcecreate'] = 'Backup and overwrite database if exists?';
$lng['install']['mysql_unpriv_user'] = 'Username for the unprivileged MySQL-account'; $lng['install']['mysql_unpriv_user'] = 'Username for the unprivileged MySQL-account';
$lng['install']['mysql_unpriv_pass'] = 'Password for the unprivileged MySQL-account'; $lng['install']['mysql_unpriv_pass'] = 'Password for the unprivileged MySQL-account';
$lng['install']['mysql_root_user'] = 'Username for the MySQL-root-account'; $lng['install']['mysql_root_user'] = 'Username for the MySQL-root-account';
$lng['install']['mysql_root_pass'] = 'Password for the MySQL-root-account'; $lng['install']['mysql_root_pass'] = 'Password for the MySQL-root-account';
$lng['install']['mysql_ssl_ca_file'] = 'MySQL server certificate file path';
$lng['install']['mysql_ssl_verify_server_certificate'] = 'Verify MySQL TLS certificate';
$lng['install']['admin_account'] = 'Administrator Account'; $lng['install']['admin_account'] = 'Administrator Account';
$lng['install']['admin_user'] = 'Administrator Username'; $lng['install']['admin_user'] = 'Administrator Username';
$lng['install']['admin_pass1'] = 'Administrator Password'; $lng['install']['admin_pass1'] = 'Administrator Password';
@@ -79,6 +82,8 @@ $lng['install']['testing_mysql_fail'] = 'There seems to be a problem with the da
$lng['install']['backup_old_db'] = 'Creating backup of old database...'; $lng['install']['backup_old_db'] = 'Creating backup of old database...';
$lng['install']['backup_binary_missing'] = 'Could not find mysqldump'; $lng['install']['backup_binary_missing'] = 'Could not find mysqldump';
$lng['install']['backup_failed'] = 'Could not backup database'; $lng['install']['backup_failed'] = 'Could not backup database';
$lng['install']['check_db_exists'] = 'Checking database...';
$lng['install']['db_exists'] = 'Unable to create database. A database with the same name exists and should not be overwritten';
$lng['install']['prepare_db'] = 'Preparing database...'; $lng['install']['prepare_db'] = 'Preparing database...';
$lng['install']['create_mysqluser_and_db'] = 'Creating database and username...'; $lng['install']['create_mysqluser_and_db'] = 'Creating database and username...';
$lng['install']['testing_new_db'] = 'Testing if database and user have been created correctly...'; $lng['install']['testing_new_db'] = 'Testing if database and user have been created correctly...';

View File

@@ -53,10 +53,13 @@ $lng['install']['welcometext'] = 'Vielen Dank dass Sie sich für Froxlor entschi
$lng['install']['database'] = 'Datenbankverbindung'; $lng['install']['database'] = 'Datenbankverbindung';
$lng['install']['mysql_host'] = 'MySQL-Hostname'; $lng['install']['mysql_host'] = 'MySQL-Hostname';
$lng['install']['mysql_database'] = 'Datenbank Name'; $lng['install']['mysql_database'] = 'Datenbank Name';
$lng['install']['mysql_forcecreate'] = 'Datenbank sichern und überschreiben wenn vorhanden?';
$lng['install']['mysql_unpriv_user'] = 'Benutzername für den unprivilegierten MySQL-Account'; $lng['install']['mysql_unpriv_user'] = 'Benutzername für den unprivilegierten MySQL-Account';
$lng['install']['mysql_unpriv_pass'] = 'Passwort für den unprivilegierten MySQL-Account'; $lng['install']['mysql_unpriv_pass'] = 'Passwort für den unprivilegierten MySQL-Account';
$lng['install']['mysql_root_user'] = 'Benutzername für den MySQL-Root-Account'; $lng['install']['mysql_root_user'] = 'Benutzername für den MySQL-Root-Account';
$lng['install']['mysql_root_pass'] = 'Passwort für den MySQL-Root-Account'; $lng['install']['mysql_root_pass'] = 'Passwort für den MySQL-Root-Account';
$lng['install']['mysql_ssl_ca_file'] = 'MySQL-Server Zertifikatspfad';
$lng['install']['mysql_ssl_verify_server_certificate'] = 'Validieren des MySQL-Server Zertifikats';
$lng['install']['admin_account'] = 'Admin-Zugang'; $lng['install']['admin_account'] = 'Admin-Zugang';
$lng['install']['admin_user'] = 'Administrator-Benutzername'; $lng['install']['admin_user'] = 'Administrator-Benutzername';
$lng['install']['admin_pass1'] = 'Administrator-Passwort'; $lng['install']['admin_pass1'] = 'Administrator-Passwort';
@@ -79,6 +82,8 @@ $lng['install']['testing_mysql_fail'] = 'Bei der Verwendung der Datenbank gibt e
$lng['install']['backup_old_db'] = 'Sicherung vorheriger Datenbank...'; $lng['install']['backup_old_db'] = 'Sicherung vorheriger Datenbank...';
$lng['install']['backup_binary_missing'] = 'Konnte mysqldump nicht finden'; $lng['install']['backup_binary_missing'] = 'Konnte mysqldump nicht finden';
$lng['install']['backup_failed'] = 'Sicherung fehlgeschlagen'; $lng['install']['backup_failed'] = 'Sicherung fehlgeschlagen';
$lng['install']['check_db_exists'] = 'Databenbank wird geprüft...';
$lng['install']['db_exists'] = 'Datenbank kann nicht erstellt werden. Eine Datenbank mit dem selben Namen existiert bereits und soll nicht überschrieben werden.';
$lng['install']['prepare_db'] = 'Datenbank wird vorbereitet...'; $lng['install']['prepare_db'] = 'Datenbank wird vorbereitet...';
$lng['install']['create_mysqluser_and_db'] = 'Erstelle Datenbank und Benutzer...'; $lng['install']['create_mysqluser_and_db'] = 'Erstelle Datenbank und Benutzer...';
$lng['install']['testing_new_db'] = 'Teste, ob Datenbank und Benutzer korrekt angelegt wurden...'; $lng['install']['testing_new_db'] = 'Teste, ob Datenbank und Benutzer korrekt angelegt wurden...';

View File

@@ -926,3 +926,25 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.27')) {
showUpdateStep("Updating from 0.10.27 to 0.10.28", false); showUpdateStep("Updating from 0.10.27 to 0.10.28", false);
\Froxlor\Froxlor::updateToVersion('0.10.28'); \Froxlor\Froxlor::updateToVersion('0.10.28');
} }
if (\Froxlor\Froxlor::isDatabaseVersion('202108180')) {
showUpdateStep("Adding czech language file", true);
Database::query("INSERT INTO `" . TABLE_PANEL_LANGUAGE . "` SET `language` = '&#268;esk&aacute; republika', `iso` = 'cs', `file` = 'lng/czech.lng.php'");
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('202109040');
}
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');
}

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) * optional, whether to create an exclusive web-logfile for this domain, default 0 (false)
* @param int $alias * @param int $alias
* optional, domain-id of a domain that the new domain should be an alias of, default 0 (none) * 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) * 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 * @param string $registration_date
* optional, date of domain registration in form of YYYY-MM-DD, default empty (none) * optional, date of domain registration in form of YYYY-MM-DD, default empty (none)
@@ -901,7 +901,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) * optional, when setting $speciallogfile to false, this needs to be set to true to confirm the action, default 0 (false)
* @param int $alias * @param int $alias
* optional, domain-id of a domain that the new domain should be an alias of, default 0 (none) * 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) * 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 * @param string $registration_date
* optional, date of domain registration in form of YYYY-MM-DD, default empty (none) * optional, date of domain registration in form of YYYY-MM-DD, default empty (none)

View File

@@ -61,7 +61,9 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true); $password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
$password = \Froxlor\System\Crypt::validatePassword($password, true); $password = \Froxlor\System\Crypt::validatePassword($password, true);
$databasedescription = \Froxlor\Validate\Validate::validate(trim($databasedescription), 'description', '', '', array(), true); $databasedescription = \Froxlor\Validate\Validate::validate(trim($databasedescription), 'description', '', '', array(), true);
$databasename = \Froxlor\Validate\Validate::validate(trim($databasename), 'database_name', '', '', 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 // validate whether the dbserver exists
$dbserver = \Froxlor\Validate\Validate::validate($dbserver, html_entity_decode($this->lng['mysql']['mysql_server']), '', '', 0, true); $dbserver = \Froxlor\Validate\Validate::validate($dbserver, html_entity_decode($this->lng['mysql']['mysql_server']), '', '', 0, true);

View File

@@ -217,7 +217,9 @@ 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 * optional number of seconds for idle-timeout if FPM is used, default is fpm-daemon-value
* @param string $limit_extensions * @param string $limit_extensions
* optional limitation of php-file-extensions if FPM is used, default is fpm-daemon-value * 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 * @access admin
* @throws \Exception * @throws \Exception
* @return string json-encoded array * @return string json-encoded array
@@ -261,6 +263,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$max_requests = $this->getParam('max_requests', true, $def_fpmconfig['max_requests']); $max_requests = $this->getParam('max_requests', true, $def_fpmconfig['max_requests']);
$idle_timeout = $this->getParam('idle_timeout', true, $def_fpmconfig['idle_timeout']); $idle_timeout = $this->getParam('idle_timeout', true, $def_fpmconfig['idle_timeout']);
$limit_extensions = $this->getParam('limit_extensions', true, $def_fpmconfig['limit_extensions']); $limit_extensions = $this->getParam('limit_extensions', true, $def_fpmconfig['limit_extensions']);
$allow_all_customers = $this->getBoolParam('allow_all_customers', true, 0);
// validation // validation
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true); $description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
@@ -367,6 +370,8 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$result = $this->apiCall('PhpSettings.get', array( $result = $this->apiCall('PhpSettings.get', array(
'id' => $ins_data['id'] 'id' => $ins_data['id']
)); ));
$this->addForAllCustomers($allow_all_customers, $ins_data['id']);
return $this->response(200, "successful", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("Not allowed to execute given command.", 403); 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 * optional number of seconds for idle-timeout if FPM is used, default is fpm-daemon-value
* @param string $limit_extensions * @param string $limit_extensions
* optional limitation of php-file-extensions if FPM is used, default is fpm-daemon-value * 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 * @access admin
* @throws \Exception * @throws \Exception
@@ -456,6 +463,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$max_requests = $this->getParam('max_requests', true, $result['max_requests']); $max_requests = $this->getParam('max_requests', true, $result['max_requests']);
$idle_timeout = $this->getParam('idle_timeout', true, $result['idle_timeout']); $idle_timeout = $this->getParam('idle_timeout', true, $result['idle_timeout']);
$limit_extensions = $this->getParam('limit_extensions', true, $result['limit_extensions']); $limit_extensions = $this->getParam('limit_extensions', true, $result['limit_extensions']);
$allow_all_customers = $this->getBoolParam('allow_all_customers', true, 0);
// validation // validation
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true); $description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
@@ -563,6 +571,8 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$result = $this->apiCall('PhpSettings.get', array( $result = $this->apiCall('PhpSettings.get', array(
'id' => $id 'id' => $id
)); ));
$this->addForAllCustomers($allow_all_customers, $id);
return $this->response(200, "successful", $result); return $this->response(200, "successful", $result);
} }
throw new \Exception("Not allowed to execute given command.", 403); throw new \Exception("Not allowed to execute given command.", 403);
@@ -618,4 +628,38 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
} }
throw new \Exception("Not allowed to execute given command.", 403); 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,16 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$phpsid_result['phpsettingid'] = intval($phpsettingid); $phpsid_result['phpsettingid'] = intval($phpsettingid);
} }
$allowed_phpconfigs = $customer['allowed_phpconfigs'];
if (! empty($allowed_phpconfigs)) {
$allowed_phpconfigs = json_decode($allowed_phpconfigs, true);
} else {
$allowed_phpconfigs = [];
}
if (! in_array($phpsid_result['phpsettingid'], $allowed_phpconfigs)) {
\Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true);
}
// actually insert domain // actually insert domain
$stmt = Database::prepare(" $stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
@@ -616,7 +626,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
// We can't enable let's encrypt for wildcard-domains // We can't enable let's encrypt for wildcard-domains
if ($iswildcarddomain == '1' && $letsencrypt == '1') { 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 // Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
@@ -638,6 +648,16 @@ 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']) . "'"); $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 = [];
}
if (! in_array($phpsettingid, $allowed_phpconfigs)) {
\Froxlor\UI\Response::standard_error('notallowedphpconfigused', '', true);
}
// handle redirect // handle redirect
if ($_doredirect) { if ($_doredirect) {
\Froxlor\Domain\Domain::updateRedirectOfDomain($id, $redirectcode); \Froxlor\Domain\Domain::updateRedirectOfDomain($id, $redirectcode);

View File

@@ -133,7 +133,7 @@ abstract class BulkAction
$new_data = array(); $new_data = array();
foreach ($this->api_params as $idx => $param) { 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]; $new_data[$param] = $data_array[$idx];
} }
} }

View File

@@ -341,13 +341,43 @@ class ConfigServicesAction extends \Froxlor\Cli\Action
// try to convert namserver hosts to ip's // try to convert namserver hosts to ip's
$ns_ips = ""; $ns_ips = "";
$known_ns_ips = [];
if (Settings::Get('system.nameservers') != '') { if (Settings::Get('system.nameservers') != '') {
$nameservers = explode(',', Settings::Get('system.nameservers')); $nameservers = explode(',', Settings::Get('system.nameservers'));
foreach ($nameservers as $nameserver) { foreach ($nameservers as $nameserver) {
$nameserver = trim($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); $nameserver_ips = \Froxlor\PhpHelper::gethostbynamel6($nameserver);
if (is_array($nameserver_ips) && count($nameserver_ips) > 0) { // append dot to hostname
$ns_ips .= implode(",", $nameserver_ips); 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'), '<SERVERIP>' => Settings::Get('system.ipaddress'),
'<NAMESERVERS>' => Settings::Get('system.nameservers'), '<NAMESERVERS>' => Settings::Get('system.nameservers'),
'<NAMESERVERS_IP>' => $ns_ips, '<NAMESERVERS_IP>' => $ns_ips,
'<AXFRSERVERS>' => Settings::Get('system.axfrservers'),
'<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'), '<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'),
'<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'), '<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'),
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'), '<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),

View File

@@ -15,7 +15,7 @@ use Froxlor\Settings;
* @author Froxlor team <team@froxlor.org> (2016-) * @author Froxlor team <team@froxlor.org> (2016-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron * @package Cron
* *
*/ */
class PowerDNS extends DnsBase class PowerDNS extends DnsBase
{ {
@@ -99,30 +99,32 @@ class PowerDNS extends DnsBase
)); ));
$pdns_domain = $pdns_domains_stmt->fetch(\PDO::FETCH_ASSOC); $pdns_domain = $pdns_domains_stmt->fetch(\PDO::FETCH_ASSOC);
$del_rec_stmt->execute(array( if ($pdns_domain && ! empty($pdns_domain['id'])) {
'did' => $pdns_domain['id'] $del_rec_stmt->execute(array(
)); 'did' => $pdns_domain['id']
$del_meta_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'] $del_dom_stmt->execute(array(
)); 'did' => $pdns_domain['id']
));
}
} }
} }
private function insertZone($domainname, $serial = 0) 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 INSERT INTO domains set `name` = :domainname, `notified_serial` = :serial, `type` = :type
"); ");
$ins_stmt->execute(array( $ins_stmt->execute(array(
'domainname' => $domainname, 'domainname' => $domainname,
'serial' => $serial, 'serial' => $serial,
'type' => strtoupper(Settings::Get('system.powerdns_mode')) 'type' => strtoupper(Settings::Get('system.powerdns_mode'))
)); ));
$lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId(); $lastid = \Froxlor\Dns\PowerDNS::getDB()->lastInsertId();
return $lastid;; return $lastid;
} }
private function insertRecords($domainid = 0, $records = array(), $origin = "") private function insertRecords($domainid = 0, $records = array(), $origin = "")

View File

@@ -131,7 +131,8 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
'ssl_key_file' => null, 'ssl_key_file' => null,
'ssl_ca_file' => null, 'ssl_ca_file' => null,
'ssl_csr_file' => null, 'ssl_csr_file' => null,
'id' => null 'id' => null,
'wwwserveralias' => 0
); );
// add to queue // 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_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_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, '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; $renew_domains[] = $certrow;
} }

View File

@@ -279,6 +279,8 @@ class Database
$host = $sql_root[self::$dbserver]['host']; $host = $sql_root[self::$dbserver]['host'];
$socket = isset($sql_root[self::$dbserver]['socket']) ? $sql_root[self::$dbserver]['socket'] : null; $socket = isset($sql_root[self::$dbserver]['socket']) ? $sql_root[self::$dbserver]['socket'] : null;
$port = isset($sql_root[self::$dbserver]['port']) ? $sql_root[self::$dbserver]['port'] : '3306'; $port = isset($sql_root[self::$dbserver]['port']) ? $sql_root[self::$dbserver]['port'] : '3306';
$sslCAFile = $sql_root[self::$dbserver]['ssl']['caFile'] ?? "";
$sslVerifyServerCertificate = $sql_root[self::$dbserver]['ssl']['verifyServerCertificate'] ?? false;
} else { } else {
$caption = 'localhost'; $caption = 'localhost';
$user = $sql["user"]; $user = $sql["user"];
@@ -286,6 +288,8 @@ class Database
$host = $sql["host"]; $host = $sql["host"];
$socket = isset($sql['socket']) ? $sql['socket'] : null; $socket = isset($sql['socket']) ? $sql['socket'] : null;
$port = isset($sql['port']) ? $sql['port'] : '3306'; $port = isset($sql['port']) ? $sql['port'] : '3306';
$sslCAFile = $sql['ssl']['caFile'] ?? "";
$sslVerifyServerCertificate = $sql['ssl']['verifyServerCertificate'] ?? false;
} }
// save sql-access-data if needed // save sql-access-data if needed
@@ -297,7 +301,9 @@ class Database
'port' => $port, 'port' => $port,
'socket' => $socket, 'socket' => $socket,
'db' => $sql["db"], 'db' => $sql["db"],
'caption' => $caption 'caption' => $caption,
'ssl_ca_file' => $sslCAFile,
'ssl_verify_server_certificate' => $sslVerifyServerCertificate
); );
} }
@@ -321,6 +327,11 @@ class Database
} else { } else {
$dbconf["dsn"]['host'] = $host; $dbconf["dsn"]['host'] = $host;
$dbconf["dsn"]['port'] = $port; $dbconf["dsn"]['port'] = $port;
if (!empty(self::$sqldata['ssl_ca_file'])) {
$options[\PDO::MYSQL_ATTR_SSL_CA] = self::$sqldata['ssl_ca_file'];
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = (bool) self::$sqldata['ssl_verify_server_certificate'];
}
} }
self::$dbname = $sql["db"]; self::$dbname = $sql["db"];

View File

@@ -82,10 +82,10 @@ class DbManager
// get all usernames from db-manager // get all usernames from db-manager
$allsqlusers = $this->getManager()->getAllSqlUsers(); $allsqlusers = $this->getManager()->getAllSqlUsers();
// generate random username // generate random username
$username = $loginname . '-' . substr(md5(uniqid(microtime(), 1)), 20, 3); $username = $loginname . '-' . substr(\Froxlor\Froxlor::genSessionId(), 20, 3);
// check whether it exists on the DBMS // check whether it exists on the DBMS
while (in_array($username, $allsqlusers)) { while (in_array($username, $allsqlusers)) {
$username = $loginname . '-' . substr(md5(uniqid(microtime(), 1)), 20, 3); $username = $loginname . '-' . substr(\Froxlor\Froxlor::genSessionId(), 20, 3);
} }
} elseif (strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME') { } elseif (strtoupper(Settings::Get('customer.mysqlprefix')) == 'DBNAME') {
$username = $loginname; $username = $loginname;

View File

@@ -62,6 +62,11 @@ class PowerDNS
} else { } else {
$dbconf["dsn"]['host'] = $mysql_data['gmysql-host']; $dbconf["dsn"]['host'] = $mysql_data['gmysql-host'];
$dbconf["dsn"]['port'] = $mysql_data['gmysql-port']; $dbconf["dsn"]['port'] = $mysql_data['gmysql-port'];
if (!empty($mysql_data['gmysql-ssl-ca-file'])) {
$options[\PDO::MYSQL_ATTR_SSL_CA] = $mysql_data['gmysql-ssl-ca-file'];
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = (bool) $mysql_data['gmysql-ssl-verify-server-certificate'];
}
} }
// add options to dsn-string // add options to dsn-string

View File

@@ -340,7 +340,7 @@ class Domain
// run remove command // run remove command
\Froxlor\FileDir::safe_exec($acmesh . $params); \Froxlor\FileDir::safe_exec($acmesh . $params);
// remove certificates directory // remove certificates directory
@unlink($certificate_folder); \Froxlor\FileDir::safe_exec('rm -rf ' . $certificate_folder);
} }
} }
return true; return true;

View File

@@ -7,10 +7,10 @@ final class Froxlor
{ {
// Main version variable // Main version variable
const VERSION = '0.10.28'; const VERSION = '0.10.30';
// Database version (YYYYMMDDC where C is a daily counter) // Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '202108180'; const DBVERSION = '202109040';
// Distribution branding-tag (used for Debian etc.) // Distribution branding-tag (used for Debian etc.)
const BRANDING = ''; const BRANDING = '';
@@ -202,6 +202,30 @@ final class Froxlor
return false; return false;
} }
/**
* generate safe unique session id
*
* @param int $length
* @return string
*/
public static function genSessionId(int $length = 16)
{
if(!isset($length) || intval($length) <= 8 ){
$length = 16;
}
if (function_exists('random_bytes')) {
return bin2hex(random_bytes($length));
}
if (function_exists('mcrypt_create_iv')) {
return bin2hex(mcrypt_create_iv($length, MCRYPT_DEV_URANDOM));
}
if (function_exists('openssl_random_pseudo_bytes')) {
return bin2hex(openssl_random_pseudo_bytes($length));
}
// if everything else fails, use unsafe fallback
return md5(uniqid(microtime(), 1));
}
/** /**
* compare of froxlor versions * compare of froxlor versions
* *

View File

@@ -382,13 +382,12 @@ exit "$RETVAL"
</daemon> </daemon>
<daemon name="powerdns" title="PowerDNS (standalone)"> <daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -907,7 +906,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -917,6 +916,8 @@ gmysql-dbname=pdns
gmysql-user=powerdns gmysql-user=powerdns
gmysql-group=client gmysql-group=client
gmysql-password= gmysql-password=
#gmysql-ssl-ca-file=
#gmysql-ssl-verify-server-certificate=0
]]> ]]>
</content> </content>
</file> </file>
@@ -925,13 +926,12 @@ gmysql-password=
<daemon name="powerdns_bind" <daemon name="powerdns_bind"
title="PowerDNS via bind-backend"> title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> # 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1451,7 +1451,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -3877,6 +3877,15 @@ plugin {
# (Currently only relevant for ManageSieve) # (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0 #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> </content>
</file> </file>

View File

@@ -75,7 +75,7 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}
]]> ]]>
</content> </content>
</file> </file>
<command><![CDATA[/etc/init.d/apache2 restart]]></command> <command><![CDATA[service apache2 restart]]></command>
</daemon> </daemon>
<!-- HTTP Lighttpd --> <!-- HTTP Lighttpd -->
<daemon name="lighttpd" title="LigHTTPd"> <daemon name="lighttpd" title="LigHTTPd">
@@ -139,7 +139,7 @@ include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
</command> </command>
<command><![CDATA[lighty-disable-mod cgi]]></command> <command><![CDATA[lighty-disable-mod cgi]]></command>
<command><![CDATA[lighty-disable-mod fastcgi]]></command> <command><![CDATA[lighty-disable-mod fastcgi]]></command>
<command><![CDATA[/etc/init.d/lighttpd restart]]></command> <command><![CDATA[service lighttpd restart]]></command>
</daemon> </daemon>
<!-- HTTP Nginx --> <!-- HTTP Nginx -->
<daemon name="nginx" title="nginx"> <daemon name="nginx" title="nginx">
@@ -355,7 +355,7 @@ exit "$RETVAL"
</visibility> </visibility>
<content><![CDATA[/etc/init.d/php-fcgi restart]]></content> <content><![CDATA[/etc/init.d/php-fcgi restart]]></content>
</command> </command>
<command><![CDATA[/etc/init.d/nginx restart]]></command> <command><![CDATA[service nginx restart]]></command>
</daemon> </daemon>
</service> </service>
<!--DNS --> <!--DNS -->
@@ -367,17 +367,16 @@ exit "$RETVAL"
<command><![CDATA[touch {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command> <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[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[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>
<daemon name="powerdns" title="PowerDNS (standalone)"> <daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -881,7 +880,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -891,21 +890,22 @@ gmysql-dbname=pdns
gmysql-user=powerdns gmysql-user=powerdns
gmysql-group=client gmysql-group=client
gmysql-password= gmysql-password=
#gmysql-ssl-ca-file=
#gmysql-ssl-verify-server-certificate=0
]]> ]]>
</content> </content>
</file> </file>
<command><![CDATA[/etc/init.d/pdns restart]]></command> <command><![CDATA[service pdns restart]]></command>
</daemon> </daemon>
<daemon name="powerdns_bind" <daemon name="powerdns_bind"
title="PowerDNS via bind-backend"> title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> # 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1410,7 +1410,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -1426,7 +1426,7 @@ bind-check-interval=180
]]> ]]>
</content> </content>
</file> </file>
<command><![CDATA[/etc/init.d/pdns restart]]></command> <command><![CDATA[service pdns restart]]></command>
</daemon> </daemon>
</service> </service>
<!-- SMTP services --> <!-- SMTP services -->
@@ -1549,7 +1549,7 @@ root: root@<SERVERNAME>
</files> </files>
<commands index="3"> <commands index="3">
<command><![CDATA[newaliases]]></command> <command><![CDATA[newaliases]]></command>
<command><![CDATA[/etc/init.d/postfix restart]]></command> <command><![CDATA[service postfix restart]]></command>
</commands> </commands>
</general> </general>
<!-- postfix with dovecot --> <!-- postfix with dovecot -->
@@ -4084,12 +4084,21 @@ plugin {
# the source line numbers. # the source line numbers.
#sieve_trace_addresses = no #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> </content>
</file> </file>
</files> </files>
<commands index="1"> <commands index="1">
<command><![CDATA[/etc/init.d/dovecot restart]]></command> <command><![CDATA[service dovecot restart]]></command>
</commands> </commands>
</general> </general>
<!-- Dovecot with postfix --> <!-- Dovecot with postfix -->
@@ -4516,7 +4525,7 @@ TLSVerifyClient off
]]> ]]>
</content> </content>
</file> </file>
<command><![CDATA[/etc/init.d/proftpd restart]]></command> <command><![CDATA[service proftpd restart]]></command>
</daemon> </daemon>
<!-- Pureftpd --> <!-- Pureftpd -->
<daemon name="pureftpd" title="PureFTPd"> <daemon name="pureftpd" title="PureFTPd">
@@ -4742,7 +4751,7 @@ UPLOADGID=
]]> ]]>
</content> </content>
</file> </file>
<command><![CDATA[/etc/init.d/pure-ftpd-mysql restart]]></command> <command><![CDATA[service pure-ftpd-mysql restart]]></command>
</daemon> </daemon>
</service> </service>
<!-- System tools/services --> <!-- System tools/services -->
@@ -4836,7 +4845,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command> <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_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.3]]></command> <command><![CDATA[a2dismod php7.4]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->
@@ -4869,12 +4878,12 @@ aliases: files
</visibility> </visibility>
<visibility mode="true">{{settings.phpfpm.enabled_ownvhost}} <visibility mode="true">{{settings.phpfpm.enabled_ownvhost}}
</visibility> </visibility>
<command><![CDATA[a2dismod php7.3]]></command> <command><![CDATA[a2dismod php7.4]]></command>
</commands> </commands>
<commands index="5"> <commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}} <visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility> </visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command> <command><![CDATA[service apache2 restart]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->

View File

@@ -371,13 +371,12 @@ exit "$RETVAL"
</daemon> </daemon>
<daemon name="powerdns" title="PowerDNS (standalone)"> <daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -881,7 +880,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -891,6 +890,8 @@ gmysql-dbname=pdns
gmysql-user=powerdns gmysql-user=powerdns
gmysql-group=client gmysql-group=client
gmysql-password= gmysql-password=
#gmysql-ssl-ca-file=
#gmysql-ssl-verify-server-certificate=0
]]> ]]>
</content> </content>
</file> </file>
@@ -899,13 +900,12 @@ gmysql-password=
<daemon name="powerdns_bind" <daemon name="powerdns_bind"
title="PowerDNS via bind-backend"> title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> # 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1410,7 +1410,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -4079,6 +4079,15 @@ plugin {
# the source line numbers. # the source line numbers.
#sieve_trace_addresses = no #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> </content>
</file> </file>

View File

@@ -1712,6 +1712,15 @@ plugin {
# (Currently only relevant for ManageSieve) # (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0 #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> </content>
</file> </file>

View File

@@ -1713,6 +1713,15 @@ plugin {
# (Currently only relevant for ManageSieve) # (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0 #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> </content>
</file> </file>

View File

@@ -369,13 +369,12 @@ exit "$RETVAL"
</daemon> </daemon>
<daemon name="powerdns" title="PowerDNS (standalone)"> <daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -894,7 +893,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -904,6 +903,8 @@ gmysql-dbname=pdns
gmysql-user=powerdns gmysql-user=powerdns
gmysql-group=client gmysql-group=client
gmysql-password= gmysql-password=
#gmysql-ssl-ca-file=
#gmysql-ssl-verify-server-certificate=0
]]> ]]>
</content> </content>
</file> </file>
@@ -912,13 +913,12 @@ gmysql-password=
<daemon name="powerdns_bind" <daemon name="powerdns_bind"
title="PowerDNS via bind-backend"> title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> # 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1438,7 +1438,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -3293,6 +3293,15 @@ plugin {
# (Currently only relevant for ManageSieve) # (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0 #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> </content>
</file> </file>

View File

@@ -391,14 +391,13 @@ mail IN A <SERVERIP>
</daemon> </daemon>
<daemon name="powerdns" title="PowerDNS (standalone)"> <daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[emerge net-dns/pdns]]></install> <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[ <content><![CDATA[
# Autogenerated configuration file template # Autogenerated configuration file template
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -902,7 +901,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -912,6 +911,8 @@ gmysql-dbname=pdns
gmysql-user=powerdns gmysql-user=powerdns
gmysql-group=client gmysql-group=client
gmysql-password= gmysql-password=
#gmysql-ssl-ca-file=
#gmysql-ssl-verify-server-certificate=0
]]> ]]>
</content> </content>
</file> </file>
@@ -920,14 +921,13 @@ gmysql-password=
<daemon name="powerdns_bind" <daemon name="powerdns_bind"
title="PowerDNS via bind-backend"> title="PowerDNS via bind-backend">
<install><![CDATA[emerge net-dns/pdns]]></install> <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[ <content><![CDATA[
# Autogenerated configuration file template # Autogenerated configuration file template
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1431,7 +1431,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
#local-ipv6=YOUR_IPv6_(if_any) #local-ipv6=YOUR_IPv6_(if_any)
bind-config=<BIND_CONFIG_PATH>named.conf bind-config=<BIND_CONFIG_PATH>named.conf
@@ -2345,6 +2345,15 @@ plugin {
]]> ]]>
</content> </content>
</file> </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[rc-update add dovecot default]]></command>
<command><![CDATA[/etc/init.d/dovecot restart]]></command> <command><![CDATA[/etc/init.d/dovecot restart]]></command>
</daemon> </daemon>

View File

@@ -371,13 +371,12 @@ exit "$RETVAL"
</daemon> </daemon>
<daemon name="powerdns" title="PowerDNS (standalone)"> <daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -896,7 +895,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -906,6 +905,8 @@ gmysql-dbname=pdns
gmysql-user=powerdns gmysql-user=powerdns
gmysql-group=client gmysql-group=client
gmysql-password= gmysql-password=
#gmysql-ssl-ca-file=
#gmysql-ssl-verify-server-certificate=0
]]> ]]>
</content> </content>
</file> </file>
@@ -914,13 +915,12 @@ gmysql-password=
<daemon name="powerdns_bind" <daemon name="powerdns_bind"
title="PowerDNS via bind-backend"> title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> # 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1440,7 +1440,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -3866,6 +3866,15 @@ plugin {
# (Currently only relevant for ManageSieve) # (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0 #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> </content>
</file> </file>

View File

@@ -382,13 +382,12 @@ exit "$RETVAL"
</daemon> </daemon>
<daemon name="powerdns" title="PowerDNS (standalone)"> <daemon name="powerdns" title="PowerDNS (standalone)">
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -907,7 +906,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# mysql-settings / you need to create the power-dns database for yourself! # mysql-settings / you need to create the power-dns database for yourself!
launch=gmysql launch=gmysql
@@ -917,6 +916,8 @@ gmysql-dbname=pdns
gmysql-user=powerdns gmysql-user=powerdns
gmysql-group=client gmysql-group=client
gmysql-password= gmysql-password=
#gmysql-ssl-ca-file=
#gmysql-ssl-verify-server-certificate=0
]]> ]]>
</content> </content>
</file> </file>
@@ -925,13 +926,12 @@ gmysql-password=
<daemon name="powerdns_bind" <daemon name="powerdns_bind"
title="PowerDNS via bind-backend"> title="PowerDNS via bind-backend">
<install><![CDATA[apt-get install pdns-server]]></install> <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[ <content><![CDATA[
################################# #################################
# allow-axfr-ips Allow zonetransfers only to these subnets # allow-axfr-ips Allow zonetransfers only to these subnets
# #
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP> # 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. # allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
@@ -1451,7 +1451,7 @@ include-dir=/etc/powerdns/froxlor/
</file> </file>
<command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command> <command><![CDATA[mkdir -p /etc/powerdns/froxlor/]]></command>
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" <file name="/etc/powerdns/froxlor/pdns_froxlor.conf"
chown="root:root" chmod="600"> chown="root:pdns" chmod="640">
<content><![CDATA[ <content><![CDATA[
# Bind backend configuration # Bind backend configuration
@@ -3877,6 +3877,15 @@ plugin {
# (Currently only relevant for ManageSieve) # (Currently only relevant for ManageSieve)
#sieve_quota_max_storage = 0 #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> </content>
</file> </file>

View File

@@ -179,6 +179,18 @@ return array(
'cols' => 80, 'cols' => 80,
'rows' => 20, 'rows' => 20,
'value' => $result['phpsettings'] '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, 'cols' => 80,
'rows' => 20, 'rows' => 20,
'value' => $result['phpsettings'] '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

@@ -103,7 +103,7 @@ unset($_);
unset($value); unset($value);
unset($key); unset($key);
$filename = htmlentities(basename($_SERVER['PHP_SELF'])); $filename = htmlentities(basename($_SERVER['SCRIPT_NAME']));
// check whether the userdata file exists // check whether the userdata file exists
if (! file_exists(\Froxlor\Froxlor::getInstallDir() . '/lib/userdata.inc.php')) { if (! file_exists(\Froxlor\Froxlor::getInstallDir() . '/lib/userdata.inc.php')) {
@@ -161,7 +161,9 @@ $idna_convert = new \Froxlor\Idna\IdnaWrapper();
/** /**
* If Froxlor was called via HTTPS -> enforce it for the next time by settings HSTS header according to settings * If Froxlor was called via HTTPS -> enforce it for the next time by settings HSTS header according to settings
*/ */
$is_ssl = false;
if (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) { if (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) {
$is_ssl = true;
$maxage = Settings::Get('system.hsts_maxage'); $maxage = Settings::Get('system.hsts_maxage');
if (empty($maxage)) { if (empty($maxage)) {
$maxage = 0; $maxage = 0;
@@ -217,6 +219,8 @@ if (isset($s) && $s != "" && $nosession != 1) {
ini_set("session.name", "s"); ini_set("session.name", "s");
ini_set("url_rewriter.tags", ""); ini_set("url_rewriter.tags", "");
ini_set("session.use_cookies", false); ini_set("session.use_cookies", false);
ini_set("session.cookie_httponly", true);
ini_set("session.cookie_secure", $is_ssl);
session_id($s); session_id($s);
session_start(); session_start();
$query = "SELECT `s`.*, `u`.* FROM `" . TABLE_PANEL_SESSIONS . "` `s` LEFT JOIN `"; $query = "SELECT `s`.*, `u`.* FROM `" . TABLE_PANEL_SESSIONS . "` `s` LEFT JOIN `";

View File

@@ -382,7 +382,7 @@ $lng['serversettings']['pathedit']['description'] = 'Měla by cesta být na výb
$lng['serversettings']['nameservers']['title'] = 'Názvy serverů'; $lng['serversettings']['nameservers']['title'] = 'Názvy serverů';
$lng['serversettings']['nameservers']['description'] = 'Seznam oddělený čárkami obsahující názvy hostitelů všech jmenných serverů. První bude primární.'; $lng['serversettings']['nameservers']['description'] = 'Seznam oddělený čárkami obsahující názvy hostitelů všech jmenných serverů. První bude primární.';
$lng['serversettings']['mxservers']['title'] = 'MX servery'; $lng['serversettings']['mxservers']['title'] = 'MX servery';
$lng['serversettings']['mxservers']['description'] = 'Seznam oddělený čárkami obsahující dvojici čísla a jméno hostitele oddělené mezerou (např. \ '10 mx.example.com \ ') obsahující servery mx.'; $lng['serversettings']['mxservers']['description'] = 'Seznam oddělený čárkami obsahující dvojici čísla a jméno hostitele oddělené mezerou (např. \'10 mx.example.com\') obsahující servery mx.';
/** /**
* CHANGED BETWEEN 1.2.12 and 1.2.13 * CHANGED BETWEEN 1.2.12 and 1.2.13

View File

@@ -2131,3 +2131,7 @@ $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_exists'] = 'The given group already exists on the system.';
$lng['error']['local_group_invalid'] = 'The given group name is invalid'; $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']['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.';

View File

@@ -1777,3 +1777,7 @@ $lng['serversettings']['froxlorusergroup']['description'] = 'Voraussetzung hierf
$lng['error']['local_group_exists'] = 'Die angegebene Gruppe existiert bereits auf dem System'; $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']['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']['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.';

View File

@@ -10,7 +10,7 @@ $header
</div> </div>
</if> </if>
<section class="loginsec"> <section class="loginsec">
<form method="post" action="$filename" enctype="application/x-www-form-urlencoded"> <form method="post" action="index.php" enctype="application/x-www-form-urlencoded">
<fieldset> <fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['login']['presend']}</legend> <legend>Froxlor&nbsp;-&nbsp;{$lng['login']['presend']}</legend>
<p> <p>

View File

@@ -25,7 +25,7 @@ $header
</if> </if>
<section class="loginsec"> <section class="loginsec">
<form method="post" action="$filename" enctype="application/x-www-form-urlencoded"> <form method="post" action="index.php" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="script" value="{$lastscript}" /> <input type="hidden" name="script" value="{$lastscript}" />
<input type="hidden" name="qrystr" value="{$lastqrystr}" /> <input type="hidden" name="qrystr" value="{$lastqrystr}" />
<fieldset> <fieldset>

View File

@@ -1,41 +0,0 @@
<article class="login bradius">
<header class="dark">
<img src="{$header_logo_login}" alt="{t}Froxlor Server Management Panel{/t}" />
</header>
{if isset($successmessage)}
<div class="successcontainer bradius">
<div class="successtitle">{t}Success{/t}</div>
<div class="success">{$successmessage}</div>
</div>
{/if}
{if isset($errormessage)}
<div class="errorcontainer bradius">
<div class="errortitle">{t}Error{/t}</div>
<div class="error">{$errormessage}</div>
</div>
{/if}
<section class="loginsec">
<form method="post" action="webftp.php" enctype="application/x-www-form-urlencoded">
<fieldset>
<legend>{t}Froxlor - WebFTP - Login{/t}</legend>
<p>
<label for="loginname">{t}Username{/t}:</label>&nbsp;
<input type="text" name="loginname" id="loginname" value="" required/>
</p>
<p>
<label for="password">{t}Password{/t}:</label>&nbsp;
<input type="password" name="password" id="password" required/>
</p>
<p class="submit">
<input type="hidden" name="send" value="send" />
<input type="submit" value="{t}Login{/t}" />
</p>
</fieldset>
</form>
<aside>&nbsp;</aside>
</section>
</article>

View File

@@ -11,7 +11,7 @@ $header
</if> </if>
<section class="loginsec"> <section class="loginsec">
<h3>{$lng['pwdreminder']['choosenew']}</h3> <h3>{$lng['pwdreminder']['choosenew']}</h3>
<form method="post" action="{$filename}?action=resetpwd&resetcode={$activationcode}" enctype="application/x-www-form-urlencoded"> <form method="post" action="index.php?action=resetpwd&resetcode={$activationcode}" enctype="application/x-www-form-urlencoded">
<fieldset> <fieldset>
<legend>Froxlor&nbsp;-&nbsp;{$lng['login']['presend']}</legend> <legend>Froxlor&nbsp;-&nbsp;{$lng['login']['presend']}</legend>
<p> <p>

View File

@@ -67,7 +67,7 @@ a:hover {
<span> <img <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/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKm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7aBHvM/ZwAAAABJRU5ErkJggg=="
style="height: 13px; margin: 0 2px 3px 0; vertical-align: middle;" /> 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> Team</a>
</span> </span>
</footer> </footer>

View File

@@ -97,4 +97,34 @@ class PhpSettingsText extends TestCase
'id' => 1 'id' => 1
))->get(); ))->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\Database\Database;
use Froxlor\Settings; use Froxlor\Settings;
Database::needRoot(true);
if (TRAVIS_CI == 0) { if (TRAVIS_CI == 0) {
Database::needRoot(true);
Database::query("DROP DATABASE IF EXISTS `froxlor010`;"); Database::query("DROP DATABASE IF EXISTS `froxlor010`;");
Database::query("CREATE DATABASE `froxlor010`;"); Database::query("CREATE DATABASE `froxlor010`;");
exec("mysql -u root -p" . $rpwd . " froxlor010 < " . dirname(__DIR__) . "/install/froxlor.sql"); 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 // clear all tables
Database::query("TRUNCATE TABLE `" . TABLE_PANEL_CUSTOMERS . "`;"); 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.use_ssl', '1', true);
Settings::Set('system.froxlordirectlyviahostname', '1', true); Settings::Set('system.froxlordirectlyviahostname', '1', true);
Settings::Set('system.dns_createhostnameentry', '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.dnsenabled', '1', true);
Settings::Set('system.dns_server', 'PowerDNS', true); Settings::Set('system.dns_server', 'PowerDNS', true);
Settings::Set('phpfpm.enabled', '1', true); Settings::Set('phpfpm.enabled', '1', true);