Skip to content

Commit 14d80d3

Browse files
author
Marius Burkard
committed
Merge branch '6134-acme-sh-switching-to-zerossl-by-default-should-be-set-to-let-s-encrypt' into 'develop'
Resolve "Acme.sh switching to ZeroSSL by default -> should be set to Let's Encrypt" Closes #6134 See merge request ispconfig/ispconfig3!1462
2 parents 8788d2f + fcff3cd commit 14d80d3

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

install/install.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,9 @@
597597
}
598598
}
599599

600+
// update acme.sh if installed
601+
$inst->update_acme();
602+
600603
if($conf['services']['web'] == true) {
601604
//** Configure apps vhost
602605
swriteln('Configuring Apps vhost');

install/lib/installer_base.lib.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ private function install_acme() {
5151
return ($val == 0 ? true : false);
5252
}
5353

54+
public function update_acme() {
55+
$acme = explode("\n", shell_exec('which /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
56+
$acme = reset($acme);
57+
$val = 0;
58+
59+
if($acme && is_executable($acme)) {
60+
$cmd = $acme . ' --upgrade --auto-upgrade ; ' . $acme . ' --set-default-ca --server letsencrypt';
61+
$ret = null;
62+
$val = 0;
63+
exec($cmd. ' 2>&1', $ret, $val);
64+
}
65+
66+
return ($val == 0 ? true : false);
67+
}
68+
5469
//: TODO Implement the translation function and language files for the installer.
5570
public function lng($text) {
5671
return $text;
@@ -2939,6 +2954,9 @@ public function make_ispconfig_ssl_cert() {
29392954
$acme = reset($acme);
29402955
if($acme && is_executable($acme)) {
29412956
swriteln('Installed acme.sh and using it for certificate creation during install.');
2957+
2958+
// we do this even on install to enable automatic updates
2959+
$this->update_acme();
29422960
} else {
29432961
swriteln('Failed installing acme.sh. Will not be able to issue certificate during install.');
29442962
}

install/update.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@
566566
}
567567
}
568568

569+
// update acme.sh if installed
570+
$inst->update_acme();
571+
569572
$inst->install_ispconfig();
570573

571574
// Cleanup

0 commit comments

Comments
 (0)