Passing passphrases as environment variables to age and KeepassXC #4486
-
I know the security implications and that is another discussion, I am trying to automate the chezmoi apply when I am accessing remote machines and my passphrases are intentionally difficult to memorize. I also would like to know if I can pass the passphrase to the KeepassXC instead of getting prompted, I know the implications of environment variables on security. I am willing to take that risk in both cases the tool itself allow the use of env variables, but I am not sure how can i do that from within chezmoi and during chezmoi init and apply Thanks again for amazingly useful product |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
chezmoi will not modify the calling environment except for |
Beta Was this translation helpful? Give feedback.
You will need to use
.age.command
and a wrapper script to do this forage
and.keepassxc.command
with a wrapper script forkeepassxc-cli
.The wrapper scripts would exactly do what you suggested, for example:
For keepassxc, this will not work with
.keepassxc.mode: builtin
(this uses an internal library) and may not work with.keepassxc.mode: open
(which expects stdin to work withexpect
-like functionality).