From patchwork Thu Jun 24 18:51:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghav Gururajan X-Patchwork-Id: 30684 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4D48027BC81; Thu, 24 Jun 2021 19:52:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DAB2827BC78 for ; Thu, 24 Jun 2021 19:52:27 +0100 (BST) Received: from localhost ([::1]:53800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwUSg-0005Lf-Q5 for patchwork@mira.cbaines.net; Thu, 24 Jun 2021 14:52:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwUSK-0005KX-5Y for guix-patches@gnu.org; Thu, 24 Jun 2021 14:52:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60831) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwUSI-00042p-53 for guix-patches@gnu.org; Thu, 24 Jun 2021 14:52:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lwUSH-0000yn-TM for guix-patches@gnu.org; Thu, 24 Jun 2021 14:52:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49213] [PATCH v1] services: certbot: Add option to use CSR file. Resent-From: Raghav Gururajan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Jun 2021 18:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49213 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49213@debbugs.gnu.org Cc: Raghav Gururajan X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16245607203755 (code B ref -1); Thu, 24 Jun 2021 18:52:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Jun 2021 18:52:00 +0000 Received: from localhost ([127.0.0.1]:44144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwUSG-0000yU-Gm for submit@debbugs.gnu.org; Thu, 24 Jun 2021 14:52:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:41250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwUSE-0000yL-RV for submit@debbugs.gnu.org; Thu, 24 Jun 2021 14:51:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwUSC-0005IF-Vl for guix-patches@gnu.org; Thu, 24 Jun 2021 14:51:58 -0400 Received: from out0.migadu.com ([2001:41d0:2:267::]:22239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwUS7-0003wD-Mv for guix-patches@gnu.org; Thu, 24 Jun 2021 14:51:56 -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=1624560707; 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=Gjx8ow+V4RlUd9dHWUeOnEsR+eqgBiqA0i7I9b/u/Ms=; b=DNd60GXGuiM14dSCwKAMqnOQr2uu5Jg4Ezyh8xiKQrMIXh4JxmWEN/tV3PQ+8lv+dldbCp mckRub6y9ugtFiaG/AyrrabUu9eejcnXmOLmnpAyDTcgpQ/0LpfcAE6tQYjBODxu5HSLTC nhAvvsp1whE3c4VN80nNWvmYNqUY+rzQP5NAEf6mH9drbILkrI3hFd0tpknx+9aNKn5p3g 8EQV6rohxVhw1tLylzxgY4W71F19TfMcqC7gH/2h+Zs0qUz4wICcs8WKbvp2UGaSPO5HXk OWXSi1DIjkcjYoDW2qsomykoX5FZbnp0ua0QvMQg8pDfe+/BzJTJk8YElj3swg== Date: Thu, 24 Jun 2021 14:51:11 -0400 Message-Id: <20210624185111.5959-1-rg@raghavgururajan.name> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: rg@raghavgururajan.name Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=rg@raghavgururajan.name; helo=out0.migadu.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Raghav Gururajan X-ACL-Warn: , Raghav Gururajan via Guix-patches X-Patchwork-Original-From: Raghav Gururajan via Guix-patches via From: Raghav Gururajan X-getmail-retrieved-from-mailbox: Patches * gnu/services/certbot.scm (): Add csr field. (certbot-command): Modify. * doc/guix.texi (Certificate Services): Document it. --- doc/guix.texi | 6 ++++++ gnu/services/certbot.scm | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 15e8999447..689d6498a9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -25934,6 +25934,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}) +Path to a 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 passed, +certbot uses it to obtain certificate, instead of using randomly generated +private-key. + @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..9a3822a679 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