3. Configuration

halon-bounce-classifier loads settings from environment variables.

You can set the environment variables by using the following command.

$ systemctl edit halon-bounce-classifier

You can then add the environment variables you want to configure like below.

[Service]
Environment="PORT=8000"
Environment="HOST=127.0.0.1"

Below are some of the most important environment variables that can be configured.

PORT

The port that the server will run on. The default is 8000.

HOST

The IP address that the server will run on. The default is 127.0.0.1.

Note

Use * to listen on any IP, useful when for example running in a container

SSL_CERTFILE

The path to the certificate. The default is to not use SSL.

SSL_KEYFILE

The path to the private key. The default is to not use SSL.

API_KEY

The API key to use. The default is to not use an API key.

3.1. Cache

HALON_BNAC_CACHE
Type:

bool

True if the cache should be enabled. The default is True.

HALON_BNAC_CACHE_STATS
Type:

bool

True if the cache statistics should be enabled. The default is False since collection statistics has a small performance impact.

HALON_BNAC_CACHE_FOLDER
Type:

str

The folder where the cache is stored. The default is /tmp/halon-bnac-cache-{version}/. One per version of the endpoints if the version changes the output.

HALON_BNAC_CACHE_SIZE
Type:

int

The size of the cache in bytes. The default is of approximately 100MB.