-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
zabbixWeb could not connect to a database #144104
Comments
Thanks for reporting this. I'll take a look when I get a chance. If actually you're connecting to localhost (as opposed to using localhost as a simple and reproducible example) I would really suggest using socket authentication which is more secure and doesn't require a password. |
Oh... I reviewed the code:
You mean that you put a newline in your password file? Just remove the newline in the password file. |
Of course not. Newline is added by file_get_contents I assume. Why do we need such an obscure way of configuration? Why we can't just add a 'password' option instead of passwordFile? |
Your password ends up in the nix store and is readable by any user on the OS. Then you commit your configuration to github and the situation worsens. Unfortunately we must avoid |
It's up to end user to decide. I'd use blocks like this for example:
Otherwise you'll end up with over engineered costructions with nix functions generating php functions, etc. It's pretty annoying to debug. |
I agree, the user should be given a footgun in this scenario.
What you're looking for is: {
services.zabbixWeb.database.passwordFile = pkgs.writeText "footgun.txt" "this-is-my-password";
}
I bet it was. I'm sorry this issue exists and you ran into it 😞. PR incoming. Unfortunate (from your perspective, fortunate from other persons perspective) people who commit NixOS module generally agree that adding |
Nix tells ZabbixWeb to use file_get_contents function for retrieving DB password from file. And seems that it adds a newline symbol to a password string so auth failing.
zabbix.conf:
[root@box:~]# nix-shell -p nix-info --run "nix-info -m"
"x86_64-linux"
Linux 5.10.71, NixOS, 21.05.3834.88b914e7e43 (Okapi)
yes
yes
nix-env (Nix) 2.3.15
"nixos-21.05.3834.88b914e7e43, nixos-unstable-21.11pre323079.2cf9db0e3d4"
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: