# Environment Variables

## DecisionRules Environment Variables

All variables can be set either in the docker-compose configuration file or directly as a command-line parameter before running the containers.

### License Key Validation

Your server must have access to host <https://license.decisionrules.io/>. You won't be able to start the container without the connectivity to the license server.

### Server environment variables

<table data-full-width="true"><thead><tr><th width="238">Variable name</th><th>Description</th><th width="139">Mandatory</th><th width="124">Version</th><th>Example value</th></tr></thead><tbody><tr><td>REDIS_URL</td><td>Redis URL</td><td>Yes</td><td></td><td>redis(s)://host.docker.internal:6379</td></tr><tr><td>SOLVER_REDIS_URL</td><td>Redis URL for solver</td><td>Yes</td><td>Not needed from version 1.6.0, will use REDIS_URL instead</td><td>redis(s)://host.docker.internal:6379</td></tr><tr><td>MONGO_DB_URI</td><td>Mongo URL</td><td>Yes</td><td></td><td>mongodb(+srv)://host.docker.internal:27017</td></tr><tr><td>CLIENT_URL</td><td>Url on which client container is accessible</td><td>Yes</td><td></td><td>http://localhost:80/<strong># (# is mandatory)</strong></td></tr><tr><td>LICENSE_KEY</td><td>License key string</td><td>Yes</td><td></td><td>YOUR LICENSE KEY</td></tr><tr><td>DB_TYPE</td><td>Specify MongoDB type</td><td>If you use CosmosDB or DocumentDB</td><td>>= 1.8.2</td><td>MONGODB (default)<br>COSMOSDB<br>DOCUMENTDB</td></tr><tr><td>API_URL</td><td>Lets the server know it's own address for Rule Flow and dependant rule solves.</td><td>Yes*</td><td>The server will run without this variable but Rule Flow and Solve functions might not work</td><td>https://api.decisionrules.io</td></tr></tbody></table>

### Optional server environment variables

