Merge pull request #2923 from overleaf/jpa-sentry-in-staging

[misc] sentry: allow reports for resources on the same origin and CDN

GitOrigin-RevId: 617939dccef839eb80df0b9d84e6684b5b2e618f
This commit is contained in:
Jakob Ackermann 2020-06-23 15:15:22 +02:00 committed by Copybot
parent ae327e7fd0
commit 5d9740408a
2 changed files with 4 additions and 3 deletions

View file

@ -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()

View file

@ -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: [