From 03e61fad26fdbfd7bca6851815be8190c58e4de6 Mon Sep 17 00:00:00 2001 From: Miraty Date: Wed, 26 Apr 2023 14:08:47 +0200 Subject: [PATCH] Autoconfigure certbot using cli.ini --- DOCS/configuration.md | 4 ---- config.ini | 2 -- pg-act/ht/add-dns.php | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/DOCS/configuration.md b/DOCS/configuration.md index dfafa3b..01df26c 100644 --- a/DOCS/configuration.md +++ b/DOCS/configuration.md @@ -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.) diff --git a/config.ini b/config.ini index 681acfc..3b13404 100644 --- a/config.ini +++ b/config.ini @@ -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" diff --git a/pg-act/ht/add-dns.php b/pg-act/ht/add-dns.php index 109b3f9..d74c046 100644 --- a/pg-act/ht/add-dns.php +++ b/pg-act/ht/add-dns.php @@ -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);