Environment Variables¶
All runtime configuration is injected via environment variables. The backend reads
them at startup from the backend.env file (loaded by Docker Compose via
env_file), plus a handful set directly in docker-compose.yaml (ENV, paths,
REPO_FORMAT, DATABASE_URL). The frontend reads a small subset baked in at
build time.
A value set in docker-compose.yaml wins over backend.env
Compose gives the environment: block of the backend service priority over
env_file. In the bundled file that block fixes ENV=production,
DATABASE_URL (built from POSTGRES_PASSWORD), REPO_FORMAT and the storage
paths: setting them in backend.env has no effect. To change one, edit
docker-compose.yaml.
Docker Compose variable escaping
In any file loaded with env_file:, literal $ characters must be escaped as $$.
This affects bcrypt hashes ($$2b$$12$$...) and any value containing a dollar sign.
Backend variables¶
Database¶
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
DATABASE_URL |
string |
— | Yes | PostgreSQL connection string: postgresql://repod:<password>@db:5432/repod. db/engine.py raises RuntimeError at startup if unset. With the bundled Compose file it is built from POSTGRES_PASSWORD (.env) and a value in backend.env is ignored; production startup is refused while the password is the development default. All relational data (users, manifest index, inventory, install jobs, package search, ssh_known_hosts) lives here, managed via SQLAlchemy Core + Alembic. |
Repository format¶
| Variable | Type | Default | Description |
|---|---|---|---|
REPO_FORMAT |
string |
apt (the bundled Compose file sets all) |
Read once at startup by format_router.py. Set it in docker-compose.yaml, not in backend.env. One of apt, rpm, apk, both (apt+rpm), or all (apt+rpm+apk). Any other value is rejected (warning logged, falls back to apt). |
Authentication & security¶
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
JWT_SECRET_KEY |
string |
— | Yes | HMAC-SHA256 signing key for JWT tokens. Generate with openssl rand -hex 32. The application refuses to start in production if it is empty or equal to change-me-in-production. |
JWT_EXPIRE_MINUTES |
integer |
60 |
No | Token lifetime in minutes. Tokens expire and must be re-issued after this period. API tokens have their own expiry set at creation time. |
SETTINGS_ENCRYPTION_KEY |
string |
falls back to JWT_SECRET_KEY |
No (recommended) | Dedicated key used to encrypt secrets stored in settings.json (SMTP/LDAP password, OIDC client_secret). Generate with openssl rand -hex 32. Keeping it separate from JWT_SECRET_KEY means rotating the JWT key doesn't break decryption of these stored secrets. |
ADMIN_USERNAME |
string |
admin |
No | Username of an admin account to pre-provision at startup. Only takes effect together with a valid ADMIN_PASSWORD_HASH. If unset, no admin is seeded and the first-run setup wizard (/api/v1/setup) is used instead. |
ADMIN_PASSWORD_HASH |
string |
— | No | bcrypt hash of the admin password (must start with $2a$, $2b$, or $2y$). Generate with python3 -c "import bcrypt; print(bcrypt.hashpw(b'password', bcrypt.gensalt(12)).decode())". Escape every $ as $$ in the env file. If empty or not a valid bcrypt hash, no admin row is seeded — the setup wizard remains available (safe default). |
SETUP_TOKEN |
string |
generated at each start in production | No | POST /api/v1/setup requires a matching X-Setup-Token header (compared with hmac.compare_digest), closing the race window between container startup and first-admin creation. When it is unset and ENV=production, the backend generates one and writes it once in its log (docker compose logs backend \| grep SETUP_TOKEN); the setup wizard then asks for it. Set it to keep a stable value. GET /api/v1/setup/status is unaffected and reports setup_token_required. |
WEBHOOK_SECRET |
string |
— | Yes (production) | HMAC secret used to verify signatures on /webhooks/github and /webhooks/kev. Generate with openssl rand -hex 32. The application refuses to start in production if it is empty or equal to changeme-for-production. Docker Compose also reads WEBHOOK_SECRET from .env: keep both identical. |
REPOD_LICENSE_PUBLIC_KEY / REPOD_LICENSE_PUBLIC_KEY_PATH |
string / path |
built-in key | No | Public key (PEM, inline or file) used to verify Enterprise license keys (repod_lic2_..., RS256). It is a public key, not a secret. Override it only if your vendor gave you a different one. |
REPOD_LICENSE_VENDOR_KEY |
string |
— | No | Only used to verify old license keys in the legacy HMAC format (repod_lic_...). A new installation does not need it. A warning is logged if it is left at the value published in the source code. |
METRICS_TOKEN |
string |
— | No (recommended) | Bearer token Prometheus must send to scrape GET /metrics. When empty, the endpoint instead accepts an auditor's login token. See Health & monitoring. |
AUTH_RATELIMIT_PER_MINUTE |
integer |
10 |
No | Requests per minute allowed on authentication endpoints (login, password reset, OCI token, sign-up). Fallback value: the limit set in Paramètres → Sécurité → Limites de débit takes priority. |
LOGIN_MAX_ATTEMPTS |
integer |
5 |
No | Failed logins before an account is locked. |
LOGIN_LOCKOUT_MINUTES |
integer |
15 |
No | Duration of that lock. |
SECURITY_HEADERS_DISABLED |
boolean |
false |
No | 1/true/yes turns off the security headers middleware. Leave it alone unless a proxy already adds them. |
WEBHOOK_SIGNATURE_SKIP |
boolean |
false |
No | true turns off signature checking on /webhooks/*. For CI and local tests only, never in production. |
TRUSTED_PROXIES |
string |
127.0.0.1 |
No | Comma-separated IP addresses allowed to set X-Forwarded-For. Read by the container entrypoint and passed to uvicorn as --forwarded-allow-ips. Behind a reverse proxy, list the proxy's address so rate limiting and the audit log see the real client address. |
CORS_ORIGINS |
string |
http://localhost:3003 |
No | Comma-separated list of allowed CORS origins. Include your frontend URL in production (e.g. https://repod.example.com). |
Storage paths¶
These variables control where Repod stores its data. The defaults match the Docker Compose volume mounts and should not be changed unless you know what you are doing.
| Variable | Type | Default | Description |
|---|---|---|---|
POOL_DIR |
path |
/repos/pool |
Canonical package store — all validated .deb/.rpm binaries land here on upload. Served read-only by the repository Nginx containers. |
MANIFEST_DIR |
path |
/repos/manifests |
Directory for per-package JSON manifests and the central index.json catalog. |
STAGING_INCOMING |
path |
/repos/staging/incoming |
Temporary landing zone for uploaded files before validation. Never served over HTTP. |
STAGING_QUARANTINE |
path |
/repos/staging/quarantine |
Destination for files that failed validation or were blocked by CVE policy. |
AUDIT_DIR |
path |
/repos/audit |
Append-only JSONL audit log files, one per day (YYYY-MM-DD.jsonl). |
INDEX_PATH |
path |
/repos/manifests/index.json |
Path to the central package index JSON file (atomic writes via tempfile + os.replace()). |
INDEX_DIR |
path |
/repos/package-index |
Working directory for sync/import indexing. The package-index full-text search data itself lives in PostgreSQL. |
IMPORTS_DIR |
path |
/repos/imports |
Working directory for packages imported from external sources (sync/mirror). |
SETTINGS_PATH |
path |
/repos/settings/settings.json (set by the bundled Compose file) |
Persistent settings file (LDAP config, webhook, CVE policy, retention, mirror, backup, etc.). |
SECURITY_DIR |
path |
/repos/security |
Directory for CVE decisions, CISA KEV cache, and EPSS cache. |
GNUPG_HOME |
path |
/repos/gnupg |
GPG keyring directory shared between the backend and the repository containers (depot-apt, depot-rpm). |
NGINX_LOGS_DIR |
path |
/repos/logs |
Directory where the repository Nginx containers write access.log. Parsed by the download statistics endpoint. |
CLAMAV_DB_DIR |
path |
/var/lib/clamav |
ClamAV signature database directory. Signatures are populated and kept up to date by freshclam. |
GRYPE_DB_CACHE_DIR |
path |
/repos/grype-db |
Grype vulnerability database cache. Refreshed by the nightly security synchronisation (03:00 by default) and at startup when the database on disk is no longer valid. |
SSH_KEY_PATH |
path |
/home/appuser/.ssh/id_ed25519 |
Ed25519 private key used by ssh_scanner.py for SSH-based inventory scanning (Enterprise). |
SBOM_DIR |
path |
/repos/sboms |
Stored CycloneDX SBOMs captured at scan time (services/component_sbom.py), used for CVE re-matching without reopening the original package file. |
MANIFEST_CACHE_TTL |
integer |
30 |
In-memory manifest cache TTL, in seconds (services/manifest.py). |
BACKUP_DIR |
path |
/repos/backups |
Where scheduled and manual backup archives are written. |
EMAIL_TEMPLATES_DIR |
path |
/repos/templates/email |
Notification email templates edited in the web interface. |
Concurrency and timeouts¶
| Variable | Type | Default | Description |
|---|---|---|---|
MAX_CONCURRENT_SCANS |
integer |
3 |
Inventory scans running at the same time. |
MAX_CONCURRENT_INSTALLS |
integer |
3 |
Remote install jobs running at the same time. |
MAX_MACHINES_PER_INSTALL |
integer |
10 |
SSH connections opened at the same time for one install job. |
INSTALL_MAX_FAIL_PERCENT |
integer |
50 |
When that percentage of machines fails, the rest of the job is cancelled. 100 never stops early. |
GRYPE_TIMEOUT |
integer |
600 |
Seconds allowed for one Grype scan of a machine's packages. |
OCI registry (Zot)¶
Used when the docker-compose.oci.yml overlay is deployed.
| Variable | Type | Default | Description |
|---|---|---|---|
ZOT_URL |
string |
http://depot-oci:5000 |
Internal URL of the Zot OCI registry container. Backend admin/read calls only — docker push/pull never transit through the backend. |
OCI_SIGNING_KEY_PATH |
path |
/repos/oci/keys/private.pem |
RSA private key used to sign OCI Bearer tokens (RS256). Generate with scripts/gen-oci-signing-keys.sh. |
OCI_TOKEN_ISSUER |
string |
repod-oci-registry |
iss claim on issued OCI tokens. Must match Zot's configured service value. |
OCI_TOKEN_TTL_SECONDS |
integer |
300 |
Lifetime, in seconds, of an issued OCI Bearer token. |
TRIVY_SERVER_URL |
string |
http://depot-trivy:4954 |
URL of the Trivy server sidecar used by the dual-scan cross-verification feature (services/dual_scan.py). SaaS only — only set by docker-compose.saas.yml, absent in EE on-premise/CE. |
Upstream cache (pull-through proxy)¶
Used when the depot-cache service is deployed.
| Variable | Type | Default | Description |
|---|---|---|---|
UPSTREAM_CACHE_DATA_DIR |
path |
/repos/upstream-cache/data |
Cached upstream package/index files. Backend-writable, so a purge can delete cached data. Mounted at the same absolute path into depot-cache. |
UPSTREAM_CACHE_CONF_DIR |
path |
/repos/upstream-cache/conf |
Generated per-target Nginx config fragments, watched by scripts/cache-reload-watcher.sh inside depot-cache to trigger a reload. |
License server integration & HA (Redis)¶
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
LICENSE_SERVER_INTERNAL_TOKEN |
string |
— | Yes (DEPLOYMENT_MODE=saas) |
Shared secret checked on GET /internal/tenants, called by the standalone license-server/ vendor tool for its read-only SaaS status panel. Must match the same variable in license-server/.env. |
REDIS_URL |
string |
— | No | redis://host:6379/0. Backs services/cache.py's response cache. Unset means an in-memory cache (the default everywhere today — the redis:7-alpine Compose service is opt-in via the ha-active-active profile). Fail-soft: a connection error at startup falls back to in-memory. |
JOB_STATE_BACKEND |
string |
local |
No | local or redis. Selects the state backend for scan_manager/install_manager/mirror_manager/sync_manager (services/job_state_backend.py), sse_bus's pub/sub backend (services/sse_redis_bus.py), and logging_config's pub/sub + bounded-history backend (services/logs_redis_bus.py). redis requires JOB_STATE_REDIS_URL/REDIS_URL to be reachable at startup, or each component independently falls back to local (logged at ERROR; visible per-flow at GET /health → checks.info.ha.job_state_backend). |
JOB_STATE_REDIS_URL |
string |
falls back to REDIS_URL |
No | Optional override of REDIS_URL specifically for JOB_STATE_BACKEND=redis, for operators who want job-coordination traffic on a separate Redis instance/DB from the response cache. |
APT-mode paths¶
Used when REPO_FORMAT is apt, both, or all.
| Variable | Type | Default | Description |
|---|---|---|---|
REPREPRO_BASE |
path |
/repos |
Base directory passed to reprepro -b. Reprepro expects conf/, db/, dists/, and pool/ under this path. Also used by services/reprepro.py:add_package() to invoke reprepro includedeb directly (no shell wrapper). |
DISTS_DIR |
path |
/repos/dists |
APT distribution tree managed by reprepro. Served by depot-apt. |
CONF_DIR |
path |
/repos/conf |
Reprepro configuration directory. Contains the distributions file generated at initialization. |
RPM-mode paths¶
Used when REPO_FORMAT is rpm, both, or all.
| Variable | Type | Default | Description |
|---|---|---|---|
REPO_BASE |
path |
/repos/rpm |
Base directory for RPM distribution trees. Each distribution/arch gets a <codename>/<arch>/ subdirectory under this path, served by depot-rpm. |
APK-mode paths¶
Used when REPO_FORMAT is apk or all.
| Variable | Type | Default | Description |
|---|---|---|---|
APK_REPO_BASE |
path |
/repos/apk |
Base directory for Alpine repositories. Each distribution gets a <codename>/main/<arch>/APKINDEX.tar.gz tree, served by depot-apt under /apk/. |
External integrations¶
LDAP, SMTP, the notification webhook URL and the other integrations are not
environment variables. Configure them in the web interface (Administration →
Paramètres); they are stored, encrypted where relevant, in settings.json. See
Configuration reference.
Network / outbound proxy¶
| Variable | Type | Default | Description |
|---|---|---|---|
HTTP_PROXY / HTTPS_PROXY |
string |
— | Standard proxy environment variables, honored automatically by the Python HTTP client, Grype, and the Docker CLI/skopeo (used for OCI import) — set in backend.env if the server has no direct internet access. |
NO_PROXY |
string |
— | Comma-separated list of hosts to reach directly, bypassing the proxy (typically internal LDAP/SMTP servers, your license-server if self-hosted). |
ClamAV and the proxy
freshclam (ClamAV signature updates, version 1.4 in the image) follows the same
variables. See Proxy configuration for the
full list of external dependencies and a worked example with Squid.
Runtime behavior¶
| Variable | Type | Default | Description |
|---|---|---|---|
ENV |
string |
development (the bundled Compose file sets production) |
production enables strict mode: startup is refused with an empty or default JWT_SECRET_KEY, WEBHOOK_SECRET or database password, a SETUP_TOKEN is generated if missing, and the Swagger UI and /openapi.json are disabled. |
APP_VERSION |
string |
dev |
Version string returned by /health. Set at image build time (VERSION build argument). An APP_VERSION line in backend.env or .env overrides it, so remove a stale one. |
DEPLOYMENT_MODE |
string |
standalone |
standalone for an on-premise installation. saas is for the hosted multi-tenant service and is not documented here. |
PRIVACY_CONTACT_EMAIL |
string |
[email protected] |
Contact address returned by the privacy information endpoint. Set your own. |
OSV_API_BASE |
string |
https://api.osv.dev/v1 |
OSV.dev endpoint for the npm/Maven/PyPI dependency scan. Change it only for a mirror. |
SQL_ECHO |
boolean |
false |
1/true logs every SQL statement. Debugging only. |
Frontend variables (build-time)¶
Build-time only
React environment variables prefixed with REACT_APP_ are embedded in the
JavaScript bundle at docker build time. Changing them after the image is
built has no effect. Pass them as Docker Compose build.args.
| Variable | Default | Description |
|---|---|---|
REACT_APP_API_URL |
(empty) | Base URL of the backend API. Must stay empty in normal deployments — the frontend then uses relative URLs (/api/v1/...) and relies on its Nginx reverse proxy. Setting it bakes an absolute URL into the bundle and breaks cross-host access. |
REACT_APP_REPO_URL |
(empty) | Base URL of the APT/APK repository server, shown in client setup instructions. When empty the interface derives it from the address in the browser. Set it only if you moved APT_PORT away from 80. |
REACT_APP_RPM_REPO_URL |
(empty) | Same for the RPM repository server. Set it only if you moved RPM_REPO_PORT away from 8080. |
Docker Compose variables (.env file)¶
These variables are interpolated by Docker Compose itself before launching
containers. Place them in a .env file next to docker-compose.yaml
(cp .env.example .env).
| Variable | Default | Description |
|---|---|---|
BIND_HOST |
0.0.0.0 |
Host interface to bind all published ports to. Set to 127.0.0.1 in production when a reverse proxy handles external traffic. |
BACKEND_PORT |
8000 |
Host port mapped to the backend-api container. |
FRONTEND_PORT |
3003 |
Host port mapped to the frontend-ui container. |
APT_PORT |
80 |
Host port mapped to depot-apt (serves .deb + .apk). |
RPM_REPO_PORT |
8080 |
Host port mapped to depot-rpm (serves .rpm). |
POSTGRES_PASSWORD |
repod_dev_password |
Password for the repod PostgreSQL user. Compose builds the backend's DATABASE_URL from it, so the two cannot diverge. Change it in production: the backend refuses to start otherwise. |
WEBHOOK_SECRET |
— | Must be identical to WEBHOOK_SECRET in backend.env. |
PUBLIC_URL |
http://<host>:3003 |
Public address of the web interface. |
UPSTREAM_CACHE_PORT |
8090 |
Host port mapped to depot-cache (the upstream cache). |
REPOD_VERSION |
latest |
Image tag used by the pre-built images Compose file (docker-compose.ghcr.yml). |
APT_TLS_PORT |
8085 |
Used by docker-compose.tls.yml; depot-apt falls back to this port when nginx-proxy takes port 80 for HTTPS redirection. |
REACT_APP_API_URL |
(empty) | Passed as a build argument to the frontend image — keep empty. |
REACT_APP_REPO_URL |
(empty) | Passed as a build argument to the frontend image — keep empty (see above). |
REACT_APP_RPM_REPO_URL |
(empty) | Passed as a build argument to the frontend image — keep empty (see above). |
Example: production backend.env¶
# DATABASE_URL, REPO_FORMAT, ENV and the storage paths are fixed by
# docker-compose.yaml: do not set them here.
# ── Security ─────────────────────────────────────────────────────────────────
JWT_SECRET_KEY=<output of openssl rand -hex 32>
JWT_EXPIRE_MINUTES=60
SETTINGS_ENCRYPTION_KEY=<output of openssl rand -hex 32>
WEBHOOK_SECRET=<output of openssl rand -hex 32>
METRICS_TOKEN=<output of openssl rand -hex 32>
# Optional: pre-provision the first admin (otherwise use the setup wizard,
# POST /api/v1/setup, on first access — recommended)
#ADMIN_USERNAME=admin
#ADMIN_PASSWORD_HASH=$$2b$$12$$exampleHashHere...
# Optional: keep a stable setup token (otherwise one is generated at each start
# and written in the backend log)
#SETUP_TOKEN=<output of openssl rand -hex 32>
# ── Reverse proxy ────────────────────────────────────────────────────────────
TRUSTED_PROXIES=<address of your reverse proxy>
CORS_ORIGINS=https://repod.example.com
LDAP, SMTP, webhook URL, mirror sources, retention, and CVE policy are configured
through Settings in the web UI and stored (encrypted where relevant) in
settings.json — see Configuration reference.