diff --git a/front/.eslintrc.cjs b/front/.eslintrc.cjs index 995ce8131..c89e605b9 100644 --- a/front/.eslintrc.cjs +++ b/front/.eslintrc.cjs @@ -30,6 +30,7 @@ module.exports = { }, globals: { APP_VERSION: true, + APP_ENVIRONMENT: true, __BACKEND_ENDPOINT__: true, __GRAPHQL_ENDPOINT__: true, __EXPORT_ENDPOINT__: true, diff --git a/front/src/index.jsx b/front/src/index.jsx index d598d54ac..6db08d04a 100644 --- a/front/src/index.jsx +++ b/front/src/index.jsx @@ -30,6 +30,7 @@ const history = createBrowserHistory() if (import.meta.env.SENTRY_DSN) { Sentry.init({ dsn: import.meta.env.SENTRY_DSN, + environment: import.meta.env.APP_ENVIRONMENT, integrations: [ Sentry.reactRouterV5BrowserTracingIntegration({ history }) ], diff --git a/front/vite.config.js b/front/vite.config.js index 18a61507d..9a3be2d0a 100644 --- a/front/vite.config.js +++ b/front/vite.config.js @@ -8,7 +8,7 @@ import graphql from '@rollup/plugin-graphql' // https://vitejs.dev/config/ export default defineConfig(async ({ mode }) => { - const env = loadEnv(mode, fileURLToPath(import.meta.resolve('..')), 'SNOWPACK_') + const env = loadEnv(mode, fileURLToPath(import.meta.resolve('..')), ['SNOWPACK_', 'SENTRY_']) const { SNOWPACK_MATOMO_URL, SNOWPACK_MATOMO_SITE_ID } = env return { diff --git a/infrastructure/templates/.env b/infrastructure/templates/.env index 2e1a965f5..d9d5cadd4 100644 --- a/infrastructure/templates/.env +++ b/infrastructure/templates/.env @@ -1,4 +1,5 @@ HTTPS={{https}} +SENTRY_ENVIRONMENT={{env}} DATABASE_URL=mongodb://127.0.0.1:27017/{{mongo_server_db}} JWT_SECRET_TOKEN="{{jwt_secret_token}}" JWT_SECRET_SESSION="{{jwt_secret_session}}"