From c6d1c5d9dabc2aeba1b24c89fc266b1aaa62963e Mon Sep 17 00:00:00 2001 From: Jesse Norell <jesse@kci.net> Date: Tue, 13 Apr 2021 17:11:37 -0600 Subject: [PATCH] set acme.log path in installer --- install/lib/installer_base.lib.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index aa85837ffc..d39754750d 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -2886,8 +2886,13 @@ class installer_base { $check_acme_file = $acme_cert_dir . '/cert.pem'; } } - swriteln('Using certificate path ' . $acme_cert_dir); + + if(!is_dir($conf['ispconfig_log_dir'])) { + mkdir($conf['ispconfig_log_dir'], 0755, true); + } + $acme_log = $conf['ispconfig_log_dir'] . '/acme.log'; + $ip_address_match = false; if(!(($svr_ip4 && in_array($svr_ip4, $dns_ips)) || ($svr_ip6 && in_array($svr_ip6, $dns_ips)))) { swriteln('Server\'s public ip(s) (' . $svr_ip4 . ($svr_ip6 ? ', ' . $svr_ip6 : '') . ') not found in A/AAAA records for ' . $hostname . ': ' . implode(', ', $dns_ips)); @@ -3015,11 +3020,11 @@ class installer_base { $out = null; $ret = null; if($conf['nginx']['installed'] == true || $conf['apache']['installed'] == true) { - exec("$acme --issue -w /usr/local/ispconfig/interface/acme -d " . escapeshellarg($hostname) . " $renew_hook", $out, $ret); + exec("$acme --issue --log $acme_log -w /usr/local/ispconfig/interface/acme -d " . escapeshellarg($hostname) . " $renew_hook", $out, $ret); } // Else, it is not webserver, so we use standalone else { - exec("$acme --issue --standalone -d " . escapeshellarg($hostname) . " $hook", $out, $ret); + exec("$acme --issue --log $acme_log --standalone -d " . escapeshellarg($hostname) . " $hook", $out, $ret); } if($ret == 0 || ($ret == 2 && file_exists($check_acme_file))) { @@ -3031,7 +3036,7 @@ class installer_base { //$acme_cert = "--cert-file $acme_cert_dir/cert.pem"; $acme_key = "--key-file " . escapeshellarg($ssl_key_file); $acme_chain = "--fullchain-file " . escapeshellarg($ssl_crt_file); - exec("$acme --install-cert -d " . escapeshellarg($hostname) . " $acme_key $acme_chain"); + exec("$acme --install-cert --log $acme_log -d " . escapeshellarg($hostname) . " $acme_key $acme_chain"); $issued_successfully = true; umask($old_umask); -- GitLab