<table data-full-width="true"><thead><tr><th width="346">Variable name</th><th>Description</th><th width="125">Mandatory</th><th width="108">Version</th><th>Example value</th></tr></thead><tbody><tr><td>MONGO_TLS_CA_FILE</td><td>Path to file with one or more certificate authorities to trust when making a TLS connection.</td><td>No</td><td>>= 1.18.4.4</td><td>/certificates/ca.pem</td></tr><tr><td>MONGO_TLS_CERTIFICATE_KEY_FILE</td><td>Path to the client certificate private key file. This key is often included within the certificate file itself.</td><td>No</td><td>>= 1.18.4.4</td><td>/certificates/private.pem</td></tr><tr><td>BRAND_LOGO_URL</td><td>Custom brand Logo URL. Feature must be enabled in license key </td><td>No</td><td>>= 1.17.0</td><td>https://example.com.img/logo.ong <strong>OR</strong> <em>data:image/png;base64,iVBORw0KGgoAAAANSUhE...</em> </td></tr><tr><td>SHOWCASE</td><td>Turn on or off showcase mode</td><td>No</td><td></td><td>true/false</td></tr><tr><td>WORKERS_NUMBER</td><td>Sets number of workers (threads) of application OR set "auto" to allocate all CPU cores</td><td>No</td><td></td><td>1 OR auto</td></tr><tr><td>BI_MONGO_DB_URI</td><td>If you have a separate database cluster for Business Intelligence App</td><td>No</td><td>>= 1.10.0</td><td>mongodb(+srv)://host.docker.internal:27018</td></tr><tr><td>SAML_ENTRY_POINT</td><td>URL for your identity provider login page</td><td>No</td><td></td><td>https://devX.okta.com/app/name/HASH/sso/saml</td></tr><tr><td>SAML_ISSUER</td><td>Issuer string to supply to IdP</td><td>No</td><td></td><td>okta.com/HASH_STRING</td></tr><tr><td>SAML_CERT</td><td>Public certificate of provider. In RAW format as single line without BEGIN CERTIFICATE and END CERTIFICATE</td><td>No</td><td></td><td>MIIC8DCCAdigAwIBAgIQap4GhMRA26tJGFD.....</td></tr><tr><td>SAML_CALLBACK_URL</td><td>Callback URL where provider send response</td><td>No</td><td></td><td>https://api.decisionrules.io/saml/callback</td></tr><tr><td>RF_TIMEOUT</td><td>Time in milliseconds after which the process of solving a <strong>rule flow</strong> is stopped</td><td>No</td><td></td><td>5000</td></tr><tr><td>SR_TIMEOUT</td><td>Time in milliseconds after which the process of solving a <strong>scripting rule</strong> is stopped</td><td>No</td><td></td><td>5000</td></tr><tr><td>WORKFLOW_TIMEMOUT</td><td>Time in milliseconds after which the process of solving a <strong>workflow</strong> is stopped</td><td>No</td><td>>=1.19.0</td><td>10000</td></tr><tr><td>RF_NODE_LIMIT</td><td>Integer of desired rule flow nodes, default value is 30</td><td>No</td><td></td><td>30</td></tr><tr><td>SWAGGER_HOST</td><td>Host of the server application which will use swagger</td><td>No</td><td></td><td>api.decisionrules.io</td></tr><tr><td>WHITELIST</td><td>List of allowed domains from which it is possible to register or log in. You can setup multiple domains separated with comma.</td><td>No</td><td></td><td>mydomain.com, yourdomain.io</td></tr><tr><td>ALLOWLIST</td><td>Cultural-neutral synonym for WHITELIST.</td><td>No</td><td></td><td>mydomain.com, yourdomain.io</td></tr><tr><td>TELEMETRY</td><td>It turn on/off telemetry, which measures endpoint execution duration (for example: Solver API)</td><td>No</td><td>>= 1.8.1</td><td>On = 1, off = 0</td></tr><tr><td>EXAPI_<em>MAX</em>_CNT_LEN</td><td>Defined maximal response content length in bytes</td><td>No</td><td></td><td>3000</td></tr><tr><td>EXAPI_<em>MAX</em>_BODY_LEN</td><td>Defined maximal body size for request in bytes</td><td>No</td><td></td><td>10000</td></tr><tr><td>EXAPI_<em>MAX</em>_REDIRECTS</td><td>Defines maximal redirects that called URL can perform</td><td>No</td><td></td><td>5</td></tr><tr><td>EXAPI_<em>TIMEOUT</em></td><td>Defines API connection timeout in milliseconds</td><td>No</td><td></td><td>2000</td></tr><tr><td>DT_HTTP_CALL_LIMIT</td><td>Defined limit for http function that can be defined in DT or DTR</td><td>No</td><td>>= 1.12.0</td><td>100</td></tr><tr><td>LOGGER_TYPE</td><td>Select log output format/logger type<br><br>STRING is default value if not env variable is set</td><td>No</td><td></td><td>Possible options: <br>STRING<br>JSON</td></tr><tr><td>LOGGER_TIMESTAMP_UTC</td><td>Select log timestamp format<br>If true: YYYY-MM-DDTHH:mm:ss.SSSZ<br>if false: YYYY-MM-DDTHH:mm:ss.SSS(+-)HH:mm</td><td>No</td><td>>= 1.14.2</td><td>true/false</td></tr><tr><td>REDIS_PING_INTERVAL</td><td>Duration (in milliseconds) for which the server pings the Redis server.</td><td>No</td><td>>= 1.14.3</td><td>300000</td></tr><tr><td>FLUSH_REDIS_ON_STARTUP</td><td>Whether cache should be flushed when server is starting. Defaults to true.</td><td>No</td><td>>= 1.17.0</td><td>false</td></tr><tr><td>TIMEZONE</td><td><p>Default time zone for date functions. Default is: </p><pre><code>Europe/Prague
</code></pre></td><td></td><td>>= 1.13.1</td><td>Full list is available here: <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</a></td></tr><tr><td>REDIS_CACERT</td><td>CA certificate for TLS connection with Redis</td><td>No</td><td>>= 1.14.5</td><td>CA certificate as a single line without BEGIN CERTIFICATE and END CERTIFICATE. For example(MIIC8DCCAdigAwIBAgIQap4GhMRA26tJGFD...)</td></tr><tr><td>MONGO_MIN_POOL_SIZE</td><td>MongoDB connection minimal pool size</td><td>No</td><td>>= 1.16.2</td><td>5</td></tr><tr><td>MONGO_MAX_POOL_SIZE</td><td>MongoDB connection maximal pool size</td><td>No</td><td>>= 1.16.2</td><td>100</td></tr><tr><td>EXPORT_FOLDER_MEMORY_LIMIT</td><td>Memory limit on folder export</td><td>No</td><td>>=1.17.1</td><td>50000000</td></tr><tr><td>MEASUREMENTS</td><td>Logs the duration of each phase of the solving to the console</td><td>No</td><td>>= 1.18.4.3</td><td>true/false</td></tr><tr><td>REDIS_MODE</td><td>Specifies the mode in which the application should connect to the redis. Link to Redis Connection Modes documentation.</td><td>No</td><td><p></p><p>>= 1.19.2</p></td><td>NORMAL/CLUSTER</td></tr><tr><td>READER_REDIS_URL</td><td>Redis URL for reader endpoint.</td><td>No</td><td>>= 1.19.2</td><td>redis(s)://host.docker.internal:6379</td></tr><tr><td>REDIS_CACERT_PATH</td><td>Path to file withCA certificate for TLS connection with Redis</td><td>No</td><td>>= 1.19.2</td><td>/certificates/redis.pem</td></tr><tr><td>REDIS_REJECT_UNAUTHORIZED</td><td>Terminate the redis connection if the specified certificate verification fails</td><td>No</td><td>>= 1.19.2</td><td>true/false</td></tr><tr><td>IN_MEMORY_RULE_COUNT</td><td>Number of rules to store directly in memory of the server container. This allows for much faster response times when solving large rules. ( <mark style="color:red;"><strong>Setting this too high could cause the server to run out of memory.</strong></mark> On average a large rule takes up ±25MB of memory i.e.: storing 100 large rules would take up 2.5GB of memory. ) </td><td>No</td><td>>=1.19.5</td><td>25</td></tr><tr><td>TRACE_REQUEST</td><td>If enabled, all http requests will be logged to the console</td><td>No</td><td>>=1.19.5.1</td><td>true/false</td></tr></tbody></table>

