From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UG1TOkc0umXFLAAAqHPOHw:P1 (envelope-from ) for ; Wed, 31 Jan 2024 12:51:36 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UG1TOkc0umXFLAAAqHPOHw (envelope-from ) for ; Wed, 31 Jan 2024 12:51:36 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=zancanaro.id.au header.s=k1 header.b=ODW6K1eU; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=zancanaro.id.au (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706701895; h=from:from:sender:sender: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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ASaEcI+ijhVJbYwFoD/vIwYC13LeoPY59zHNXFaXWR4=; b=t1wHQX0CJR2N+tMsQZzyHyEFWauOFTRp0BFhb7KszZHR6i+c98+Nh5aPuKD4Rbax2WM9H+ KB3IBpUUqDp20dvpSTv6NNMNo4y7ekoa185/pnlK4MNS2QwcPMrwKvFw1fttXUYnuXivhc KndlgBmmgOjzm4Uj6u2vhF70vM4cL/2RwFPo9GHRSa5nKA8cjpj5e8wIRvb7eENoysyj6k 0ADjpkap06NsKjl02bTIessQ6yMLJP5E1EL4eUdqU/OlnSumpmuzVZ6rnQ0VXLIa674v/C 51JOvC38/ADhA3jT9ERImYLdPlFqSjc0efpcYEpoRzAkAgwv9MvPMIqGbJHNmQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=zancanaro.id.au header.s=k1 header.b=ODW6K1eU; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=zancanaro.id.au (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706701895; a=rsa-sha256; cv=none; b=AHONwfhH8TUrkCXh0kBodGAdI0Q7WKWEPseb2G1yDuNLtFV0FOkLyCurCMgSZIYvWu73/M MltYwfK9tEDAmz8/9ObTU3Z5nGhSQtASIFnSZtvZeJlsTtMC05Rncj60Q/IY56uTMLnyoX FgwatrdYolPBYOQNe9TCrNX0p7tGWAnoCNxtOwZayQR2JsLWWvJLno/ziCevxlYcLBgL/3 CdECpPR79Reyxo6Fj3sUMZ+B2rLe/FL0aJNA9MyuF6e3ciaRZgr2yBN7zIoV/cpoPpPJMg 1NEUZHHzvuTDoxQfGmsMNjKC519Jx4BeAZl0UhQ7Wgb0uvEZhAUayTJTQs+b3g== 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 D482516439 for ; Wed, 31 Jan 2024 12:51:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rV97I-0004rJ-GY; Wed, 31 Jan 2024 06:50:56 -0500 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 1rV97G-0004lh-6X for bug-guix@gnu.org; Wed, 31 Jan 2024 06:50:54 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rV97F-00033D-SV for bug-guix@gnu.org; Wed, 31 Jan 2024 06:50:53 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rV97P-0004m5-A1 for bug-guix@gnu.org; Wed, 31 Jan 2024 06:51:03 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#46961: [PATCH v3 3/4] services: certbot: Reload nginx in deploy hook. Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 31 Jan 2024 11:51:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46961 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 46961@debbugs.gnu.org Cc: clement@lassieur.org Received: via spool by 46961-submit@debbugs.gnu.org id=B46961.170670184118292 (code B ref 46961); Wed, 31 Jan 2024 11:51:03 +0000 Received: (at 46961) by debbugs.gnu.org; 31 Jan 2024 11:50:41 +0000 Received: from localhost ([127.0.0.1]:37579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rV972-0004kt-PK for submit@debbugs.gnu.org; Wed, 31 Jan 2024 06:50:41 -0500 Received: from voltorb.zancanaro.id.au ([45.77.50.64]:46898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rV96x-0004k6-Qe for 46961@debbugs.gnu.org; Wed, 31 Jan 2024 06:50:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=k1; bh=ASaEcI+ijhVJbYw FoD/vIwYC13LeoPY59zHNXFaXWR4=; h=references:in-reply-to:date:subject: cc:to:from; d=zancanaro.id.au; b=ODW6K1eUftVWChmlW2Lnub3gx4nTSeLhUuvgC aaF/Tdug+32ZeCJDw9yqdl3mD2q3xPOnaM8uif9u7aCHpSBPU1Sm1yJ0sRJi2r3KxAoDhs MR/xC4zeW/KbgYZKTSXoJZgRH63apZHHMRBtib2JMrNV3lA5N7mTK2N3tvjasJXk= Received: by voltorb.zancanaro.id.au (OpenSMTPD) with ESMTPSA id 8d1c8e05 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 31 Jan 2024 11:50:03 +0000 (UTC) From: Carlo Zancanaro Date: Wed, 31 Jan 2024 11:46:24 +0000 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 3.84 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: 3.84 X-Migadu-Queue-Id: D482516439 X-TUID: 3Ul5XT9HOwku * gnu/services/certbot.scm (certbot-deploy-hook): Reload nginx. * doc/guix.texi (Certificate services): Remove deploy-hook from example. Change-Id: Ibb10481170a6fda7df72492072b939dd6a6ad176 --- I've pulled the nginx reloading into the regular deployment hook here. I also removed the explicit deploy hook in the documentation, because that is now the default behaviour. doc/guix.texi | 10 +--------- gnu/services/certbot.scm | 10 ++++++++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 732abceb0f..c71d7e94cf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -32562,21 +32562,13 @@ Certificate Services must be a @code{certbot-configuration} record as in this example: @lisp -(define %certbot-deploy-hook - (program-file "certbot-deploy-hook.scm" - (with-imported-modules '((gnu services herd)) - #~(begin - (use-modules (gnu services herd)) - (with-shepherd-action 'nginx ('reload) result result))))) - (service certbot-service-type (certbot-configuration (email "foo@@example.net") (certificates (list (certificate-configuration - (domains '("example.net" "www.example.net")) - (deploy-hook %certbot-deploy-hook)) + (domains '("example.net" "www.example.net"))) (certificate-configuration (domains '("bar.example.net"))))))) @end lisp diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm index 10b99f5630..cb1be0c0e9 100644 --- a/gnu/services/certbot.scm +++ b/gnu/services/certbot.scm @@ -100,9 +100,11 @@ (define (certbot-deploy-hook name deploy-hook-script) deploy." (program-file (string-append name "-deploy-hook") - (with-imported-modules '((guix build utils)) + (with-imported-modules '((gnu services herd) + (guix build utils)) #~(begin - (use-modules (guix build utils)) + (use-modules (gnu services herd) + (guix build utils)) (mkdir-p #$(string-append "/etc/certs/" name)) (chmod #$(string-append "/etc/certs/" name) #o755) @@ -120,6 +122,10 @@ (define (certbot-deploy-hook name deploy-hook-script) #$(string-append "/etc/certs/" name "/privkey.pem")) (rename-file #$(string-append "/etc/certs/" name "/fullchain.pem.new") #$(string-append "/etc/certs/" name "/fullchain.pem")) + + ;; With the new certificates in place, tell nginx to reload them. + (with-shepherd-action 'nginx ('reload) result result) + #$@(if deploy-hook-script (list #~(invoke #$deploy-hook-script)) '()))))) -- 2.41.0