Skip to content

Commit

Permalink
Configure Figaro and move secret keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis committed Mar 1, 2017
1 parent e348f39 commit 8058356
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
.byebug_history
.DS_Store
coverage/

# Ignore application configuration
/config/application.yml
8 changes: 8 additions & 0 deletions config/initializers/omniauth.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
OmniAuth.config.logger = Rails.logger

Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2,
Figaro.env.google_client_id,
Figaro.env.google_client_secret,
{client_options: {ssl: {ca_file: Rails.root.join("cacert.pem").to_s}}}
end
10 changes: 7 additions & 3 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
# if you're sharing your code publicly.

development:
secret_key_base: 45932d3949c257ee976af471816f09c1269897f43b1018529c8efb0f48f0bd0ed54125f99fe056b3c43361ad5166ab186a527a99d4c3ebdceea1b726e28ea8ed
secret_key_base: <%= Figaro.env.secret_key_base %>
google_client_id: <%= Figaro.env.google_client_id %>
google_client_secret: <%= Figaro.env.google_client_secret %>

test:
secret_key_base: a309825319688fb7a7b27c1ca85ffbb0bab4bba42f97006abe3e087b2a6759ddfae7289043eb51e9a3c044f93d503f8152c4b8e7277c42546eaa188f354100b1
secret_key_base: <%= Figaro.env.secret_key_base %>
google_client_id: <%= Figaro.env.google_client_id %>
google_client_secret: <%= Figaro.env.google_client_secret %>

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
secret_key_base: <%= Figaro.env.secret_key_base %>

0 comments on commit 8058356

Please sign in to comment.