"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "install/lib/installer_base.lib.php" between
ISPConfig-3.2.3.tar.gz and ISPConfig-3.2.4.tar.gz

About: ISPConfig is an ISP management and Hosting Control Panel (for different Managed Services).

installer_base.lib.php  (ISPConfig-3.2.3):installer_base.lib.php  (ISPConfig-3.2.4)
skipping to change at line 53 skipping to change at line 53
private function install_acme() { private function install_acme() {
$install_cmd = 'wget -O - https://get.acme.sh | sh'; $install_cmd = 'wget -O - https://get.acme.sh | sh';
$ret = null; $ret = null;
$val = 0; $val = 0;
exec($install_cmd . ' 2>&1', $ret, $val); exec($install_cmd . ' 2>&1', $ret, $val);
return ($val == 0 ? true : false); return ($val == 0 ? true : false);
} }
public function update_acme() {
$acme = explode("\n", shell_exec('which /usr/local/ispconfig/serv
er/scripts/acme.sh /root/.acme.sh/acme.sh'));
$acme = reset($acme);
$val = 0;
if($acme && is_executable($acme)) {
$cmd = $acme . ' --upgrade --auto-upgrade ; ' . $acme . '
--set-default-ca --server letsencrypt';
$ret = null;
$val = 0;
exec($cmd. ' 2>&1', $ret, $val);
}
return ($val == 0 ? true : false);
}
//: TODO Implement the translation function and language files for the i nstaller. //: TODO Implement the translation function and language files for the i nstaller.
public function lng($text) { public function lng($text) {
return $text; return $text;
} }
public function error($msg) { public function error($msg) {
die('ERROR: '.$msg."\n"); die('ERROR: '.$msg."\n");
} }
public function warning($msg) { public function warning($msg) {
skipping to change at line 1533 skipping to change at line 1548
copy('tpl/debian_dovecot.conf.master', $config_di r.'/'.$configfile); copy('tpl/debian_dovecot.conf.master', $config_di r.'/'.$configfile);
} }
} else { //* Dovecot 2.x } else { //* Dovecot 2.x
if(is_file($conf['ispconfig_install_dir'].'/server/conf-c ustom/install/debian_dovecot2.conf.master')) { if(is_file($conf['ispconfig_install_dir'].'/server/conf-c ustom/install/debian_dovecot2.conf.master')) {
copy($conf['ispconfig_install_dir'].'/server/conf -custom/install/debian_dovecot2.conf.master', $config_dir.'/'.$configfile); copy($conf['ispconfig_install_dir'].'/server/conf -custom/install/debian_dovecot2.conf.master', $config_dir.'/'.$configfile);
} else { } else {
copy('tpl/debian_dovecot2.conf.master', $config_d ir.'/'.$configfile); copy('tpl/debian_dovecot2.conf.master', $config_d ir.'/'.$configfile);
} }
// Copy custom config file // Copy custom config file
if(is_file($conf['ispconfig_install_dir'].'/server/conf-c ustom/install/dovecot_custom.conf.master')) { if(is_file($conf['ispconfig_install_dir'].'/server/conf-c ustom/install/dovecot_custom.conf.master')) {
if(!@is_dir($config_dir . '/conf.d')) {
mkdir($config_dir . '/conf.d');
}
copy($conf['ispconfig_install_dir'].'/server/conf -custom/install/dovecot_custom.conf.master', $config_dir.'/conf.d/99-ispconfig-c ustom-config.conf'); copy($conf['ispconfig_install_dir'].'/server/conf -custom/install/dovecot_custom.conf.master', $config_dir.'/conf.d/99-ispconfig-c ustom-config.conf');
} }
replaceLine($config_dir.'/'.$configfile, 'postmaster_addr ess = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostnam e'], 1, 0); replaceLine($config_dir.'/'.$configfile, 'postmaster_addr ess = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostnam e'], 1, 0);
replaceLine($config_dir.'/'.$configfile, 'postmaster_addr ess = webmaster@localhost', 'postmaster_address = postmaster@'.$conf['hostname'] , 1, 0); replaceLine($config_dir.'/'.$configfile, 'postmaster_addr ess = webmaster@localhost', 'postmaster_address = postmaster@'.$conf['hostname'] , 1, 0);
if(version_compare($dovecot_version, 2.1, '<')) { if(version_compare($dovecot_version, 2.1, '<')) {
removeLine($config_dir.'/'.$configfile, 'ssl_prot ocols ='); removeLine($config_dir.'/'.$configfile, 'ssl_prot ocols =');
} }
if(version_compare($dovecot_version,2.2) >= 0) { if(version_compare($dovecot_version,2.2) >= 0) {
// Dovecot > 2.2 does not recognize !SSLv2 anymor e on Debian 9 // Dovecot > 2.2 does not recognize !SSLv2 anymor e on Debian 9
$content = file_get_contents($config_dir.'/'.$con figfile); $content = file_get_contents($config_dir.'/'.$con figfile);
skipping to change at line 1797 skipping to change at line 1815
} }
if(is_user('_rspamd') && is_group('amavis')) { if(is_user('_rspamd') && is_group('amavis')) {
exec("usermod -a -G amavis _rspamd"); exec("usermod -a -G amavis _rspamd");
} elseif(is_user('rspamd') && is_group('amavis')) { } elseif(is_user('rspamd') && is_group('amavis')) {
exec("usermod -a -G amavis rspamd"); exec("usermod -a -G amavis rspamd");
} }
if(!is_dir('/etc/rspamd/local.d/')){ if(!is_dir('/etc/rspamd/local.d/')){
mkdir('/etc/rspamd/local.d/', 0755, true); mkdir('/etc/rspamd/local.d/', 0755, true);
chmod('/etc/rspamd/local.d/', 0755);
} }
if(!is_dir('/etc/rspamd/local.d/maps.d/')){ if(!is_dir('/etc/rspamd/local.d/maps.d/')){
mkdir('/etc/rspamd/local.d/maps.d/', 0755, true); mkdir('/etc/rspamd/local.d/maps.d/', 0755, true);
chmod('/etc/rspamd/local.d/maps.d/', 0755);
} }
if(!is_dir('/etc/rspamd/override.d/')){ if(!is_dir('/etc/rspamd/override.d/')){
mkdir('/etc/rspamd/override.d/', 0755, true); mkdir('/etc/rspamd/override.d/', 0755, true);
chmod('/etc/rspamd/override.d/', 0755);
} }
if ( substr($mail_config['dkim_path'], strlen($mail_config['dkim_ path'])-1) == '/' ) { if ( substr($mail_config['dkim_path'], strlen($mail_config['dkim_ path'])-1) == '/' ) {
$mail_config['dkim_path'] = substr($mail_config['dkim_pat h'], 0, strlen($mail_config['dkim_path'])-1); $mail_config['dkim_path'] = substr($mail_config['dkim_pat h'], 0, strlen($mail_config['dkim_path'])-1);
} }
$dkim_domains = $this->db->queryAllRecords('SELECT `dkim_selector `, `domain` FROM ?? WHERE `dkim` = ? ORDER BY `domain` ASC', $conf['mysql']['dat abase'] . '.mail_domain', 'y'); $dkim_domains = $this->db->queryAllRecords('SELECT `dkim_selector `, `domain` FROM ?? WHERE `dkim` = ? ORDER BY `domain` ASC', $conf['mysql']['dat abase'] . '.mail_domain', 'y');
# should move maps to local.d/maps.d/ ? # should move maps to local.d/maps.d/ ?
$fpp = fopen('/etc/rspamd/local.d/dkim_domains.map', 'w'); $fpp = fopen('/etc/rspamd/local.d/dkim_domains.map', 'w');
$fps = fopen('/etc/rspamd/local.d/dkim_selectors.map', 'w'); $fps = fopen('/etc/rspamd/local.d/dkim_selectors.map', 'w');
foreach($dkim_domains as $dkim_domain) { foreach($dkim_domains as $dkim_domain) {
fwrite($fpp, $dkim_domain['domain'] . ' ' . $mail_config[ 'dkim_path'] . '/' . $dkim_domain['domain'] . '.private' . "\n"); fwrite($fpp, $dkim_domain['domain'] . ' ' . $mail_config[ 'dkim_path'] . '/' . $dkim_domain['domain'] . '.private' . "\n");
fwrite($fps, $dkim_domain['domain'] . ' ' . $dkim_domain[ 'dkim_selector'] . "\n"); fwrite($fps, $dkim_domain['domain'] . ' ' . $dkim_domain[ 'dkim_selector'] . "\n");
} }
fclose($fpp); fclose($fpp);
fclose($fps); fclose($fps);
unset($dkim_domains); unset($dkim_domains);
# local.d templates with template tags # look up values for use in template tags
$tpl = new tpl();
$tpl->newTemplate('rspamd_dkim_signing.conf.master');
$tpl->setVar('dkim_path', $mail_config['dkim_path']);
wf('/etc/rspamd/local.d/dkim_signing.conf', $tpl->grab());
$tpl = new tpl();
$tpl->newTemplate('rspamd_options.inc.master');
$local_addrs = array(); $local_addrs = array();
$ips = $this->db->queryAllRecords('SELECT `ip_address`, `ip_type` FROM ?? WHERE `server_id` = ?', $conf['mysql']['database'].'.server_ip', $conf[ 'server_id']); $ips = $this->db->queryAllRecords('SELECT `ip_address`, `ip_type` FROM ?? WHERE `server_id` = ?', $conf['mysql']['database'].'.server_ip', $conf[ 'server_id']);
if(is_array($ips) && !empty($ips)){ if(is_array($ips) && !empty($ips)){
foreach($ips as $ip){ foreach($ips as $ip){
$local_addrs[] = array('quoted_ip' => "\"".$ip['i $local_addrs[] = array(
p_address']."\",\n"); 'ip' => $ip['ip_address'],
'quoted_ip' => "\"".$ip['ip_address']."\"
,\n"
);
} }
} }
$tpl->setLoop('local_addrs', $local_addrs);
wf('/etc/rspamd/local.d/options.inc', $tpl->grab()); # local.d templates with template tags
# note: ensure these template files are in server/conf/ and symli
nked in install/tpl/
$local_d = array(
'dkim_signing.conf',
'options.inc',
'redis.conf',
'classifier-bayes.conf',
);
foreach ($local_d as $f) {
$tpl = new tpl();
$tpl->newTemplate("rspamd_${f}.master");
$tpl->setVar('dkim_path', $mail_config['dkim_path']);
$tpl->setVar('rspamd_redis_servers', $mail_config['rspamd
_redis_servers']);
$tpl->setVar('rspamd_redis_password', $mail_config['rspam
d_redis_password']);
$tpl->setVar('rspamd_redis_bayes_servers', $mail_config['
rspamd_redis_bayes_servers']);
$tpl->setVar('rspamd_redis_bayes_password', $mail_config[
'rspamd_redis_bayes_password']);
if(count($local_addrs) > 0) {
$tpl->setLoop('local_addrs', $local_addrs);
}
wf("/etc/rspamd/local.d/${f}", $tpl->grab());
}
# local.d templates without template tags # local.d templates without template tags
$local_d = array( $local_d = array(
'groups.conf', 'groups.conf',
'antivirus.conf', 'antivirus.conf',
'classifier-bayes.conf',
'greylist.conf',
'mx_check.conf', 'mx_check.conf',
'redis.conf',
'milter_headers.conf', 'milter_headers.conf',
'neural.conf', 'neural.conf',
'neural_group.conf', 'neural_group.conf',
'users.conf', 'users.conf',
'groups.conf', 'groups.conf',
); );
foreach ($local_d as $f) { foreach ($local_d as $f) {
if(file_exists($conf['ispconfig_install_dir']."/server/co nf-custom/install/rspamd_${f}.master")) { if(file_exists($conf['ispconfig_install_dir']."/server/co nf-custom/install/rspamd_${f}.master")) {
exec('cp '.$conf['ispconfig_install_dir']."/serve r/conf-custom/install/rspamd_${f}.master /etc/rspamd/local.d/${f}"); exec('cp '.$conf['ispconfig_install_dir']."/serve r/conf-custom/install/rspamd_${f}.master /etc/rspamd/local.d/${f}");
} else { } else {
skipping to change at line 1878 skipping to change at line 1913
foreach ($override_d as $f) { foreach ($override_d as $f) {
if(file_exists($conf['ispconfig_install_dir']."/server/co nf-custom/install/rspamd_${f}.master")) { if(file_exists($conf['ispconfig_install_dir']."/server/co nf-custom/install/rspamd_${f}.master")) {
exec('cp '.$conf['ispconfig_install_dir']."/serve r/conf-custom/install/rspamd_${f}.master /etc/rspamd/override.d/${f}"); exec('cp '.$conf['ispconfig_install_dir']."/serve r/conf-custom/install/rspamd_${f}.master /etc/rspamd/override.d/${f}");
} else { } else {
exec("cp tpl/rspamd_${f}.master /etc/rspamd/overr ide.d/${f}"); exec("cp tpl/rspamd_${f}.master /etc/rspamd/overr ide.d/${f}");
} }
} }
# local.d/maps.d templates without template tags # local.d/maps.d templates without template tags
$maps_d = array( $maps_d = array(
'dkim_whitelist.inc', 'dkim_whitelist.inc.ispc',
'dmarc_whitelist.inc', 'dmarc_whitelist.inc.ispc',
'spf_dkim_whitelist.inc', 'spf_dkim_whitelist.inc.ispc',
'spf_whitelist.inc', 'spf_whitelist.inc.ispc',
); );
foreach ($maps_d as $f) { foreach ($maps_d as $f) {
if(file_exists($conf['ispconfig_install_dir']."/server/co nf-custom/install/rspamd_${f}.master")) { if(file_exists($conf['ispconfig_install_dir']."/server/co nf-custom/install/rspamd_${f}.master")) {
exec('cp '.$conf['ispconfig_install_dir']."/serve r/conf-custom/install/rspamd_${f}.master /etc/rspamd/local.d/maps.d/${f}"); exec('cp '.$conf['ispconfig_install_dir']."/serve r/conf-custom/install/rspamd_${f}.master /etc/rspamd/local.d/maps.d/${f}");
} else { } else {
exec("cp tpl/rspamd_${f}.master /etc/rspamd/local .d/maps.d/${f}"); exec("cp tpl/rspamd_${f}.master /etc/rspamd/local .d/maps.d/${f}");
} }
} }
# rename rspamd templates we no longer use
if(file_exists("/etc/rspamd/local.d/greylist.conf")) {
rename("/etc/rspamd/local.d/greylist.conf", "/etc/rspamd/
local.d/greylist.old");
}
exec('chmod a+r /etc/rspamd/local.d/* /etc/rspamd/local.d/maps.d/ * /etc/rspamd/override.d/*'); exec('chmod a+r /etc/rspamd/local.d/* /etc/rspamd/local.d/maps.d/ * /etc/rspamd/override.d/*');
# protect passwords in these files
exec('chgrp _rspamd /etc/rspamd/local.d/redis.conf /etc/rspamd/lo
cal.d/classifier-bayes.conf /etc/rspamd/local.d/worker-controller.inc');
exec('chmod 640 /etc/rspamd/local.d/redis.conf /etc/rspamd/local.
d/classifier-bayes.conf /etc/rspamd/local.d/worker-controller.inc');
# unneccesary, since this was done above? # unneccesary, since this was done above?
$command = 'usermod -a -G amavis _rspamd'; $command = 'usermod -a -G amavis _rspamd';
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
if(strpos(rf('/etc/rspamd/rspamd.conf'), '.include "$LOCAL_CONFDI R/local.d/users.conf"') === false){ if(strpos(rf('/etc/rspamd/rspamd.conf'), '.include "$LOCAL_CONFDI R/local.d/users.conf"') === false){
af('/etc/rspamd/rspamd.conf', '.include "$LOCAL_CONFDIR/l ocal.d/users.conf"'); af('/etc/rspamd/rspamd.conf', '.include "$LOCAL_CONFDIR/l ocal.d/users.conf"');
} }
if(!isset($mail_config['rspamd_password']) || !$mail_config['rspa md_password']) { if(!isset($mail_config['rspamd_password']) || !$mail_config['rspa md_password']) {
skipping to change at line 2031 skipping to change at line 2074
public function configure_powerdns() { public function configure_powerdns() {
global $conf; global $conf;
//* Create the database //* Create the database
if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CH ARACTER SET ?', $conf['powerdns']['database'], $conf['mysql']['charset'])) { if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CH ARACTER SET ?', $conf['powerdns']['database'], $conf['mysql']['charset'])) {
$this->error('Unable to create MySQL database: '.$conf['p owerdns']['database'].'.'); $this->error('Unable to create MySQL database: '.$conf['p owerdns']['database'].'.');
} }
//* Create the ISPConfig database user in the local database //* Create the ISPConfig database user in the local database
$query = "GRANT ALL ON ?? TO ?@'localhost'"; $query = "GRANT ALL ON ??.* TO ?@?";
if(!$this->db->query($query, $conf['powerdns']['database'] . '.*' if(!$this->db->query($query, $conf['powerdns']['database'], $conf
, $conf['mysql']['ispconfig_user'])) { ['mysql']['ispconfig_user'], 'localhost')) {
$this->error('Unable to create user for powerdns database Error: '.$this->db->errorMessage); $this->error('Unable to create user for powerdns database Error: '.$this->db->errorMessage);
} }
//* load the powerdns databse dump //* load the powerdns databse dump
if($conf['mysql']['admin_password'] == '') { if($conf['mysql']['admin_password'] == '') {
caselog("mysql --default-character-set=".$conf['mysql'][' charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']." ' '".$conf['powerdns']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/power dns.sql' &> /dev/null", caselog("mysql --default-character-set=".$conf['mysql'][' charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']." ' --force '".$conf['powerdns']['database']."' < '".ISPC_INSTALL_ROOT."/install/s ql/powerdns.sql' &> /dev/null",
__FILE__, __LINE__, 'read in ispconfig3.sql', 'co uld not read in powerdns.sql'); __FILE__, __LINE__, 'read in ispconfig3.sql', 'co uld not read in powerdns.sql');
} else { } else {
caselog("mysql --default-character-set=".$conf['mysql'][' charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']." ' -p'".$conf['mysql']['admin_password']."' '".$conf['powerdns']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/powerdns.sql' &> /dev/null", caselog("mysql --default-character-set=".$conf['mysql'][' charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']." ' -p'".$conf['mysql']['admin_password']."' --force '".$conf['powerdns']['databas e']."' < '".ISPC_INSTALL_ROOT."/install/sql/powerdns.sql' &> /dev/null",
__FILE__, __LINE__, 'read in ispconfig3.sql', 'co uld not read in powerdns.sql'); __FILE__, __LINE__, 'read in ispconfig3.sql', 'co uld not read in powerdns.sql');
} }
//* Create the powerdns config file //* Create the powerdns config file
$configfile = 'pdns.local'; $configfile = 'pdns.local';
if(is_file($conf['powerdns']['config_dir'].'/'.$configfile)) copy ($conf['powerdns']['config_dir'].'/'.$configfile, $conf['powerdns']['config_dir' ].'/'.$configfile.'~'); if(is_file($conf['powerdns']['config_dir'].'/'.$configfile)) copy ($conf['powerdns']['config_dir'].'/'.$configfile, $conf['powerdns']['config_dir' ].'/'.$configfile.'~');
if(is_file($conf['powerdns']['config_dir'].'/'.$configfile.'~')) chmod($conf['powerdns']['config_dir'].'/'.$configfile.'~', 0400); if(is_file($conf['powerdns']['config_dir'].'/'.$configfile.'~')) chmod($conf['powerdns']['config_dir'].'/'.$configfile.'~', 0400);
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus tom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus tom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
$content = str_replace('{mysql_server_ispconfig_user}', $conf['my sql']['ispconfig_user'], $content); $content = str_replace('{mysql_server_ispconfig_user}', $conf['my sql']['ispconfig_user'], $content);
$content = str_replace('{mysql_server_ispconfig_password}', $conf ['mysql']['ispconfig_password'], $content); $content = str_replace('{mysql_server_ispconfig_password}', $conf ['mysql']['ispconfig_password'], $content);
skipping to change at line 2611 skipping to change at line 2654
//* Copy the apps vhost file //* Copy the apps vhost file
$vhost_conf_dir = $conf['nginx']['vhost_conf_dir']; $vhost_conf_dir = $conf['nginx']['vhost_conf_dir'];
$vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enab led_dir']; $vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enab led_dir'];
$apps_vhost_servername = ($conf['web']['apps_vhost_server name'] == '')?'_':$conf['web']['apps_vhost_servername']; $apps_vhost_servername = ($conf['web']['apps_vhost_server name'] == '')?'_':$conf['web']['apps_vhost_servername'];
// Dont just copy over the virtualhost template but add s ome custom settings // Dont just copy over the virtualhost template but add s ome custom settings
$content = rfsel($conf['ispconfig_install_dir'].'/server/ conf-custom/install/nginx_apps.vhost.master', 'tpl/nginx_apps.vhost.master'); $content = rfsel($conf['ispconfig_install_dir'].'/server/ conf-custom/install/nginx_apps.vhost.master', 'tpl/nginx_apps.vhost.master');
// Enable SSL if a cert is in place. // Enable SSL if a cert is in place.
if(is_file($conf['ispconfig_install_dir'].'/interface/ssl /ispserver.crt') && is_file($conf['ispconfig_install_dir'].'/interface/ssl/ispse rver.key')) { if(is_file($conf['ispconfig_install_dir'].'/interface/ssl /ispserver.crt') && is_file($conf['ispconfig_install_dir'].'/interface/ssl/ispse rver.key')) {
$content = str_replace('{ssl_on}', 'ssl', $conten t); $content = str_replace('{ssl_on}', 'ssl http2', $ content);
$content = str_replace('{ssl_comment}', '', $cont ent); $content = str_replace('{ssl_comment}', '', $cont ent);
} else { } else {
$content = str_replace('{ssl_on}', '', $content); $content = str_replace('{ssl_on}', '', $content);
$content = str_replace('{ssl_comment}', '#', $con tent); $content = str_replace('{ssl_comment}', '#', $con tent);
} }
if($conf['web']['apps_vhost_ip'] == '_default_'){ if($conf['web']['apps_vhost_ip'] == '_default_'){
$apps_vhost_ip = ''; $apps_vhost_ip = '';
} else { } else {
$apps_vhost_ip = $conf['web']['apps_vhost_ip'].': '; $apps_vhost_ip = $conf['web']['apps_vhost_ip'].': ';
skipping to change at line 2762 skipping to change at line 2805
if(!@is_dir($acme_dir)) { if(!@is_dir($acme_dir)) {
$command = "mkdir -p $acme_dir"; $command = "mkdir -p $acme_dir";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EX ECUTED: $command", "Failed to execute the command $command"); caselog($command.' &> /dev/null', __FILE__, __LINE__, "EX ECUTED: $command", "Failed to execute the command $command");
} }
wf($vhost_conf_dir.'/' . $use_name, $tpl->grab()); wf($vhost_conf_dir.'/' . $use_name, $tpl->grab());
if(@is_link($vhost_conf_enabled_dir.'/' . $use_symlink)) { if(@is_link($vhost_conf_enabled_dir.'/' . $use_symlink)) {
unlink($vhost_conf_enabled_dir.'/' . $use_symlink); unlink($vhost_conf_enabled_dir.'/' . $use_symlink);
} }
if(!@is_link($vhost_conf_enabled_dir.'' . $use_symlink)) { if(!@is_link($vhost_conf_enabled_dir.'/' . $use_symlink)) {
symlink($vhost_conf_dir.'/' . $use_name, $vhost_conf_enab led_dir.'/' . $use_symlink); symlink($vhost_conf_dir.'/' . $use_name, $vhost_conf_enab led_dir.'/' . $use_symlink);
} }
} }
public function make_ispconfig_ssl_cert() { public function make_ispconfig_ssl_cert() {
global $conf, $autoinstall; global $conf, $autoinstall;
//* Get hostname from user entry or shell command */ //* Get hostname from user entry or shell command */
if($conf['hostname'] !== 'localhost' && $conf['hostname'] !== '') { if($conf['hostname'] !== 'localhost' && $conf['hostname'] !== '') {
$hostname = $conf['hostname']; $hostname = $conf['hostname'];
skipping to change at line 2901 skipping to change at line 2944
if((!$acme || !is_executable($acme)) && (!$le_client || ! is_executable($le_client))) { if((!$acme || !is_executable($acme)) && (!$le_client || ! is_executable($le_client))) {
$success = $this->install_acme(); $success = $this->install_acme();
if(!$success) { if(!$success) {
swriteln('Failed installing acme.sh. Will not be able to issue certificate during install.'); swriteln('Failed installing acme.sh. Will not be able to issue certificate during install.');
} else { } else {
$acme = explode("\n", shell_exec('which / usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh')); $acme = explode("\n", shell_exec('which / usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
$acme = reset($acme); $acme = reset($acme);
if($acme && is_executable($acme)) { if($acme && is_executable($acme)) {
swriteln('Installed acme.sh and u sing it for certificate creation during install.'); swriteln('Installed acme.sh and u sing it for certificate creation during install.');
// we do this even on install to
enable automatic updates
$this->update_acme();
} else { } else {
swriteln('Failed installing acme. sh. Will not be able to issue certificate during install.'); swriteln('Failed installing acme. sh. Will not be able to issue certificate during install.');
} }
} }
} }
$restore_conf_symlink = false; $restore_conf_symlink = false;
// we only need this for apache, so use fixed conf index // we only need this for apache, so use fixed conf index
$vhost_conf_dir = $conf['apache']['vhost_conf_dir']; $vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
skipping to change at line 3507 skipping to change at line 3553
if($conf['nginx']['installed'] == true && $this->install_ispconfi g_interface == true){ if($conf['nginx']['installed'] == true && $this->install_ispconfi g_interface == true){
//* Copy the ISPConfig vhost for the controlpanel //* Copy the ISPConfig vhost for the controlpanel
$vhost_conf_dir = $conf['nginx']['vhost_conf_dir']; $vhost_conf_dir = $conf['nginx']['vhost_conf_dir'];
$vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enab led_dir']; $vhost_conf_enabled_dir = $conf['nginx']['vhost_conf_enab led_dir'];
// Dont just copy over the virtualhost template but add s ome custom settings // Dont just copy over the virtualhost template but add s ome custom settings
$content = rfsel($conf['ispconfig_install_dir'].'/server/ conf-custom/install/nginx_ispconfig.vhost.master', 'tpl/nginx_ispconfig.vhost.ma ster'); $content = rfsel($conf['ispconfig_install_dir'].'/server/ conf-custom/install/nginx_ispconfig.vhost.master', 'tpl/nginx_ispconfig.vhost.ma ster');
$content = str_replace('{vhost_port}', $conf['nginx']['vh ost_port'], $content); $content = str_replace('{vhost_port}', $conf['nginx']['vh ost_port'], $content);
if(is_file($install_dir.'/interface/ssl/ispserver.crt') & & is_file($install_dir.'/interface/ssl/ispserver.key')) { if(is_file($install_dir.'/interface/ssl/ispserver.crt') & & is_file($install_dir.'/interface/ssl/ispserver.key')) {
$content = str_replace('{ssl_on}', 'ssl', $conten t); $content = str_replace('{ssl_on}', 'ssl http2', $ content);
$content = str_replace('{ssl_comment}', '', $cont ent); $content = str_replace('{ssl_comment}', '', $cont ent);
$content = str_replace('{fastcgi_ssl}', 'on', $co ntent); $content = str_replace('{fastcgi_ssl}', 'on', $co ntent);
} else { } else {
$content = str_replace('{ssl_on}', '', $content); $content = str_replace('{ssl_on}', '', $content);
$content = str_replace('{ssl_comment}', '#', $con tent); $content = str_replace('{ssl_comment}', '#', $con tent);
$content = str_replace('{fastcgi_ssl}', 'off', $c ontent); $content = str_replace('{fastcgi_ssl}', 'off', $c ontent);
} }
$socket_dir = escapeshellcmd($conf['nginx']['php_fpm_sock et_dir']); $socket_dir = escapeshellcmd($conf['nginx']['php_fpm_sock et_dir']);
if(substr($socket_dir, -1) != '/') $socket_dir .= '/'; if(substr($socket_dir, -1) != '/') $socket_dir .= '/';
 End of changes. 20 change blocks. 
28 lines changed or deleted 85 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)