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

identityPaths doesn't act like list #116

Closed
gergovari opened this issue Jul 3, 2022 · 4 comments · Fixed by #146
Closed

identityPaths doesn't act like list #116

gergovari opened this issue Jul 3, 2022 · 4 comments · Fixed by #146

Comments

@gergovari
Copy link

Setting age.identityPaths = [ "/etc/ssh/ssh_host_rsa_key" "/etc/nixos/keys/${config.networking.hostName}/id_rsa" ]; will give a warning that the first doesn't exist (at the moment, after boot it will) and I expected it to fallback to the second one. That doesn't happen and it fails to decrypt the secrets. Switching the order works but then if workaround path doesn't exist the same issue comes up.

@ryantm
Copy link
Owner

ryantm commented Jul 3, 2022

Needs str4d/rage#294 to be fixed.

@n8henrie
Copy link
Collaborator

n8henrie commented Feb 4, 2023

@ryantm reviewing that issue, seems like this is more of a decision on the part of the rage team than something that wil be fixed.

Might there be a way to filter identities for paths that exist?

identities = builtins.concatStringsSep " " (map (path: "-i ${path}") cfg.identityPaths);
If so, it would be a nice improvement to the user experience (and perhaps ameliorate some issues with #45).

Happy to work on PR if you think this slight departure from rage behavior would be acceptable.

Perhaps could even have a user-facing flag that defaults to false: ignoreMissingIdentities?

@ryantm
Copy link
Owner

ryantm commented Feb 4, 2023

I think you're right. Let's work around it. I don't think we need an option!

@cole-h
Copy link
Collaborator

cole-h commented Feb 4, 2023

If you weren't already planning on it, I'd strongly suggest implementing the check as part of one of the scripts, rather than in Nix; paths may not be available at build / evaluation time, but may when the script runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants