diff --git a/.env_sample b/.env_sample index 523d687fe..16737ab1e 100644 --- a/.env_sample +++ b/.env_sample @@ -4,3 +4,6 @@ AWS_SECRET_ACCESS_KEY='yolo' MANDRILL_SMTP_USER='coursemology' MANDRILL_SMTP_PASSWORD='ootd' + +APP_ID='wassup' +SECRET_KEY='youmadbro' diff --git a/.travis.yml b/.travis.yml index f406468dd..417eab7b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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" diff --git a/README.md b/README.md index 858cb206b..04f98d08e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config/database.yml.sample b/config/database.yml similarity index 100% rename from config/database.yml.sample rename to config/database.yml diff --git a/sample_config/devise_initializer.rb.sample b/config/initializers/devise.rb similarity index 99% rename from sample_config/devise_initializer.rb.sample rename to config/initializers/devise.rb index 6e26ba120..dff242e5f 100644 --- a/sample_config/devise_initializer.rb.sample +++ b/config/initializers/devise.rb @@ -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 diff --git a/config/initializers/koala.rb b/config/initializers/koala.rb index e3a179a94..4367d868b 100644 --- a/config/initializers/koala.rb +++ b/config/initializers/koala.rb @@ -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 @@ -20,4 +19,4 @@ def initialize_with_default_settings(*args) end alias_method_chain :initialize, :default_settings -end \ No newline at end of file +end diff --git a/provisioning/playbook.yml b/provisioning/playbook.yml index eb82d7a62..5a3797160 100644 --- a/provisioning/playbook.yml +++ b/provisioning/playbook.yml @@ -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" diff --git a/sample_config/facebook.yml.sample b/sample_config/facebook.yml.sample deleted file mode 100644 index 4455b79e5..000000000 --- a/sample_config/facebook.yml.sample +++ /dev/null @@ -1,11 +0,0 @@ -development: - app_id: 'abcxyz' - secret_key: 'abcxyz' - -test: - app_id: 'abcxyz' - secret_key: 'abcxyz' - -production: - app_id: 'abcxyz' - secret_key: 'abcxyz'