Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Updated sentry config to be more rational
Browse files Browse the repository at this point in the history
  • Loading branch information
afischer committed Aug 21, 2017
1 parent ae5155f commit 8db6a62
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# export SECRET_KEY_BASE='change_me'
# export FB_APP_ID='change_me'
# export FB_APP_SECRET='change_me'
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ gem 'momentjs-rails', '>= 2.9.0'
gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47'
gem 'activeadmin', github: 'activeadmin'
gem 'active_bootstrap_skin'
gem 'sentry-raven'
gem 'mysql2'

group :production do
gem 'sentry-raven'
gem 'mysql2'
end
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'capybara', '~> 2.13'
Expand Down
5 changes: 2 additions & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class Application < Rails::Application
# Set calendar first-day of week to Sunday, since this 'Murica
config.beginning_of_week = :sunday

Raven.configure do |config|
config.dsn = 'https://bc380f8287694c2d9a3597b374e6dd07:[email protected]/205950'
end
# filtered parameters that won't be sent to sentry
config.filter_parameters << :password
end
end
17 changes: 9 additions & 8 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
# default: &default

development:
adapter: sqlite3
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000

development:
<<: *default
database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
adapter: sqlite3
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
database: db/test.sqlite3

production:
adapter: mysql2
host: 127.0.0.1
port: 3306
database: <%= ENV.fetch("DB_NAME") %>
username: <%= ENV.fetch("DB_USERNAME") %>
password: <%= ENV.fetch("DB_PASSWORD") %>
database: <%= ENV.fetch("DB_NAME") {"foo"} %>
username: <%= ENV.fetch("DB_USERNAME") {"foo"}%>
password: <%= ENV.fetch("DB_PASSWORD") {"foo"}%>
10 changes: 10 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'sentry-raven'

env = ENV.fetch('RAILS_ENV') { 'development' }

if env == 'production'
Raven.configure do |config|
dsn = Rails.application.secrets.sentry_dsn
config.dsn = dsn
end
end
1 change: 1 addition & 0 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
fb_app_id: <%= ENV["FB_APP_ID"] %>
fb_app_secret: <%= ENV["FB_APP_SECRET"] %>
sentry_dsn: <%= ENV["SENTRY_DSN"] %>

0 comments on commit 8db6a62

Please sign in to comment.