unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: Arun Isaac <arunisaac@systemreboot.net>,
	Felix Lechner <felix.lechner@lease-up.com>
Cc: 67497@debbugs.gnu.org
Subject: [bug#67497] [PATCH] Multiple deploy hooks in certbot service
Date: Sat, 16 Dec 2023 20:50:16 +0000	[thread overview]
Message-ID: <a224335a-b8f0-46cd-ba90-8bc51d698376@makinata.eu> (raw)
In-Reply-To: <874jh6bu8c.fsf@systemreboot.net>


[-- Attachment #1.1: Type: text/plain, Size: 2389 bytes --]

Hi Felix and Arun,

On 2023-11-28 00:24, Arun Isaac wrote:
> It's already possible to write the deploy-hook as a G-expression
> constructed script (using program-file) that invokes multiple hooks in
> succession. Something like:
> 
> (program-file "deploy-hook"
>   (with-imported-modules '((guix build utils))
>     #~(begin
>         (use-modules (guix build utils))
> 
>         (invoke "/some/hook")
>         (invoke "/some/other/hook"))))

Indeed, and for the record mine looks like this:

--8<---------------cut here---------------start------------->8---
(program-file "certbot-hook.scm"
  ;; source-module-closure not used here because at the time of writing
  ;; (gnu services herd) only uses Guile modules.
  (with-imported-modules '((gnu services herd))
    #~(begin
        (use-modules (gnu services herd))
        (with-shepherd-action 'nginx ('reload) result result)
        (restart-service 'dovecot)
        (restart-service 'smtpd))))
--8<---------------cut here---------------end--------------->8---

(that is, a single hook is responsible for various other shepherd
services)

> Here /some/hook and /some/other/hook can themselves be recursively
> constructed using program-file. So, do we really need a service that
> explicitly accepts multiple deploy hooks?

As Arun pointed out, I don't think multiple deploy hooks would be
adding value here.

What would be interesting though is adding service-extensions support
for certbot-service-type. Roughly speaking, two plausible ways to
achieve this would be:

* Single deploy-hook and ungexp-splicing, i.e.:

--8<---------------cut here---------------start------------->8---
;; service-extension-hooks: list of program-files
#$@(map (lambda (extension-hook)
          #~(invoke #$extension-hook))
        service-extension-hooks)
--8<---------------cut here---------------end--------------->8---

* Multiple --deploy-hook … behind the scenes (the deploy-hook
field in <certificate-configuration> still accepts only a single hook)

Important note, such service-extensions must account for the fact that
they are actually extensions to <certificate-configuration> objects,
i.e. they have to account for which domain(s) is the (deploy/
cleanup/authentication)-hook for.

-- 
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-12-16 20:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87zfyzkkt4.fsf@lease-up.com>
2023-11-27 21:20 ` [bug#67497] [PATCH 1/4] In documentation, rename %certbot-deploy-hook back to %nginx-deploy-hook Felix Lechner via Guix-patches via
2023-11-27 21:20   ` [bug#67497] [PATCH 2/4] In certbot documentation, call environment variables by their proper name Felix Lechner via Guix-patches via
2023-12-16 20:58     ` Bruno Victal
2023-11-27 21:20   ` [bug#67497] [PATCH 3/4] In certbot service, reduce code duplication Felix Lechner via Guix-patches via
2023-11-27 21:20   ` [bug#67497] [PATCH 4/4] In certbot's client configuration, offer multiple deploy-hooks Felix Lechner via Guix-patches via
2023-11-28  0:24 ` [bug#67497] [PATCH] Multiple deploy hooks in certbot service Arun Isaac
2023-12-16 20:50   ` Bruno Victal [this message]
2023-12-17 17:46     ` Felix Lechner via Guix-patches via
2023-12-19  6:29       ` Arun Isaac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a224335a-b8f0-46cd-ba90-8bc51d698376@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=67497@debbugs.gnu.org \
    --cc=arunisaac@systemreboot.net \
    --cc=felix.lechner@lease-up.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).