Using environment variables to configure the administration endpoint

IBM provides a Docker environment file, which can be configured to activate the administration (admin) endpoint.

The Bridge can run in Docker containers or in the native host OS. The setting is different depending on the deployment environments.

In the Docker container, the .tz package from IBM provides a Docker environment file.

Before you begin, extract the .tz package.

The imabridge-docker.env file contains the following content:

IMABRIDGE_ADMINPORT=9082
IMABRIDGE_ADMINIFACE=localhost
IMABRIDGE_ADMINSECURE=true
IMABRIDGE_ADMINUSER=adminUser
IMABRIDGE_ADMINPW=adminPassword
IMABRIDGE_ENABLEABOUT=true
IMABRIDGE_AUTHENTICATION=basic

The Bridge is deployed in a native OS as the service EclipseAmlenBridge. The service needs the same variables as those in the preceding Docker. The environment variables are set in the Systemd configuration file.

Table 1. A connection object defines the following properties that are required to connect to an MQTT server.
Parameter Default value Description
IMABRIDGE_ADMINPORT 9082 The mandatory admin port number, ranging from 1 to 65535.
IMABRIDGE_ADMINIFACE localhost The optional administrative interface.
IMABRIDGE_ADMINSECURE true The optional TLS switch, which is set to true by default (meaning TLS is enabled). If IMABRIDGE_ADMINSECURE is true, you must provide further TLS-related information, which is explained in the Using the Bridge configuration topic.
IMABRIDGE_ADMINUSER adminUser The optional admin user ID.
IMABRIDGE_ADMINPW adminPassword The optional password for IMABRIDGE_ADMINUSER. The password can be either plain text or obfuscated by using a uni-directional hash.
IMABRIDGE_ENABLEABOUT true The simple HTTP server is enabled showing the About page. IMABRIDGE_AUTHENTICATION is set to basic. If the username is not specified, an HTTP status of 401 is returned.
  1. The imabridge-docker.env file can be modified to meet your requirements. To use the environment file, run the following command:
    docker run --net=host -P -it --name BRIDGE -m <memory_size> 
    -v <data_volume> --env-file imabridge-docker.env  -d imabridge:5.0.0.0
    
  2. Before you start the EclipseAmlenBridge service, open and edit the /etc/systemd/system.conf file. Update the DefaultEnvironment parameter with the following values:DefaultEnvironment="IMABRIDGE_ADMINPORT=9082" "IMABRIDGE_ADMINIFACE=localhost" "IMABRIDGE_ADMINSECURE=true" "IMABRIDGE_ADMINUSER=adminUser" "IMABRIDGE_ADMINPW=adminPassword" "IMABRIDGE_ENABLEABOUT=true" "IMABRIDGE_AUTHENTICATION=basic" where all the variables are the same as those in the preceding Docker, but with a different format.
  3. Save and close the the /etc/systemd/system.conf file.
  4. Either reboot the server or run the following command to activate the new environment variables: systemctl daemon-reexec.
  5. Start the EclipseAmlenBridge service by running the systemctl command.