From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iFRpBa7a1GAjQAAAgWs5BA (envelope-from ) for ; Thu, 24 Jun 2021 21:19:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kFISAa7a1GAISwAAbx9fmQ (envelope-from ) for ; Thu, 24 Jun 2021 19:19:10 +0000 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 D155511AB8 for ; Thu, 24 Jun 2021 21:19:09 +0200 (CEST) Received: from localhost ([::1]:50754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwUsW-0006eK-Eb for larch@yhetil.org; Thu, 24 Jun 2021 15:19:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwUsQ-0006e8-JK for guix-patches@gnu.org; Thu, 24 Jun 2021 15:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwUsP-0003qu-Ra for guix-patches@gnu.org; Thu, 24 Jun 2021 15:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lwUsP-0001li-NH for guix-patches@gnu.org; Thu, 24 Jun 2021 15:19:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49213] [PATCH v2] services: certbot: Add option to use CSR file. References: <20210624185111.5959-1-rg@raghavgururajan.name> In-Reply-To: <20210624185111.5959-1-rg@raghavgururajan.name> Resent-From: Raghav Gururajan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Jun 2021 19:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49213 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49213@debbugs.gnu.org Cc: Raghav Gururajan Received: via spool by 49213-submit@debbugs.gnu.org id=B49213.16245623276771 (code B ref 49213); Thu, 24 Jun 2021 19:19:01 +0000 Received: (at 49213) by debbugs.gnu.org; 24 Jun 2021 19:18:47 +0000 Received: from localhost ([127.0.0.1]:44169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwUsA-0001l8-LK for submit@debbugs.gnu.org; Thu, 24 Jun 2021 15:18:46 -0400 Received: from out1.migadu.com ([91.121.223.63]:62335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwUs6-0001ks-7G for 49213@debbugs.gnu.org; Thu, 24 Jun 2021 15:18:45 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1624562320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5J1qwjNxQUuFTRYrtH2Q0HnqLDdd7IeDdNM8SfxNL38=; b=dbqx/CrQ2xDEs6SpcnjkSgcfsgvgWz83CiGC74l2xMKEZu3OU+62qMkyqdV4U+vAlET1F9 k/i/9PeuIwawir8lKJSq/izaTrmFBjrWd6hkhbl389i8hL38x2jJtVd49Ctg8+tHoiKOEY KinDzk9vfzqBoKPUaXen9TzZIb2CcqDriErdUCGorJ80brFiFiVtqO7czyc5+s1EYbBNQ8 6FdClP05Ns3uThZv6aMJqx+Zcwd+olZToAL34vwj1p3/XNYS8250SzdTdpEkJDYppHcWSm +Lb0ZuI3ycQT2p3CYKypz1h/bzl6VZJZ3zeDV0a5NbVWfBxooOaqawYXcOMUXw== Date: Thu, 24 Jun 2021 15:18:37 -0400 Message-Id: <20210624191837.6615-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Auth-User: rg@raghavgururajan.name 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Raghav Gururajan X-ACL-Warn: , Raghav Gururajan via Guix-patches From: Raghav Gururajan via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: D155511AB8 X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: DNWy37zg8Y7T * gnu/services/certbot.scm (): Add csr field. (certbot-command): Modify. * doc/guix.texi (Certificate Services): Document it. --- doc/guix.texi | 7 +++++++ gnu/services/certbot.scm | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 15e8999447..fce72a9fb5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -91,6 +91,7 @@ Copyright @copyright{} 2020 Edgar Vincent@* Copyright @copyright{} 2021 Maxime Devos@* Copyright @copyright{} 2021 B. Wilson@* Copyright @copyright{} 2021 Xinglu Chen@* +Copyright @copyright{} 2021 Raghav Gururajan@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -25934,6 +25935,12 @@ the documentation at @url{https://certbot.eff.org/docs/using.html#hooks}), and gives Let's Encrypt permission to log the public IP address of the requesting machine. +@item @code{csr} (default: @code{#f}) +File name of Certificate Signing Request (CSR) in DER or PEM format. +If @code{#f} is specified, this argument will not be passed to certbot. +If a value is provided, certbot will use it to obtain a certificate, instead of +using a randomly-generated CSR. + @item @code{authentication-hook} (default: @code{#f}) Command to be run in a shell once for each certificate challenge to be answered. For this command, the shell variable @code{$CERTBOT_DOMAIN} diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm index 1c67ff63f1..c73142ca81 100644 --- a/gnu/services/certbot.scm +++ b/gnu/services/certbot.scm @@ -55,6 +55,8 @@ (default '())) (challenge certificate-configuration-challenge (default #f)) + (csr certificate-configuration-csr + (default #f)) (authentication-hook certificate-authentication-hook (default #f)) (cleanup-hook certificate-cleanup-hook @@ -95,7 +97,7 @@ (match-lambda (($ custom-name domains challenge authentication-hook cleanup-hook - deploy-hook) + deploy-hook csr) (let ((name (or custom-name (car domains)))) (if challenge (append @@ -110,6 +112,7 @@ '("--register-unsafely-without-email")) (if server `("--server" ,server) '()) (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) + (if csr `("--csr" ,csr) '()) (if authentication-hook `("--manual-auth-hook" ,authentication-hook) '()) @@ -125,6 +128,7 @@ '("--register-unsafely-without-email")) (if server `("--server" ,server) '()) (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) + (if csr `("--csr" ,csr) '()) (if deploy-hook `("--deploy-hook" ,deploy-hook) '())))))) certificates))) (program-file -- 2.32.0