From: Timo Wilken <guix@twilken.net>
To: Julien Lepiller <julien@lepiller.eu>, help-guix@gnu.org
Subject: Re: How do I install a file with custom permissions?
Date: Tue, 29 Nov 2022 20:43:18 +0100 [thread overview]
Message-ID: <20221129194318.qqb4ntwg7poic2ia@timo-pc> (raw)
In-Reply-To: <66FA4764-AAD9-4A40-AA34-73C918B5F3D6@lepiller.eu>
Hi Julien,
Thanks! It did seem slightly odd to me how `wireguard-service-type'
set the private key in a bit of a roundabout way, by referring to an
external file. I'll try and set the pre-shared keys the same way.
Cheers,
Timo
On Tue, Nov 29, 2022 at 08:34:21PM +0100, Julien Lepiller wrote:
> Hi Timo,
>
> Files in the store are always world-readable and there's nothing you can do to change that. There has been discussions in the past about how to handle secrets in the store, but no solution so far.
>
> One thing you can do, if wireguard allows it, is to have the pre-shared key in a separate file out of the store and simply point the config to that file (instead of using a file-like object). This is how we handle other secrets so far.
>
> Le 29 novembre 2022 20:24:13 GMT+01:00, Timo Wilken <guix@twilken.net> a écrit :
> >Hi Guixers,
> >
> >I'm trying to patch the `wireguard-service-type' to accept pre-shared
> >keys and add them to the generated config. This all seems to work
> >fine, except that I can't get guix to generate a non-world-readable
> >configuration file.
> >
> >I've tried adding a `(chmod port #o400)' call to the end of the lambda
> >that generates the config file (gnu/services/vpn.scm lines 784-838),
> >but that seems to have no effect -- the resulting file at
> >/gnu/store/...-wireguard-config/wg0.conf is still
> >world-readable. Adding `(chmod #$config-file #o400)' after the
> >`call-with-output-file' call doesn't work either.
> >
> >What do I need to do to make guix install the generated config file
> >with 0400 permissions?
> >
> >Cheers,
> >Timo
> >
next prev parent reply other threads:[~2022-11-29 19:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 19:24 How do I install a file with custom permissions? Timo Wilken
2022-11-29 19:34 ` Julien Lepiller
2022-11-29 19:43 ` Timo Wilken [this message]
2022-11-29 19:34 ` Tobias Geerinckx-Rice
2022-11-29 20:56 ` Timo Wilken
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221129194318.qqb4ntwg7poic2ia@timo-pc \
--to=guix@twilken.net \
--cc=help-guix@gnu.org \
--cc=julien@lepiller.eu \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.