The configuration can be done by environment variables or by a yaml configuration file. For more complex scenario the yaml is recommended.
How to configure
The viewer allows two different ways to apply configuration.
Configuration by environment variables is for configurations that are small and modify only a few variables. It is easy and fast to create and apply these configurations.
Configuration with yaml is for more complex configurations and different instances with complete different configurations. A yaml is prepared and then mapped in the container like as configmap or volume mapping.
Configuration by environment variables
Example for docker compose file
...
language | yaml |
---|
tia Viewer Core settings may be specified either by environmental variables in the container context or by providing a YAML configuration file.
When using environmental variables the pure amount of settings can cause long command lines (e.g. docker run) that are hard to maintain. Using a file-based approach (e.g. docker compose) is easier to maintain.
When using YAML configuration file, there is only one environmental variable to be set in order to include the YAML into startup procedure:
SPRING_CONFIG_ADDITIONAL-LOCATION
The YAML file is then easy to read and maintain.
Configuration using environmental variables
As environmental variables do not have any hierarchical order, the tia Viewer parameters must be qualified completely:
TIA_DESTINATIONS_SAPHTTP_HOST
Info |
---|
While tia Viewer Core parameter names are case-sensitive and use the |
Example for a docker-compose file with configuration using environmental variables:
Code Block |
---|
version: '3' services: tiaviewer: container_name: tiaviewer image: images.docker.kgs-cloud.de/tia-viewer/archivelink-oidc:latest ports: - "8080:8080" environment: tia.destinations.saphttp.hostTIA_DESTINATIONS_SAPHTTP_HOST: contentservevr.kgs.local tia.destinations.saphttp.portTIA_DESTINATIONS_SAPHTTP_PORT: 8090 tia.instances.default.watermark.textTIA_INSTANCES_DEFAULT_WATERMARK_TEXT: copy tia.instances.default.sap.urlTIA_INSTANCES_DEFAULT_SAP_URL: https://sapServer:8400/tia/tia_viewer?sap-client=250 tia.instances.default.sap.usernameTIA_INSTANCES_DEFAULT_SAP_USERNAME: secuser tia.instances.default.sap.passwordTIA_INSTANCES_DEFAULT_SAP_PASSWORD: s3cret tia.instances.default.mimetypes.TIA_INSTANCES_DEFAULT_MIMETYPES_0: application/pdf TIA_INSTANCES_HR_DOWNLOADDOCUMENT: false TIA_INSTANCES_FI_TEXT: confidential TIA_INSTANCES_FO_PRINTDOCUMENTNODE: false TIA_INSTANCES_FO_MIMETYPES_0: application/pdf |
Configuration
...
Example for docker compose file
viewer.yaml:
...
language | yaml |
---|
using YAML file
YAML defines a text-file-format (typical file extensions used are .yaml
and .yml
) for configuration parameters with a hierarchical order by line intend. There is always one parameter setting per row only.
By the parent section and the intend before the parameter name hierarchical order is specified and replace the prefixes as used with environmental variables.
Prepare the YAML file in the directory of choice at the host
Info |
---|
Using the file name |
Example tia Viewer configuration file:
Code Block |
---|
tia: destinations: saphttp: host: contentservevr.kgs.local port: 8090 instances: default: watermark: text: "copy" sap: url: "https://sapServer:8400/tia/tia_viewer?sap-client=250" username: secuser password: s3cret mimetypes: - application/pdf HR: downloadDocument: false FI: text: "confidential" FO: printDocumentNote: false mimetypes.0: application/pdf |
load the viewer.yaml in the container:
...
language | yaml |
---|
Map the configuration file into the container context, and included into tia Viewer Core start procedure by specifying its location to the
SPRING_CONFIG_ADDITIONAL-LOCATION
environmental variable.
Example docker compose file to load YAML file configuration:
Code Block |
---|
version: '3' services: tiaviewer: container_name: tiaviewer image: http://images.docker.kgs-cloud.de/tia-viewer/archivelink-oidc:latest ports: - "8080:8080" volumes: ./viewer.yml: /app/config/viewer.yml environment: spring.config.additional-locationSPRING_CONFIG_ADDITIONAL-LOCATION: /app/config/viewer.yml |