From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kGjWOmoF1WB+qwAAgWs5BA (envelope-from ) for ; Fri, 25 Jun 2021 00:21:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UPV+NmoF1WDNSQAA1q6Kng (envelope-from ) for ; Thu, 24 Jun 2021 22:21:30 +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 A1A081438B for ; Fri, 25 Jun 2021 00:21:29 +0200 (CEST) Received: from localhost ([::1]:57244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwXiy-0001Mp-LS for larch@yhetil.org; Thu, 24 Jun 2021 18:21:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwXiZ-0001Mf-56 for guix-patches@gnu.org; Thu, 24 Jun 2021 18:21:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwXiY-0005To-Pt for guix-patches@gnu.org; Thu, 24 Jun 2021 18:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lwXiY-0007G7-F8 for guix-patches@gnu.org; Thu, 24 Jun 2021 18:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49213] [PATCH v5] 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 22:21:02 +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.162457322627838 (code B ref 49213); Thu, 24 Jun 2021 22:21:02 +0000 Received: (at 49213) by debbugs.gnu.org; 24 Jun 2021 22:20:26 +0000 Received: from localhost ([127.0.0.1]:44288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwXhy-0007Ew-Gp for submit@debbugs.gnu.org; Thu, 24 Jun 2021 18:20:26 -0400 Received: from out2.migadu.com ([188.165.223.204]:64535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwXhu-0007Eg-NK for 49213@debbugs.gnu.org; Thu, 24 Jun 2021 18:20:25 -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=1624573220; h=from:from: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; bh=qn+2NP29/a4lkOeeco9BOD4cYkzgwGvJyMcKpPOciCg=; b=pcjNsNU2iU1ae2UCtEIUX5ChFDTTcCS8Jwlc1t6YMYBqAOvBLnv545ySxs00RQ8cmga1S9 7hoSIRhoCZDVQ+LLcvdivvp2cwIxBw40ij7WGkS4Ry1yFgnymlB5D5MxTMh2diZEoNrjvl YQ/t/3PBvH2fsUqB8fjsasAw/nmD04Tq6lEmJZTHLUCgqbQ4LIOKVPeR91UlJGu1EhXyfQ i4voeb4zNiUmbQp9oGHdOYPxa3N6nE6aO42+J8ysUqEB6yRvcuiz/IeTHwAkm7u4gzuf6J 2EVG9FjDm7wDPybA7vTQnTMBsahMMghOP7/xwGFSyCue3RdA5ZPF0ylcpbcw4A== Date: Thu, 24 Jun 2021 18:20:17 -0400 Message-Id: <20210624222017.11844-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: A1A081438B X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: 78fFy44amNOy * gnu/services/certbot.scm (): Add csr field. (certbot-command): Modify. * doc/guix.texi (Certificate Services): Document it. --- doc/guix.texi | 9 +++++++++ gnu/services/certbot.scm | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 15e8999447..560d7af83f 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,14 @@ 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 specified, certbot will use it to obtain a certificate, instead of +using a self-generated CSR. +The domain-name(s) mentioned in @code{domains}, must be consistent with the +domain-name(s) mentioned in CSR file. + @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..1c819bef48 100644 --- a/gnu/services/certbot.scm +++ b/gnu/services/certbot.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2019 Julien Lepiller ;;; Copyright © 2020 Jack Hill ;;; Copyright © 2020 Tobias Geerinckx-Rice +;;; Copyright © 2021 Raghav Gururajan ;;; ;;; This file is part of GNU Guix. ;;; @@ -55,6 +56,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 @@ -94,8 +97,8 @@ (map (match-lambda (($ custom-name domains challenge - authentication-hook cleanup-hook - deploy-hook) + csr authentication-hook + cleanup-hook deploy-hook) (let ((name (or custom-name (car domains)))) (if challenge (append @@ -105,6 +108,7 @@ "--cert-name" name "--manual-public-ip-logging-ok" "-d" (string-join domains ",")) + (if csr `("--csr" ,csr) '()) (if email `("--email" ,email) '("--register-unsafely-without-email")) @@ -120,6 +124,7 @@ "--webroot" "-w" webroot "--cert-name" name "-d" (string-join domains ",")) + (if csr `("--csr" ,csr) '()) (if email `("--email" ,email) '("--register-unsafely-without-email")) -- 2.32.0