Skip to content

Commit ba24468

Browse files
author
Marius Burkard
committed
- added 'certbot' to which command (if letsencrypt is not installed as system package, but certbot is)
1 parent b115572 commit ba24468

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

server/lib/classes/cron.d/900-letsencrypt.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ class cronjob_letsencrypt extends cronjob {
3636
public function onRunJob() {
3737
global $app, $conf;
3838

39-
$letsencrypt = array_shift( explode("\n", `which letsencrypt /root/.local/share/letsencrypt/bin/letsencrypt`) );
39+
$letsencrypt = array_shift( explode("\n", $this->_exec('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt')) );
4040
if(is_executable($letsencrypt)) {
4141
$version = trim(exec($letsencrypt . ' --version 2>/dev/null'));
4242
if(preg_match('/^(\S+)\s+(\d+(\.\d+)+)$/', $version, $matches)) {
4343
$type = strtolower($matches[1]);
4444
$version = $matches[2];
45-
if($type != 'letsencrypt' || version_compare($version, '0.7.0', '<')) {
45+
if(($type != 'letsencrypt' && $type != 'certbot') || version_compare($version, '0.7.0', '<')) {
4646
exec($letsencrypt . ' -n renew');
4747
$app->services->restartServiceDelayed('httpd', 'reload');
4848
} else {

server/plugins-available/apache2_plugin.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ function update($event_name, $data) {
12341234
$app->log("Create Let's Encrypt SSL Cert for: $domain", LOGLEVEL_DEBUG);
12351235

12361236
$success = false;
1237-
$letsencrypt = array_shift( explode("\n", `which letsencrypt /root/.local/share/letsencrypt/bin/letsencrypt`) );
1237+
$letsencrypt = array_shift( explode("\n", shell_exec('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt')) );
12381238
if(is_executable($letsencrypt)) {
12391239
$success = $this->_exec($letsencrypt . " auth --text --agree-tos --authenticator webroot --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --email postmaster@$domain --domains $lddomain --webroot-path /usr/local/ispconfig/interface/acme");
12401240
}

server/plugins-available/nginx_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,9 +1313,9 @@ function update($event_name, $data) {
13131313
$app->log("Create Let's Encrypt SSL Cert for: $domain", LOGLEVEL_DEBUG);
13141314

13151315
$success = false;
1316-
$letsencrypt = array_shift( explode("\n", `which letsencrypt /root/.local/share/letsencrypt/bin/letsencrypt`) );
1316+
$letsencrypt = array_shift( explode("\n", shell_exec('which letsencrypt certbot /root/.local/share/letsencrypt/bin/letsencrypt')) );
13171317
if(is_executable($letsencrypt)) {
1318-
$success = $this->_exec($letsencrypt . " auth --text --agree-tos --authenticator webroot --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --email postmaster@$domain --domains $lddomain --webroot-path /usr/local/ispconfig/interface/acme");
1318+
$success = $this->_exec($letsencrypt . " certonly --text --agree-tos --authenticator webroot --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --email postmaster@$domain --domains $lddomain --webroot-path /usr/local/ispconfig/interface/acme");
13191319
}
13201320
if(!$success) {
13211321
// error issuing cert

0 commit comments

Comments
 (0)