Document toolboxDocument toolbox

Install Hermod (docker)

This article describes how to install the Smart ID Messaging component Hermod as a docker image. For information about how to install Hermod as a WAR file, see Install Hermod (WAR file).

From Hermod version 3.5.0, swagger is enabled by default. To view an example, see "Edit Hermod configuration" below.

This instruction is only an example and does not describe a system for production, which typically requires orchestration tools or docker hosting platforms.

Prerequisites for docker installation

  • A Linux host with docker and docker-compose installed and configured, Windows is not officially supported

  • A public DNS name which devices can reach

  • Matching certificates for the public address

  • An installed instance of an SQL server, for example, PostgreSQL, Microsoft SQL Server, Maria DB, or Oracle

Step-by-step instruction

Download the Hermod docker image and file structure

  1. Sign in to Nexus Support portal.

  2. Go to Nexus Smart ID Clients (Personal and Hermod) > Smart ID Messaging  and select a Hermod version to download the *.zip file. 

  3. Unpack the *.zip file.

  4. Open the extracted folder, for example, 3.x.y.RELEASE. 
    The folder contains the Hermod installation file and a simple-setup file to set up a default configuration. 

  5. Unpack simple-setup.zip. 

Default file structure

The following file structure will be created for configuration and certificate files:

example/ `-- compose     `-- hermod         |-- cacerts         |   `-- clientcert.cer         |-- certificates         |   `-- hermod-host-bundle.p12         |-- config         |   |-- application.yml -> ./cod-hermod.yml         |   `-- README.txt         |-- docker-compose.yml         |-- postgresql         |   `-- data         `-- testdb

Store certificate files in the Hermod structure

  1. Put one or multiple CA certificates in base64 format with .cer file extension in the folder example/compose/hermod/cacerts. The file name cannot contain spaces.  

  2. Put one or multiple certificate containers, including the whole certificate chain with any intermediate CA certificates, in pkcs#12 format (with a .pfx or .p12 extension) in the folder example/compose/hermod/certificates. The file name cannot contain spaces.  

You must include intermediate CA certificates.

The certificate containers are referred to from the configuration file application.yml. For more information, see "Edit Hermod configuration".

Load docker image

The docker image can be loaded locally to each machine or to the docker registry and be used remotely from several machines.

  • Load the released docker image locally on the target host:

Example: Load docker image
> docker load -i hermod-3.x.y.RELEASE.tar
  • If you have a docker registry, load the image in the docker registry.

Edit docker compose configuration

File path: example/compose/hermod/docker-compose.yml

  • Edit the configuration file docker-compose.yml with the correct values for your environment.

Example: docker-compose.yml

version: '2' services: postgresql: restart: unless-stopped image: postgres:9.4.12 ports: - "5432:5432" environment: - POSTGRES_USER=dbuser - POSTGRES_PASSWORD=dbpassword - POSTGRES_DB=hermod - TZ=Europe/Stockholm mem_limit: 256m volumes: - ./postgresql/data:/var/lib/postgresql/data:Z hermod: restart: unless-stopped image: nexusgocontainerregistry.azurecr.io/nexus-personal/hermod:3.1.1.RELEASE ports: - "20400:20400" extra_hosts: - "<my-hermod-server>:94.140.49.248" environment: - TZ=Europe/Stockholm - JAVA_OPTS=-Xms128m -Xmx256m -XX:MaxMetaspaceSize=256m -XX:CompressedClassSpaceSize=64m -Xss256k -Xmn8m -XX:InitialCodeCacheSize=4m -XX:ReservedCodeCacheSize=64m -XX:MaxDirectMemorySize=64m mem_limit: 512m volumes: - ./config:/home/docker/config:z - ./certificates:/home/docker/certificates:z - ./cacerts:/cacerts:z logging: options: max-size: 10m command: "--spring.cloud.config.fail-fast=false --springdoc.swagger-ui.enabled=false --springdoc.api-docs.enabled=false"

The default value for the context path and URI base is /hermod/rest/ (that is http://localhost:20400/hermod/rest/...).

Example 

You can change the context path and URI base for your specific configuration. For example, if you want to change the context path and URI base to empty values, change the start command for Hermod in docker-compose.yml:

Example: Hermod start command

You must also set the URI base to empty in the Hermod configuration.

Edit Hermod configuration

Default file path: example/compose/hermod/config/application.yml.

Edit the configuration file config/application.yml with the correct values for your environment.

Example

 

Change URIbase

To change the uribase, for example, set the corresponding variable to empty, in the application.yml configuration file:

Example: Set uribase to empty

Initialize database

  1. Start the specified database. See Docker compose configuration file. This example show how to start PostgreSQL. 

    Example: Start PostgreSQL

  1. Connect to your database and run the SQL ddl for the specific vendor or version, for example, postgresql/V3.1.1__base_version.sql.

Start Hermod and Hermod test app

Start Hermod with the following command:

  • Example: Start Hermod

To install and start the Hermod test application, see Install Hermod test app.  The test application can be used for basic tests.

Verify SSL certificate of Hermod public URL

Make sure that the public URL that has been configured in Hermod has a valid and trusted SSL certificate. To verify this, open the Hermod public URL in a browser and make sure the connection is secure, by viewing the padlock in the browser bar.

Example: Hermod public URL

Additional information





Copyright 2024 Technology Nexus Secured Business Solutions AB. All rights reserved.
Contact Nexus | https://www.nexusgroup.com | Disclaimer | Terms & Conditions