Where should I store keys specific to my development, test, production servers in my ruby project? For example where should store my development-specific amazon s3 secret and key? my config/development.rb file? One issue I see with that is if the file was a part of a public github project it would show for everyone.
Thanks!
Where should I store keys specific to my development, test, production servers in my
Share
You store separate environment variables in
config/development.rb,config/testing.rbandconfig/production.rbrespectively.However, if your files will be stored in a public git repo, you do not want to hardcode any sensitive information into them. The best method is to use either yaml files that are part of your
.gitignoreor to use Environment variables in your shell. I prefer the latter, like this:You then just set the environment variables on the system that is running the app.
If you use the yaml config file method, you must add the sensitive config files to your
.gitignorefile. Otherwise they will still be uploaded to your public repo.