<a id="configuration"></a>

# Configuration

*halon-submission-tracking* loads the non-reloadable configuration from `/etc/halon/submission-tracking.yaml`.
It is described by, and can be validated with, the
[submission-tracking.schema.json](http://lbovet.github.io/docson/index.html#https://docs.halon.io/json-schemas/submission-tracking/2.2-stable/submission-tracking.schema.json)
[JSON schema](https://docs.halon.io/json-schemas/submission-tracking/2.2-stable/) (included in our [Visual Studio Code integration](https://docs.halon.io/manual/vscode.html)).
The default startup configuration file in `/opt/halon/submission-tracking/share` can normally be used as a base:

```console
# cp /opt/halon/submission-tracking/share/submission-tracking.yaml /etc/halon/
```

<a id="listener-directives"></a>

## Listener directives

<a id="confval-listeners"></a>

### listeners[]

One or more listen directives needs to be configured which specify which TCP port and address to listen on. **Required.**

<a id="confval-listeners-.port"></a>

### listeners[].port

Which TCP port to listen on. **Required.**

<a id="confval-listeners-.address"></a>

### listeners[].address

IPv4 or IPv6 address to listen on.
The default is to listen to all IPv4 and IPv6 addresses.

<a id="confval-listeners-.pki"></a>

### listeners[].pki

The X.509 certificate and private key.
The private key and certificate should have either a `path` or `data` property.

```yaml
pki:
  certificate:
    data: |-
      -----BEGIN CERTIFICATE-----
      ...
  privatekey:
    data: |-
      -----BEGIN PRIVATE KEY-----
      ...
```

<a id="confval-listeners-.proxy"></a>

### listeners[].proxy[]

A list of IP addresses and subnets to trust as being a reverse proxy.

<a id="secret-directives"></a>

## Secret directives

<a id="confval-secrets"></a>

### secrets[]

One or more secrets needs to be configured which are used to validate the hash of the tracking payload. **Required.**

<a id="confval-secrets-.id"></a>

### secrets[].id

The ID of the secret that should be used to validate the hash of the tracking payload. This must be an integer between *1* and *254*. **Required.**

<a id="confval-secrets-.key"></a>

### secrets[].key

The key for the secret that should be used to validate the hash of the tracking payload. **Required.**

<a id="host-directives"></a>

## Host directives

<a id="confval-hosts"></a>

### hosts[]

One or more host directives needs to be configured which specify the webhook event receiver node(s). **Required.**

<a id="confval-hosts-.port"></a>

### hosts[].port

Which TCP port to connect to. **Required.**

<a id="confval-hosts-.address"></a>

### hosts[].address

Hostname, IPv4 address or IPv6 address to connect to. **Required.**

<a id="confval-hosts-.path"></a>

### hosts[].path

The URL path. The default is `/`.

<a id="confval-hosts-.tls.enabled"></a>

### hosts[].tls.enabled

If TLS should be used for the requests. The default is *false*.

<a id="confval-hosts-.tls.verify"></a>

### hosts[].tls.verify

If the server certificate should be verified. The default is *true*.

<a id="confval-hosts-.apikey"></a>

### hosts[].apikey

The API key that will be used for the requests (sent in the *X-API-Key* header).

<a id="queue-directives"></a>

## Queue directives

<a id="confval-queues.timeout.connect"></a>

### queues.timeout.connect

The connect timeout (in seconds) against the webhook event receiver node(s). The default is 30.

<a id="confval-queues.timeout.socket"></a>

### queues.timeout.socket

The socket timeout (in seconds) against the webhook event receiver node(s). The default is 900.

<a id="confval-queues.retry.interval"></a>

### queues.retry.interval

The interval (in seconds). The default is 0 (No interval).

<a id="confval-queues.retry.count"></a>

### queues.retry.count

The retry count. The default is 0 (No retries).

<a id="confval-queues.min_items"></a>

### queues.min_items

Minimum items to send in bulk request. The default is 1.

> **Note**
> 
> This value is unique to each worker (child process).

<a id="confval-queues.max_items"></a>

### queues.max_items

Maximum items to send in bulk request. The default is 1.

> **Note**
> 
> This value is unique to each worker (child process).

<a id="confval-queues.max_interval"></a>

### queues.max_interval

Maximum time to wait for [`queues.min_items`](#confval-queues.min_items) (in seconds). The default is to wait indefinitely.

> **Note**
> 
> This value is unique to each worker (child process).

<a id="other-directives"></a>

## Other directives

<a id="confval-workers"></a>

### workers

The amount of child processes that should be started to handle incoming requests. The default is as many as there are CPU cores.

<a id="confval-redis.host"></a>

### redis.host

The hostname or IP of the redis server. The default is *localhost*.

<a id="environment-directives"></a>

## Environment directives

<a id="confval-environment.privdrop.user"></a>

### environment.privdrop.user

<a id="confval-environment.privdrop.group"></a>

### environment.privdrop.group
