diff options
| author | Pierre Langlois <pierre.langlois@gmx.com> | 2021-03-14 13:15:43 +0000 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2025-07-08 16:54:06 +0900 |
| commit | 57fc58ba485caecdb6910d3609abb974cb167068 (patch) | |
| tree | 58cb436e8a7ed27ec1d6ce24f05e59d0fca779e5 /gnu | |
| parent | c603068f6f52b0d600809cc6eb857f9b68be8421 (diff) | |
services: certbot: Add dry-run? certificate option.
* gnu/services/certbot.scm (certificate-configuration): Add dry-run? field.
(certbot-command): Use it to pass --dry-run to certbot.
* doc/guix.texi (Certificate Services): Document dry-run? option.
Change-Id: I26b0dc06e2b7e5fb34305deee09e311d085f8a4b
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
Modified-by: Maxim Cournoyer <maxim@guixotic.coop>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/services/certbot.scm | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm index 2c7979a4bea..7a7c2a9e00e 100644 --- a/gnu/services/certbot.scm +++ b/gnu/services/certbot.scm @@ -66,6 +66,8 @@ (default #f)) (deploy-hook certificate-configuration-deploy-hook (default #f)) + (dry-run? certbot-configuration-dry-run? + (default #f)) (start-self-signed? certificate-configuration-start-self-signed? (default #t))) @@ -141,40 +143,44 @@ deploy." (match-lambda (($ <certificate-configuration> custom-name domains challenge csr authentication-hook - cleanup-hook deploy-hook) - (let ((name (or custom-name (car domains)))) - (if challenge - (append - (list name certbot "certonly" "-n" "--agree-tos" - "--manual" - (string-append "--preferred-challenges=" challenge) - "--cert-name" name - "-d" (string-join domains ",")) - (if csr `("--csr" ,csr) '()) - (if email - `("--email" ,email) - '("--register-unsafely-without-email")) - (if server `("--server" ,server) '()) - (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) - (if authentication-hook - `("--manual-auth-hook" ,authentication-hook) - '()) - (if cleanup-hook `("--manual-cleanup-hook" ,cleanup-hook) '()) - (list "--deploy-hook" - (certbot-deploy-hook name deploy-hook))) - (append - (list name certbot "certonly" "-n" "--agree-tos" - "--webroot" "-w" webroot - "--cert-name" name - "-d" (string-join domains ",")) - (if csr `("--csr" ,csr) '()) - (if email - `("--email" ,email) - '("--register-unsafely-without-email")) - (if server `("--server" ,server) '()) - (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) - (list "--deploy-hook" - (certbot-deploy-hook name deploy-hook))))))) + cleanup-hook deploy-hook + dry-run?) + (append + (let ((name (or custom-name (car domains)))) + (if challenge + (append + (list name certbot "certonly" "-n" "--agree-tos" + "--manual" + (string-append "--preferred-challenges=" challenge) + "--cert-name" name + "-d" (string-join domains ",")) + (if csr `("--csr" ,csr) '()) + (if email + `("--email" ,email) + '("--register-unsafely-without-email")) + (if server `("--server" ,server) '()) + (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) + (if authentication-hook + `("--manual-auth-hook" ,authentication-hook) + '()) + (if cleanup-hook `("--manual-cleanup-hook" ,cleanup-hook) '()) + (list "--deploy-hook" + (certbot-deploy-hook name deploy-hook))) + (append + (list name certbot "certonly" "-n" "--agree-tos" + "--webroot" "-w" webroot + "--cert-name" name + "-d" (string-join domains ",")) + (if csr `("--csr" ,csr) '()) + (if email + `("--email" ,email) + '("--register-unsafely-without-email")) + (if server `("--server" ,server) '()) + (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) + (list "--deploy-hook" + (certbot-deploy-hook name deploy-hook))))) + ;; Common options. + (if dry-run? '("--dry-run") '())))) certificates))) (program-file "certbot-command" |
