unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#62642] [PATCH] services: certbot: Fix nginx crash when certbot is used without domains
@ 2023-04-03 13:32 Saku Laesvuori via Guix-patches via
  2023-04-03 14:28 ` Bruno Victal
  0 siblings, 1 reply; 8+ messages in thread
From: Saku Laesvuori via Guix-patches via @ 2023-04-03 13:32 UTC (permalink / raw)
  To: 62642; +Cc: Saku Laesvuori

* gnu/services/certbot.scm (certbot-nginx-server-configurations):
Don't return a broken nginx-server-configuration when no certificate
domains are configured.
---
 gnu/services/certbot.scm | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm
index 8e6784df2b..3d9d207f8a 100644
--- a/gnu/services/certbot.scm
+++ b/gnu/services/certbot.scm
@@ -173,20 +173,21 @@ (define certbot-nginx-server-configurations
   (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))))))))
+     (if (null? certificates) '()
+       (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 certbot-service-type
   (service-type (name 'certbot)

base-commit: 2cf71e725d55bc5bf1ad663b7c696516299cc8a7
-- 
2.39.2





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

end of thread, other threads:[~2023-06-18 21:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 13:32 [bug#62642] [PATCH] services: certbot: Fix nginx crash when certbot is used without domains Saku Laesvuori via Guix-patches via
2023-04-03 14:28 ` Bruno Victal
2023-04-03 18:06   ` Saku Laesvuori via Guix-patches via
2023-04-04 13:21     ` Bruno Victal
2023-04-04 20:43       ` [bug#62642] [PATCH v2] " Saku Laesvuori via Guix-patches via
2023-06-18 21:11         ` bug#62642: [PATCH] " Ludovic Courtès
2023-04-13  9:00       ` [bug#62642] " Saku Laesvuori via Guix-patches via
2023-05-22 11:34         ` Saku Laesvuori via Guix-patches via

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).