2 ms·
I use pass for exporting secrets to environment variables. I have a multi-line password called "envvars" that contains a script like this: #!/usr/bin/fish
by redsparrow 5y ago
I use pass for exporting secrets to environment variables. I have a multi-line password called "envvars" that contains a script like this:
#!/usr/bin/fish
set -x PASSWORD hunter2
set -x PASSWORD_STG hunter3
set -x LUGGAGE_KEY 12345
set -x TOKEN (curl "https://api.example.com/oauth/token" \
--data-urlencode "username=$USERNAME" \
--data-urlencode "password=$PASSWORD" | jq --raw-output .access_token)
set -x TOKEN_STG (curl "https://api-stg.example.com/oauth/token" \
--data-urlencode "username=$USERNAME_STG" \
--data-urlencode "password=$PASSWORD_STG" | jq --raw-output .access_token)
When I want to set the environment variables I run `pass show envvars | source` and it sets the environment variables for the current shell. It's an easy way to keep the secrets out of my shell history and plaintext files.
- mackrevinack 5y agovery nice. ive been setting up a post install script the last while and something like this would be very useful for logging into some desktop apps automatically