|
@@ -1,33 +1,27 @@
|
|
|
import * as Sentry from '@sentry/nextjs';
|
|
|
-import { getSentryTunnelURL } from '@ente/shared/network/api';
|
|
|
import { getSentryUserID } from '@ente/shared/sentry/utils';
|
|
|
import { runningInBrowser } from '@ente/shared/platform';
|
|
|
import { getHasOptedOutOfCrashReports } from '@ente/shared/storage/localStorage/helpers';
|
|
|
import { getIsSentryEnabled } from '@ente/shared/sentry/utils';
|
|
|
-import {
|
|
|
- getAppEnv,
|
|
|
- getSentryDSN,
|
|
|
- getSentryRelease,
|
|
|
-} from '@ente/shared/apps/env';
|
|
|
+import { getAppEnv, getSentryRelease } from '@ente/shared/apps/env';
|
|
|
|
|
|
-export const setupSentry = async (DEFAULT_SENTRY_DSN: string) => {
|
|
|
+export const setupSentry = async (dsn: string) => {
|
|
|
const HAS_OPTED_OUT_OF_CRASH_REPORTING =
|
|
|
runningInBrowser() && getHasOptedOutOfCrashReports();
|
|
|
|
|
|
if (!HAS_OPTED_OUT_OF_CRASH_REPORTING) {
|
|
|
- const SENTRY_DSN = getSentryDSN() ?? DEFAULT_SENTRY_DSN;
|
|
|
const APP_ENV = getAppEnv();
|
|
|
const IS_ENABLED = getIsSentryEnabled();
|
|
|
const SENTRY_RELEASE = getSentryRelease();
|
|
|
|
|
|
Sentry.init({
|
|
|
- dsn: SENTRY_DSN,
|
|
|
+ dsn,
|
|
|
enabled: IS_ENABLED,
|
|
|
environment: APP_ENV,
|
|
|
release: SENTRY_RELEASE,
|
|
|
attachStacktrace: true,
|
|
|
autoSessionTracking: false,
|
|
|
- tunnel: getSentryTunnelURL(),
|
|
|
+ tunnel: 'https://sentry-reporter.ente.io',
|
|
|
beforeSend(event) {
|
|
|
event.request = event.request || {};
|
|
|
const currentURL = new URL(document.location.href);
|