Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Separately allow to disable sentry without removing dsn

Oliver Güntherad0e22d64a00
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index b37b69a95d1..02ca2d2a4d4 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -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 %>
diff --git a/lib/open_project/configuration.rb b/lib/open_project/configuration.rb
index 9fd2621a48e..eb1ced46093 100644
--- a/lib/open_project/configuration.rb
+++ b/lib/open_project/configuration.rb
@@ -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'
}
diff --git a/lib/open_project/configuration/helpers.rb b/lib/open_project/configuration/helpers.rb
index 955b914ae4a..fd4debc96d7 100644
--- a/lib/open_project/configuration/helpers.rb
+++ b/lib/open_project/configuration/helpers.rb
@@ -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 = {