--- Begin Message ---
Subject: |
[PATCH] services: certbot: Don't try to renew certificates on activation. |
Date: |
Mon, 19 Mar 2018 22:17:12 +0100 |
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
--- End Message ---
--- Begin Message ---
Subject: |
Re: [bug#30866] [PATCH] services: certbot: Don't try to renew certificates on activation. |
Date: |
Tue, 03 Apr 2018 17:03:45 +0200 |
User-agent: |
mu4e 1.0; emacs 25.3.1 |
Clément Lassieur <address@hidden> 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.
--- End Message ---