diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3bb140d1b1aaa5cc99b94b2ed8570d35b6a3b33..e1a491345480e10d57a2d354e4f3636e3a6db505 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - syntax - syntax_diff - test + - build # ### Stage syntax @@ -63,3 +64,21 @@ test:install: - apt-get --yes install curl - curl --insecure https://127.0.0.1:8080/login/ - ps xaf + + +build:package: + stage: build + image: edbizarro/gitlab-ci-pipeline-php:7.2 + only: + refs: + - /^\d+\.\d+\.\d+$/ + except: + - branches + - merge_requests + - schedules + - pushes + script: + - echo "Building release." + + when: manual + allow_failure: false \ No newline at end of file diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 7856cc2f26323abb8f4063599f13a134b101eec5..43d226aab5b33a6a9614ac3f91f933d03850dabe 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -3147,17 +3147,11 @@ class installer_base { } // We can still use the old self-signed method - $ssl_pw = substr(md5(mt_rand()), 0, 6); - exec("openssl genrsa -des3 -passout pass:$ssl_pw -out $ssl_key_file 4096"); + $openssl_cmd = 'openssl req -nodes -newkey rsa:4096 -x509 -days 3650 -keyout ' . escapeshellarg($ssl_key_file) . ' -out ' . escapeshellarg($ssl_crt_file); if(AUTOINSTALL){ - exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -subj '/C=".escapeshellcmd($autoinstall['ssl_cert_country'])."/ST=".escapeshellcmd($autoinstall['ssl_cert_state'])."/L=".escapeshellcmd($autoinstall['ssl_cert_locality'])."/O=".escapeshellcmd($autoinstall['ssl_cert_organisation'])."/OU=".escapeshellcmd($autoinstall['ssl_cert_organisation_unit'])."/CN=".escapeshellcmd($autoinstall['ssl_cert_common_name'])."' -key $ssl_key_file -out $ssl_csr_file"); - } else { - exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -out $ssl_csr_file"); + $openssl_cmd .= ' -subj ' . escapeshellarg('/C=' . $autoinstall['ssl_cert_country'] . '/ST=' . $autoinstall['ssl_cert_state'] . '/L=' . $autoinstall['ssl_cert_locality'] . '/O=' . $autoinstall['ssl_cert_organisation'] . '/OU=' . $autoinstall['ssl_cert_organisation_unit'] . '/CN=' . $autoinstall['ssl_cert_common_name']); } - exec("openssl req -x509 -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -in $ssl_csr_file -out $ssl_crt_file -days 3650"); - exec("openssl rsa -passin pass:$ssl_pw -in $ssl_key_file -out $ssl_key_file.insecure"); - rename($ssl_key_file, $ssl_key_file.'.secure'); - rename($ssl_key_file.'.insecure', $ssl_key_file); + exec($openssl_cmd); } // Build ispserver.pem file and chmod it diff --git a/interface/lib/classes/quota_lib.inc.php b/interface/lib/classes/quota_lib.inc.php index 3bae97f046ada93cb7c701dfb5d52ffa58e7ad8f..b02cdea9949fb92c23451a18f49b2377a3d23d4c 100644 --- a/interface/lib/classes/quota_lib.inc.php +++ b/interface/lib/classes/quota_lib.inc.php @@ -2,8 +2,8 @@ class quota_lib { public function get_quota_data($clientid = null, $readable = true) { - global $app; - + global $app; + $tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC"); $monitor_data = array(); if(is_array($tmp_rec)) { @@ -12,10 +12,10 @@ class quota_lib { } } //print_r($monitor_data); - + // select all websites or websites belonging to client $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'".(($clientid != null)?" AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)":'') . " ORDER BY domain", $clientid); - + //print_r($sites); if(is_array($sites) && !empty($sites)){ for($i=0;$i $sites[$i]['used'][1]){ $sites[$i]['used'] = $sites[$i]['used'][0]; @@ -35,13 +35,13 @@ class quota_lib { if (!is_numeric($sites[$i]['soft'])) $sites[$i]['soft']=$sites[$i]['soft'][1]; if (!is_numeric($sites[$i]['hard'])) $sites[$i]['hard']=$sites[$i]['hard'][1]; if (!is_numeric($sites[$i]['files'])) $sites[$i]['files']=$sites[$i]['files'][1]; - + $sites[$i]['used_raw'] = $sites[$i]['used']; $sites[$i]['soft_raw'] = $sites[$i]['soft']; $sites[$i]['hard_raw'] = $sites[$i]['hard']; $sites[$i]['files_raw'] = $sites[$i]['files']; $sites[$i]['used_percentage'] = ($sites[$i]['soft'] > 0 && $sites[$i]['used'] > 0 ? round($sites[$i]['used'] * 100 / $sites[$i]['soft']) : 0); - + if ($readable) { // colours $sites[$i]['display_colour'] = '#000000'; @@ -52,31 +52,31 @@ class quota_lib { } if($used_ratio >= 0.8) $sites[$i]['display_colour'] = '#fd934f'; if($used_ratio >= 1) $sites[$i]['display_colour'] = '#cc0000'; - + if($sites[$i]['used'] > 1024) { $sites[$i]['used'] = round($sites[$i]['used'] / 1024, 1).' MB'; } else { if ($sites[$i]['used'] != '') $sites[$i]['used'] .= ' KB'; } - + if($sites[$i]['soft'] > 1024) { $sites[$i]['soft'] = round($sites[$i]['soft'] / 1024, 1).' MB'; } else { $sites[$i]['soft'] .= ' KB'; } - + if($sites[$i]['hard'] > 1024) { $sites[$i]['hard'] = round($sites[$i]['hard'] / 1024, 1).' MB'; } else { $sites[$i]['hard'] .= ' KB'; } - + if($sites[$i]['soft'] == " KB") $sites[$i]['soft'] = $app->lng('unlimited_txt'); if($sites[$i]['hard'] == " KB") $sites[$i]['hard'] = $app->lng('unlimited_txt'); - + if($sites[$i]['soft'] == '0 B' || $sites[$i]['soft'] == '0 KB' || $sites[$i]['soft'] == '0') $sites[$i]['soft'] = $app->lng('unlimited_txt'); if($sites[$i]['hard'] == '0 B' || $sites[$i]['hard'] == '0 KB' || $sites[$i]['hard'] == '0') $sites[$i]['hard'] = $app->lng('unlimited_txt'); - + /* if(!strstr($sites[$i]['used'],'M') && !strstr($sites[$i]['used'],'K')) $sites[$i]['used'].= ' B'; if(!strstr($sites[$i]['soft'],'M') && !strstr($sites[$i]['soft'],'K')) $sites[$i]['soft'].= ' B'; @@ -86,35 +86,35 @@ class quota_lib { else { if (empty($sites[$i]['soft'])) $sites[$i]['soft'] = -1; if (empty($sites[$i]['hard'])) $sites[$i]['hard'] = -1; - + if($sites[$i]['soft'] == '0 B' || $sites[$i]['soft'] == '0 KB' || $sites[$i]['soft'] == '0') $sites[$i]['soft'] = -1; if($sites[$i]['hard'] == '0 B' || $sites[$i]['hard'] == '0 KB' || $sites[$i]['hard'] == '0') $sites[$i]['hard'] = -1; } } } - + return $sites; } - + public function get_trafficquota_data($clientid = null, $lastdays = 0) { global $app; - + $traffic_data = array(); - + // select vhosts (belonging to client) if($clientid != null){ $sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)"; } $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias')".$sql_where, $clientid); - + $hostnames = array(); $traffic_data = array(); - + foreach ($sites as $site) { $hostnames[] = $site['domain']; $traffic_data[$site['domain']]['domain_id'] = $site['domain_id']; } - + // fetch all traffic-data of selected vhosts if (!empty($hostnames)) { $tmp_year = date('Y'); @@ -129,7 +129,7 @@ class quota_lib { foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['this_year'] = $tmp_rec['t']; } - + $tmp_year = date('Y', mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); $tmp_month = date('m', mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); // Last Month @@ -137,14 +137,14 @@ class quota_lib { foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['last_month'] = $tmp_rec['t']; } - + $tmp_year = date('Y', mktime(0, 0, 0, date("m"), date("d"), date("Y")-1)); // Last Year $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $hostnames); foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['last_year'] = $tmp_rec['t']; } - + if (is_int($lastdays) && ($lastdays > 0)) { // Last xx Days $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(traffic_bytes) as t FROM web_traffic WHERE (traffic_date >= DATE_SUB(NOW(), INTERVAL ? DAY)) AND hostname IN ? GROUP BY hostname", $lastdays, $hostnames); @@ -153,29 +153,29 @@ class quota_lib { } } } - + return $traffic_data; } public function get_ftptrafficquota_data($clientid = null, $lastdays = 0) { global $app; - + $traffic_data = array(); - + // select vhosts (belonging to client) if($clientid != null){ $sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)"; } $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias')".$sql_where, $clientid); - + $hostnames = array(); $traffic_data = array(); - + foreach ($sites as $site) { $hostnames[] = $site['domain']; $traffic_data[$site['domain']]['domain_id'] = $site['domain_id']; } - + // fetch all traffic-data of selected vhosts if (!empty($hostnames)) { $tmp_year = date('Y'); @@ -190,7 +190,7 @@ class quota_lib { foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['this_year'] = $tmp_rec['t']; } - + $tmp_year = date('Y', mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); $tmp_month = date('m', mktime(0, 0, 0, date("m")-1, date("d"), date("Y"))); // Last Month @@ -198,14 +198,14 @@ class quota_lib { foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['last_month'] = $tmp_rec['t']; } - + $tmp_year = date('Y', mktime(0, 0, 0, date("m"), date("d"), date("Y")-1)); // Last Year $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(in_bytes) AS ftp_in, SUM(out_bytes) AS ftp_out FROM ftp_traffic WHERE YEAR(traffic_date) = ? AND hostname IN ? GROUP BY hostname", $tmp_year, $hostnames); foreach ($tmp_recs as $tmp_rec) { $traffic_data[$tmp_rec['hostname']]['last_year'] = $tmp_rec['t']; } - + if (is_int($lastdays) && ($lastdays > 0)) { // Last xx Days $tmp_recs = $app->db->queryAllRecords("SELECT hostname, SUM(in_bytes) AS ftp_in, SUM(out_bytes) AS ftp_out FROM ftp_traffic WHERE (traffic_date >= DATE_SUB(NOW(), INTERVAL ? DAY)) AND hostname IN ? GROUP BY hostname", $lastdays, $hostnames); @@ -214,13 +214,13 @@ class quota_lib { } } } - + return $traffic_data; } - + public function get_mailquota_data($clientid = null, $readable = true) { global $app; - + $tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'email_quota' ORDER BY created DESC"); $monitor_data = array(); if(is_array($tmp_rec)) { @@ -235,25 +235,25 @@ class quota_lib { } } //print_r($monitor_data); - + // select all email accounts or email accounts belonging to client $emails = $app->db->queryAllRecords("SELECT * FROM mail_user".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : '') . " ORDER BY email", $clientid); - + //print_r($emails); - if(is_array($emails) && !empty($emails)){ + if(is_array($emails) && !empty($emails)) { for($i=0;$ifunctions->htmlentities($emails[$i]['name']); $emails[$i]['used'] = isset($monitor_data[$email]['used']) ? $monitor_data[$email]['used'] : array(1 => 0); - + if (!is_numeric($emails[$i]['used'])) $emails[$i]['used']=$emails[$i]['used'][1]; - + $emails[$i]['quota_raw'] = $emails[$i]['quota']; $emails[$i]['used_raw'] = $emails[$i]['used']; $emails[$i]['used_percentage'] = ($emails[$i]['quota'] > 0 && $emails[$i]['used'] > 0 ? round($emails[$i]['used'] * 100 / $emails[$i]['quota']) : 0); - + if ($readable) { // colours $emails[$i]['display_colour'] = '#000000'; @@ -264,14 +264,14 @@ class quota_lib { } if($used_ratio >= 0.8) $emails[$i]['display_colour'] = '#fd934f'; if($used_ratio >= 1) $emails[$i]['display_colour'] = '#cc0000'; - + if($emails[$i]['quota'] == 0){ $emails[$i]['quota'] = $app->lng('unlimited_txt'); } else { $emails[$i]['quota'] = round($emails[$i]['quota'] / 1048576, 1).' MB'; } - - + + if($emails[$i]['used'] < 1544000) { $emails[$i]['used'] = round($emails[$i]['used'] / 1024, 1).' KB'; } else { @@ -280,13 +280,13 @@ class quota_lib { } } } - + return $emails; } - + public function get_databasequota_data($clientid = null, $readable = true) { global $app; - + $tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'database_size' ORDER BY created DESC"); $monitor_data = array(); if(is_array($tmp_rec)) { @@ -300,21 +300,21 @@ class quota_lib { } } //print_r($monitor_data); - + // select all databases belonging to client $databases = $app->db->queryAllRecords("SELECT * FROM web_database".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : '') . " ORDER BY database_name", $clientid); - + //print_r($databases); if(is_array($databases) && !empty($databases)){ for($i=0;$i 0) && ($databases[$i]['used'] > 0)) ? round($databases[$i]['used_raw'] * 100 / $databases[$i]['database_quota']) : 0; - + if ($readable) { // colours $databases[$i]['display_colour'] = '#000000'; @@ -325,14 +325,14 @@ class quota_lib { } if($used_ratio >= 0.8) $databases[$i]['display_colour'] = '#fd934f'; if($used_ratio >= 1) $databases[$i]['display_colour'] = '#cc0000'; - + if($databases[$i]['database_quota'] == 0){ $databases[$i]['database_quota'] = $app->lng('unlimited_txt'); } else { $databases[$i]['database_quota'] = $databases[$i]['database_quota'] . ' MB'; } - - + + if($databases[$i]['used'] < 1544000) { $databases[$i]['used'] = round($databases[$i]['used'] / 1024, 1).' KB'; } else { @@ -341,8 +341,8 @@ class quota_lib { } } } - + return $databases; } - + } diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index 170f8b1b72f9c4c2a52a3f53b06d24a952a5bef3..19f650d4b3bf05f76bc235dfb99ee00248c2d8f2 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -278,7 +278,6 @@ class apache2_plugin { $ssl_dir = $data['new']['document_root'].'/ssl'; $domain = ($data['new']['ssl_domain'] != '') ? $data['new']['ssl_domain'] : $data['new']['domain']; $key_file = $ssl_dir.'/'.$domain.'.key'; - $key_file2 = $ssl_dir.'/'.$domain.'.key.org'; $csr_file = $ssl_dir.'/'.$domain.'.csr'; $crt_file = $ssl_dir.'/'.$domain.'.crt'; $bundle_file = $ssl_dir.'/'.$domain.'.bundle'; @@ -293,10 +292,6 @@ class apache2_plugin { $app->system->rename($key_file, $key_file.'.bak'); $app->system->chmod($key_file.'.bak', 0400); } - if(file_exists($key_file2)){ - $app->system->rename($key_file2, $key_file2.'.bak'); - $app->system->chmod($key_file2.'.bak', 0400); - } if(file_exists($csr_file)) $app->system->rename($csr_file, $csr_file.'.bak'); if(file_exists($crt_file)) $app->system->rename($crt_file, $crt_file.'.bak'); @@ -346,44 +341,35 @@ class apache2_plugin { $ssl_ext_file = $ssl_dir.'/v3.ext'; $app->system->file_put_contents($ssl_ext_file, $ext_cnf); - $rand_file = $rand_file; - $key_file2 = $key_file2; - $openssl_cmd_key_file2 = $key_file2; - if(substr($domain, 0, 2) == '*.' && strpos($key_file2, '/ssl/\*.') !== false) $key_file2 = str_replace('/ssl/\*.', '/ssl/*.', $key_file2); // wildcard certificate - $key_file = $key_file; $openssl_cmd_key_file = $key_file; if(substr($domain, 0, 2) == '*.' && strpos($key_file, '/ssl/\*.') !== false) $key_file = str_replace('/ssl/\*.', '/ssl/*.', $key_file); // wildcard certificate $ssl_days = 3650; - $csr_file = $csr_file; $openssl_cmd_csr_file = $csr_file; if(substr($domain, 0, 2) == '*.' && strpos($csr_file, '/ssl/\*.') !== false) $csr_file = str_replace('/ssl/\*.', '/ssl/*.', $csr_file); // wildcard certificate $config_file = $ssl_cnf_file; - $crt_file = $crt_file; $openssl_cmd_crt_file = $crt_file; if(substr($domain, 0, 2) == '*.' && strpos($crt_file, '/ssl/\*.') !== false) $crt_file = str_replace('/ssl/\*.', '/ssl/*.', $crt_file); // wildcard certificate if(is_file($ssl_cnf_file) && !is_link($ssl_cnf_file)) { - - $app->system->exec_safe("openssl genrsa -des3 -rand ? -passout pass:? -out ? 2048", $rand_file, $ssl_password, $openssl_cmd_key_file2); - $app->system->exec_safe("openssl req -new -sha256 -passin pass:? -passout pass:? -key ? -out ? -days ? -config ?", $ssl_password, $ssl_password, $openssl_cmd_key_file2, $openssl_cmd_csr_file, $ssl_days, $config_file); - $app->system->exec_safe("openssl rsa -passin pass:? -in ? -out ?", $ssl_password, $openssl_cmd_key_file2, $openssl_cmd_key_file); + $openssl_cmd = 'openssl req -nodes -newkey rsa:4096 -x509 -days ? -keyout ? -out ? -config ?'; + $app->system->exec_safe($openssl_cmd, $ssl_days, $openssl_cmd_key_file, $openssl_cmd_crt_file, $config_file); if(file_exists($web_config['CA_path'].'/openssl.cnf')) { + $app->system->exec_safe("openssl req -new -sha256 -key ? -out ? -days ? -config ?", $openssl_cmd_key_file, $openssl_cmd_csr_file, $ssl_days, $config_file); $app->system->exec_safe("openssl ca -batch -out ? -config ? -passin pass:? -in ? -extfile ?", $openssl_cmd_crt_file, $web_config['CA_path']."/openssl.cnf", $web_config['CA_pass'], $openssl_cmd_csr_file, $ssl_ext_file); $app->log("Creating CA-signed SSL Cert for: $domain", LOGLEVEL_DEBUG); if(filesize($crt_file) == 0 || !file_exists($crt_file)) { $app->log("CA-Certificate signing failed. openssl ca -out $openssl_cmd_crt_file -config " . $web_config['CA_path'] . "/openssl.cnf -passin pass:" . $web_config['CA_pass'] . " -in $openssl_cmd_csr_file -extfile $ssl_ext_file", LOGLEVEL_ERROR); } - }; + } if (@filesize($crt_file)==0 || !file_exists($crt_file)){ - $app->system->exec_safe("openssl req -x509 -passin pass:? -passout pass:? -key ? -in ? -out ? -days ? -config ? ", $ssl_password, $ssl_password, $openssl_cmd_key_file2, $openssl_cmd_csr_file, $openssl_cmd_crt_file, $ssl_days, $config_file); + $app->system->exec_safe($openssl_cmd, $ssl_days, $openssl_cmd_key_file, $openssl_cmd_crt_file, $config_file); $app->log("Creating self-signed SSL Cert for: $domain", LOGLEVEL_DEBUG); - }; + } } - $app->system->chmod($key_file2, 0400); $app->system->chmod($key_file, 0400); @$app->system->unlink($config_file); @$app->system->unlink($rand_file); @@ -445,10 +431,6 @@ class apache2_plugin { $app->system->copy($key_file, $key_file.'~'); $app->system->chmod($key_file.'~', 0400); } - if(file_exists($key_file2)){ - $app->system->copy($key_file2, $key_file2.'~'); - $app->system->chmod($key_file2.'~', 0400); - } if(file_exists($csr_file)) $app->system->copy($csr_file, $csr_file.'~'); if(file_exists($crt_file)) $app->system->copy($crt_file, $crt_file.'~'); if(file_exists($bundle_file)) $app->system->copy($bundle_file, $bundle_file.'~'); @@ -1316,7 +1298,6 @@ class apache2_plugin { $tmp = $app->letsencrypt->get_website_certificate_paths($data); $domain = $tmp['domain']; $key_file = $tmp['key']; - $key_file2 = $tmp['key2']; $csr_file = $tmp['csr']; $crt_file = $tmp['crt']; $bundle_file = $tmp['bundle']; @@ -2094,17 +2075,12 @@ class apache2_plugin { $app->system->copy($key_file, $key_file.'.err'); $app->system->chmod($key_file.'.err', 0400); } - if(is_file($key_file2)){ - $app->system->copy($key_file2, $key_file2.'.err'); - $app->system->chmod($key_file2.'.err', 0400); - } if(is_file($csr_file)) $app->system->copy($csr_file, $csr_file.'.err'); if(is_file($crt_file)) $app->system->copy($crt_file, $crt_file.'.err'); if(is_file($bundle_file)) $app->system->copy($bundle_file, $bundle_file.'.err'); //* Restore the ~ backup files if(is_file($key_file.'~')) $app->system->copy($key_file.'~', $key_file); - if(is_file($key_file2.'~')) $app->system->copy($key_file2.'~', $key_file2); if(is_file($crt_file.'~')) $app->system->copy($crt_file.'~', $crt_file); if(is_file($csr_file.'~')) $app->system->copy($csr_file.'~', $csr_file); if(is_file($bundle_file.'~')) $app->system->copy($bundle_file.'~', $bundle_file); @@ -2129,7 +2105,6 @@ class apache2_plugin { $this->ssl_certificate_changed = false; if(@is_file($key_file.'~')) $app->system->unlink($key_file.'~'); - if(@is_file($key_file2.'~')) $app->system->unlink($key_file2.'~'); if(@is_file($crt_file.'~')) $app->system->unlink($crt_file.'~'); if(@is_file($csr_file.'~')) $app->system->unlink($csr_file.'~'); if(@is_file($bundle_file.'~')) $app->system->unlink($bundle_file.'~');