Separately allow to disable sentry without removing dsn

Allows us to quickly enable/disable only frontend reporting
pull/7865/head
Oliver Günther 5 years ago
parent 2ce9162f07
commit ad0e22d64a
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 2
      app/views/layouts/base.html.erb
  2. 2
      lib/open_project/configuration.rb
  3. 6
      lib/open_project/configuration/helpers.rb

@ -53,7 +53,7 @@ See docs/COPYRIGHT.rdoc for more details.
data-id="<%= User.current.id %>" />
<% end %>
<% if OpenProject::Configuration.sentry_dsn.present? %>
<% if OpenProject::Configuration.frontend_sentry? %>
<%= tag :meta, name: 'openproject_sentry', data: { dsn: OpenProject::Configuration.sentry_dsn } %>
<% end %>

@ -161,6 +161,8 @@ module OpenProject
# Log errors to sentry instance
'sentry_dsn' => nil,
# Allow error reporting for frontend errors
'sentry_report_js' => false,
'sentry_host' => 'https://sentry.openproject.com'
}

@ -83,6 +83,12 @@ module OpenProject
ENV['OPENPROJECT_EDITION'] == 'bim'
end
##
# Whether we want to report to sentry
def frontend_sentry?
self['sentry_dsn'].present? && sentry_report_js?
end
def available_file_uploaders
uploaders = {

Loading…
Cancel
Save