@@ -2418,21 +2418,24 @@ 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
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
24222423 $domain_file = '/usr/local/ispconfig/server/conf-custom/letsencrypt_domains.master';
24232424 $cli_domain_arg = '';
24242425
24252426 // 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
24262429 if (file_exists($domain_file)) {
2427- $ extra_domains = file ($ domain_file , FILE_IGNORE_NEW_LINES );
2430+ $extra_domains = file($domain_file, FILE_SKIP_EMPTY_LINES );
24282431 $extra_domains = array_unique($extra_domains);
24292432 $le_domain_count = count($extra_domains);
24302433 if($le_domain_count > 99) {
24312434 $extra_domains = array_slice($extra_domains, 0, 99);
24322435 echo "\nExtra domains exceed limits. Only the first 99 will be expanded into the hostname FQDN cert.\n";
24332436 }
24342437 foreach($extra_domains as $le_domain) $cli_domain_arg .= (string) ' -d ' . $le_domain;
2435- }
2438+ } */
24362439
24372440 // Get the default LE client name and version
24382441 $ le_client = explode ("\n" , shell_exec ('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt /opt/eff.org/certbot/venv/bin/certbot ' ));
@@ -2453,11 +2456,12 @@ public function make_ispconfig_ssl_cert() {
24532456 $ acme_challenge = '/usr/local/ispconfig/interface/acme/.well-known/acme-challenge ' ;
24542457 if (!is_dir ($ well_known )) mkdir ($ well_known , 0755 , true );
24552458 if (!is_dir ($ challenge )) exec ("ln -sf $ acme_challenge $ challenge " );
2456- exec ("$ le_client $ certonly $ acme_version $ webroot --email postmaster@ $ hostname -d $ hostname $ cli_domain_arg " );
2459+ //exec("$le_client $certonly $acme_version $webroot --email postmaster@$hostname -d $hostname $cli_domain_arg");
2460+ exec ("$ le_client $ certonly $ acme_version $ webroot --email postmaster@ $ hostname -d $ hostname " );
24572461 }
24582462 // Else, it is not webserver, so we use standalone
24592463 else
2460- exec ("$ le_client $ certonly $ acme_version $ standalone --email postmaster@ $ hostname -d $ hostname $ cli_domain_arg " );
2464+ exec ("$ le_client $ certonly $ acme_version $ standalone --email postmaster@ $ hostname -d $ hostname " );
24612465 }
24622466 }
24632467
0 commit comments