summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2019-04-19 22:28:30 +0200
committerJulien Lepiller <julien@lepiller.eu>2019-04-25 19:46:18 +0200
commitb68aff1f05864a589b62afa44665a99e5cf43718 (patch)
tree70bca19ca5fe12b6a9cf889c8a18fb002cbc7b45 /gnu
parentc3634df2a48a5b981a97c85f425784cee9f94bc7 (diff)
gnu: certbot: Add support for manual plugin.
* gnu/services/certbot.scm (certificate-configuration): Add challenge, auth-hook and cleanup-hook fields. (certbot-command): Use them. * doc/guix.texi (Certificate Services): Document them.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/certbot.scm40
1 files changed, 31 insertions, 9 deletions
diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm
index 7565bc97ca6..ae34ad17bb7 100644
--- a/gnu/services/certbot.scm
+++ b/gnu/services/certbot.scm
@@ -2,6 +2,7 @@
2;;; Copyright © 2016 ng0 <ng0@n0.is> 2;;; Copyright © 2016 ng0 <ng0@n0.is>
3;;; Copyright © 2016 Sou Bunnbu <iyzsong@member.fsf.org> 3;;; Copyright © 2016 Sou Bunnbu <iyzsong@member.fsf.org>
4;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org> 4;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
5;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
5;;; 6;;;
6;;; This file is part of GNU Guix. 7;;; This file is part of GNU Guix.
7;;; 8;;;
@@ -50,6 +51,12 @@
50 (default #f)) 51 (default #f))
51 (domains certificate-configuration-domains 52 (domains certificate-configuration-domains
52 (default '())) 53 (default '()))
54 (challenge certificate-configuration-challenge
55 (default #f))
56 (authentication-hook certificate-authentication-hook
57 (default #f))
58 (cleanup-hook certificate-cleanup-hook
59 (default #f))
53 (deploy-hook certificate-configuration-deploy-hook 60 (deploy-hook certificate-configuration-deploy-hook
54 (default #f))) 61 (default #f)))
55 62
@@ -81,17 +88,32 @@
81 (commands 88 (commands
82 (map 89 (map
83 (match-lambda 90 (match-lambda
84 (($ <certificate-configuration> custom-name domains 91 (($ <certificate-configuration> custom-name domains challenge
92 authentication-hook cleanup-hook
85 deploy-hook) 93 deploy-hook)
86 (let ((name (or custom-name (car domains)))) 94 (let ((name (or custom-name (car domains))))
87 (append 95 (if challenge
88 (list name certbot "certonly" "-n" "--agree-tos" 96 (append
89 "-m" email 97 (list name certbot "certonly" "-n" "--agree-tos"
90 "--webroot" "-w" webroot 98 "-m" email
91 "--cert-name" name 99 "--manual"
92 "-d" (string-join domains ",")) 100 (string-append "--preferred-challenges=" challenge)
93 (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) 101 "--cert-name" name
94 (if deploy-hook `("--deploy-hook" ,deploy-hook) '()))))) 102 "-d" (string-join domains ","))
103 (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '())
104 (if authentication-hook
105 `("--manual-auth-hook" ,authentication-hook)
106 '())
107 (if cleanup-hook `("--manual-cleanup-hook" ,cleanup-hook) '())
108 (if deploy-hook `("--deploy-hook" ,deploy-hook) '()))
109 (append
110 (list name certbot "certonly" "-n" "--agree-tos"
111 "-m" email
112 "--webroot" "-w" webroot
113 "--cert-name" name
114 "-d" (string-join domains ","))
115 (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '())
116 (if deploy-hook `("--deploy-hook" ,deploy-hook) '()))))))
95 certificates))) 117 certificates)))
96 (program-file 118 (program-file
97 "certbot-command" 119 "certbot-command"