From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id ELrjH+DVKmQe7AAASxT56A (envelope-from ) for ; Mon, 03 Apr 2023 15:34:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +A6YH+DVKmQvdQEAauVa8A (envelope-from ) for ; Mon, 03 Apr 2023 15:34:24 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3828E98D0 for ; Mon, 3 Apr 2023 15:34:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjKK3-0007KT-Lp; Mon, 03 Apr 2023 09:34:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjKJv-0007I2-LT for guix-patches@gnu.org; Mon, 03 Apr 2023 09:34:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pjKJv-00029Q-5t for guix-patches@gnu.org; Mon, 03 Apr 2023 09:34:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pjKJu-0000n3-HD for guix-patches@gnu.org; Mon, 03 Apr 2023 09:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62642] [PATCH] services: certbot: Fix nginx crash when certbot is used without domains Resent-From: Saku Laesvuori Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Apr 2023 13:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62642 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62642@debbugs.gnu.org Cc: Saku Laesvuori X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16805288052984 (code B ref -1); Mon, 03 Apr 2023 13:34:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Apr 2023 13:33:25 +0000 Received: from localhost ([127.0.0.1]:43729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjKJJ-0000m4-3e for submit@debbugs.gnu.org; Mon, 03 Apr 2023 09:33:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:51392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pjKJG-0000lw-Ul for submit@debbugs.gnu.org; Mon, 03 Apr 2023 09:33:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjKJG-0006ej-IJ for guix-patches@gnu.org; Mon, 03 Apr 2023 09:33:22 -0400 Received: from vmi571514.contaboserver.net ([75.119.130.101] helo=mail.laesvuori.fi) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjKJE-00022w-KX for guix-patches@gnu.org; Mon, 03 Apr 2023 09:33:21 -0400 Received: from localhost.localdomain (185-185-168-253.localnetip.fi [185.185.168.253]) by mail.laesvuori.fi (Postfix) with ESMTPSA id 1943034009E; Mon, 3 Apr 2023 15:33:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1680528813; bh=zatl4EdA0bu8eWvevljNb9xXf/srAwIQhHwRBr4YKPU=; h=From:To:Cc:Subject:Date; b=TwU38LUJUK91SiOu/rBd96OeGggiO65jTUVNbpGTzl9J+mB3WSK0CVLH0+wyg+5kM hhIQLa26h/jYnJMSY2VUUSYWe6WZOZmc7Fd8jwT85uUvNI8zUy0huIbANaOr6hURmZ OKSWiHSU6czYqciISp9MrI9XHuvH5ziI4WepUric= Date: Mon, 3 Apr 2023 16:32:41 +0300 Message-Id: <20230403133241.14760-1-saku@laesvuori.fi> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=75.119.130.101; envelope-from=saku@laesvuori.fi; helo=mail.laesvuori.fi X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Saku Laesvuori X-ACL-Warn: , Saku Laesvuori via Guix-patches From: Saku Laesvuori via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680528864; a=rsa-sha256; cv=none; b=Ml9hW9uGIKv6GVHHkFfqpiJ0lLxRQ1rlnH4AIt4lWVEixDHTVfCWoSSR2422BLWbPserC4 ppV5ppZ+ERxnrCCa3F/QgRiqKYtBtb1sfiiZGOK660dis1w2APVQT96sbgVRhGVJzozvDC IckSb52GDgmrB6QswFC2B5ts7lfMzcP+C29DQODfw0DfBixnGp0cnSfcfTpkKXdSkEaqEa yHFTFVFQ3Wv/Nizs+7WyBd1Sy3NsqduymYpudgEaVPF3v5tHzXfpzFBbqv2o33ED8aV+FL wnh2kdHXBA+p7vOhEkwEFAuNwF8HsK2F4c2KM417s7ZRZULfVHJ5P8uihKYaQw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=TwU38LUJ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680528864; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=0dZQ/yPci3vtrw0rbmdXMXDj6UIB2A25JxiUQjBUmnI=; b=YLsWYV78c/symvhP5HX7UGKuOgd2AWop6JgHwWBLU8EUkJaB2rPYvUpCrT5uI+ghOooNpM K1ZNuUa0Md+dwW1wMsBDSneJmLyBvu2kLd3x12BpW8rC6cyNUMo5P3gjssuJokt8PGJGXr ejFm+t7EbpynwFCOnxKT1AEeUeQ0beihF26KF/Om12lA8pDuwXHRyHJXeX2hczljcMceGK 12r2B3U4LybVoI9tvXu8SMRJKdlHYPmcrxqgFVT4x8j0n2dlRZKy3nn2Ct/lR7+Zx5RfGr EMQKFGeOBpGSPO6bzw8Omz/5bdJrRRg40jnALtgCmMG+6e/zvc9YkY1PWscNgg== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=TwU38LUJ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -4.22 X-Spam-Score: -4.22 X-Migadu-Queue-Id: 3828E98D0 X-TUID: lfreYWgxR1yt * 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 (($ 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