cmd/age: passphrase optionnaly supplied from an environment variable#520
cmd/age: passphrase optionnaly supplied from an environment variable#520wj wants to merge 1 commit into
Conversation
The passphrase is now read from the AGE_PASSPHRASE environment variable, as an alternative to being requested interactively. This enables the following usage patterns: - automation of the encryption, without having to manage an additional private key file - provide a less error prone way of supplying a passphrase. Copy-pasting to an echo-less prompt, for example, is often hazardous on some platforms.
|
Hi, Edit: Never mind, figured out. |
|
This would be nice to see, as it would allow one to use 1Password Secret reference syntax for shared passphrases. |
|
This would be great for automation/CI! |
|
Cross-referencing related/duplicated discussion/PR topics:
|
|
Thanks @wj 🙏 , you saved me a few hours. When I get a few minutes I'll be building this and giving it a go 😀 |
|
Follow up from last year, wj's code works flawlessly for my use case where I need to script encryption and decryption. |
Hi @clach04, is this already usable in the latest chezmoi release? |
|
There is other easy way with using "expect": example of encryption: example of decryption: |
Do you have details on this? A search yields https://github.com/twpayne/chezmoi but unclear on environment variable support, the download is substantially larger than the age download. |
Have you found a way to get this to run natively under Windows? A custom build has been the most simple solution I've tried so far. |
nope not tried, dont have windows machines in my inventory |
|
Any plans to make this into a age plugin now that plugin support is here? |
Based on #256 (reply in thread) it doesn't look like the plugin architecture as implemented today allows that to be implemented 😢 , @FiloSottile please reply if this is incorrect. |
|
I have implemented this as the batchpass plugin. See #256 (comment) for usage and a warning. |
The passphrase is now read from the AGE_PASSPHRASE environment variable, as an alternative to being requested interactively.
This enables the following usage patterns: