diff --git a/install/install.php b/install/install.php index 7bc3836223514ae3685b1d49543818d725c3c6df..a5233744c8534de4cf51a26c36bab37dc2b3f629 100644 --- a/install/install.php +++ b/install/install.php @@ -597,6 +597,9 @@ if(!$issue_asked) { } } +// update acme.sh if installed +$inst->update_acme(); + if($conf['services']['web'] == true) { //** Configure apps vhost swriteln('Configuring Apps vhost'); diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 42a3b1792abf3b96d994039c8aaf18b25455e1a8..ae2b288cdb548b0ddf6f91c3360227c7b62648c0 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -51,6 +51,21 @@ class installer_base { return ($val == 0 ? true : false); } + public function update_acme() { + $acme = explode("\n", shell_exec('which /usr/local/ispconfig/server/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 installer. public function lng($text) { return $text; @@ -2917,6 +2932,9 @@ class installer_base { $acme = reset($acme); if($acme && is_executable($acme)) { swriteln('Installed acme.sh and using it for certificate creation during install.'); + + // we do this even on install to enable automatic updates + $this->update_acme(); } else { swriteln('Failed installing acme.sh. Will not be able to issue certificate during install.'); } diff --git a/install/update.php b/install/update.php index e821eac2033b5711b77b42408040de5ee699fa12..0122f27678a8a475933e6d2365c63f631929e423 100644 --- a/install/update.php +++ b/install/update.php @@ -566,6 +566,9 @@ if(!$issue_asked) { } } +// update acme.sh if installed +$inst->update_acme(); + $inst->install_ispconfig(); // Cleanup