Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
Merge pull request #308 from jsyeo/jsyeo-secrets
Browse files Browse the repository at this point in the history
Move facebook secrets to dotenv. Make database.yml the default config.
  • Loading branch information
raymondtangsc committed Dec 6, 2014
2 parents 3598656 + e0ab994 commit 64ca0a5
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .env_sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ AWS_SECRET_ACCESS_KEY='yolo'

MANDRILL_SMTP_USER='coursemology'
MANDRILL_SMTP_PASSWORD='ootd'

APP_ID='wassup'
SECRET_KEY='youmadbro'
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ matrix:
bundler_args: --without development:production
before_script:
- cp config/database.yml.travis config/database.yml
- cp sample_config/facebook.yml.sample config/facebook.yml
- cp sample_config/devise_initializer.rb.sample config/initializers/devise.rb
- bundle exec rake db:create db:schema:load db:migrate db:seed
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ Setting up a Ruby on Rails environment is pretty involved. You may follow the in

#### Setting up

cp sample_config/facebook.yml.sample config/facebook.yml
cp sample_config/devise_initializer.rb.sample config/initializers/devise.rb
cp config/database.yml.sample config/database.yml
# Change the username and password in the development section as appropriate
cp .env_sample .env

bundle install
rake db:setup db:migrate db:populate_course_pref db:gen_fake_data
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
# Add a new OmniAuth provider. Check the wiki for more information on setting
# up on your models and hooks.
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
config.omniauth :facebook, "sdf", 'asdf'
config.omniauth :facebook, ENV['APP_ID'], ENV['SECRET_KEY']

# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or
Expand Down
7 changes: 3 additions & 4 deletions config/initializers/koala.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
# automatically use Facebook settings from here if none are given

module Facebook
CONFIG = YAML.load_file(Rails.root.join("config/facebook.yml"))[Rails.env]
APP_ID = CONFIG['app_id']
SECRET = CONFIG['secret_key']
APP_ID = ENV['APP_ID']
SECRET = ENV['SECRET_KEY']
end

Koala::Facebook::OAuth.class_eval do
Expand All @@ -20,4 +19,4 @@ def initialize_with_default_settings(*args)
end

alias_method_chain :initialize, :default_settings
end
end
3 changes: 0 additions & 3 deletions provisioning/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,5 @@
- copy: src=files/gemrc dest=~/.gemrc
- gem: name=bundle executable=/usr/bin/gem2.1
- command: "{{ gem_bin }}/bundle install chdir={{ work_dir }}"
- command: cp sample_config/devise_initializer.rb.sample config/initializers/devise.rb chdir={{ work_dir }}
- command: cp sample_config/facebook.yml.sample config/facebook.yml chdir={{ work_dir }}
- command: cp config/database.yml.sample config/database.yml chdir={{ work_dir }}
- command: "{{ gem_bin }}/bundle exec rake db:setup db:migrate chdir={{ work_dir }}"
- lineinfile: dest=~/.bashrc line="export PATH={{ gem_bin }}:$PATH"
11 changes: 0 additions & 11 deletions sample_config/facebook.yml.sample

This file was deleted.

0 comments on commit 64ca0a5

Please sign in to comment.