Skip to main content
Version: 19

Harmoney Services

The Harmoney platform consists of the following services:

  • api: The main backend service that handles API requests, processes data, and manages business logic.
  • web: The frontend service that serves the user interface and interacts with the backend API.
  • pdf: A service dedicated to generating PDF documents.
  • listcheck: A service that stores lists for compliance checks, autocomplete, etc.

The sections below provide an overview of the configuration possibilities of each service.

API​

Environment Variables​

The following environment variables can be configured:

Variable NameDescriptionDefault Value
DOMAINBase domain of the instancelocal.myharmoney.eu
DEFAULT_THREAD_POOL_SIZEMax number of threads100
DB_HOSTDatabase hostdb
DB_SCHEMADatabase schema (in single-tenant mode)harmoney
DB_USERDatabase user
DB_PASSWORDDatabase password
DB_MIN_POOL_SIZEMin DB-connection-pool size0
DB_MAX_POOL_SIZEMax DB-connection-pool size150
JDBC_OPTSQuery params to add to the jdbc urlallowPublicKeyRetrieval=true&useSSL=false
JDBC_OPTS_FLYWAYQuery params to add to the jdbc url for the Flyway migrationsallowPublicKeyRetrieval=true&useSSL=false
JOB_INTERVAL_SECONDSNumber of seconds between each job execution for a single timer1
NUM_JOB_TIMERSNumber of job timers5
LOG_LEVELLogging levelINFO
LOG_JSONEnable JSON formatted logstrue
PROXY_HOSTProxy host for outbound requests
PROXY_PORTProxy port for outbound requests
NON_PROXY_HOSTSPipe-separated list of hosts that should bypass the proxy
OTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry OTLP exporter endpoint (gRPC)http://localhost:4317
OTEL_EXPORTER_OTLP_HEADERSOpenTelemetry OTLP exporter headers
OTEL_RESOURCE_ATTRIBUTESOpenTelemetry resource attributesdeployment.environment=local,application.packages=eu.myharmoney
OTEL_SERVICE_NAMEOpenTelemetry service nameapi
OTEL_TRACES_SAMPLER_RATIOOpenTelemetry Traces Sampler Ratio0.0 (tracing is off)
JAVA_OPTSAdditional Java options
HARMONEY_KAFKA_*See Data Warehouse
DWH_*See Data Warehouse

Multi-tenancy​

The API service can be configured to run in either single-tenant or multi-tenant mode. In single-tenant mode, all data is stored in a single database schema. In multi-tenant mode, each tenant has its own database schema, and the service dynamically switches between schemas based on the host of the incoming request. The host is translated to the database schema using a host-mapping (see below).

The API service is at this moment not fully stateless. To avoid leaking state across tenants, all stateful components (e.g., caches) are tenant-aware, so they will only store and serve data for the current tenant.

The following configuration is necessary to enable multi-tenancy:

Variable NameValue
DB_SCHEMAMust be empty
JDBC_OPTSShould be extended with databaseTerm=SCHEMA
JDBC_OPTS_FLYWAYSame as JDBC_OPTS, but without databaseTerm=SCHEMA
JAVA_OPTSSee example below

JAVA_OPTS should be extended with the host mapping as follows:

JAVA_OPTS: >-
-Dtenants.host-map.tenant1.myharmoney.eu=tenant1
-Dtenants.host-map.tenant2.myharmoney.eu=tenant2

An empty schema with the name base must be present for the API to connect to the database at startup. Multi-tenancy works with a single user, so that user must have access to all schemas.

Database Configuration​

The following parameters can be configured in the table settings_global_parameters:

Parameter NameDescriptionDefault Value
ENVIRONMENTContains the base domain of this instance (required)
API_URLThe relative url of the api (required)/api
HEALTH_CHECK_GATEWAYChecks (level) that should be included in the gateway health-check endpoint1
HEALTH_CHECK_TIMEOUTDefault timeout for health-checks of external providers (in seconds)30
HEALTH_CHECK_GLOBAL_TIMEOUTGlobal timeout for health-checks of external providers (in seconds)30
RUN_HEALTH_CHECKSExecute health-checks or not (L1: 50s, L2: 300s, L3: 600s)true
PRIVACY_POLICY_URLDefault privacy policy urlhttps://cdn.myharmoney.eu/harmoney-public/terms/terms-of-use-{{lang}}.pdf
TERMS_OF_USE_URLDefault terms of use urlhttps://cdn.myharmoney.eu/harmoney-public/terms/privacy-policy-{{lang}}.pdf
ERROR_REPORTING_ENABLEDUsed to enable/disable error-mailstrue
RATE_LIMIT_DISABLEDUsed to enable/disable the rate limit (both internal api and gateway)false
RATE_LIMIT_WHITELISTComma-separated list of IP-addresses that skip the rate limiter
GATEWAY_RATE_LIMIT_NUM_CALLSNumber of gateway calls per IP-address per window12
GATEWAY_RATE_LIMIT_WINDOWRate limit window (in seconds)60
SMS_VALIDITYValidity of OTP codes sent via SMS (in seconds)120
EMAIL_VALIDITYValidity of OTP codes sent via email (in seconds)120
DEV_MAILEmail used to send error-mails to[email protected]
CONFIG_MAILEmail used to send configuration exceptions to[email protected]
EXPONENTIAL_BACK_OFFBase delay for exponential backoff of job retries. E.g. 30s, 60s, 120s, etc.30
DATABASE_CLEAN_ARCHIVES_BEFORE_DURATION
JWT_SHARED_SECRETSecret used to encrypt JWT tokens
JWT_EXPIRATIONExpiration time of JWT tokens of authenticated users (in minutes)120
SESSION_EXPIRATIONExpiration of sessions (JWT expiration can be extended until session expiration) (in minutes)1440
COOKIE_SAME_SITEControls the SameSite attribute of the authorization cookieStrict
COOKIE_DOMAINControls the Domain attribute of the authorization cookieWL origin
WHITE_LABEL_VERIFICATION_DISABLEDAllows to disable cross-white-label verificationfalse
TIMEOUT_SECONDSDefault (per-request) timeout of external calls (in seconds)110
GLOBAL_TIMEOUT_SECONDSDefault global (including retries) timeout of external calls (in seconds)110

