Configuration Overview
Katalogue configuration is performed in a number of different locations:
Backend Service (api)
Section titled “Backend Service (api)”The Katalogue API backend service uses a number of sources for configuration, see below. Some settings can be set in multiple locations and the list below is ordered by priority from high to low. Higher priority means that a configuration parameter set there overrides any value set in a source with lower priority, e.g. environment variables overrides parameters set in the configuration file or database table.
- Environment variables, and Docker secrets for the parameters that take one
- Configuration file (
/services/api/config/appsettings.json) - Database table (
public.settings.setting_value) - Default value in database table (
public.settings.setting_default_value) - Default configuration file (
/services/api/config/appsettings_default.json)
Every parameter can be set as an environment variable or in the configuration file. Some can also be set in the database table, through the Settings page in the GUI. A parameter set as an environment variable or in the configuration file cannot be changed in the GUI.
See the Config Parameter Reference for all available config parameters.
Environment Variables
Section titled “Environment Variables”Every parameter can be set as an environment variable with the same name as the parameter. The path a parameter has in the configuration file is not part of the name.
- An empty variable, or one of only spaces, counts as not set, so
X=leavesXto the configuration file, the database or the default. - A boolean takes
true,false,1or0. - A list, such as
CORS_ORIGIN, takes a JSON array or a comma-separated list:CORS_ORIGIN=https://a.example.com,https://b.example.com. - Generic names, such as
ENVIRONMENTorPORT, are read as they are. Make sure the host does not set one of them for something else.
A secret parameter can also be given as a Docker secret, a file under /run/secrets named as the parameter, which is read before the variable: ENCRYPTION_KEY, REPOSITORY_PASSWORD, MAIL_PASSWORD, OIDC_CLIENT_SECRET, REST_API_OIDC_SIGNING_KEY, and TLS_CA_CERTIFICATES_PEM.
Example
Section titled “Example”To set OIDC_APPLICATION_ID as an environment variable (use just the parameter name):
export OIDC_APPLICATION_ID=abcd-12345678-defgConfiguration File (appsettings.json)
Section titled “Configuration File (appsettings.json)”The purpose of this file is to set configuration parameters required to start the backend service, and a number of parameters that are considered to be static during the lifetime of the application.
Every parameter can be set in the configuration file. A parameter set to null, "" or only spaces counts as not set. A value that is not a parameter, or is placed under the wrong path, is ignored, with a warning in the log when the backend starts.
The configuration file is located here: /services/api/config/appsettings.json
The file /services/api/config/appsettings_default.json can be used as an example and template for the configuration file.
Example
Section titled “Example”To set OIDC_APPLICATION_ID in the appsettings.json config file (here, authentication.oidc is the path the Config Parameter Reference gives for the section the parameter is in):
{ "config": { "authentication": { "oidc": { "OIDC_APPLICATION_ID": "abcd-12345678-defg" } } }}Database Table (public.settings)
Section titled “Database Table (public.settings)”The database table contains parameters that might change during the lifetime of the applications. All parameters (with a few exceptions) in the database can be changed through the Settings page in the Katalogue GUI (requires the admin role).
Example
Section titled “Example”To set OIDC_APPLICATION_ID in the database table, use the GUI (preferred) or a query like the one below.
UPDATE public.setting SET setting_value = 'abcd-12345678-defg'WHERE setting_code = 'OIDC_APPLICATION_ID';Frontend Service (spa)
Section titled “Frontend Service (spa)”The configuration required for the frontend application can be set as environment variables or in a config file.
Some settings can be set in multiple locations and the list below is ordered by priority from high to low. Higher priority means that a configuration parameter set there overrides any value set in a source with lower priority, e.g. environment variables overrides parameters set in the configuration file or database table.
- Environment variables (injected at container startup via
docker-entrypoint.sh) - Configuration file (
/services/spa/public/appsettings.json) - Default configuration file (
/services/spa/public/appsettings_default.json)
The file /services/spa/public/appsettings_default.json can be used as an example and template for the configuration file.
See the Config Parameter Reference for all available config parameters.