> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables

> Deploy-time environment variables for Lerian SILOC — runtime, SILOC settlement-queue connectivity, persistence, authentication, and certificates.

Lerian SILOC is Lerian's native messaging integration for SILOC, the card-domain deferred-net settlement system operated by Núclea. The variables below are set at deploy time and require a service restart to take effect. For the knobs that behave the same across every Lerian Go service — deployment posture, telemetry, and datastore conventions — see [BYOC configuration essentials](/en/reference/byoc-configuration).

<Note>
  Lerian SILOC is an early-stage service. The variables documented here are the current verified configuration surface; expect it to grow as the rail matures (for example, a systemplane runtime-configuration plane is planned but not yet exposed). Treat the service's own environment reference as the source of truth for a given release.
</Note>

In the tables below, **Required** marks a variable that must be set (globally, or under the condition named). `—` means no default.

## Runtime and server

| Variable          | Description                                                                                                                                                                                             | Default         | Required |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | -------- |
| `SERVICE_NAME`    | Service identifier used in logs and telemetry.                                                                                                                                                          | Service default | No       |
| `ENV_NAME`        | Runtime environment label. `production` arms the stricter authentication and TLS gates below.                                                                                                           | `development`   | No       |
| `DEPLOYMENT_MODE` | TLS-enforcement posture (`local`, `byoc`, `saas`). `saas` makes TLS mandatory and refuses to start without it. See [Deployment mode and TLS](/en/reference/byoc-configuration#deployment-mode-and-tls). | —               | No       |
| `LOG_LEVEL`       | Log verbosity (`debug`, `info`, `warn`, `error`).                                                                                                                                                       | `info`          | No       |
| `SERVER_PORT`     | HTTP listen port. The liveness and readiness probes bind this same port.                                                                                                                                | `9820`          | No       |

## Authentication

Lerian SILOC authorizes protected routes through Access Manager, and is default-closed: authentication is on unless explicitly disabled.

| Variable       | Description                                                                                       | Default | Required      |
| -------------- | ------------------------------------------------------------------------------------------------- | ------- | ------------- |
| `AUTH_ENABLED` | Require Access Manager authentication on protected routes. Must be `true` in production and SaaS. | `true`  | In production |
| `AUTH_ADDRESS` | Access Manager service address. Must be a valid `https://` URL in production and SaaS.            | —       | In production |

## PostgreSQL

The replica falls back to the primary host when `DB_REPLICA_HOST` is unset (single-node default).

| Variable          | Description                                                         | Default   | Required   |
| ----------------- | ------------------------------------------------------------------- | --------- | ---------- |
| `DB_HOST`         | PostgreSQL host.                                                    | —         | Yes (live) |
| `DB_PORT`         | PostgreSQL port.                                                    | `5432`    | No         |
| `DB_USER`         | Database user.                                                      | —         | Yes (live) |
| `DB_PASSWORD`     | Database password. Sensitive — inject at deploy time; never commit. | —         | Yes (live) |
| `DB_NAME`         | Database name.                                                      | —         | Yes (live) |
| `DB_SSLMODE`      | libpq TLS mode. Use `require` or stronger in production.            | `disable` | No         |
| `DB_REPLICA_HOST` | Optional read-replica host. Falls back to `DB_HOST` when unset.     | —         | No         |

## Redis

| Variable         | Description                 | Default | Required |
| ---------------- | --------------------------- | ------- | -------- |
| `REDIS_ADDRESS`  | Redis/Valkey host and port. | —       | No       |
| `REDIS_PASSWORD` | Redis password. Sensitive.  | —       | No       |
| `REDIS_DB`       | Redis database number.      | `0`     | No       |
| `REDIS_TLS`      | Enable TLS to Redis.        | `false` | No       |

## SILOC settlement connectivity

Lerian SILOC maintains a single IBM MQ connection to the Núclea SILOC settlement queue manager. When any of these variables is set, the whole connection descriptor is validated fail-closed at startup.

| Variable                | Description                                                                                                                                                       | Default | Required         |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------------- |
| `MQ_HOST`               | Queue-manager host.                                                                                                                                               | —       | Yes (live SILOC) |
| `MQ_PORT`               | Queue-manager listener port.                                                                                                                                      | —       | Yes (live SILOC) |
| `MQ_QUEUE_MANAGER`      | Queue-manager name. Must be the Núclea SILOC settlement queue manager.                                                                                            | —       | Yes (live SILOC) |
| `MQ_CHANNEL`            | Server-connection channel. Must match the Núclea SILOC channel pattern `C02992335.<ISPB>.1`, where `<ISPB>` is the participant's 8-digit ISPB.                    | —       | Yes (live SILOC) |
| `MQ_SEND_QUEUE`         | Outbound send queue.                                                                                                                                              | —       | Yes (live SILOC) |
| `MQ_RECEIVE_QUEUE`      | Inbound receive queue.                                                                                                                                            | —       | Yes (live SILOC) |
| `MQ_TLS_ENABLED`        | Enable mutual TLS on the MQ channel. Must be `true` in production.                                                                                                | `false` | In production    |
| `MQ_SSL_KEY_REPOSITORY` | Path to the GSKit key repository (`MQSSLKEYR`) backing MQ TLS. The private key lives here, never in an environment variable. Required when `MQ_TLS_ENABLED=true`. | —       | If TLS enabled   |

## Certificates

| Variable                  | Description                                                                                             | Default | Required |
| ------------------------- | ------------------------------------------------------------------------------------------------------- | ------- | -------- |
| `CERT_READINESS_MIN_DAYS` | Minimum days-to-expiry before the certificate readiness check reports degraded. Must be greater than 0. | `30`    | No       |

## Observability

| Variable                      | Description                           | Default | Required             |
| ----------------------------- | ------------------------------------- | ------- | -------------------- |
| `ENABLE_TELEMETRY`            | Enable OpenTelemetry instrumentation. | `false` | No                   |
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP collector endpoint.              | —       | If telemetry enabled |

## Health and readiness

Lerian SILOC exposes `GET /health` (liveness), `GET /readyz` (readiness), and `GET /version` on the main HTTP port. The service boots and serves these probes even before its datastores and settlement connection are reachable; dependency health is reported through `/readyz`. See [Health and readiness](/en/reference/health-and-readiness) for the probe contract.
