From b68aff1f05864a589b62afa44665a99e5cf43718 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 19 Apr 2019 22:28:30 +0200 Subject: 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. --- gnu/services/certbot.scm | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'gnu/services') diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm index 7565bc97ca..ae34ad17bb 100644 --- a/gnu/services/certbot.scm +++ b/gnu/services/certbot.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016 ng0 ;;; Copyright © 2016 Sou Bunnbu ;;; Copyright © 2017, 2018 Clément Lassieur +;;; Copyright © 2019 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,6 +51,12 @@ (default #f)) (domains certificate-configuration-domains (default '())) + (challenge certificate-configuration-challenge + (default #f)) + (authentication-hook certificate-authentication-hook + (default #f)) + (cleanup-hook certificate-cleanup-hook + (default #f)) (deploy-hook certificate-configuration-deploy-hook (default #f))) @@ -81,17 +88,32 @@ (commands (map (match-lambda - (($ custom-name domains + (($ custom-name domains challenge + authentication-hook cleanup-hook deploy-hook) (let ((name (or custom-name (car domains)))) - (append - (list name certbot "certonly" "-n" "--agree-tos" - "-m" email - "--webroot" "-w" webroot - "--cert-name" name - "-d" (string-join domains ",")) - (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) - (if deploy-hook `("--deploy-hook" ,deploy-hook) '()))))) + (if challenge + (append + (list name certbot "certonly" "-n" "--agree-tos" + "-m" email + "--manual" + (string-append "--preferred-challenges=" challenge) + "--cert-name" name + "-d" (string-join domains ",")) + (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) + (if authentication-hook + `("--manual-auth-hook" ,authentication-hook) + '()) + (if cleanup-hook `("--manual-cleanup-hook" ,cleanup-hook) '()) + (if deploy-hook `("--deploy-hook" ,deploy-hook) '())) + (append + (list name certbot "certonly" "-n" "--agree-tos" + "-m" email + "--webroot" "-w" webroot + "--cert-name" name + "-d" (string-join domains ",")) + (if rsa-key-size `("--rsa-key-size" ,rsa-key-size) '()) + (if deploy-hook `("--deploy-hook" ,deploy-hook) '())))))) certificates))) (program-file "certbot-command" -- cgit v1.2.3