Extracting Rails credentials as ENV vars for accessories? #1115
-
I'm running Litestream as an accessory and would like to be able to use the existing S3 credentials encrypted with RAILS_MASTER_KEY and set them as environment variables - any idea how I could go about this? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
You can set the secrets environment variable for accessory, like this:
|
Beta Was this translation helpful? Give feedback.
-
One way could be to parse the credential file in your SMTP_PASSWORD=${rails credentials:show | grep smtp_password | cut -f2 -d" "} (this is using a very simple way of extracting yml values from the config that I threw together in a few minutes, it's probably better to use a custom ruby script that's more readable and uses a proper yml parser) |
Beta Was this translation helpful? Give feedback.
-
I realized I can do this in deploy.yml - thanks for the suggestions everyone! |
Beta Was this translation helpful? Give feedback.
I realized I can do this in deploy.yml - thanks for the suggestions everyone!