guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#44800] [PATCH v2 2/3] publish: Add avahi support.


From: Ludovic Courtès
Subject: [bug#44800] [PATCH v2 2/3] publish: Add avahi support.
Date: Fri, 27 Nov 2020 18:12:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

Mathieu Othacehe <othacehe@gnu.org> skribis:

> * guix/scripts/publish.scm (%options): Add "--enable-avahi" option.
> (show-help): Document it.
> (service-name): New procedure,
> (publish-service-type): new variable.
> (run-publish-server): Add "avahi?" and "port" parameters. Use them to publish
> the server using Avahi.
> (guix-publish): Pass the "avahi?" option to "run-publish-server".
> * gnu/services/base.scm (<guix-publish-configuration>): Add "enable-avahi?"
> field.
> (guix-publish-shepherd-service): Honor it.

Neat!

> +When the @option{--enable-avahi} option is passed, the publish server is
> +advertised on the local network as an Avahi service, using Guile-Avahi
> +bindings.

s/bindings/(@pxref{Top,,, guile-avahi, Using Avahi in Guile Scheme Programs}/

As discussed on IRC, I would avoid using the name Avahi on the CLI and
to some extent in the API as well.  The command-line option could be
“--advertise”.

The documentation would be something like:

  … the server advertises its availability on the local network using
  multicast DNS (mDNS) and DNS service discovery (DNS-SD), currently
  @i{via} Guile-Avahi …

(I remember that Julien posted a DNS client implementation a few years
ago, we never know what the future will be like…  :-))

> +  (enable-avahi? guix-publish-enable-avahi?       ;boolean
> +                 (default #f))

Same here.

>  (define* (run-publish-server socket store
>                               #:key
> +                             avahi? port
>                               (compressions (list %no-compression))
>                               (nar-path "nar") narinfo-ttl
>                               cache pool)
> +  (when avahi?
> +    (avahi-publish-service-thread (service-name)
> +                                  #:type publish-service-type
> +                                  #:port port))

Maybe add (info (_ "advertising …")) here.  Ideally, you’d need a
callback because you can’t tell what the actual advertised name is since
Avahi can pick one to avoid name clashes.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]