Web​

Environment Variables​

The following environment variables can be configured:

Variable NameDescriptionDefault Value
APIRelative path towards the api/api
APM_CONFIGOpenTelemetry configuration (see examples below)
KEYCLOAK_ADMIN_CONFIGKeycloak configuration (see example below) (beta)

Elastic RUM​

Example value for APM_CONFIG when using Elastic RUM:

{
"active": true,
"serviceName": "web",
"environment": "local",
"serverUrl": "<elastic apm server url>"
}

Datadog RUM​

Example value for APM_CONFIG when using Datadog RUM:

{
"active": true,
"serviceName": "web",
"environment": "local",
"datadogApplicationId": "<datadog application id>",
"datadogClientToken": "<datadog client token>",
"datadogSite": "<datadog site>",
"sessionSampleRate": 100,
"telemetrySampleRate": 100,
"datadogTrackingConsent": "not-granted"
}

Keycloak (beta)​

{
"keycloakUrl": "https://kc.uat.myharmoney.eu/",
"realm": "realmName",
"clientId": "uat-admin-ui",
"adminApiUrl": "kc-admin-service.uat.myharmoney.eu",
"managerGroup": "/user-managers"
}

PDF​

Environment Variables​

The following environment variables can be configured:

Variable NameDescriptionDefault Value
OTEL_EXPORTER_OTLP_ENABLEDEnable OpenTelemetry OTLP exporterfalse
OTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry OTLP exporter endpoint (gRPC)http://localhost:4317
OTEL_EXPORTER_OTLP_HEADERSOpenTelemetry OTLP exporter headers
OTEL_RESOURCE_ATTRIBUTESOpenTelemetry resource attributesdeployment.environment=local
OTEL_SERVICE_NAMEOpenTelemetry service namepdf
OTEL_TRACES_SAMPLER_RATIOOpenTelemetry Traces Sampler Ratio0.0 (tracing is off)

Listcheck​

Environment Variables​

The following environment variables can be configured:

Variable NameDescriptionDefault Value
DB_HOSTDatabase hostdb
DB_SCHEMADatabase schema (in single-tenant mode)harmoney
DB_USERDatabase user
DB_PASSWORDDatabase password
JDBC_OPTSQuery params to add to the jdbc urlallowPublicKeyRetrieval=true&useSSL=false
JDBC_OPTS_FLYWAYQuery params to add to the jdbc url for the Flyway migrationsallowPublicKeyRetrieval=true&useSSL=false
LOG_LEVELLogging levelINFO
LOG_JSONEnable JSON formatted logstrue
OTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry OTLP exporter endpoint (gRPC)http://localhost:4317
OTEL_EXPORTER_OTLP_HEADERSOpenTelemetry OTLP exporter headers
OTEL_RESOURCE_ATTRIBUTESOpenTelemetry resource attributesdeployment.environment=local,application.packages=eu.myharmoney
OTEL_SERVICE_NAMEOpenTelemetry service namelistcheck
OTEL_TRACES_SAMPLER_RATIOOpenTelemetry Traces Sampler Ratio0.0 (tracing is off)
JAVA_OPTSAdditional Java options

Multi-tenancy​

The listcheck service can be configured to run in either single-tenant or multi-tenant mode. In single-tenant mode, all data is stored in a single database schema. In multi-tenant mode, each tenant has its own database schema, and the service dynamically switches between schemas based on an incoming HTTP header from the API service. For simplicity, the listcheck service uses the same host-mapping as the API service, but instead of using the host of the incoming request, it uses the value of the X-Tenant-Schema header to determine the tenant and thus the database schema.

The listcheck service is fully stateless, so no additional measures are necessary to avoid leaking state across tenants.

The following configuration is necessary to enable multi-tenancy:

Variable NameValue
DB_SCHEMAMust be empty
JDBC_OPTSShould be extended with databaseTerm=SCHEMA
JDBC_OPTS_FLYWAYSame as JDBC_OPTS, but without databaseTerm=SCHEMA
JAVA_OPTSSee example below

JAVA_OPTS should be extended with the host mapping as follows:

JAVA_OPTS: >-
-Dtenants.host-map.tenant1.myharmoney.eu=tenant1
-Dtenants.host-map.tenant2.myharmoney.eu=tenant2

An empty schema with the name base must be present for the listcheck service to connect to the database at startup. Multi-tenancy works with a single user, so that user must have access to all schemas.