Re: [PATCH] gnu: services: Add gnunet-service.

2016-12-21 Thread ng0
Ludovic Courtès  writes:

> ng0  skribis:
>
>> +@cindex GNUnet
>> +@cindex gnunet
>> +@subsubheading GNUnet Service
>> +
>> +@deffn {Scheme Variable} gnunet-service-type
>> +This is the type of the @uref{https://gnunet.org, GNUnet}
>
> Since GNUnet is supposed to be available to unprivileged users via
> ‘gnunet-arm’, perhaps you could clarify a bit what this does and what
> the tradeoffs are?

I can document this in the next preview I send to the
list. Running gnunet via system service is the correct way to run
it, this way multiple unix users can have their own ego (gnunet
term) etc. You will no longer use gnunet-arm, you just use the
gnunet subsystems directly.

>
> [...]
>
>> +(user-account
>> + (name "gnunet")
>> + (group "gnunet")
>> + (system? #t)
>> + (comment "GNUnet system user")
>> + (home-directory "/var/empty")
>> + (shell #~(string-append #$shadow "/sbin/nologin")
>
> Prefer (file-append shadow "/sbin/nologin").

Ok.

>> +(define gnunet-activation
>> +  (match-lambda
>> +(($  package config-file)
>> + (let ((gnunet
>> +(file-append package "/lib/gnunet/libexec/gnunet-service-arm")))
>> +   #~(begin
>> +   (use-modules (guix build utils))
>> +   (define %user (getpw "gnunet"))
>> +   (mkdir-p "/var/lib/gnunet/")
>> +   (chown "/var/lib/gnunet" (passwd:uid %user) (passwd:gid %user))
>> +   (chmod "/var/lib/gnunet/" #o600)
>> +   (mkdir-p "/var/lib/gnunet/.local/share/gnunet")
>> +   (mkdir-p "/var/lib/gnunet/.cache/gnunet")
>> +   (mkdir-p "/var/lib/gnunet/.config/gnunet")
>> +   (chmod "/var/lib/gnunet/.config/gnunet" #o600)
>> +   (chmod "/var/lib/gnunet/.cache/gnunet" #o600)
>> +   (chmod "/var/lib/gnunet/.local/share/gnunet" #o600))
>
> The .local, .share, and .config sub-directories here look fishy.  I’d
> suggest reporting that as a bug upstream.  :-)

I'm discussing it right now, to figure out if this was fixed
later or if this is still relevant to report, and if it was fixed
later if it can be backported.

> The rest LGTM!
>
> Thanks,
> Ludo’.
>

Thanks for this first review.
-- 
♥Ⓐ  ng0  | PGP keys and more: https://n0is.noblogs.org/
 |http://ng0.chaosnet.org



Re: [PATCH] gnu: services: Add gnunet-service.

2016-12-21 Thread Ludovic Courtès
ng0  skribis:

> +@cindex GNUnet
> +@cindex gnunet
> +@subsubheading GNUnet Service
> +
> +@deffn {Scheme Variable} gnunet-service-type
> +This is the type of the @uref{https://gnunet.org, GNUnet}

Since GNUnet is supposed to be available to unprivileged users via
‘gnunet-arm’, perhaps you could clarify a bit what this does and what
the tradeoffs are?


[...]

> +(user-account
> + (name "gnunet")
> + (group "gnunet")
> + (system? #t)
> + (comment "GNUnet system user")
> + (home-directory "/var/empty")
> + (shell #~(string-append #$shadow "/sbin/nologin")

Prefer (file-append shadow "/sbin/nologin").

> +(define gnunet-activation
> +  (match-lambda
> +(($  package config-file)
> + (let ((gnunet
> +(file-append package "/lib/gnunet/libexec/gnunet-service-arm")))
> +   #~(begin
> +   (use-modules (guix build utils))
> +   (define %user (getpw "gnunet"))
> +   (mkdir-p "/var/lib/gnunet/")
> +   (chown "/var/lib/gnunet" (passwd:uid %user) (passwd:gid %user))
> +   (chmod "/var/lib/gnunet/" #o600)
> +   (mkdir-p "/var/lib/gnunet/.local/share/gnunet")
> +   (mkdir-p "/var/lib/gnunet/.cache/gnunet")
> +   (mkdir-p "/var/lib/gnunet/.config/gnunet")
> +   (chmod "/var/lib/gnunet/.config/gnunet" #o600)
> +   (chmod "/var/lib/gnunet/.cache/gnunet" #o600)
> +   (chmod "/var/lib/gnunet/.local/share/gnunet" #o600))

The .local, .share, and .config sub-directories here look fishy.  I’d
suggest reporting that as a bug upstream.  :-)

The rest LGTM!

Thanks,
Ludo’.