Commit 38b0fe8f authored by jnsc's avatar jnsc
Browse files

Merge remote-tracking branch 'upstream/stable-3.1' into Various_3.1_fixes

parents f4cdb2f0 b62d0810
......@@ -11,6 +11,7 @@ $autoinstall['mysql_charset'] = 'utf8'; // default: utf8
$autoinstall['http_server'] = 'nginx'; // apache (default), nginx
$autoinstall['ispconfig_port'] = '8080'; // default: 8080
$autoinstall['ispconfig_use_ssl'] = 'y'; // y (default), n
$autoinstall['ispconfig_admin_password'] = 'admin'; // default: admin
/* SSL Settings */
$autoinstall['ssl_cert_country'] = 'AU';
......
......@@ -10,6 +10,7 @@ mysql_charset=utf8
http_server=apache
ispconfig_port=8080
ispconfig_use_ssl=y
ispconfig_admin_password=admin
[ssl_cert]
ssl_cert_country=AU
......
......@@ -546,7 +546,7 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Install ISPCon
//** Customise the port ISPConfig runs on
$ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port');
$conf['interface_password'] = $inst->free_query('Admin password', 'admin');
$conf['interface_password'] = $inst->free_query('Admin password', 'admin','ispconfig_admin_password');
if($conf['interface_password'] != 'admin') {
$check = false;
do {
......
......@@ -7,12 +7,12 @@ $wb['bad_header_lover_txt'] = 'Aime les mauvaises entêtes';
$wb['bypass_virus_checks_txt'] = 'Contourner la vérification des virus';
$wb['bypass_banned_checks_txt'] = 'Contourner la vérification des bannissements.';
$wb['bypass_header_checks_txt'] = 'Contourner la vérification des entêtes';
$wb['virus_quarantine_to_txt'] = 'Faire suivre les virus vers lemail';
$wb['spam_quarantine_to_txt'] = 'Faire suivre le spam vers lemail';
$wb['banned_quarantine_to_txt'] = 'Faire suivre les bannis vers lemail';
$wb['bad_header_quarantine_to_txt'] = 'Faire suivre les mauvaises entêtes vers lemail';
$wb['clean_quarantine_to_txt'] = 'Faire suivre ce qui est propre vers lemail';
$wb['other_quarantine_to_txt'] = 'Faire suivre les autres vers lemail';
$wb['virus_quarantine_to_txt'] = 'Faire suivre les virus vers le mail';
$wb['spam_quarantine_to_txt'] = 'Faire suivre le spam vers le mail';
$wb['banned_quarantine_to_txt'] = 'Faire suivre les bannis vers le mail';
$wb['bad_header_quarantine_to_txt'] = 'Faire suivre les mauvaises entêtes vers le mail';
$wb['clean_quarantine_to_txt'] = 'Faire suivre ce qui est propre vers le mail';
$wb['other_quarantine_to_txt'] = 'Faire suivre les autres vers le mail';
$wb['spam_tag_level_txt'] = 'Niveau du tag de SPAM';
$wb['spam_tag2_level_txt'] = 'Niveau du tag2 de SPAM';
$wb['spam_kill_level_txt'] = 'Niveau du kill de SPAM';
......
......@@ -7,12 +7,12 @@ $wb['bad_header_lover_txt'] = 'Aime les mauvaises entêtes';
$wb['bypass_virus_checks_txt'] = 'Contourner la vérification des virus';
$wb['bypass_banned_checks_txt'] = 'Contourner la vérification des bannissements.';
$wb['bypass_header_checks_txt'] = 'Contourner la vérification des entêtes';
$wb['virus_quarantine_to_txt'] = 'Faire suivre les virus vers lemail';
$wb['spam_quarantine_to_txt'] = 'Faire suivre le spam vers lemail';
$wb['banned_quarantine_to_txt'] = 'Faire suivre les bannis vers lemail';
$wb['bad_header_quarantine_to_txt'] = 'Faire suivre les mauvaises entêtes vers lemail';
$wb['clean_quarantine_to_txt'] = 'Faire suivre ce qui est propre vers lemail';
$wb['other_quarantine_to_txt'] = 'Faire suivre les autres vers lemail';
$wb['virus_quarantine_to_txt'] = 'Faire suivre les virus vers le mail';
$wb['spam_quarantine_to_txt'] = 'Faire suivre le spam vers le mail';
$wb['banned_quarantine_to_txt'] = 'Faire suivre les bannis vers le mail';
$wb['bad_header_quarantine_to_txt'] = 'Faire suivre les mauvaises entêtes vers le mail';
$wb['clean_quarantine_to_txt'] = 'Faire suivre ce qui est propre vers le mail';
$wb['other_quarantine_to_txt'] = 'Faire suivre les autres vers le mail';
$wb['spam_tag_level_txt'] = 'Niveau du tag de SPAM';
$wb['spam_tag2_level_txt'] = 'Niveau du tag2 de SPAM';
$wb['spam_kill_level_txt'] = 'Niveau du kill de SPAM';
......
......@@ -1153,11 +1153,8 @@ class apache2_plugin {
$crt_file = $ssl_dir.'/'.$domain.'.crt';
$bundle_file = $ssl_dir.'/'.$domain.'.bundle';
$vhost_data['ssl_crt_file'] = $crt_file;
$vhost_data['ssl_key_file'] = $key_file;
$vhost_data['ssl_bundle_file'] = $bundle_file;
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y') {
$domain = $data['new']['domain'];
if(substr($domain, 0, 2) === '*.') {
// wildcard domain not yet supported by letsencrypt!
$app->log('Wildcard domains not yet supported by letsencrypt, so changing ' . $domain . ' to ' . substr($domain, 2), LOGLEVEL_WARN);
......@@ -1173,6 +1170,10 @@ class apache2_plugin {
$bundle_file = $ssl_dir.'/'.$domain.'-le.bundle';
}
$vhost_data['ssl_crt_file'] = $crt_file;
$vhost_data['ssl_key_file'] = $key_file;
$vhost_data['ssl_bundle_file'] = $bundle_file;
//* Generate Let's Encrypt SSL certificat
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
......@@ -1256,8 +1257,9 @@ class apache2_plugin {
//* check is been correctly created
if(file_exists($crt_tmp_file)) {
$date = date("YmdHis");
//* TODO: check if is a symlink, if target same keep it, either remove it
if(is_file($key_file)) {
$app->system->copy($key_file, $key_file.'.old'.$date);
$app->system->copy($key_file, $key_file.'.old.'.$date);
$app->system->chmod($key_file.'.old.'.$date, 0400);
$app->system->unlink($key_file);
}
......@@ -1396,10 +1398,10 @@ class apache2_plugin {
$alias_seo_redirects = array();
switch($data['new']['subdomain']) {
case 'www':
$server_alias[] .= 'www.'.$data['new']['domain'].' ';
$server_alias[] = 'www.'.$data['new']['domain'].' ';
break;
case '*':
$server_alias[] .= '*.'.$data['new']['domain'].' ';
$server_alias[] = '*.'.$data['new']['domain'].' ';
break;
}
if(is_array($aliases)) {
......@@ -2086,8 +2088,7 @@ class apache2_plugin {
// remove letsencrypt if it exists (renew will always fail otherwise)
$old_domain = $data['old']['ssl_domain'];
if(!$old_domain) $old_domain = $data['old']['domain'];
$old_domain = $data['old']['domain'];
if(substr($old_domain, 0, 2) === '*.') {
// wildcard domain not yet supported by letsencrypt!
$old_domain = substr($old_domain, 2);
......@@ -3010,7 +3011,7 @@ class apache2_plugin {
}
if($data['new']['php'] == 'hhvm' && $data['old']['php'] != 'hhvm' || (isset($data['old']['custom_php_ini']) && $data['new']['custom_php_ini'] != $data['old']['custom_php_ini'])) {
// Custom php.ini settings
$custom_php_ini_settings = trim($data['new']['custom_php_ini']);
if(intval($data['new']['directive_snippets_id']) > 0){
......@@ -3039,7 +3040,7 @@ class apache2_plugin {
} else {
if($data['old']['system_user'] != '' && is_file('/etc/hhvm/'.$data['old']['system_user'].'.ini')) unlink('/etc/hhvm/'.$data['old']['system_user'].'.ini');
}
$content = str_replace('{SYSTEM_USER}', $data['new']['system_user'], $content);
file_put_contents('/etc/init.d/hhvm_' . $data['new']['system_user'], $content);
exec('chmod +x /etc/init.d/hhvm_' . $data['new']['system_user'] . ' >/dev/null 2>&1');
......@@ -3061,12 +3062,12 @@ class apache2_plugin {
if(is_file('/etc/hhvm/'.$data['old']['system_user'].'.ini')) unlink('/etc/hhvm/'.$data['old']['system_user'].'.ini');
}
if(is_file('/etc/monit/conf.d/hhvm_' . $data['new']['system_user']) || is_file('/etc/monit/conf.d/00-hhvm_' . $data['new']['system_user'])){
if(is_file('/etc/monit/conf.d/hhvm_' . $data['new']['system_user'])){
unlink('/etc/monit/conf.d/hhvm_' . $data['new']['system_user']);
if(is_file('/etc/monit/conf.d/hhvm_' . $data['old']['system_user']) || is_file('/etc/monit/conf.d/00-hhvm_' . $data['old']['system_user'])){
if(is_file('/etc/monit/conf.d/hhvm_' . $data['old']['system_user'])){
unlink('/etc/monit/conf.d/hhvm_' . $data['old']['system_user']);
}
if(is_file('/etc/monit/conf.d/00-hhvm_' . $data['new']['system_user'])){
unlink('/etc/monit/conf.d/00-hhvm_' . $data['new']['system_user']);
if(is_file('/etc/monit/conf.d/00-hhvm_' . $data['old']['system_user'])){
unlink('/etc/monit/conf.d/00-hhvm_' . $data['old']['system_user']);
}
exec('/etc/init.d/monit restart >/dev/null 2>&1');
}
......@@ -3224,9 +3225,9 @@ class apache2_plugin {
}
}
}
$tpl->setVar('custom_session_save_path', ($custom_session_save_path ? 'y' : 'n'));
$tpl->setLoop('custom_php_ini_settings', $final_php_ini_settings);
$app->system->file_put_contents($pool_dir.$pool_name.'.conf', $tpl->grab());
......
......@@ -129,7 +129,7 @@ class backup_plugin {
//$db_name = $parts[1];
preg_match('@^db_(.+)_\d{4}-\d{2}-\d{2}_\d{2}-\d{2}\.sql\.gz$@', $backup['filename'], $matches);
$db_name = $matches[1];
$command = "gunzip --stdout ".escapeshellarg($backup_dir.'/'.$backup['filename'])." | mysql -h '".escapeshellarg($clientdb_host)."' -u '".escapeshellarg($clientdb_user)."' -p'".escapeshellarg($clientdb_password)."' '".$db_name."'";
$command = "gunzip --stdout ".escapeshellarg($backup_dir.'/'.$backup['filename'])." | mysql -h ".escapeshellarg($clientdb_host)." -u ".escapeshellarg($clientdb_user)." -p".escapeshellarg($clientdb_password)." ".escapeshellarg($db_name);
exec($command);
}
unset($clientdb_host);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment