-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it possible to change configuration variables at runtime (#536)
* Add runtime config in JSON format * Add global runtime config from public folder * Rework production docker image for runtime config This updates the docker production image to be a fully operational nginx server which serves the statically built Argus front-end. Now that runtime configuration is supported, the updated image will produce a runtime config file from the same environment variables that were originally expected by the frontend build process, and ensure it's in the correct location before starting nginx. * Fix proper update of backend url in axios * Add Config class For handling of fixed values, required and optional values and easy stripping of unknown config values provided by users * Add handling of missing config file in dev environment in DEV env: config file can still be added to overwrite defaults but is not required anymore * Delete runtime-config file It is no longer required in dev * Update changelogs * Document new configuration options * Update docker/README.md The image runtime has significantly changed, simplifying deployment. * Update README.md Co-authored-by: Morten Brekkevold <[email protected]> * Document example runtime-config.json * Specify config uri for prod env * Add info about config in prod via env variables * Polish runtime-config-template.json --------- Co-authored-by: Morten Brekkevold <[email protected]>
- Loading branch information
1 parent
62231b1
commit 8570175
Showing
22 changed files
with
368 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ node_modules | |
build | ||
.dockerignore | ||
Dockerfile | ||
docker/Dockerfile | ||
docker/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
# Build the runtime config from environment: | ||
envsubst < /runtime-config-template.json > /usr/share/nginx/html/runtime-config.json | ||
# Now serve the static files forever: | ||
exec nginx -g "daemon off;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
server { | ||
listen 8080; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"backendUrl": "${REACT_APP_BACKEND_URL}", | ||
"backendWSUrl": "${REACT_APP_BACKEND_WS_URL}", | ||
"enableWebsocketSupport": ${REACT_APP_ENABLE_WEBSOCKETS_SUPPORT}, | ||
"useSecureCookie": ${REACT_APP_USE_SECURE_COOKIE}, | ||
"debug": ${REACT_APP_DEBUG}, | ||
"cookieDomain": "${REACT_APP_COOKIE_DOMAIN}", | ||
"defaultAutoRefreshInterval": ${REACT_APP_DEFAULT_AUTO_REFRESH_INTERVAL}, | ||
"realtimeServiceMaxRetries": ${REACT_APP_REALTIME_SERVICE_MAX_RETRIES}, | ||
"use24hTime": true, | ||
"timestampDateFormat": "yyyy-MM-dd", | ||
"timestampTimeFormat": "HH:mm:ss", | ||
"timestampTimeNoSeconds": "HH:mm", | ||
"timestampTimezoneOffsetFormat": "xxx", | ||
"timestampFormat": "{date} {time}{timezone_offset}", | ||
"showSeverityLevels": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.