Skip to content

Commit

Permalink
fix: restore Sentry; Config CSP
Browse files Browse the repository at this point in the history
  • Loading branch information
gander committed Nov 22, 2024
1 parent 8d144ac commit 0f9b87f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 0 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
9 changes: 7 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -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}) => {
Expand All @@ -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}),
],
};
});

0 comments on commit 0f9b87f

Please sign in to comment.