From: "Ludovic Courtès" <ludo@gnu.org>
To: "Jan \(janneke\) Nieuwenhuizen" <janneke@gnu.org>
Cc: 43106@debbugs.gnu.org
Subject: [bug#43106] [PATCH v3 2/2] services: childhurd: Support installing secrets from the host.
Date: Tue, 01 Sep 2020 10:37:40 +0200 [thread overview]
Message-ID: <87tuwhao4r.fsf@gnu.org> (raw)
In-Reply-To: <20200831063913.664-3-janneke@gnu.org> (Jan Nieuwenhuizen's message of "Mon, 31 Aug 2020 08:39:13 +0200")
"Jan (janneke) Nieuwenhuizen" <janneke@gnu.org> skribis:
> * gnu/system/examples/bare-hurd.tmpl (%hurd-os)[services]: Add secret-service.
> * gnu/services/virtualization.scm (%hurd-vm-operating-system): Likewise.
> (hurd-vm-shepherd-service): Use it to install secrets.
> * doc/guix.texi (The Hurd in a Virtual Machine): Document it.
Yay, minor issues, but overall LGTM!\
> (services (cons*
> + ;; Receive secret keys on port 1004, TCP.
> + (service secret-service-type 1004)
[...]
> + (start
> + (with-imported-modules
> + (source-module-closure '((gnu build secret-service)
> + (guix build utils)))
> + #~(let ((spawn (make-forkexec-constructor #$vm-command)))
> + (lambda _
> + (let ((pid (spawn))
> + (port #$(hurd-vm-port config %hurd-vm-secrets-port))
> + (root #$(hurd-vm-configuration-secret-root config)))
> + (and root (directory-exists? root)
> + (catch #t
> + (lambda _
> + (secret-service-send-secrets port root))
Perhaps ‘hurd-vm-service-type’ should unconditionally extend (via
‘service-extension’) ‘secret-service-type’, just to ensure that Hurd VMs
always include the secret service.
In any case, we should assume that the VM is always running the secret
service server, and thus call ‘secret-service-send-secrets’
unconditionally (‘secret-service-send-secrets’ does (find-files root),
which returns the empty list when ROOT doesn’t exist, I think.)
> + (lambda (keys . args)
Should be “key” (singular).
> + (format (current-error-port)
> + "failed to send secrets: ~a ~s\n" key args)
> + (kill pid)
(kill (- pid)) to kill the whole process group (just in case).
I’d remove the ‘format’ call and just re-throw the exception: shepherd
should report it correctly.
[...]
> + (service (@@ (gnu services virtualization)
> + secret-service-type) 5999))
This is useful for testing but I wouldn’t commit it (in particular
because the example would no longer work for people who’re just spawning
the VM and not trying to feed it secrets over TCP).
That’s it, thanks a lot!
Ludo’.
next prev parent reply other threads:[~2020-09-01 10:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-29 21:57 [bug#43106] [PATCH] DRAFT services: childhurd: Support for setting secrets Jan (janneke) Nieuwenhuizen
2020-08-30 13:44 ` Ludovic Courtès
2020-08-30 20:41 ` Jan Nieuwenhuizen
2020-08-31 6:39 ` [bug#43106] [PATCH v3 0/2] Secret services for the Childhurd Jan (janneke) Nieuwenhuizen
2020-08-31 6:39 ` [bug#43106] [PATCH v3 1/2] services: Add secret-service-type Jan (janneke) Nieuwenhuizen
2020-09-01 8:26 ` Ludovic Courtès
2020-08-31 6:39 ` [bug#43106] [PATCH v3 2/2] services: childhurd: Support installing secrets from the host Jan (janneke) Nieuwenhuizen
2020-08-31 15:23 ` Jan Nieuwenhuizen
2020-09-01 8:37 ` Ludovic Courtès [this message]
2020-09-01 8:50 ` [bug#43106] [PATCH v3 0/2] Secret services for the Childhurd Ludovic Courtès
2020-09-01 11:16 ` Jan Nieuwenhuizen
2020-09-01 20:45 ` Ludovic Courtès
2020-09-01 13:38 ` [bug#43106] [PATCH v3 1/2] services: Add secret-service-type Jan Nieuwenhuizen
2020-09-01 13:40 ` [bug#43106] [PATCH v3 2/2] services: childhurd: Support installing secrets from the host Jan Nieuwenhuizen
2020-09-01 14:16 ` bug#43106: " Jan Nieuwenhuizen
2020-09-01 20:54 ` [bug#43106] " Ludovic Courtès
2020-09-02 5:28 ` Jan Nieuwenhuizen
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=87tuwhao4r.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=43106@debbugs.gnu.org \
--cc=janneke@gnu.org \
/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).