From e8bb95cb35ed1b02a85cf7cbea5bfc20fe0324c2 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 14:50:38 +0200 Subject: build: Support runtime variables in frontend Docker image This change adds support for dynamically specifying various variables for the frontend Docker image through environmental variables. Previously, these were embedded directly into the source code, which requires rebuilding the entire image to change these variables. --- opendc-web/opendc-web-ui/src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'opendc-web/opendc-web-ui/src/index.js') diff --git a/opendc-web/opendc-web-ui/src/index.js b/opendc-web/opendc-web-ui/src/index.js index 3517147e..bddf0b0e 100644 --- a/opendc-web/opendc-web-ui/src/index.js +++ b/opendc-web/opendc-web-ui/src/index.js @@ -12,10 +12,11 @@ setupSocketConnection(() => { const store = configureStore() // Initialize Sentry if the user has configured a DSN - if (process.env.REACT_APP_SENTRY_DSN) { + const dsn = window.$$env['SENTRY_DSN'] + if (dsn) { Sentry.init({ environment: process.env.NODE_ENV, - dsn: process.env.REACT_APP_SENTRY_DSN, + dsn: dsn, integrations: [new Integrations.BrowserTracing()], tracesSampleRate: 0.1, }) -- cgit v1.2.3