[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/24: services: certbot: Fix nginx crash when certbot is used without d
From: |
guix-commits |
Subject: |
03/24: services: certbot: Fix nginx crash when certbot is used without domains. |
Date: |
Sun, 18 Jun 2023 17:35:58 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit a82130de50d2c84d77492d9aa43e4b7f4b06b4b2
Author: Saku Laesvuori <saku@laesvuori.fi>
AuthorDate: Tue Apr 4 23:43:46 2023 +0300
services: certbot: Fix nginx crash when certbot is used without domains.
* gnu/services/certbot.scm (certbot-nginx-server-configurations):
Don't return a broken nginx-server-configuration with empty server_name
when no certificate domains are configured. Instead add a separate
server for every certificate, so 0 certificates adds 0 servers.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Reviewed-by: Bruno Victal <mirai@makinata.eu>
---
gnu/services/certbot.scm | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm
index 8e6784df2b..0c45471659 100644
--- a/gnu/services/certbot.scm
+++ b/gnu/services/certbot.scm
@@ -173,20 +173,24 @@
(match-lambda
(($ <certbot-configuration> package webroot certificates email
server rsa-key-size default-location)
- (list
- (nginx-server-configuration
- (listen '("80" "[::]:80"))
- (ssl-certificate #f)
- (ssl-certificate-key #f)
- (server-name
- (apply append (map certificate-configuration-domains certificates)))
- (locations
- (filter identity
- (list
- (nginx-location-configuration
- (uri "/.well-known")
- (body (list (list "root " webroot ";"))))
- default-location))))))))
+ (define (certificate->nginx-server certificate-configuration)
+ (match-record certificate-configuration <certificate-configuration>
+ (domains challenge)
+ (nginx-server-configuration
+ (listen '("80" "[::]:80"))
+ (ssl-certificate #f)
+ (ssl-certificate-key #f)
+ (server-name domains)
+ (locations
+ (filter identity
+ (append
+ (if challenge
+ '()
+ (list (nginx-location-configuration
+ (uri "/.well-known")
+ (body (list (list "root " webroot ";"))))))
+ (list default-location)))))))
+ (map certificate->nginx-server certificates))))
(define certbot-service-type
(service-type (name 'certbot)
- branch master updated (726f2a9447 -> 81231bf236), guix-commits, 2023/06/18
- 03/24: services: certbot: Fix nginx crash when certbot is used without domains.,
guix-commits <=
- 07/24: gnu: font-alias: Update to 1.0.5., guix-commits, 2023/06/18
- 10/24: gnu: font-dec-misc: Update to 1.0.4., guix-commits, 2023/06/18
- 12/24: gnu: font-micro-misc: Update to 1.0.4., guix-commits, 2023/06/18
- 01/24: doc: Fix typo., guix-commits, 2023/06/18
- 04/24: gnu: openmw-openscenegraph: Update to Nov 2022 commit., guix-commits, 2023/06/18
- 05/24: gnu: font-adobe100dpi: Update to 1.0.4., guix-commits, 2023/06/18
- 06/24: gnu: font-adobe75dpi: Update to 1.0.4., guix-commits, 2023/06/18
- 02/24: gnu: libreoffice: Fix access to python modules., guix-commits, 2023/06/18
- 09/24: gnu: font-cronyx-cyrillic: Update to 1.0.4., guix-commits, 2023/06/18
- 11/24: gnu: font-isas-misc: Update to 1.0.4., guix-commits, 2023/06/18