Skip to content

Commit 5251944

Browse files
committed
Update installer_base.lib.php to finalize removal multi domain support.
1 parent 804cfa6 commit 5251944

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

install/lib/installer_base.lib.php

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,30 +2418,13 @@ public function make_ispconfig_ssl_cert() {
24182418
$le_live_dir = '/etc/letsencrypt/live/' . $hostname;
24192419
if (!@is_dir($le_live_dir) && in_array($svr_ip, $dns_ips)) {
24202420

2421-
/* // Try to support for multi domain, if it is defined in letsencrypt_domains.master
2422-
// Should try to get from ISPConfig database later on
2423-
$domain_file = '/usr/local/ispconfig/server/conf-custom/letsencrypt_domains.master';
2424-
$cli_domain_arg = '';
2425-
2426-
// If file exist, get the unique domains but not more then 99
2427-
// This won't work if the domain don't have working vhost / conf file
2428-
// In other words this won't work on non web-server
2429-
if (file_exists($domain_file)) {
2430-
$extra_domains = file($domain_file, FILE_SKIP_EMPTY_LINES);
2431-
$extra_domains = array_unique($extra_domains);
2432-
$le_domain_count = count($extra_domains);
2433-
if($le_domain_count > 99) {
2434-
$extra_domains = array_slice($extra_domains, 0, 99);
2435-
echo "\nExtra domains exceed limits. Only the first 99 will be expanded into the hostname FQDN cert.\n";
2436-
}
2437-
foreach($extra_domains as $le_domain) $cli_domain_arg .= (string) ' -d ' . $le_domain;
2438-
} */
2439-
24402421
// Get the default LE client name and version
24412422
$le_client = explode("\n", shell_exec('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt /opt/eff.org/certbot/venv/bin/certbot'));
24422423
$le_client = reset($le_client);
24432424
$le_info = exec($le_client . ' --version 2>&1', $ret, $val);
24442425
if(preg_match('/^(\S+|\w+)\s+(\d+(\.\d+)+)$/', $le_info, $matches)) { $le_name = $matches[1]; $le_version = $matches[2]; }
2426+
2427+
// Define certbot commands
24452428
$acme_version = '--server https://acme-v0' . (($le_version >=0.22) ? '2' : '1') . '.api.letsencrypt.org/directory';
24462429
$certonly = 'certonly --agree-tos --non-interactive --expand --rsa-key-size 4096';
24472430
$webroot = '--authenticator webroot --webroot-path /var/www/html';
@@ -2456,7 +2439,6 @@ public function make_ispconfig_ssl_cert() {
24562439
$acme_challenge = '/usr/local/ispconfig/interface/acme/.well-known/acme-challenge';
24572440
if (!is_dir($well_known)) mkdir($well_known, 0755, true);
24582441
if (!is_dir($challenge)) exec("ln -sf $acme_challenge $challenge");
2459-
//exec("$le_client $certonly $acme_version $webroot --email postmaster@$hostname -d $hostname $cli_domain_arg");
24602442
exec("$le_client $certonly $acme_version $webroot --email postmaster@$hostname -d $hostname");
24612443
}
24622444
// Else, it is not webserver, so we use standalone
@@ -2519,7 +2501,7 @@ public function make_ispconfig_ssl_cert() {
25192501
if(!is_dir($pureftpd_dir)) mkdir($pureftpd_dir, 0755, true);
25202502
$pureftpd_pem = $pureftpd_dir.'/pure-ftpd.pem';
25212503

2522-
// Backup existing postfix ssl files
2504+
// Backup existing pureftpd ssl files
25232505
if (file_exists($pureftpd_pem)) rename($pureftpd_pem, $pureftpd_pem . '-' .$date->format('YmdHis') . '.bak');
25242506

25252507
// Create symlink to ISPConfig SSL files

0 commit comments

Comments
 (0)