I’ve created a small gem called multa_arcana (latin for “Many Secrets”) which allows one to store all Rails secrets in one file, which should not be checked into revision control, but other files then can be. Source is on https://github.com/skandragon/multa_arcana
Usage:
add to Gemfile: gem ‘multa_arcana’
Create a file to hold the secrets: config/secrets.yml
While the filename can be changed, it is somewhat hard to do so without modifying a file that is loaded fairly early, like application.rb. I just use the default. Currently to change this, one must pass in a file to load on the first call to retrieve a secret. API suggestions welcome.
Place in this file the various secrets your rails app needs to keep secret:
I've created a small gem called multa_arcana (latin for "Many Secrets")
which allows one to store all Rails secrets in one file, which should
not
be checked into revision control, but other files then can be. Source
is
on GitHub - skandragon/multa_arcana
Interesting, but what advantage does this have over...
Probably none, but "settingslogic" didn't appear in my search when I
looked
for ways to store secrets in a single file.
Sure there is advantage to writing your own gem. You wrote it, and
shared it with the community. That's AWESOME! I considered doing
something similar, until I ran across SettingsLogic.
Posted by unknown (Guest) on 2013-02-22 09:05
Why not just use environment variables?
Yes, environment variables are certainly an option, but I really like
the consistent API, and baked-in support for different environments that
SettingLogic provides.
If it’s an issue of security…if somebody is already looking at your processes, what’s keeping them from cd’ing to your application’s config directory and reading secrets.yml?