Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcehut secrets #126090

Closed
tomberek opened this issue Jun 7, 2021 · 4 comments · Fixed by #133984
Closed

Sourcehut secrets #126090

tomberek opened this issue Jun 7, 2021 · 4 comments · Fixed by #133984
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@tomberek
Copy link
Contributor

tomberek commented Jun 7, 2021

Is there an option to read keys from a file so that they don't end up in the nix store? Something similar to what wireguard has:
networking.wireguard.interfaces.<name>.privateKeyFile instead of networking.wireguard.interfaces.<name>.privateKey?

Originally posted by @pinpox in #113244 (comment)

What's the best way to do this? TOML nor sourcehut allow a "from file" ability. So next best option is to have a config.ini.template in /etc/sr.ht and a service that fills in the details imperatively into the actual config.ini from non-nix-store'd files prior to services starting?

@veprbl veprbl added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Jun 18, 2021
@Artturin
Copy link
Member

Artturin commented Jun 19, 2021

implement it upstream?

@pinpox
Copy link
Member

pinpox commented Jul 2, 2021

@tomberek Are you planning on implementing this? I can't really use the current module without giving all users on my system access to the keys (they can obviously read the nix store) and also I keep my nixos configs in public repository, which currently would expose the secret to the world.

So next best option is to have a config.ini.template in /etc/sr.ht and a service that fills in the details imperatively into the actual config.ini from non-nix-store'd files prior to services starting?

I think this is the way to go, there are other examples of modules doing this in nixpgks, I think the mattermost module does something similar using the preStart directive of the systemd unit.

@pinpox
Copy link
Member

pinpox commented Jul 9, 2021

@tomberek Another option that would be possible without too much rework:

We could just add an option to use a predefined settings file. In addition to to services.sourcehut.settings there could be a services.sourcehut.configFilePath or similar that just allows to use a static file as configuration. The settings and configFilePath options would be mutually exclusive.

@tomberek
Copy link
Contributor Author

Being worked on in 133984.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants