Configuration of OEC services
The configuration of OI4 OEC service is defined in chapter 6.1 Container storage of the OEC guideline. It separates the configuration into the following sections:
- Message Bus storage
- OI4 certificate storage
- Secret storage
- Application specific storages
Files and folder are mounted as volumes to the container. The default implementation of the oi4-oec-service will use the defined paths of the files or directories are mounted in the container.
Message Bus storage
The message bus storage contains all the non-sensitive data to connect to the broker, like the CA certificates (not the private key), addresses, ports, etc. and consists of the following elements:
- Message bus CA certificate is stored in the
certs/ca.pem
file. - Broker settings are stored in the
config/broker.json
file.
OI4 certificate storage
The certificate storage contains all certificates used in the OEC but not their private keys.
- Message bus client certificate is stored in the
certs/oi4-oec-service-demo.pem
file, in case client certificate based authentication is used.
Secret storage
Sensitive data like private keys and passphrases are stored in the secret storage.
- Username and password is stored in the
secrets/mqtt_passphrase
in case it is used. The file contains username and password separated by a colon BASE64 encoded. - Client certificate is stored in the
secrets/mqtt_private_key.pem
in case client certificate based authentication is used.
Environment variables
There are two environment variables that can be used to overwrite the log and event notification level:
- OI4_EDGE_EVENT_LEVEL
- OI4_EDGE_LOG_LEVEL
The values are Syslog levels according to the RFC 3164 and can be one of
emergency
,alert
,critical
,error
,warning
,notice
,info
,debug
The default value for event notification and logging iswarning
.
MAM of the service
The MAM (Master Asset Model) of the service is used as an identification of the service. The data is for example used in the OI4 Identifier. Every instance of a service needs an own, globally unique MAM, which is achieved by providing a unique hostname to the container that is used as the serial number. Every other data of the MAM should already be known before the installation of the service and can therefore be provided already in the container. Therefore, there is no configuration defined to set the MAM.
Overriding the default behaviour
The default configuration handling of the oi4-oec-service is according to the OEC guideline and need to stay as it is to be compliant.
Nevertheless, there are cases like local testing where it is necessary to gather the configuration from a different location.
To overwrite the default paths, you need to provide an instance of ISettingsPaths
with the adjusted paths to the OI4ApplicationFactory
during initialization.