From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id qKokM3MYcGbtuQAAe85BDQ:P1 (envelope-from ) for ; Mon, 17 Jun 2024 11:05:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id qKokM3MYcGbtuQAAe85BDQ (envelope-from ) for ; Mon, 17 Jun 2024 13:05:23 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=zancanaro.id.au header.s=k1 header.b=i6Osru56; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-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=1718622323; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=lKzo6AjQRsbdt4Bb0ok1f70Bk7FFjHz9/5mHmoK66qg=; b=Eaeej0Tcf/76d9ajXaueo9Cd4MEhlY3ro4IBVq2OC7rM8stWF+3bXo1rFN/St6JMmtD10z Aylf1LVwBfDrLudQFo6qm1H4fZ05pvLqrnTAFEr7sNu6v9E22nPcIh53sCe5SoDd75iNeo N7d5wp4i81+hLHQKLcbXOwuYxH3BeSxwhbcpQLGudLg3/HpqQxL1pCHDfu5qLNYDd2KXh9 xXvwc6y4eHRkvw9kXdhRdZmEua6ouefSsYUVS0rnOP20RTpqzKN12X028OsoYqlXiaFGcK zbRGqvcFpajEknfMT2DLob1tLnciO/AIsZJzOduDc1QClWju5Cj+ryS8wm2WMA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=zancanaro.id.au header.s=k1 header.b=i6Osru56; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-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=1718622323; a=rsa-sha256; cv=none; b=NKWv0aX7m5NPPd5q7QTOVqRd0q/CMUPVT5SyUNJOBR7PrRQfgFHKJS612A+jMRFvA7ietn daMMP03QD0AJEkRmf3FxYFV8IxflMucToNR0n7AMjrJxRGBFxcMKshQuCSlQVe6kxWULqh Y9ImH3ZOrsT2dTsmQ4878DMxj6Rm8vhU1WtQ9idMrWqZCSksZjbbTBlhFjdDbYVbmCFEKV LR2l68gFqVRGvYeE7lmLZsUYWAaNO/YjWv+WQ5Sdd6EP7Isf9g8w40mSdLMIRiQqRCGX+r 9cqrCZO9m3kUfurGlUhGrM6j35aiUkwuSV2JfOGrMLwAoymBxhaPm9MHzBEqXg== 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 026D257D3F for ; Mon, 17 Jun 2024 13:05:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJAAP-0002Rw-Ad; Mon, 17 Jun 2024 07:04:53 -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 1sJAAN-0002RQ-Vz; Mon, 17 Jun 2024 07:04:52 -0400 Received: from voltorb.zancanaro.id.au ([45.77.50.64]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJAAL-00076F-7Q; Mon, 17 Jun 2024 07:04:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=k1; bh=ns1IqWNgou79Bif o/wX21j/OguTxFZsPLCuOcioNrqU=; h=references:in-reply-to:date:subject: cc:to:from; d=zancanaro.id.au; b=i6Osru56zWmjWArcU1EznFrocJhv4yDXTLwxj Qnrhy3XZRbOZAmXk8Q6HQk77KJAK/Y1XmtlBwhk0elGov9OZhhnbB8MQdetrd/GwTN3uXD eFzscOQgo6KxHH3oJYKTYaDZIgx6aL2jM+1meXIsH9MXdcsdrfE/JRZqCjyRSyE4= Received: by voltorb.zancanaro.id.au (OpenSMTPD) with ESMTPSA id ffac75ca (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 17 Jun 2024 11:04:34 +0000 (UTC) From: Carlo Zancanaro To: Christopher Baines Cc: Andy Tai , guix-devel@gnu.org, guix-sysadmin@gnu.org Subject: [PATCH maintenance] hydra: services: Reload nginx when certbot updates certificates. Date: Mon, 17 Jun 2024 21:03:50 +1000 Message-ID: <20240617110421.28377-1-carlo@zancanaro.id.au> X-Mailer: git-send-email 2.41.0 In-Reply-To: <877ceo58mh.fsf@cbaines.net> References: <877ceo58mh.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=45.77.50.64; envelope-from=carlo@zancanaro.id.au; helo=voltorb.zancanaro.id.au 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_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 026D257D3F X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -4.26 X-Spam-Score: -4.26 X-TUID: x2cclUgqyifM * hydra/modules/sysadmin/services.scm (%certbot-deploy-hook): New variable. (%certbot-job): Pass %certbot-deploy-hook to certbot invocation. --- I think this patch should resolve the certificate issue more permanently. I haven't tested it at all, but I mostly just stole it from Guix's certbot service. I know it works there, so I'm just assuming it will work here, too. hydra/modules/sysadmin/services.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hydra/modules/sysadmin/services.scm b/hydra/modules/sysadmin/services.scm index 128b0c1..3d996f5 100644 --- a/hydra/modules/sysadmin/services.scm +++ b/hydra/modules/sysadmin/services.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2023 Andreas Enge ;;; Copyright © 2023 Lars-Dominik Braun ;;; Copyright © 2024 Arun Isaac +;;; Copyright © 2024 Carlo Zancanaro ;;; ;;; This program is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by @@ -616,11 +617,19 @@ to a selected directory.") `(("nginx" ,(file-append nginx "/share/nginx/conf"))))) +(define %certbot-deploy-hook + ;; Reload nginx after a new certificate is deployed. + (with-imported-modules '((gnu services herd)) + #~(begin + (use-modules (gnu services herd)) + (with-shepherd-action 'nginx ('reload) result result)))) + + (define %certbot-job ;; Attempt to renew the Let's Encrypt certificate twice a week. #~(job "30 0 * * 2,5" (string-append #$certbot "/bin/certbot renew \ ---webroot --webroot-path /var/www"))) +--webroot --webroot-path /var/www --deploy-hook " #$certbot-deploy-hook))) base-commit: 489fc437c7b3aa0af41a40d6090eb4c51ced0028 -- 2.41.0