2016-01-18 11:15:10 -05:00
|
|
|
# Be sure to restart your server when you modify this file.
|
|
|
|
|
|
|
|
require 'gitlab/current_settings'
|
|
|
|
include Gitlab::CurrentSettings
|
|
|
|
|
2016-01-20 03:48:38 -05:00
|
|
|
if Rails.env.production?
|
|
|
|
# allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done
|
|
|
|
begin
|
|
|
|
sentry_enabled = current_application_settings.sentry_enabled
|
|
|
|
rescue
|
|
|
|
sentry_enabled = false
|
|
|
|
end
|
2016-01-18 11:15:10 -05:00
|
|
|
|
2016-01-20 03:48:38 -05:00
|
|
|
if sentry_enabled
|
|
|
|
Raven.configure do |config|
|
|
|
|
config.dsn = current_application_settings.sentry_dsn
|
2016-02-15 12:41:12 -05:00
|
|
|
config.release = Gitlab::REVISION
|
2016-04-28 17:08:23 -04:00
|
|
|
|
|
|
|
# Sanitize fields based on those sanitized from Rails.
|
|
|
|
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
|
2016-10-04 10:35:41 -04:00
|
|
|
# Sanitize authentication headers
|
|
|
|
config.sanitize_http_headers = %w[Authorization Private-Token]
|
2016-08-24 23:06:16 -04:00
|
|
|
config.tags = { program: Gitlab::Sentry.program_context }
|
2016-01-20 03:48:38 -05:00
|
|
|
end
|
2016-01-18 11:15:10 -05:00
|
|
|
end
|
|
|
|
end
|