diff --git a/install/dist/lib/debian60.lib.php b/install/dist/lib/debian60.lib.php index ecf3db3a4b1eadd884d90967b811fb1449db3d67..730058f6e77d499dec6a23dcf7455ff1eba26bb7 100644 --- a/install/dist/lib/debian60.lib.php +++ b/install/dist/lib/debian60.lib.php @@ -111,7 +111,10 @@ class installer extends installer_base { } if(version_compare($dovecot_version,2.2) >= 0) { // Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9 - replaceLine($config_dir.'/'.$configfile, 'ssl_protocols = !SSLv2 !SSLv3', 'ssl_protocols = !SSLv3', 1, 0); + $content = file_get_contents($config_dir.'/'.$configfile); + $content = str_replace('!SSLv2','',$content); + file_put_contents($config_dir.'/'.$configfile,$content); + unset($content); } } else { if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian6_dovecot.conf.master')) { diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php index c4beb0dffa6757e0179cb5fa4ed3ede79bf2aaab..b50062403eb461ec5985f8bed7a868be5b8a8847 100644 --- a/install/dist/lib/fedora.lib.php +++ b/install/dist/lib/fedora.lib.php @@ -443,6 +443,13 @@ class installer_dist extends installer_base { if(version_compare($dovecot_version,2.1) < 0) { removeLine($config_dir.'/'.$configfile, 'ssl_protocols ='); } + if(version_compare($dovecot_version,2.2) >= 0) { + // Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9 + $content = file_get_contents($config_dir.'/'.$configfile); + $content = str_replace('!SSLv2','',$content); + file_put_contents($config_dir.'/'.$configfile,$content); + unset($content); + } replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0); replaceLine($config_dir.'/'.$configfile, 'postmaster_address = webmaster@localhost', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0); } else { diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index fbef274d0bb68b54f56905a57b85fe9f9d56739b..ec279d13d01373e83749eba0b158d1d35cb42dff 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -1378,7 +1378,10 @@ class installer_base { } if(version_compare($dovecot_version,2.2) >= 0) { // Dovecot > 2.2 does not recognize !SSLv2 anymore on Debian 9 - replaceLine($config_dir.'/'.$configfile, 'ssl_protocols = !SSLv2 !SSLv3', 'ssl_protocols = !SSLv3', 1, 0); + $content = file_get_contents($config_dir.'/'.$configfile); + $content = str_replace('!SSLv2','',$content); + file_put_contents($config_dir.'/'.$configfile,$content); + unset($content); } } diff --git a/install/patches/upd_0086.php b/install/patches/upd_0086.php new file mode 100644 index 0000000000000000000000000000000000000000..045c48b2f3e0acf40606118094b3d75a911fb183 --- /dev/null +++ b/install/patches/upd_0086.php @@ -0,0 +1,46 @@ +simple_query('Delete obsolete file ' . $file . '?', array('y', 'n', 'a', 'all', 'none'), 'y'); + if($answer == 'n') continue; + elseif($answer == 'a' || $answer == 'all') $del_all = true; + elseif($answer == 'none') break; + } + if(@is_file('/usr/local/ispconfig/' . $file) && !@is_file($curpath . '/' . $file)) { + // be sure this is not a file contained in installation! + @unlink('/usr/local/ispconfig/' . $file); + ilog('Deleted obsolete file /usr/local/ispconfig/' . $file); + $c++; + } + } + ilog($c . 'obsolete files deleted.'); + } +} + +?> diff --git a/install/tpl/debian6_dovecot-sql.conf.master b/install/tpl/debian6_dovecot-sql.conf.master index 496e9965dfbd41d8b67946a55adcd74fd2ba61cf..e05330dc26a4216d28e5d85f2918d005558232f4 100644 --- a/install/tpl/debian6_dovecot-sql.conf.master +++ b/install/tpl/debian6_dovecot-sql.conf.master @@ -19,4 +19,4 @@ user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':', # The iterate_query is required for the doveadm command only and works only on dovecot 2 servers. # Do not enable it on Dovecot 1.x servers -# iterate_query = SELECT email as user FROM mail_user WHERE `disable%Ls` = 'n' AND server_id = '{server_id}' +# iterate_query = SELECT email as user FROM mail_user WHERE server_id = '{server_id}' diff --git a/install/tpl/server.ini.master b/install/tpl/server.ini.master index cfbdfa3a06c93c755bfbc479976f10cdb76ab948..b0454cdfd80dba67701ded60b83bf63de0657775 100644 --- a/install/tpl/server.ini.master +++ b/install/tpl/server.ini.master @@ -16,6 +16,7 @@ firewall=bastille loglevel=2 admin_notify_events=1 backup_dir=/var/backup +backup_tmp=/tmp backup_dir_is_mount=n backup_mode=rootgz backup_time=0:00 diff --git a/install/tpl/system.ini.master b/install/tpl/system.ini.master index b5a09ba5ff6c87db8e162f542262956ed22b3f90..5cd9b0873724da0be26870df8e3ffac163fe1a1c 100644 --- a/install/tpl/system.ini.master +++ b/install/tpl/system.ini.master @@ -15,6 +15,8 @@ mailbox_show_backup_tab=y mailboxlist_webmail_link=y webmail_url=/webmail dkim_path=/var/lib/amavis/dkim +smtp_enabled=y +smtp_host=localhost [monitor] diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php index e6f81c6fa6bf4fc4054d91a244f4d7dd21128d69..3ee0556226758989ce3b21c48af98767f370e8c6 100644 --- a/interface/lib/classes/functions.inc.php +++ b/interface/lib/classes/functions.inc.php @@ -58,6 +58,10 @@ class functions { if($cc != '') $app->ispcmail->setHeader('Cc', $cc); if($bcc != '') $app->ispcmail->setHeader('Bcc', $bcc); + if(is_string($to) && strpos($to, ',') !== false) { + $to = preg_split('/\s*,\s*/', $to); + } + $app->ispcmail->send($to); $app->ispcmail->finish(); diff --git a/interface/lib/classes/validate_client.inc.php b/interface/lib/classes/validate_client.inc.php index 256b483c4f377a470b2175096024ebee1b26eeaf..4652e2a07b1ddc65f5776a4538ec34d4ab382db4 100644 --- a/interface/lib/classes/validate_client.inc.php +++ b/interface/lib/classes/validate_client.inc.php @@ -174,10 +174,8 @@ class validate_client { } } } - - $client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"); - - if($client){ + try { + $client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"); $params = array('countryCode' => $cc, 'vatNumber' => $vn); try{ $r = $client->checkVat($params); @@ -191,12 +189,12 @@ class validate_client { } } - // This foreach shows every single line of the returned information - /* - foreach($r as $k=>$prop){ - echo $k . ': ' . $prop; - } - */ + // This foreach shows every single line of the returned information + /* + foreach($r as $k=>$prop){ + echo $k . ': ' . $prop; + } + */ } catch(SoapFault $e) { //echo 'Error, see message: '.$e->faultstring; @@ -217,7 +215,7 @@ class validate_client { break; } } - } else { + } catch(SoapFault $e){ // Connection to host not possible, europe.eu down? // this shouldn't be the user's fault, so we return no error } diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php index df1d2befdfacce4632facb3f0ce3afb5b031ed5c..ade5d978ae56894350e17aeafc375eba1b42343a 100644 --- a/interface/web/admin/form/server_config.tform.php +++ b/interface/web/admin/form/server_config.tform.php @@ -183,6 +183,20 @@ $form["tabs"]['server'] = array( 'width' => '40', 'maxlength' => '255' ), + 'backup_tmp' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '/tmp/', + 'validators' => array( 0 => array('type' => 'NOTEMPTY', + 'errmsg' => 'tmpdir_path_error_empty'), + 1 => array ( 'type' => 'REGEX', + 'regex' => "/^\/[a-zA-Z0-9\.\-\_\/]{4,128}$/", + 'errmsg'=> 'tmpdir_path_error_regex'), + ), + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), 'backup_dir_is_mount' => array( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index f1658a00b29f0991aa1820f3f87e775de9ba29e7..ea1ce1aaf773bc0cabb0e179c337e72a26af45ad 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -323,7 +323,7 @@ $form["tabs"]['mail'] = array ( 'smtp_enabled' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', - 'default' => 'n', + 'default' => 'y', 'value' => array(0 => 'n', 1 => 'y') ), 'smtp_host' => array ( @@ -340,7 +340,7 @@ $form["tabs"]['mail'] = array ( 'type' => 'STRIPNL') ), 'formtype' => 'TEXT', - 'default' => '', + 'default' => 'localhost', 'value' => '', 'width' => '30', 'maxlength' => '255' diff --git a/interface/web/admin/lib/lang/de_server_config.lng b/interface/web/admin/lib/lang/de_server_config.lng index 1d2755fe41c147b7aa59ed8b8f8f331c2343bdcf..3f349369a72db97f3c053cfc75a08f14f31add12 100644 --- a/interface/web/admin/lib/lang/de_server_config.lng +++ b/interface/web/admin/lib/lang/de_server_config.lng @@ -81,6 +81,7 @@ $wb['awstats_data_dir_txt'] = 'AWStats Datenverzeichnis'; $wb['awstats_pl_txt'] = 'AWStats awstats.pl Script'; $wb['awstats_buildstaticpages_pl_txt'] = 'AWStats awstats_buildstaticpages.pl Script'; $wb['backup_dir_txt'] = 'Backupverzeichnis'; +$wb['backup_tmp_txt'] = 'Backup tmp-Dir (zip)'; $wb['named_conf_local_path_txt'] = 'BIND named.conf.local Pfad'; $wb['php_ini_path_cgi_txt'] = 'CGI php.ini Pfad'; $wb['php_ini_path_apache_txt'] = 'Apache php.ini Pfad'; @@ -103,6 +104,8 @@ $wb['nginx_user_txt'] = 'Nginx Benutzer'; $wb['nginx_group_txt'] = 'Nginx Gruppe'; $wb['nginx_cgi_socket_txt'] = 'Nginx CGI Socket'; $wb['backup_dir_error_empty'] = 'Backup Verzeichnis ist leer.'; +$wb['tmpdir_path_error_empty'] = 'Tmp-Dir Pfad ist leer.'; +$wb['tmpdir_path_error_regex'] = 'Invalid Tmp-Dir Pfad.'; $wb['maildir_path_error_empty'] = 'Maildir Pfad ist leer.'; $wb['homedir_path_error_empty'] = 'Homedir Pfad ist leer.'; $wb['mailuser_uid_error_empty'] = 'Mail Benutzer UID ist leer.'; diff --git a/interface/web/admin/lib/lang/en_server_config.lng b/interface/web/admin/lib/lang/en_server_config.lng index b851dae68f8f68b8a7019b7055fddba61535072c..30f6f1e8d31977ef0f964b4ad1ad5327fd291896 100644 --- a/interface/web/admin/lib/lang/en_server_config.lng +++ b/interface/web/admin/lib/lang/en_server_config.lng @@ -90,6 +90,7 @@ $wb["awstats_data_dir_txt"] = 'awstats data folder'; $wb["awstats_pl_txt"] = 'awstats.pl script'; $wb["awstats_buildstaticpages_pl_txt"] = 'awstats_buildstaticpages.pl script'; $wb["backup_dir_txt"] = 'Backup directory'; +$wb["backup_tmp_txt"] = 'Backup tmp directory for zip'; $wb["named_conf_local_path_txt"] = 'BIND named.conf.local path'; $wb["php_ini_path_cgi_txt"] = 'CGI php.ini path'; $wb["php_ini_path_apache_txt"] = 'Apache php.ini path'; @@ -101,6 +102,8 @@ $wb["fastcgi_config_syntax_txt"] = 'FastCGI config syntax'; $wb["backup_mode_txt"] = 'Backup mode'; $wb["backup_mode_userzip"] = 'Backup web files owned by web user as zip'; $wb["backup_mode_rootgz"] = 'Backup all files in web directory as root user'; +$wb['tmpdir_path_error_empty'] = 'tmp-dir Path is empty.'; +$wb['tmpdir_path_error_regex'] = 'Invalid tmp-dir path.'; $wb["backup_time_txt"] = 'Backup time'; $wb["server_type_txt"] = 'Server Type'; $wb["nginx_vhost_conf_dir_txt"] = 'Nginx Vhost config dir'; diff --git a/interface/web/admin/templates/server_config_server_edit.htm b/interface/web/admin/templates/server_config_server_edit.htm index 90be365f174f662e39cd3e3182c2e003a00400fe..df81f72846b0bc5962210fc984f4047ae2bb86a0 100644 --- a/interface/web/admin/templates/server_config_server_edit.htm +++ b/interface/web/admin/templates/server_config_server_edit.htm @@ -63,6 +63,10 @@ {tmpl_var name='backup_mode'} +
+ +
+
+ + {tmpl_var name='dkim_generate_txt'}
@@ -121,4 +124,30 @@ - + + + diff --git a/remoting_client/examples/mail_user_add.php b/remoting_client/examples/mail_user_add.php index 25e3590af10bde0a838388ca395b3481925d9836..3b7d240eccea9805b43526959ed5298ed025cc86 100644 --- a/remoting_client/examples/mail_user_add.php +++ b/remoting_client/examples/mail_user_add.php @@ -29,8 +29,8 @@ try { 'cc' => '', 'homedir' => '/var/vmail', 'autoresponder' => 'n', - 'autoresponder_start_date' => array('day' => 1, 'month' => 7, 'year' => 2012, 'hour' => 0, 'minute' => 0), - 'autoresponder_end_date' => array('day' => 20, 'month' => 7, 'year' => 2012, 'hour' => 0, 'minute' => 0), + 'autoresponder_start_date' => '', + 'autoresponder_end_date' => '', 'autoresponder_text' => 'hallo', 'move_junk' => 'n', 'custom_mailfilter' => 'spam', diff --git a/server/conf/nginx_vhost.conf.master b/server/conf/nginx_vhost.conf.master index cdf1cb4c15a569d2d0b9af18a0c85c474a2a1d5b..d80fff3e01298e0979b0bee04dce0f789a9ae90b 100644 --- a/server/conf/nginx_vhost.conf.master +++ b/server/conf/nginx_vhost.conf.master @@ -334,8 +334,19 @@ server { } + ## no redirect for acme + location ^~ /.well-known/acme-challenge/ { + access_log off; + log_not_found off; + root /usr/local/ispconfig/interface/acme/; + autoindex off; + index index.html; + try_files $uri $uri/ =404; + } - rewrite ^ $request_uri? ; + location / { + rewrite ^ $request_uri? ; + } location / { diff --git a/server/conf/sieve_filter_1.2.master b/server/conf/sieve_filter_1.2.master index 47370ec0a919e4c165835e8fd5ae8734cc7b5c45..8a1c80713fb7fafda8fbed675e2a7f1183aaff23 100644 --- a/server/conf/sieve_filter_1.2.master +++ b/server/conf/sieve_filter_1.2.master @@ -1,12 +1,5 @@ require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress"]; - -# Send a copy of email to - -redirect ""; - - - # Move spam to spam folder if header :contains "X-Spam-Flag" "YES" { @@ -16,6 +9,13 @@ if header :contains "X-Spam-Flag" "YES" { } + +# Send a copy of email to + +redirect ""; + + + keep; diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 145f3b7cfc22a26b959d9a1ba8da0f3f98337612..f90e14d20ed43a6afe33fb055f16e5292de74421 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -258,16 +258,16 @@ # php as cgi enabled - ScriptAlias /php5-cgi - Action php5-cgi /php5-cgi + ScriptAlias /php-cgi + Action php-cgi /php-cgi - SetHandler php5-cgi + SetHandler php-cgi - SetHandler php5-cgi + SetHandler php-cgi @@ -354,10 +354,10 @@ - SetHandler php5-fcgi + SetHandler php-fcgi - SetHandler php5-fcgi + SetHandler php-fcgi @@ -365,20 +365,20 @@ - SetHandler php5-fcgi + SetHandler php-fcgi - SetHandler php5-fcgi + SetHandler php-fcgi - Action php5-fcgi /php5-fcgi virtual - Alias /php5-fcgi {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} + Action php-fcgi /php-fcgi virtual + Alias /php-fcgi {tmpl_var name='document_root'}/cgi-bin/php-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} - FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1: -pass-header Authorization -pass-header Content-Type + FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -host 127.0.0.1: -pass-header Authorization -pass-header Content-Type - FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket -pass-header Authorization -pass-header Content-Type + FastCgiExternalServer {tmpl_var name='document_root'}/cgi-bin/php-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'} -idle-timeout 300 -socket -pass-header Authorization -pass-header Content-Type @@ -507,7 +507,7 @@ RewriteCond %{REQUEST_URI} !^/webdav/ - RewriteCond %{REQUEST_URI} !^/php5-fcgi/ + RewriteCond %{REQUEST_URI} !^/php-fcgi/ RewriteCond %{REQUEST_URI} !^ RewriteRule /(.*) $1 diff --git a/server/lib/classes/cron.d/100-monitor_raid.inc.php b/server/lib/classes/cron.d/100-monitor_raid.inc.php index 3349ffbf444241e21e70b90acf2508808df0666c..d1a9a53455c6a70e2efab0a561c1d7e21b1e6404 100644 --- a/server/lib/classes/cron.d/100-monitor_raid.inc.php +++ b/server/lib/classes/cron.d/100-monitor_raid.inc.php @@ -283,7 +283,7 @@ class cronjob_monitor_raid extends cronjob { if($retval === 0 || $retval64 === 0) { $binary=@($retval === 0)?'megacli':'megacli64'; $state = 'ok'; - $data['output'] = shell_exec($binary.' -LDInfo -Lall -aAll'); + $data['output'] = shell_exec($binary.' -LDInfo -Lall -aAll -NoLog'); if (strpos($data['output'], 'Optimal') !== false) { $this->_tools->_setState($state, 'ok'); } else if (strpos($data['output'], 'Degraded') !== false) { diff --git a/server/lib/classes/cron.d/500-backup.inc.php b/server/lib/classes/cron.d/500-backup.inc.php index 5dcb2d5fc3973ec07abee3d9ee861808bd8a860e..fa574311164630cc933539b914e6ca71b5b6c6fa 100644 --- a/server/lib/classes/cron.d/500-backup.inc.php +++ b/server/lib/classes/cron.d/500-backup.inc.php @@ -54,6 +54,7 @@ class cronjob_backup extends cronjob { $global_config = $app->getconf->get_global_config('sites'); $backup_dir = trim($server_config['backup_dir']); $backup_mode = $server_config['backup_mode']; + $backup_tmp = trim($server_config['backup_tmp']); if($backup_mode == '') $backup_mode = 'userzip'; $web_config = $app->getconf->get_server_config($conf['server_id'], 'web'); @@ -77,6 +78,15 @@ class cronjob_backup extends cronjob { if( $server_config['backup_dir_is_mount'] == 'y' && !$app->system->mount_backup_dir($backup_dir) ) $run_backups = false; if($run_backups){ $web_array = array(); + + system('which pigz > /dev/null', $ret); + if($ret === 0) { + $use_pigz = true; + $zip_cmd = 'pigz'; // db-backups + } else { + $use_pigz = false; + $zip_cmd = 'gzip'; // db-backups + } //* backup only active domains $sql = "SELECT * FROM web_domain WHERE server_id = ? AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias') AND active = 'y'"; @@ -117,12 +127,16 @@ class cronjob_backup extends cronjob { if($backup_mode == 'userzip') { //* Create a .zip backup as web user and include also files owned by apache / nginx user $web_backup_file = 'web'.$web_id.'_'.date('Y-m-d_H-i').'.zip'; - exec('cd '.escapeshellarg($web_path).' && sudo -u '.escapeshellarg($web_user).' find . -group '.escapeshellarg($web_group).' -print 2> /dev/null | zip -b /tmp --exclude=./backup\*'.$backup_excludes.' --symlinks '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' -@', $tmp_output, $retval); - if($retval == 0 || $retval == 12) exec('cd '.escapeshellarg($web_path).' && sudo -u '.escapeshellarg($web_user).' find . -user '.escapeshellarg($http_server_user).' -print 2> /dev/null | zip -b /tmp --exclude=./backup\*'.$backup_excludes.' --update --symlinks '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' -@', $tmp_output, $retval); + exec('cd '.escapeshellarg($web_path).' && sudo -u '.escapeshellarg($web_user).' find . -group '.escapeshellarg($web_group).' -print 2> /dev/null | zip -b '.escapeshellarg($backup_tmp).' --exclude=./backup\*'.$backup_excludes.' --symlinks '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' -@', $tmp_output, $retval); + if($retval == 0 || $retval == 12) exec('cd '.escapeshellarg($web_path).' && sudo -u '.escapeshellarg($web_user).' find . -user '.escapeshellarg($http_server_user).' -print 2> /dev/null | zip -b '.escapeshellarg($backup_tmp).' --exclude=./backup\*'.$backup_excludes.' --update --symlinks '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' -@', $tmp_output, $retval); } else { //* Create a tar.gz backup as root user $web_backup_file = 'web'.$web_id.'_'.date('Y-m-d_H-i').'.tar.gz'; - exec('tar pczf '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' --exclude=./backup\*'.$backup_excludes.' --directory '.escapeshellarg($web_path).' .', $tmp_output, $retval); + if ($use_pigz) { + exec('tar pcf - --directory '.escapeshellarg($web_path).' . --exclude=./backup\*'.$backup_excludes.' | pigz > '.escapeshellarg($web_backup_dir.'/'.$web_backup_file), $tmp_output, $retval); + } else { + exec('tar pczf '.escapeshellarg($web_backup_dir.'/'.$web_backup_file).' --exclude=./backup\*'.$backup_excludes.' --directory '.escapeshellarg($web_path).' .', $tmp_output, $retval); +} } if($retval == 0 || ($backup_mode != 'userzip' && $retval == 1) || ($backup_mode == 'userzip' && $retval == 12)) { // tar can return 1, zip can return 12(due to harmless warings) and still create valid backups if(is_file($web_backup_dir.'/'.$web_backup_file)){ @@ -241,8 +255,8 @@ class cronjob_backup extends cronjob { $command = "mysqldump -h ".escapeshellarg($clientdb_host)." -u ".escapeshellarg($clientdb_user)." -p".escapeshellarg($clientdb_password)." -c --add-drop-table --create-options --quick --max_allowed_packet=512M --result-file='".$db_backup_dir.'/'.$db_backup_file."' '".$db_name."'"; exec($command, $tmp_output, $retval); - //* Compress the backup with gzip - if($retval == 0) exec("gzip -c '".escapeshellcmd($db_backup_dir.'/'.$db_backup_file)."' > '".escapeshellcmd($db_backup_dir.'/'.$db_backup_file).".gz'", $tmp_output, $retval); + //* Compress the backup with gzip / pigz + if($retval == 0) exec("$zip_cmd -c '".escapeshellcmd($db_backup_dir.'/'.$db_backup_file)."' > '".escapeshellcmd($db_backup_dir.'/'.$db_backup_file).".gz'", $tmp_output, $retval); if($retval == 0){ if(is_file($db_backup_dir.'/'.$db_backup_file.'.gz')){ diff --git a/server/lib/classes/cron.d/500-backup_mail.inc.php b/server/lib/classes/cron.d/500-backup_mail.inc.php index 5e84fb3417890a18d716d9ef011d1bb5b42d6d44..a6807021df866ab9f7d29986134e4bb3c7a0460f 100644 --- a/server/lib/classes/cron.d/500-backup_mail.inc.php +++ b/server/lib/classes/cron.d/500-backup_mail.inc.php @@ -59,6 +59,7 @@ class cronjob_backup_mail extends cronjob { $backup_mode = $server_config['backup_mode']; if($backup_mode == '') $backup_mode = 'userzip'; + $backup_tmp = trim($server_config['backup_tmp']); if($backup_dir != '') { $run_backups = true; @@ -72,7 +73,12 @@ class cronjob_backup_mail extends cronjob { } else { chmod(escapeshellcmd($backup_dir), $backup_dir_permissions); } - + system('which pigz > /dev/null', $ret); + if($ret === 0) { + $use_pigz = true; + } else { + $use_pigz = false; + } foreach($records as $rec) { //* Do the mailbox backup $email = $rec['email']; @@ -120,11 +126,15 @@ class cronjob_backup_mail extends cronjob { if($backup_mode == 'userzip') { $mail_backup_file.='.zip'; - exec('cd '.$this->tmp_backup_dir.' && zip '.$mail_backup_dir.'/'.$mail_backup_file.' -b /tmp -r backup > /dev/null && rm -rf backup', $tmp_output, $retval); + exec('cd '.$this->tmp_backup_dir.' && zip '.$mail_backup_dir.'/'.$mail_backup_file.' -b '.escapeshellarg($backup_tmp).' -r backup > /dev/null && rm -rf backup', $tmp_output, $retval); } else { $mail_backup_file.='.tar.gz'; - exec(escapeshellcmd('tar pczf '.$mail_backup_dir.'/'.$mail_backup_file.' --directory '.$this->tmp_backup_dir.' backup && rm -rf '.$this->tmp_backup_dir.'/backup'), $tmp_output, $retval); + if ($use_pigz) { + exec('tar pcf - --directory '.escapeshellarg($this->tmp_backup_dir).' backup | pigz > '.$mail_backup_dir.'/'.$mail_backup_file.' && rm -rf '.$this->tmp_backup_dir.'/backup', $tmp_output, $retval); + } else { + exec(escapeshellcmd('tar pczf '.$mail_backup_dir.'/'.$mail_backup_file.' --directory '.$this->tmp_backup_dir.' backup && rm -rf '.$this->tmp_backup_dir.'/backup'), $tmp_output, $retval); + } } if ($retval != 0) { @@ -144,11 +154,15 @@ class cronjob_backup_mail extends cronjob { //* create archives if($backup_mode == 'userzip') { $mail_backup_file.='.zip'; - exec('cd '.$domain_dir.' && zip '.$mail_backup_dir.'/'.$mail_backup_file.' -b /tmp -r '.$source_dir.' > /dev/null', $tmp_output, $retval); + exec('cd '.$domain_dir.' && zip '.$mail_backup_dir.'/'.$mail_backup_file.' -b '.escapeshellarg($backup_tmp).' -r '.$source_dir.' > /dev/null', $tmp_output, $retval); } else { /* Create a tar.gz backup */ $mail_backup_file.='.tar.gz'; - exec(escapeshellcmd('tar pczf '.$mail_backup_dir.'/'.$mail_backup_file.' --directory '.$domain_dir.' '.$source_dir), $tmp_output, $retval); + if ($use_pigz) { + exec('tar pcf - --directory '.escapeshellarg($domain_dir).' '.escapeshellarg($source_dir).' | pigz > '.$mail_backup_dir.'/'.$mail_backup_file, $tmp_output, $retval); + } else { + exec(escapeshellcmd('tar pczf '.$mail_backup_dir.'/'.$mail_backup_file.' --directory '.$domain_dir.' '.$source_dir), $tmp_output, $retval); + } } } diff --git a/server/plugins-available/backup_plugin.inc.php b/server/plugins-available/backup_plugin.inc.php index 6d89eb6ac26e48a5d4398eff56062aec2286aeba..11f0363c917929538e56682a41290dc80312c310 100644 --- a/server/plugins-available/backup_plugin.inc.php +++ b/server/plugins-available/backup_plugin.inc.php @@ -170,7 +170,7 @@ class backup_plugin { $sql = "DELETE FROM web_backup WHERE server_id = ? AND parent_domain_id = ? AND filename = ?"; $app->db->query($sql, $conf['server_id'], $backup['parent_domain_id'], $backup['filename']); - if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql); + if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql, $conf['server_id'], $backup['parent_domain_id'], $backup['filename']); $app->log('unlink '.$backup_dir.'/'.$backup['filename'], LOGLEVEL_DEBUG); } } diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php index 35ade14c45a9c095a6c1629ed3ebfcaa1a09e3df..14052e5b7078747e415ff2568d7c3c5662c72340 100644 --- a/server/plugins-available/mysql_clientdb_plugin.inc.php +++ b/server/plugins-available/mysql_clientdb_plugin.inc.php @@ -504,7 +504,7 @@ class mysql_clientdb_plugin { $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING); } else { // Find out users to drop and users to revoke - $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $old_host_list); + $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $old_host_list); if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); } @@ -580,7 +580,7 @@ class mysql_clientdb_plugin { $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING); } else { // Find out users to drop and users to revoke - $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $data['old']['remote_ips']); + $drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $data['old']['remote_ips']); if($drop_or_revoke_user['drop_hosts'] != '') $this->process_host_list('DROP', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['drop_hosts'], $link); if($drop_or_revoke_user['revoke_hosts'] != '') $this->process_host_list('REVOKE', $data['old']['database_name'], $old_db_ro_user['database_user'], $old_db_ro_user['database_password'], $drop_or_revoke_user['revoke_hosts'], $link); } diff --git a/server/plugins-available/shelluser_jailkit_plugin.inc.php b/server/plugins-available/shelluser_jailkit_plugin.inc.php index 295112d4230e1f77ad55b862b78f5bba577d6506..9a29a10a6fcc7da9c6cedaee82af41cc60070369 100755 --- a/server/plugins-available/shelluser_jailkit_plugin.inc.php +++ b/server/plugins-available/shelluser_jailkit_plugin.inc.php @@ -399,7 +399,7 @@ class shelluser_jailkit_plugin { if($this->data['new']['active'] != 'y') $shell = '/bin/false'; $app->system->usermod($this->data['new']['username'], 0, 0, $this->data['new']['dir'].'/.'.$jailkit_chroot_userhome, $shell); - $app->system->usermod($this->data['new']['puser'], 0, 0, $this->data['new']['dir'].'/.'.$jailkit_chroot_userhome, '/usr/sbin/jk_chrootsh'); + $app->system->usermod($this->data['new']['puser'], 0, 0, $this->data['new']['dir'].'/.'.$jailkit_chroot_puserhome, '/usr/sbin/jk_chrootsh'); $this->app->log("Added jailkit user to chroot with command: ".$command, LOGLEVEL_DEBUG);