Skip to main content
Version: 2.x (upcoming)

Frontend configuration

The OpenCDMP webapp is configured through its config.json file. When the webapp container starts, it fills in config.json from the environment variables below, which the Docker example sets in its .env file (see the Docker Compose environment). Other values of config.json can be changed with a config-override.json file.

Environment variables​

Core configuration​

Env VariableDescriptionRequiredDefault ValueExample
WEBAPP_API_URLAddress of the API, as the browser reaches it, with a trailing slash.Yes-https://opencdmp.example.org/api/
INSTALLATION_URLAddress of the webapp, with a trailing slash.Yes-https://opencdmp.example.org/
WEBAPP_BASE_URLBase path of the webapp, when it is not served at the root of its host.No//opencdmp/
DEFAULT_CULTUREDefault language of the webapp, as an ISO 639 code.Noenen

Keycloak authentication​

Env VariableDescriptionRequiredDefault ValueExample
KEYCLOAK_ADDRESSKeycloak server URL, including its relative path (/auth/ in the Docker example).Yes-https://opencdmp.example.org/auth/
KEYCLOAK_REALMKeycloak realm.Yes-OpenCDMP
KEYCLOAK_CLIENT_IDKeycloak client of the webapp.Yes-webapp
KEYCLOAK_SCOPEScopes the webapp requests. They must include api (the API audience) and, for comments and notifications, annotation and notification.Noopenid profile email address phone api notification annotation identity_provideropenid profile email api notification annotation identity_provider

Appearance and accessibility​

Env VariableDescriptionRequiredDefault ValueExample
PRIMARY_COLORMain colour of the installation (theme.primaryColor). Each organisation can set its own on its Branding page.No-#1e6b52
CSS_OVERRIDESStyle variables of the installation (theme.cssOverride): a JSON object of variable names and values, see Branding. The value is inserted into a JSON string, so escape its quotes; it cannot contain a comma, so set more than one variable in config-override.json instead.No-{\"--mat-sys-primary\":\"#1e6b52\"}
USERWAY_IDAccount id of the UserWay accessibility widget (userWay.id). The widget is not loaded when it is empty.No-<userway-account-id>

Logging​

Env VariableDescriptionRequiredDefault ValueExample
LOGGING_ENABLEDWrites the webapp's log messages to the browser console.Nofalsetrue

Overrides​

To change other values of config.json, mount a config-override.json file at /usr/share/nginx/html/assets/config/config-override.json in the webapp container (the Docker example has the volume line commented out in docker-compose.override.yml). The webapp merges it over config.json when it loads: objects are merged key by key, and any other value that is not null in the override replaces the value of config.json, including values set from the environment variables. List only the keys you change. The sections you can change are listed below.

Notifications​

"notification_service": {
"enabled": true,
"address": null
}
VariableDescriptionRequiredDefault ValueExample
enabledShows the in-app notifications.Notruefalse
addressAddress under which the webapp calls the notification service (<address>api/notification/...), with a trailing slash. When null, the webapp calls its own address, where the proxy forwards /api/notification/.Nonullhttps://notifications.example.org/

Annotations​

"annotation_service": {
"enabled": true,
"address": null
}
VariableDescriptionRequiredDefault ValueExample
enabledShows comments on plans and assets.Notruefalse
addressAddress under which the webapp calls the annotation service (<address>api/annotation/...), with a trailing slash. When null, the webapp calls its own address, where the proxy forwards /api/annotation/.Nonullhttps://annotations.example.org/

Logging​

When LOGGING_ENABLED is true, logLevels selects the levels written to the browser console.

"logging": {
"logLevels": ["debug", "info", "warning", "error"]
}
VariableDescriptionRequiredDefault ValueExample
logLevelsLevels to write.No["debug", "info", "warning", "error"]["warning", "error"]

Default:

"sidebar": {
"infoItems": [
{
"title": "SIDE-BAR.SUPPORT",
"icon": "help",
"routerPath": "/contact-support",
"accessLevel": "authenticated"
}
],
"footerItems": [
{
"routerPath": "/about",
"title": "FOOTER.ABOUT",
"icon": "feedback",
"accessLevel": "public"
},
{
"routerPath": "/terms-and-conditions",
"title": "FOOTER.TERMS-OF-SERVICE",
"accessLevel": "public"
},
{
"routerPath": "/glossary",
"title": "FOOTER.GLOSSARY",
"accessLevel": "public"
},
{
"routerPath": "/user-guide",
"title": "FOOTER.GUIDE",
"accessLevel": "public"
},
{
"routerPath": "/contact-support",
"title": "FOOTER.CONTACT-SUPPORT",
"accessLevel": "authenticated"
}
]
}
VariableDescriptionRequiredDefault ValueExample
titlePage titleYes-page-title
routerPathInternal path to the pageYes¹-/<relative-route>
externalUrlURL that leads to external viewYes²-http://<base-route>/<route>
accessLevelAccess level of users allowed to view pageYes-authenticated
iconSidebar menu material symbol icon that appears next to the titleNo-feedback

¹ Required if not using externalUrl ² Required if not using routerPath

Authorization providers​

authProviders sets the icon shown next to each email address on the profile page, by the identity provider the user signed in with through Keycloak. Providers that are not listed get the default icon.

Default:

"authProviders": {
"defaultAuthProvider": {
"name": "Default",
"providerClass": "defaultIcon"
},
"authProviders": [
{
"name": "google",
"providerClass": "googleIcon",
"cultures": ["en"]
},
{
"name": "facebook",
"providerClass": "facebookIcon",
"cultures": ["en"]
}
]
}
VariableDescriptionRequiredDefault ValueExample
nameAlias of the identity provider in Keycloak.Yes-google
providerClassStyle class of the icon.Yes-googleIcon
culturesLanguages, as ISO 639 codes, in which the icon is shown.Yes-["en"]

UserWay​

UserWay is an accessibility widget. It is loaded when an account id is set, with USERWAY_ID or here.

"userWay": {
"id": "<userway-account-id>"
}
VariableDescriptionRequiredDefault ValueExample
idAccount id of the UserWay widget.No-<userway-account-id>

Theme​

primaryColor and cssOverride are the installation's defaults, also set by PRIMARY_COLOR and CSS_OVERRIDES. Each organisation can replace them on its Branding page, which also lists the style variables. cssOverride is a JSON object written as a string:

"theme": {
"primaryColor": "#1e6b52",
"cssOverride": "{\"--mat-sys-primary\": \"#1e6b52\", \"--link-color\": \"#1F57C3\"}"
}

See also​