From 0f9b87f2da0c546865a402285ad16cb3ab3b7093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20G=C4=85sowski?= Date: Fri, 22 Nov 2024 01:44:28 +0100 Subject: [PATCH] fix: restore Sentry; Config CSP --- .env | 3 ++- src/main.ts | 1 - vite.config.ts | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 3e431e7..8d451bd 100644 --- a/.env +++ b/.env @@ -2,5 +2,6 @@ #/ public-key encryption for .env files / #/ [how it works](https://dotenvx.com/encryption) / #/----------------------------------------------------------/ -DOTENV_PUBLIC_KEY="035bcaae66c2cf7320a79fc804e98c91ab0d8d52e5d486e13d82cba67202efac06" +DOTENV_PUBLIC_KEY="02b2547e49bab36a88919f8d2205edd9a2ade7b5b347a8adbad7a6da13de89fb32" +VITE_SENTRY_DSN="encrypted:BBDW6P7CdjG838df48KkyJ/iqTjA+BiuIpdgD3GhH0qc2TTvurfN6y8P1+wFEDxkqzWGalvFRGaj5kv6mtggor/0iFlmrUA3UZcZRKcrqG11n08stA+lNj4wDkZJP9yfx6tPGsGECwfQohlzlp8YpmzzY2LWZtLEfRqEHL+A6j81HbrTnvfv0X0++ScdJMH7NuoJ8N5fP09FLrvJXTGU" diff --git a/src/main.ts b/src/main.ts index 63e4223..527857d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,7 +17,6 @@ const app = createApp(App); if (import.meta.env.PROD && import.meta.env.VITE_SENTRY_DSN) { Sentry.init({ app, - tunnel: '/bugs-tunnel', dsn: import.meta.env.VITE_SENTRY_DSN, environment: import.meta.env.MODE, integrations: [ diff --git a/vite.config.ts b/vite.config.ts index cc42e51..edd7069 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,6 @@ import {defineConfig} from 'vite'; import vue from '@vitejs/plugin-vue'; -import HtmlPlugin, {ScriptTag} from 'vite-plugin-html-config'; +import HtmlPlugin, {IHTMLTag, ScriptTag} from 'vite-plugin-html-config'; // https://vitejs.dev/config/ export default defineConfig(({command}) => { @@ -25,10 +25,15 @@ export default defineConfig(({command}) => { } } + const metas: IHTMLTag[] = [{ + 'http-equiv': 'Content-Security-Policy', + 'content': `default-src 'self'; img-src * data: blob:; media-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://sentry.gander.tools/ https://browser.sentry-cdn.com/; style-src 'self' 'unsafe-inline'; frame-src 'self'; connect-src 'self' blob: https://sentry.gander.tools/api/ https://pub.highlight.io/ https://otel.highlight.io/v1/traces; font-src 'self'; worker-src 'self' blob:` + }]; + return { plugins: [ vue(), - HtmlPlugin({headScripts}), + HtmlPlugin({headScripts, metas}), ], }; });