unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#30866] [PATCH] services: certbot: Don't try to renew certificates on activation.
@ 2018-03-19 21:17 Clément Lassieur
  2018-04-03 15:03 ` bug#30866: " Clément Lassieur
  0 siblings, 1 reply; 2+ messages in thread
From: Clément Lassieur @ 2018-03-19 21:17 UTC (permalink / raw)
  To: 30866

Because it takes too much time and it requires networking.

Thanks to Mathieu Othacehe for suggesting this.

* gnu/services/certbot.scm (certbot-activation): Do not run the renewal
command, copy its path to a fixed location, display it, so that the user can
run the command when they want.
---
 gnu/services/certbot.scm | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm
index 066b8241b..938016402 100644
--- a/gnu/services/certbot.scm
+++ b/gnu/services/certbot.scm
@@ -26,6 +26,7 @@
   #:use-module (gnu services web)
   #:use-module (gnu system shadow)
   #:use-module (gnu packages tls)
+  #:use-module (guix i18n)
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
@@ -113,14 +114,19 @@
           #$(certbot-command config))))
 
 (define (certbot-activation config)
-  (match config
-    (($ <certbot-configuration> package webroot certificates email
-                                rsa-key-size default-location)
-     (with-imported-modules '((guix build utils))
-       #~(begin
-           (use-modules (guix build utils))
-           (mkdir-p #$webroot)
-           (zero? (system* #$(certbot-command config))))))))
+  (let* ((certbot-directory "/var/lib/certbot")
+         (script (in-vicinity certbot-directory "renew-certificates"))
+         (message (format #f (G_ "~a may need to be run~%") script)))
+    (match config
+      (($ <certbot-configuration> package webroot certificates email
+                                  rsa-key-size default-location)
+       (with-imported-modules '((guix build utils))
+         #~(begin
+             (use-modules (guix build utils))
+             (mkdir-p #$webroot)
+             (mkdir-p #$certbot-directory)
+             (copy-file #$(certbot-command config) #$script)
+             (display #$message)))))))
 
 (define certbot-nginx-server-configurations
   (match-lambda
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#30866: [PATCH] services: certbot: Don't try to renew certificates on activation.
  2018-03-19 21:17 [bug#30866] [PATCH] services: certbot: Don't try to renew certificates on activation Clément Lassieur
@ 2018-04-03 15:03 ` Clément Lassieur
  0 siblings, 0 replies; 2+ messages in thread
From: Clément Lassieur @ 2018-04-03 15:03 UTC (permalink / raw)
  To: 30866-done

Clément Lassieur <clement@lassieur.org> writes:

> Because it takes too much time and it requires networking.
>
> Thanks to Mathieu Othacehe for suggesting this.
>
> * gnu/services/certbot.scm (certbot-activation): Do not run the renewal
> command, copy its path to a fixed location, display it, so that the user can
> run the command when they want.
> ---
>  gnu/services/certbot.scm | 22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)

Pushed as f72662968e757ed79eefa1990b5b94d802571632.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-03 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 21:17 [bug#30866] [PATCH] services: certbot: Don't try to renew certificates on activation Clément Lassieur
2018-04-03 15:03 ` bug#30866: " Clément Lassieur

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).