You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, my use case is basically to avoid exposing a secret (postgres password) anywhere in repository or nix store. To do so, I'm leveraging sops-nix files with secrets. Here is the part of my config:
ATTIC_SERVER_DATABASE_URL="postgresql://postgres:<password which I want to keep secret>@localhost:5432/attic"
ATTIC_SERVER_TOKEN_HS256_SECRET_BASE64="..."
AWS_ACCESS_KEY_ID="..."
AWS_SECRET_ACCESS_KEY="..."
So far so good, credentials file is generated properly and loaded as environment file. But atticd still uses sqlite as it's DB. My assumption is, because nix sets a default in settings here: https://github.com/zhaofengli/attic/blob/main/nixos/atticd.nix#L174 and env var has lower priority.
As a workaround I tried to use configFile and pass full config from sops there, but because checkedConfigFile evaluates too early, the sops secret is not there yet.
Is there any way, to pass postgres password without exposing it? Also I think that env being effectively ignore, is a bug, and should be taking priority if set.
The text was updated successfully, but these errors were encountered:
and then adding PGPASSWORD=mypostgrespassword to credentials file, I managed to make it work. Still I think, it's a hack, and not a proper solution of the problem :)
So, my use case is basically to avoid exposing a secret (postgres password) anywhere in repository or nix store. To do so, I'm leveraging sops-nix files with secrets. Here is the part of my config:
and in sops
attic/server/credentials
:So far so good, credentials file is generated properly and loaded as environment file. But atticd still uses sqlite as it's DB. My assumption is, because nix sets a default in settings here: https://github.com/zhaofengli/attic/blob/main/nixos/atticd.nix#L174 and env var has lower priority.
As a workaround I tried to use
configFile
and pass full config from sops there, but because checkedConfigFile evaluates too early, the sops secret is not there yet.Is there any way, to pass postgres password without exposing it? Also I think that env being effectively ignore, is a bug, and should be taking priority if set.
The text was updated successfully, but these errors were encountered: