Autoconfigure certbot using cli.ini

This commit is contained in:
Miraty 2023-04-26 14:08:47 +02:00
parent 5adb07c7c8
commit 03e61fad26
3 changed files with 1 additions and 7 deletions

View File

@ -171,10 +171,6 @@ Filesystem path to the certbot binary. It is used through sudo to get a Let's En
Filesystem paths to the corresponding GNU coreutils binary (other implementations are not tested). (Their PHP counterpart can't be used as they need to act as another user through sudo.)
### `acme_path`
Filesystem path to the root directory that is served when a request hits `.well-known/acme-challenge` on port 80. Certbot places ACME authentication files here to get Let's Encrypt certificates through the HTTP-01 challenge.
### `sftpgo_group`
Linux group as who runs SFTPGo. (Gets full permissions on users directories.)

View File

@ -51,8 +51,6 @@ cat_path = "/usr/bin/cat"
rm_path = "/usr/bin/rm"
mkdir_path = "/usr/bin/mkdir"
acme_path = "/srv/servnest/acme"
sftpgo_group = "sftpgo"
sftpgo_user = "sftpgo"

View File

@ -32,7 +32,7 @@ rateLimit();
addSite($_SESSION['id'], $_POST['dir'], $_POST['domain'], 'dns');
exec('2>&1 ' . CONF['ht']['sudo_path'] . ' ' . CONF['ht']['certbot_path'] . ' certonly' . (($_SESSION['type'] === 'approved') ? '' : ' --test-cert') . ' --key-type rsa --rsa-key-size 3072 --webroot --webroot-path ' . CONF['ht']['acme_path'] . ' --domain ' . $_POST['domain'], $output, $returnCode);
exec('2>&1 ' . CONF['ht']['sudo_path'] . ' ' . CONF['ht']['certbot_path'] . ' certonly' . (($_SESSION['type'] === 'approved') ? '' : ' --test-cert') . ' --domain ' . $_POST['domain'], $output, $returnCode);
if ($returnCode !== 0)
output(500, 'Certbot failed to get a Let\'s Encrypt certificate.', $output);