I have a few web services that require secure tokens/keys/passwords to be passed in. Where should I define these secure values for my rails app to see? I want the development keys in version control, but don't want the production keys in version control. How should I set this up? I'm new to rails.
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- “Zero out” sensitive String data in Swift
- Eager-loading association count with Arel (Rails 3
- High cost encryption but less cost decryption
相关文章
- Warning : HTML 1300 Navigation occured?
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
- Rspec controller error expecting <“index”> but
apneadiving is right, symlinking the files is a good idea. Another approach is to put the keys in the shell variables, accessible only to the user that runs the app. Then, in your rails app you'll have
You see the question properly.
Put your
passwords
andkeys
in some yml file excluded from version control.Then on your production server, create the very same file and symlink your app to it every time you deploy.
EDIT.
Capistrano is almost made to fits these needs:
put your
yml
files in theshared
folderIn your capistrano
deploy.rb
file:to work with yml files: http://railscasts.com/episodes/85-yaml-configuration-file
As of Rails 4.1.0, check out secrets.yml.