When deploying on Heroku, it's useful to put various sensitive values (like your AWS or Facebook credentials) in the environment's config variables. But what about locally? The local setup options Heroku suggests are terrible.
It's super easy. Just write them out in config/local-env.yml
:
AWS_ACCESS_KEY: 2hsjckh2hsjhzjh3hzh
AWS_SECRET_KEY: hkskdjkjsjfiud9uweirjk234jrihfsd
Or, if you like, namespace them by environment:
development:
FOO: value
BAR: another value
test:
FOO: test value
BAR: another test value
Add config/local-env.yml
to your .gitignore
and it won't be deployed to Heroku or live in your repository for prying eyes. Now your secrets are safe.
In your Gemfile
:
group :test, :development do
gem 'local-env
end