Fix sentry config

This commit is contained in:
Jade Ellis 2024-08-27 19:24:01 +01:00
parent 0be4f5f0c6
commit bb847974a4
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
4 changed files with 13 additions and 6 deletions

View file

@ -1,6 +1,3 @@
# This is committed to git
# DO NOT STORE SECRETS IN THIS FILE
# use .env.local for secrets
SENTRY_DSN = "https://d006c73cc53783930a1521a68ae1c312@o4507835405369344.ingest.de.sentry.io/4507835410481232"
SENTRY_REPORT_URL = "https://o4507835405369344.ingest.de.sentry.io/api/4507835410481232/security/?sentry_key=d006c73cc53783930a1521a68ae1c312"

View file

@ -1,7 +1,8 @@
import { SENTRY_DSN } from '$lib/config';
import { init as initSentry, handleErrorWithSentry, makeBrowserOfflineTransport, makeFetchTransport, replayIntegration } from '@sentry/sveltekit';
initSentry({
dsn: import.meta.env.SENTRY_DSN,
dsn: SENTRY_DSN,
environment: import.meta.env.MODE,
tracesSampleRate: 1.0,

View file

@ -2,9 +2,10 @@ import { sequence } from '@sveltejs/kit/hooks';
import {init as initSentry, handleErrorWithSentry, sentryHandle} from '@sentry/sveltekit';
import type { Handle } from "@sveltejs/kit";
import { randomBytes } from 'crypto';
import { SENTRY_DSN, SENTRY_REPORT_URL } from './lib/config';
initSentry({
dsn: import.meta.env.SENTRY_DSN,
dsn: SENTRY_DSN,
environment: import.meta.env.MODE,
tracesSampleRate: 1
})
@ -21,7 +22,7 @@ const securityHeaders = {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Resource-Policy': 'same-origin',
'Report-To': '{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"' + import.meta.env.SENTRY_REPORT_URL + '"}],"include_subdomains":true}',
'Report-To': '{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"' + SENTRY_REPORT_URL + '"}],"include_subdomains":true}',
}
export const handle: Handle = async (input) => {

View file

@ -0,0 +1,8 @@
// Sentry config
export const SENTRY_HOST = "o4507835405369344.ingest.de.sentry.io"
export const SENTRY_PROJECT_ID = "4507835410481232"
export const SENTRY_KEY = "d006c73cc53783930a1521a68ae1c312"
export const SENTRY_TUNNEL_ALLOWED_IDS = [SENTRY_PROJECT_ID]
export const SENTRY_DSN = "https://" + SENTRY_KEY + "@" + SENTRY_HOST + "/" + SENTRY_PROJECT_ID
export const SENTRY_REPORT_URL = "https://" + SENTRY_HOST + "/api/" + SENTRY_PROJECT_ID + "/security/?sentry_key=" + SENTRY_KEY