### Client environment variables

<table data-full-width="true"><thead><tr><th>Variable name</th><th>Description</th><th>Mandatory</th><th width="116.80000000000001">Version</th><th>Example value</th></tr></thead><tbody><tr><td>API_URL</td><td>URL on which backend API is accessible</td><td>Yes</td><td></td><td>http://localhost:8080</td></tr><tr><td>BI_API_URL</td><td>URL on which Business Intelligence API is accessible</td><td>No, but the features related to Business Intelligence won't work</td><td>>= 1.10.0</td><td>http://localhost:8082</td></tr><tr><td>NGINX_PORT</td><td>Custom port on which the container will run</td><td>No</td><td>>= 1.9.3</td><td>80</td></tr></tbody></table>

### Audit environment variables

<table data-full-width="true"><thead><tr><th width="252">Variable name</th><th>Description</th><th>Mandatory</th><th>Example value</th></tr></thead><tbody><tr><td>BI_MONGO_DB_URI</td><td>Mongo URL of Business Intelligence App</td><td>Yes</td><td>mongodb(+srv)://host.docker.internal:27017</td></tr><tr><td>MONGO_DB_URI</td><td>In case you have a separate database cluster for Server App</td><td>No</td><td>mongodb(+srv)://host.docker.internal:27018</td></tr><tr><td>WORKERS_NUMBER</td><td>Sets number of workers (threads) of application</td><td>No</td><td>1</td></tr><tr><td>DB_TYPE</td><td>If you use CosmosDB or DocumentDB</td><td>No</td><td>MONGODB (default)<br>COSMOSDB<br>DOCUMENTDB</td></tr><tr><td>LOGGER_TYPE</td><td>Select log output format/logger type<br><br>STRING is default value if not evn variable is set</td><td>No</td><td>Possible options: <br>STRING<br>JSON</td></tr><tr><td>LOGGER_TIMESTAMP_UTC</td><td>Select log timestamp format<br>If true: YYYY-MM-DDTHH:mm:ss.SSSZ<br>if false: YYYY-MM-DDTHH:mm:ss.SSS(+-)HH:mm</td><td>No</td><td>true/false</td></tr></tbody></table>

### Kafka env variables

<table data-full-width="true"><thead><tr><th width="197">Variable name</th><th>Description</th><th>Mandatory</th><th>Example value</th></tr></thead><tbody><tr><td>KAFKA_ENABLED</td><td>Turn Kafka on/off</td><td>Yes (Kafka is disabled by default)</td><td>1/0</td></tr><tr><td>KAFKA_<em>CLUSTER_CLIENTID</em></td><td>A logical identifier of an application.</td><td>Yes</td><td>"my-app"</td></tr><tr><td>KAFKA_<em>CLUSTER_BROKERS</em></td><td>Broker definition</td><td>Yes</td><td>"my-broker:9092, my-broker2:9092"</td></tr><tr><td>KAFKA_<em>CLUSTER_SSL</em></td><td>SSL on/off</td><td>Yes</td><td>"true"</td></tr><tr><td>KAFKA_<em>CLUSTER_SASL_MECHANISM</em></td><td>Definition of Kafka SASL mechanism.</td><td>Yes</td><td>"plain"</td></tr><tr><td>KAFKA_<em>CLUSTER_SASL_USERNAME</em></td><td>SASL username</td><td>No</td><td>"my-username"</td></tr><tr><td>KAFKA_<em>CLUSTER_SASL_PASSWORD</em></td><td>SASL password</td><td>No</td><td>"top-secret-password"</td></tr><tr><td>KAFKA_<em>CLUSTER_SASL_AUTHID</em></td><td>SASL authorization identity for aws mechanism</td><td>No</td><td>"IDIDIDIDID"</td></tr><tr><td>KAFKA_<em>CLUSTER_SASL_ACCKEYID</em></td><td>SASL access key for aws mechanism</td><td>No</td><td>"KEYKEYKEY"</td></tr><tr><td>KAFKA_<em>CLUSTER_SASL_SECRETKEY</em></td><td>SASL secret access key for aws mechanism</td><td>No</td><td>"SECRETKEY"</td></tr><tr><td>KAFKA_<em>CLUSTER_SASL_SESSIONTOKEN</em></td><td>SASL session token for aws mechanism</td><td>No</td><td>"SESSIONTOKEN"</td></tr><tr><td>KAFKA_<em>GROUP_TOPIC_1</em></td><td>Definition of Kafka consumer group, request topic and response topic, respectively. To define multiple topic groups, use numbers 1, 2, ..., N. Each record must have different consumer group.</td><td>Yes</td><td>"my-group, my-request-topic, my-response-topic"</td></tr></tbody></table>
