-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
OpenVPN: allow passing credentials with file #239268
base: master
Are you sure you want to change the base?
Conversation
…ntials in plaintext in the nix store
|
||
authUserPassFileOption = optionalString (cfg.authUserPassFile != null) "auth-user-pass ${cfg.authUserPassFile}"; | ||
|
||
authUserPassOption = if (authUserPassFileOption != "") then authUserPassFileOption else authUserPassUnsafeOption; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add an assertion that only one of these options can be set (i.e. cfg.authUserPass -> !cfg.authUserPassFile && cfg.authUserPassFile -> !cfg.authUserPass
) you could just add both authUserPassUnsafeOption
and authUserPassFileOption
to the result, as at least one of them will always be an empty string
Feedback welcome
Description of changes
This adds an extra option to
services.openvpn.servers.<name>.config
:authUserPassFile
.When this is specified, it overrides the existing
authUserPass
option.When this is specified, the openvpn option
auth-users-file
is passed with the given filename.By default the file is not included in the system build (since it's a
str
not apath
:authUserPassFile = "/run/secrets/myfile.txt"
).If it is still desirable to include this file in the store, it can be specified as
authUserPassFile = "${./myfile.txt}"
;TODO: Test this change. I don't know how to do that, since only ever used the default nixpkgs.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)