---
title: Environment variables
description: The API service's settings that can be set in its environment, and what they lock.
---

Most settings are also on the **Settings** page. A value set in the API service's environment wins and locks its field there. The other variables can only be set in the environment.

The Podman installer writes the API's environment to `~/.config/glodrik/api.env` on every run, so changes there are lost. On a Podman installation, use the **Settings** page.

## Also on the Settings page

| Variable | Setting |
| --- | --- |
| `GLODRIK_URL` | Public address, for example `https://glodrik.example.com:8443`. Notification links and the single sign-on callback (`<address>/api/oidc/callback`) use it. |
| `GLODRIK_DATE_FORMAT` | Date format: `iso` (default), `eu`, `uk` or `us`. |
| `GLODRIK_OIDC_ISSUER` | The OpenID Connect provider's issuer. Single sign-on is on when it's set. HTTPS only. |
| `GLODRIK_OIDC_CLIENT_ID`, `GLODRIK_OIDC_CLIENT_SECRET` | The confidential client at the provider. |
| `GLODRIK_OIDC_NAME` | The sign-in button's name, default "Single sign-on". |
| `GLODRIK_OIDC_SCOPES` | Default `openid profile email`. |
| `GLODRIK_OIDC_USERNAME_CLAIM` | The claim that names a new user, default `preferred_username`. |
| `GLODRIK_OIDC_GROUPS_CLAIM` | The claim with the user's groups, default `groups`. A dotted name reads a nested claim, such as `realm_access.roles`. |
| `GLODRIK_OIDC_ADMIN_GROUPS` | Provider groups whose members are system administrators, comma-separated, set at each sign-in. Without it, administrators are set in Glodrik. |
| `GLODRIK_OIDC_LINK_BY_NAME` | `true`: a first sign-in may take over a local user of the same name, never a system administrator, and removes its password. Default off: such a sign-in is refused. |
| `GLODRIK_OIDC_CA_FILE` | The provider's CA certificates (PEM), in addition to the system's. |
| `GLODRIK_CERT_VALIDITY_HOURS` | How long a job's gateway certificate is valid, default 8. Open connections outlive it; only reconnects after that fail. |
| `GLODRIK_WORKER_OFFLINE_SECONDS` | A worker without a heartbeat for this long is offline and gets no new jobs, default 60. |
| `GLODRIK_NO_WORKER_TIMEOUT_SECONDS` | A job that no worker could take for this long ends with an error, default 3600. 0 waits forever. |
| `GLODRIK_TEST_RUN_MAX_MB` | The largest compressed upload of a CLI test run, default 50. |
| `GLODRIK_MASK_PATTERNS` | Python regular expressions, one per line, that workers mask in job output in addition to the built-in detectors. With a group, only the group's text is masked. At most 50. |
| `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_HEADERS` | An OpenTelemetry collector (OTLP over HTTP) for traces, metrics and logs. Nothing is sent without an endpoint. The other standard `OTEL_*` variables apply as well. |
| `GLODRIK_EVENT_RETENTION_DAYS` | Days after a job finished until its output is deleted, default 90. Summaries stay. 0 keeps everything. |
| `GLODRIK_COMMIT_RETENTION_DAYS` | Days workers keep the commits of finished jobs, default 90. 0 keeps everything. |
| `GLODRIK_METRICS_RETENTION_15S_DAYS`, `GLODRIK_METRICS_RETENTION_1M_DAYS`, `GLODRIK_METRICS_RETENTION_1H_DAYS` | Days the performance figures are kept per 15 seconds (default 3), per minute (7) and per hour (90). |

## Environment only

| Variable | Setting |
| --- | --- |
| `GLODRIK_DATABASE_URL` | The PostgreSQL database, `postgresql+psycopg://…`. |
| `GLODRIK_VALKEY_URL` | Valkey, `redis://:<password>@host:port/0`. |
| `GLODRIK_SECRET_KEY` | 32 bytes, base64. Encrypts stored credentials. Without it, they can't be read: keep it with your backups. |
| `GLODRIK_WORKER_TOKEN` | The token workers use, at least 32 characters. |
| `GLODRIK_CA_KEY` | The SSH user CA's private key, which signs gateway certificates. |
| `GLODRIK_MANAGEMENT_EE` | The image of Glodrik's management execution environment. Every organization gets it as a built-in execution environment. |
| `GLODRIK_API_NAME` | The API's name in **Topology**, default the host name. |
| `GLODRIK_METRICS_DATABASE_URL` | A separate database for the performance figures. Default: the `metrics` schema in Glodrik's database. |
