Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Consolidate configuration override

...

If you are upgrading from 7.0 or 7.1 to 7.2 (or later), you will either need to migrate your old configuration file (from Typescript to YAML) or start fresh.  You can migrate your old (7.0 or 7.1) "environment.*.ts" configuration file to the new "config.*.yml" format (see the v7 UI configuration documentation).

Configuration Override

In 7.2 or above

Info

Starting in 7.2, if you make a configuration update, you only need to restart the frontend.  There is no need to rebuild unless you have made code changes in "./src" directory or similar.

The UI configuration files reside in the the ./config/ folder in the Angular UI source code.  The default configuration is provided in config.yml.

...

  1. Environment variables
  2. The .env file
  3. The ./config/config.prod.yml, ./config/config.dev.yml or ./config/config.test.yml files (depending on current mode)
  4. The ./config/config.yml file
  5. The hardcoded defaults in ./src/config/default-app-config.ts

In 7.1 or 7.0

...

  1. .ts

...

To change the default configuration values, you simply create (one or more) local files that override the parameters you need to modify. You can use  environment.template.ts  as a starting point.

  • For example, create a new  environment.dev.ts  file in  src/environments/  for a  development  environment;
  • For example, create a new  environment.prod.ts  file in  src/environments/  for a  production  environment;

The "ui" and "rest" sections of the configuration may also be overridden separately via one of the following

By setting any of the following environment variables in your system:

Code Block
# "ui" settings environment variables
DSPACE_HOST # The host name of the angular application
DSPACE_PORT # The port number of the angular application
DSPACE_NAMESPACE # The namespace of the angular application
DSPACE_SSL # Whether the angular application uses SSL [true/false]

# "rest" settings environment variables
DSPACE_REST_HOST # The host name of the REST application
DSPACE_REST_PORT # The port number of the REST application
DSPACE_REST_NAMESPACE # The namespace of the REST application
DSPACE_REST_SSL # Whether the angular REST uses SSL [true/false]

...

The override priority ordering is as follows (with items listed at the top overriding all other settings)

  1. Environment variables
  2. The ".env" file
  3. The "environment.prod.ts", "environment.dev.ts" or "environment.test.ts"
  4. The "environment.common.ts"

Configuration Reference

The following configurations are available in ./src/environments/environment.common.ts These settings may be overridden as described above

...