diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index 2d935f65f7..465ed00ed2 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -366,6 +366,8 @@ module.exports = function(webRouter, privateApiRouter, publicApiRouter) { recaptchaDisabled: Settings.recaptcha != null ? Settings.recaptcha.disabled : undefined, validRootDocExtensions: Settings.validRootDocExtensions, + sentryAllowedOriginRegex: + Settings.sentry && Settings.sentry.allowedOriginRegex, sentryDsn: Settings.sentry != null ? Settings.sentry.publicDSN : undefined } next() diff --git a/services/web/frontend/js/utils/sentry.js b/services/web/frontend/js/utils/sentry.js index 59852ad449..7e1468c831 100644 --- a/services/web/frontend/js/utils/sentry.js +++ b/services/web/frontend/js/utils/sentry.js @@ -7,11 +7,10 @@ if (window.ExposedSettings.sentryDsn) { Sentry.init({ dsn: window.ExposedSettings.sentryDsn, - // Ignore errors unless they come from overleaf.com/sharelatex.com + // Ignore errors unless they come from our origins // Adapted from: https://docs.sentry.io/platforms/javascript/#decluttering-sentry whitelistUrls: [ - /https:\/\/[a-z]+\.overleaf\.com/, - /https:\/\/[a-z]+\.sharelatex\.com/ + new RegExp(window.ExposedSettings.sentryAllowedOriginRegex) ], ignoreErrors: [