From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em4il-0005Ds-K2 for guix-patches@gnu.org; Wed, 14 Feb 2018 16:36:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em4ii-00010v-Vi for guix-patches@gnu.org; Wed, 14 Feb 2018 16:36:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:35483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1em4ii-00010W-Qf for guix-patches@gnu.org; Wed, 14 Feb 2018 16:36:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1em4ii-0001xx-KP for guix-patches@gnu.org; Wed, 14 Feb 2018 16:36:04 -0500 Subject: [bug#30459] [PATCH 06/11] services: certbot: Get certbot to run non-interactively. Resent-Message-ID: From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Wed, 14 Feb 2018 22:34:59 +0100 Message-Id: <20180214213504.29984-6-clement@lassieur.org> In-Reply-To: <20180214213504.29984-1-clement@lassieur.org> References: <20180214213504.29984-1-clement@lassieur.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30459@debbugs.gnu.org * doc/guix.texi (Certificate Services): Add email field. * gnu/services/certbot.scm (, certbot-command, certbot-activation, certbot-nginx-server-configurations): Add email field. (certbot-command): Add '-n' and '--agree-tos' options. (certbot-service-type): Remove default-value. --- doc/guix.texi | 4 ++++ gnu/services/certbot.scm | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 42f2593d3..e951b3274 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15696,6 +15696,10 @@ files. A list of domains for which to generate certificates and request signatures. +@item @code{email} +Mandatory email used for registration, recovery contact, and important +account notifications. + @item @code{default-location} (default: @i{see below}) The default @code{nginx-location-configuration}. Because @code{certbot} needs to be able to serve challenges and responses, it needs to be able diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm index 661e17498..379c21143 100644 --- a/gnu/services/certbot.scm +++ b/gnu/services/certbot.scm @@ -50,6 +50,7 @@ (default "/var/www")) (domains certbot-configuration-domains (default '())) + (email certbot-configuration-email) (default-location certbot-configuration-default-location (default (nginx-location-configuration @@ -59,12 +60,14 @@ (define certbot-command (match-lambda - (($ package webroot domains default-location) + (($ package webroot domains email + default-location) (let* ((certbot (file-append package "/bin/certbot")) (commands (map (lambda (domain) - (list certbot "certonly" + (list certbot "certonly" "-n" "--agree-tos" + "-m" email "--webroot" "-w" webroot "-d" domain)) domains))) @@ -85,7 +88,8 @@ (define (certbot-activation config) (match config - (($ package webroot domains default-location) + (($ package webroot domains email + default-location) (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils)) @@ -94,7 +98,8 @@ (define certbot-nginx-server-configurations (match-lambda - (($ package webroot domains default-location) + (($ package webroot domains email + default-location) (map (lambda (domain) (nginx-server-configuration @@ -127,7 +132,6 @@ (domains (append (certbot-configuration-domains config) additional-domains))))) - (default-value (certbot-configuration)) (description "Automatically renew @url{https://letsencrypt.org, Let's Encrypt} HTTPS certificates by adjusting the nginx web server configuration -- 2.16.1