Permalink
Browse files

store secrets in config/secrets.rb

  • Loading branch information...
1 parent e9e3225 commit d4afaed5a46cce85db09f3ab7ecb6fe5cf1ca21a @quadule committed Mar 12, 2012
Showing with 10 additions and 5 deletions.
  1. +2 −2 .gitignore
  2. +1 −2 app/models/person.rb
  3. +1 −0 config/application.rb
  4. +1 −1 config/initializers/secret_token.rb
  5. +5 −0 config/secrets.rb.sample
View
@@ -15,5 +15,5 @@
/log/*.log
/tmp
-# Ignore instagram API keys
-/config/initializers/instagram.rb
+# Ignore API keys
+/config/secrets.rb
@@ -2,8 +2,7 @@ class Person < ActiveRecord::Base
serialize :data
def self.api
- @@api ||= Face.get_client api_key: ENV.fetch('FACE_API_KEY'),
- api_secret: ENV.fetch('FACE_API_SECRET')
+ @@api ||= Face.get_client api_key: FACE_API_KEY, api_secret: FACE_API_SECRET
end
def self.create_from_faces(image_url)
@@ -1,4 +1,5 @@
require File.expand_path('../boot', __FILE__)
+require File.expand_path('../secrets', __FILE__)
require 'rails/all'
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Instaface::Application.config.secret_token = '0a27aa1cda560e1682585c4e8cf956101cb325638ab8c472d588efa2f0de89ed3063153c17852a57d98f0ea2a8fe6826ed4f1a294141b32d7ed156b6c14d1256'
+Instaface::Application.config.secret_token = RAILS_SECRET_TOKEN
@@ -0,0 +1,5 @@
+FACE_API_KEY=''
+FACE_API_SECRET=''
+INSTAGRAM_CLIENT_ID=''
+INSTAGRAM_CLIENT_SECRET=''
+RAILS_SECRET_TOKEN='' # Generate with `rake secret`

0 comments on commit d4afaed

Please sign in to comment.