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
Describe the bug
Hello, I'm attempting to load an env var from sops. It's the output of argon2 key derivation, and contains dollar signs. E.g. (this is from a vaultwarden setup guide):
When set up with sops, this env var's value with a $ (dollar sign) is gobbled up somewhere between sops and direnv. I'm not entirely sure where the problem is, a few observations:
sops almost always strips quotes from literals in yaml. If you would use ' or " to quote the value, these are removed but I believe still correctly echoed by sops --decrypt. I suspect direnv dotenv bash /dev/stdin might be responsible for messing it up.
quoting the var with three single quotes '''$foo''' in sops yaml works:
I would like some input and propose documentation on how to properly quote this. While I have figured out a way with ''' I'm not even sure how exactly it works... Probably due to direnv dotenv using $'' style strings and ''' works like a quoted single quote in it?
Should loading direnv from stdin have a literal option?
Otherwise, what kind of quoting would work? I have attempted to just quote the dollar sign, e.g. with \$ in yaml, that did not work.
Environment
OS: macOs
Shell: zsh
Direnv version 2.34.0
The text was updated successfully, but these errors were encountered:
Describe the bug
Hello, I'm attempting to load an env var from sops. It's the output of argon2 key derivation, and contains dollar signs. E.g. (this is from a vaultwarden setup guide):
When set up with sops, this env var's value with a
$
(dollar sign) is gobbled up somewhere between sops and direnv. I'm not entirely sure where the problem is, a few observations:sops almost always strips quotes from literals in yaml. If you would use
'
or"
to quote the value, these are removed but I believe still correctly echoed bysops --decrypt
. I suspectdirenv dotenv bash /dev/stdin
might be responsible for messing it up.quoting the var with three single quotes
'''$foo'''
in sops yaml works:To Reproduce
Using age, sops and direnv with the use_sops helper function.
Observe the output:
sops dotenv output looks like this:
Expected behavior
I would like some input and propose documentation on how to properly quote this. While I have figured out a way with
'''
I'm not even sure how exactly it works... Probably due todirenv dotenv
using$''
style strings and'''
works like a quoted single quote in it?Should loading direnv from stdin have a literal option?
Otherwise, what kind of quoting would work? I have attempted to just quote the dollar sign, e.g. with
\$
in yaml, that did not work.Environment
The text was updated successfully, but these errors were encountered: