News for hackers. Stuff that matters.
Re:Production AWS keys on GitHub by rrosen326 on Sunday March 16, 2014 @08:56PM (#7412229)
Could you go through this process? I just did something where I used a file that was outside my repo but I knew there must be a best practice that I just didn't know about. What is it?
Re:Production AWS keys on GitHub by spiralganglion on Sunday March 16, 2014 @09:06PM (#7412272)
The implementation varies depending on your framework and personal preferences.

For development, I usually use a file named .env in the same directory as my project, and then do whatever I can to guarantee that this file won't be added to my repo (or other public places). I use .gitignore_global to exclude .env files, for instance.

For production, if you're running your app on a service like Heroku, they have commands you can execute to securely set environment variables on their server (since they discourage accessing the filesystem to load the .env file).

For Rails, take a look at the dotenv-rails gem. It's pretty convenient. https://github.com/bkeepers/dotenv

Here is the Heroku article on the topic (might not apply directly to your situation, but the principal is key): https://devcenter.heroku.com/articles/config-vars

Re:Production AWS keys on GitHub by a_bonobo on Sunday March 16, 2014 @11:28PM (#7412783)
Rails 4.1 includes something similar to dotenv:

https://github.com/rails/rails/blob/master/guides/source/4_1...

A secrets.yml which is globally accessible via Rails.application.secrets, and should be in the default .gitignore from Github for Rails projects