# Configuration

> Every setting of the engine, its environment variable and its default.

Applies to: the Sypnia engine (open source, self-hosted).  
Source: https://learn.docs.sypnia.com/self-hosting/configuration/

For agents: Settings (env, prefix SYPNIA_LEARN_): DATABASE_URL (required), ROOT_TOKEN (required), PUBLIC_URL (http://localhost:8097), PORT (8097), STORAGE_URL (required), AUTH_URL (Sypnia Data engine) or OIDC_ISSUER + OIDC_CLIENT_ID (+ OIDC_CLIENT_SECRET), RUNNER (agent=<url> | docker=<url> | off), RUNNER_SECRET, CHECK_TIMEOUT_S (600), CHECKS_PER_PERSON (3), AI_URL (OpenAI-compatible /v1) + AI_KEY + AI_TASK (explain), GIT_URL (Sypnia Git engine; else exercises from the CLI only), PRODUCTS (cases=,data=,telemetry= engine URLs for binding), SAMPLE (on), OFFERS (on), OFFERS_PER_DAY (3), EVENTS_SECRET (webhooks from product engines), OTLP_ENDPOINT/OTLP_HEADERS, AUTO_MIGRATE (false), LOG (info), MCP (true), MAX_UPLOAD_MB (2048 per course video).

Settings are environment variables starting with `SYPNIA_LEARN_`.

### `SYPNIA_LEARN_DATABASE_URL`* **Key:** `database_url`
* **Type:** string
* **Default:** `none (required)`
* \[Engine]Postgres 16 or newer.

### `SYPNIA_LEARN_ROOT_TOKEN`* **Key:** `root_token`
* **Type:** string (secret)
* **Default:** `none (required)`
* \[Engine]The token that can do everything on this engine, such as publishing courses. Keep it in a secret store.

### `SYPNIA_LEARN_PUBLIC_URL`* **Key:** `public_url`
* **Type:** URL
* **Default:** `http://localhost:8097`
* \[Engine]The address learners, the CLI and agents use.

### `SYPNIA_LEARN_PORT`* **Key:** `port`
* **Type:** number
* **Default:** `8097`
* \[Engine]The port the engine listens on.

### `SYPNIA_LEARN_STORAGE_URL`* **Key:** `storage_url`
* **Type:** URL
* **Default:** `none (required)`
* \[Engine]S3-compatible storage for course files and videos.

### `SYPNIA_LEARN_AUTH_URL`* **Key:** `auth_url`
* **Type:** URL
* **Default:** `empty`
* \[Engine]A Sypnia Data engine to sign people in. Use this or the OpenID Connect settings.

### `SYPNIA_LEARN_OIDC_ISSUER`* **Key:** `oidc_issuer`
* **Type:** URL
* **Default:** `empty`
* \[Engine]Any OpenID Connect provider, with `SYPNIA_LEARN_OIDC_CLIENT_ID` and, when the provider needs it, `SYPNIA_LEARN_OIDC_CLIENT_SECRET`.

### `SYPNIA_LEARN_RUNNER`* **Key:** `runner`
* **Type:** string
* **Default:** `off`
* \[Engine]Where checks run: `agent=<url>` (a Sypnia Agent sandbox), `docker=<url>` (the Docker runner) or `off` (no exercises checked on the engine). Results are signed with `SYPNIA_LEARN_RUNNER_SECRET`.

### `SYPNIA_LEARN_CHECK_TIMEOUT_S`* **Key:** `check_timeout_s`
* **Type:** number
* **Default:** `600`
* \[Engine]The longest a check run may take.

### `SYPNIA_LEARN_CHECKS_PER_PERSON`* **Key:** `checks_per_person`
* **Type:** number
* **Default:** `3`
* \[Engine]Check runs one person can have at the same time.

### `SYPNIA_LEARN_AI_URL`* **Key:** `ai_url`
* **Type:** URL
* **Default:** `empty`
* \[Engine]An OpenAI-compatible endpoint for explanations and hints, such as a Sypnia AI gateway's `/v1`, with `SYPNIA_LEARN_AI_KEY`. The task or model name sent is `SYPNIA_LEARN_AI_TASK` (default `task:explain`). Empty: explanations and hints are off.

### `SYPNIA_LEARN_GIT_URL`* **Key:** `git_url`
* **Type:** URL
* **Default:** `empty`
* \[Engine]A Sypnia Git engine, to create exercise branches for learners. Empty: exercises start from the CLI, on a local folder.

### `SYPNIA_LEARN_PRODUCTS`* **Key:** `products`
* **Type:** string
* **Default:** `empty`
* \[Engine]The engines lessons read from, as `name=url` separated by commas: `cases`, `data`, `telemetry`.

### `SYPNIA_LEARN_SAMPLE`* **Key:** `sample`
* **Type:** boolean
* **Default:** `true`
* \[Engine]Use the sample bakery when a learner's project has no match. Off: such a lesson answers `422 no_match`.

### `SYPNIA_LEARN_OFFERS`* **Key:** `offers`
* **Type:** boolean
* **Default:** `true`
* \[Engine]Offer lessons in the moment. Events come from the product engines as webhooks signed with `SYPNIA_LEARN_EVENTS_SECRET`; at most `SYPNIA_LEARN_OFFERS_PER_DAY` (default 3) per person a day.

### `SYPNIA_LEARN_OTLP_ENDPOINT`* **Key:** `otlp_endpoint`
* **Type:** URL
* **Default:** `empty`
* \[Engine]Where the engine's spans go: Sypnia Telemetry or any OpenTelemetry endpoint, with headers in `SYPNIA_LEARN_OTLP_HEADERS`.

### `SYPNIA_LEARN_MAX_UPLOAD_MB`* **Key:** `max_upload_mb`
* **Type:** number
* **Default:** `2048`
* \[Engine]The largest video file a course can carry.

### `SYPNIA_LEARN_AUTO_MIGRATE`* **Key:** `auto_migrate`
* **Type:** boolean
* **Default:** `false`
* \[Engine]Run database migrations on start.

### `SYPNIA_LEARN_MCP`* **Key:** `mcp`
* **Type:** boolean
* **Default:** `true`
* \[Engine]Serve the MCP server at `/mcp`.

### `SYPNIA_LEARN_LOG`* **Key:** `log`
* **Type:** string
* **Default:** `info`
* \[Engine]`error`, `warn`, `info` or `debug`.
