Files
nairobi/config/initializers/errbit.rb
Javi Martín 4ac36b91e2 Accept self-signed SSL certificates with airbrake
Since some people hosting errbit might be using it as an internal tool
with a self signed certificate, we need to patch Airbrake so it accepts
these certificates.
2020-08-27 16:22:01 +02:00

27 lines
894 B
Ruby

Airbrake.configure do |config|
config.host = Rails.application.secrets.errbit_host
config.project_id = Rails.application.secrets.errbit_project_id
config.project_key = Rails.application.secrets.errbit_project_key
config.environment = Rails.env
config.ignore_environments = %w[development test]
config.ignore_environments += [Rails.env] if Rails.application.secrets.errbit_project_id.blank?
end
if Rails.application.secrets.errbit_self_hosted_ssl.present?
# Patch from: https://mensfeld.pl/2016/05/setting-up-errbit-reporter-airbrake-v5-gem-to-work-with-self-signed-https-certificate/
module Patches
module Airbrake
module SyncSender
def build_https(uri)
super.tap do |req|
req.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
end
end
end
end
Airbrake::SyncSender.prepend(::Patches::Airbrake::SyncSender)
end