summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/index.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-05 14:50:38 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-05 14:50:38 +0200
commite8bb95cb35ed1b02a85cf7cbea5bfc20fe0324c2 (patch)
tree1f3992d8045437774767556bf20d053b947ed164 /opendc-web/opendc-web-ui/src/index.js
parent3c805a50ca710e123aa18ad1bfa01ea4f1ee40d2 (diff)
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.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/index.js')
-rw-r--r--opendc-web/opendc-web-ui/src/index.js5
1 files changed, 3 insertions, 2 deletions
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,
})