# Configuration - schedr reads **one configuration file** and/or **environment variables**. - Environment variables mirror the configuration file's structure, under the prefix **`SCHEDR_CONFIG__`** (e.g. a `key` in section `section` → `SCHEDR_CONFIG__SECTION__KEY`). - File format: **TOML**. - The file is found via the **`--config `** flag, then the **`SCHEDR_CONFIG_FILE`** environment variable (both: the file must exist), then the default location **`/etc/schedr/config.toml`** (read if it exists; otherwise defaults and environment only). - **Unknown keys are an error**, and every error names the key and where its value came from (the file, e.g. `SCHEDR_CONFIG__OPS__PORT`, `SCHEDR_DAG_PATH`, or a flag). In the file a path list is an array; in an environment variable a colon-separated string. Setting an alias and its full variable at once (`SCHEDR_DAG_PATH` and `SCHEDR_CONFIG__DAGS__PATH`) is an error. - **Built-in interpreter:** if `[interpreters]` doesn't define `python`, schedr looks for a `python3`, so a fresh `pip install schedr` works without configuration, even from a venv that isn't activated (1.16). First match wins: 1. **an active virtualenv:** `$VIRTUAL_ENV/bin/python3` (`source .venv/bin/activate`, `pyenv activate`); 2. **a project venv:** `.venv/bin/python3`, then `venv/bin/python3`, in the current directory, then its parents (nearest first), as uv and Poetry find a project's venv; 3. **next to the binary:** `python3` in the directory of the running `schedr` (symlinks to `schedr` resolved): the venv's own Python for a wheel installed into a venv; 4. **`python3` on `PATH`**; when it is a **pyenv shim** (in `$(pyenv root)/shims`), it is resolved **once at startup** with `pyenv which python3`, in the user's environment and directory (`PYENV_VERSION`, `.python-version`), and the real interpreter is used from then on: tasks get a clean environment and run in their root's directory, where the shim could pick another Python, and starting every task through it costs time. A shim pyenv can't resolve is a startup error with pyenv's message. Nothing found leaves plain `python3` to the system. The python path is used **as found, never resolved** (a venv's `python3` is a symlink, and only through the venv path does Python know its venv). Steps 1 and 2 depend on the user's shell and directory, so only the **local commands** use them (`standalone`, `dags check`, `dags test`); a `worker` (M2) will use the configuration, step 3 and step 4, so a stray `.venv` in a pod's directory can't change its Python. The interpreter chosen and how is logged at startup, and named in the error when the runner can't start (with the runner's last output lines and what it needs: Python 3.14+ with this version of `schedr`). Not chosen: a `python` fallback (venvs always have `python3`); reading `pyproject.toml` / `uv.lock` (`.venv` covers uv and Poetry); conda (an active environment is on `PATH`, step 4); resolving the venv's python symlink (breaks venvs). - Precedence: **command-line flags > environment variables > configuration file**. - `SCHEDR_DAG_PATH` is a normal configuration key (`SCHEDR_CONFIG__DAGS__PATH`); `SCHEDR_DAG_PATH` is kept as a **short alias**. - **Secrets** (database password, signing keys, …) come only from **environment variables** (filled from Kubernetes Secrets), never from the configuration file. The database URL is `[database] url` / `SCHEDR_CONFIG__DATABASE__URL`; a URL with a password in the file is a startup error. - **Outgoing HTTP and proxies:** schedr's own outgoing HTTP calls (notification webhooks from the master; Vault from the agent, if outside the cluster) honour `HTTPS_PROXY`, `HTTP_PROXY` and `NO_PROXY`. **Internal links never use a proxy** (gRPC between master and workers, the webserver's calls to the workers' log endpoints), whatever the environment says. Documented for deployments: `NO_PROXY` with the cluster's service domains (`.svc`, `.cluster.local`) and internal services; with Istio's `REGISTRY_ONLY` outbound policy, `ServiceEntry` resources for outside hosts. Tasks get the proxy variables only via `[worker] pass_env`.