From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 8LFOKKIvuGUY9AAAqHPOHw:P1 (envelope-from ) for ; Tue, 30 Jan 2024 00:07:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 8LFOKKIvuGUY9AAAqHPOHw (envelope-from ) for ; Tue, 30 Jan 2024 00:07:14 +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=GwnG3555; dmarc=fail reason="SPF not aligned (relaxed)" header.from=zancanaro.id.au (policy=none); 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706569634; a=rsa-sha256; cv=none; b=CFyptas5+INz3t+oCAWe8kn06vbLpAOdFbSaKwjmSNq/4DClUxCVlRLk+Mlu+9dKAcS6tu UPzQkKwPoUFsN3Lexpv6Aimod7TSPe4HhuoBBL/IsIXk/JS9/41LvnZYzPlynCJEwPqnfE ZJAhEA23H8dleCOeaVkY1YGEv1DIV+buoxssCE6x+XJqYOBfdCEEirxpKrxL+DY8u8e1lY Ma3htqmLH4Mwe7WhEgLCVcdaPbKHiPALK8CbRVA1F8kcdQp59449ZA9AR+Q9h6eUnOXmbk ehvLBTOorFfPX4/b49rx3Q+N1yCqgFo7nQ2ySxlD97jx2Ui0HP7b7ji0flL7og== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=zancanaro.id.au header.s=k1 header.b=GwnG3555; dmarc=fail reason="SPF not aligned (relaxed)" header.from=zancanaro.id.au (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706569634; 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: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=jTp24FLQaL6OXmO40VNamOtS9kyp3WjLCIeDzsWZ8vc=; b=Z7h4FTJ1pgtw3hiRxn5xVU2tXrnuXuUwfmvjh8diL/tdhuGMfD6JyBqKuRcX8Y1koqAnYw VvyMCVzu0tin1JiN5J+F2HKFaEg8ttvOM1O6uiS9vMtpJE9F+c/MTTf3XJwJ0eD3CQnIGh j1goZi8pxDp1qlkCCs9Je73vkzyqWAm2RUe+IVGq8nfYxrkKvJB7ePIZmQxwAzXbJjdYfd ZlKo2ewv5fLc5skxpvei6LNS5n7Qm/PZniD08ymJCqDz8gzBN+Kq6l12vxbqPFMMLsXm01 PVIZyZpZRyJBPE5fyF1b1rMdS7JMqJrZmra4od3eoWkL8Wx1EVF6fpg7FAZkow== 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 006CF7F942 for ; Tue, 30 Jan 2024 00:07:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUafX-0007hp-JH; Mon, 29 Jan 2024 18:04:02 -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 1rUaeU-000751-43 for bug-guix@gnu.org; Mon, 29 Jan 2024 18:03:00 -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 1rUaeT-00007m-Gl for bug-guix@gnu.org; Mon, 29 Jan 2024 18:02:53 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUaeb-0000MK-Vb for bug-guix@gnu.org; Mon, 29 Jan 2024 18:03:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#46961: Nginx and certbot cervices don't play well togther Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 29 Jan 2024 23:03:01 +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: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 46961@debbugs.gnu.org Received: via spool by 46961-submit@debbugs.gnu.org id=B46961.17065693461318 (code B ref 46961); Mon, 29 Jan 2024 23:03:01 +0000 Received: (at 46961) by debbugs.gnu.org; 29 Jan 2024 23:02:26 +0000 Received: from localhost ([127.0.0.1]:33698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUae2-0000LB-6U for submit@debbugs.gnu.org; Mon, 29 Jan 2024 18:02:26 -0500 Received: from voltorb.zancanaro.id.au ([45.77.50.64]:60198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUadz-0000Kx-Ev for 46961@debbugs.gnu.org; Mon, 29 Jan 2024 18:02:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=k1; bh=jTp24FLQaL6OXmO 40VNamOtS9kyp3WjLCIeDzsWZ8vc=; h=date:references:in-reply-to:subject: cc:to:from; d=zancanaro.id.au; b=GwnG3555Lp8K05WE+z3pJh3Z0aXEhC/Gw5y2r 7kw5OzYT2ijIFdsGp/2lnqQumbahmwEdj5ylOdjtj/qnQBi17jJelG7IsxhGpuXvbN8Uqf d9bi+CAu1OI7f6x9UPNWwevvlNMMyuLrw+NIT79BSIZFcqospwNvBxUP90YEUmbU= Received: by voltorb.zancanaro.id.au (OpenSMTPD) with ESMTPSA id b4724408 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 29 Jan 2024 23:01:57 +0000 (UTC) From: Carlo Zancanaro In-Reply-To: <878r483pv5.fsf_-_@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Mon, 29 Jan 2024 20:23:58 +0100") References: <788b23efd206b4ef627de06236f868f97e3cbe05.1706098718.git.carlo@zancanaro.id.au> <878r483pv5.fsf_-_@lassieur.org> Date: Tue, 30 Jan 2024 10:02:06 +1100 Message-ID: <87il3bd9qp.fsf@zancanaro.id.au> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Scanner: mx10.migadu.com X-Spam-Score: -5.56 X-Migadu-Queue-Id: 006CF7F942 X-Migadu-Spam-Score: -5.56 X-TUID: nC67rOBWBYEV Hi Cl=C3=A9ment, Thanks for taking the time to review my change. I've responded inline below. On Mon, Jan 29 2024, Cl=C3=A9ment Lassieur wrote: > This is great, thank you! I tested it, it worked. Could you please > just make sure lines fit within 80 columns? Yep, no worries. > Would it make sense now to run =E2=80=98update-certificates=E2=80=99 at e= nd of the > activation stuff? We can't run it during activation, because nginx won't have started yet. However, I am planning a follow-up to add a one-shot service to run certbot after nginx starts. I'll see if I can add it to this series, but if I run into any issues I'll leave it for later. > And would it make sense to reload nginx after =E2=80=98update-certificate= s=E2=80=99 is > run? This would be a sensible default. There is an example in the manual of configuring certbot to reload nginx, so this should be straightforward to add. > gnu/services/certbot.scm:203:26: warning: "subjectAltName=3D~{DNS:~a~^,~}= ": unsupported format option ~{, use (ice-9 format) instead Ha! I import (ice-9 format), but within the gexp (and then I don't use it, whoops!). Must be a leftover from a previous iteration. I'll fix this up. >> + ;; Due to the way certbot runs, we need to >> + ;; create the self-signed certificates in the >> + ;; archive folder and symlink them into the live >> + ;; folder. This mimics what certbot does well >> + ;; enough to make acquiring new certificates >> + ;; work. > > In another mail you say it doesn't work as well as you thought it did? > What doesn't work? This comment doesn't describe the code any more. In my first attempt I was trying to generate certificates in /etc/letsencrypt/live/ and get certbot to write over them when it ran. Unfortunately, it refused to do so. I then tried writing to /etc/letsencrypt/archive/ and symlinking into /etc/letsencrypt/live/ (which is what this comment describes), but that also failed. Certbot refuses to write over any existing files when fetching a certificate. It looks like other acme clients might be happier to overwrite existing files, but changing away from certbot seemed like more work than adding a deploy hook to do what we need. I'll follow up with a v2 of this patch when I get a chance. Carlo