summary refs log tree commit diff
path: root/gnu/services/certbot.scm
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.si>2020-09-11 13:55:55 +0200
committerLudovic Courtès <ludo@gnu.org>2020-09-13 23:34:23 +0200
commit11a962e6536d59b8c5b24880fbb19550242ffa04 (patch)
tree03afd178d75f8c72045372edf567e39e46ce00cd /gnu/services/certbot.scm
parent0f918908ebcfc1d5aeb780d6fbe5c52a48178e85 (diff)
downloadguix-11a962e6536d59b8c5b24880fbb19550242ffa04.tar.gz
services: certbot: Support registration without email.
* gnu/services/certbot.scm (certbot-configuration): Add default for the
email option.
(certbot-command): Pass email for registration only when specified.
* doc/guix.texi (Certificate Services): "mandatory"→"optional" email.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/services/certbot.scm')
-rw-r--r--gnu/services/certbot.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm
index 5643340799..1c67ff63f1 100644
--- a/gnu/services/certbot.scm
+++ b/gnu/services/certbot.scm
@@ -71,7 +71,8 @@
                        (default "/var/www"))
   (certificates        certbot-configuration-certificates
                        (default '()))
-  (email               certbot-configuration-email)
+  (email               certbot-configuration-email
+                       (default #f))
   (server              certbot-configuration-server
                        (default #f))
   (rsa-key-size        certbot-configuration-rsa-key-size
@@ -99,12 +100,14 @@
                    (if challenge
                      (append
                       (list name certbot "certonly" "-n" "--agree-tos"
-                            "-m" email
                             "--manual"
                             (string-append "--preferred-challenges=" challenge)
                             "--cert-name" name
                             "--manual-public-ip-logging-ok"
                             "-d" (string-join domains ","))
+                      (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
@@ -114,10 +117,12 @@
                       (if deploy-hook `("--deploy-hook" ,deploy-hook) '()))
                      (append
                       (list name certbot "certonly" "-n" "--agree-tos"
-                            "-m" email
                             "--webroot" "-w" webroot
                             "--cert-name" name
                             "-d" (string-join domains ","))
+                      (if email
+                          `("--email" ,email)
+                          '("--register-unsafely-without-email"))
                       (if server `("--server" ,server) '())
                       (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '())
                       (if deploy-hook `("--deploy-hook" ,deploy-hook) '()))))))