Environment Variables
Configuration

Environment Variables

Full reference for all Drevnix environment variables: encryption, database, cache, audit, and network.

Using an AI assistant? Give it this file.

/llms.md is a single Markdown file covering installation, configuration, quickstart, clients, upstreams, permissions, TLS, and production deployment. Copy it and paste it into your AI chat, or tell the AI to fetch https://drevnix.tech/llms.md.

Environment Variables

All Drevnix configuration is done through environment variables. There are no configuration files.

Required

VariableDescription
ENCRYPTION_KEYSecret key used to encrypt upstream registry credentials at rest (AES256-GCM). Generate with openssl rand -hex 32. Must be set before the first start and must not change after credentials have been stored.

Initial Bootstrap

These are optional and only used on first startup. Once an admin account exists they are ignored.

VariableDefaultDescription
DREVNIX_INITIAL_ADMIN_USERNAME(unset)If set, Drevnix creates an admin account with this username on first startup if no accounts exist yet. Equivalent to running drevnix init-admin interactively.
DREVNIX_INITIAL_ADMIN_PASSWORD(unset)Password for the account created by DREVNIX_INITIAL_ADMIN_USERNAME. Required when DREVNIX_INITIAL_ADMIN_USERNAME is set.

Database

VariableDefaultDescription
JDBC_URLjdbc:sqlite:/data/drevnix.db?journal_mode=WAL&synchronous=NORMAL&busy_timeout=30000&foreign_keys=onJDBC connection URL. Credentials are embedded in the URL, e.g. jdbc:postgresql://user:password@host:5432/drevnix.

Database Connection Pool

VariableDefaultDescription
DB_POOL_SIZE25Maximum number of connections in the HikariCP pool.
DB_CONNECTION_TIMEOUT_MS30000How long (ms) to wait for a connection from the pool before throwing an error.
DB_IDLE_TIMEOUT_MS600000Remove idle connections after this many ms (10 minutes).
DB_MAX_LIFETIME_MS1800000Retire connections after this many ms to prevent stale handles (30 minutes).

Networking

VariableDefaultDescription
PROXY_HTTP_PORT8000Port for the Docker Registry V2 proxy endpoint.
PROXY_HTTP_HOST0.0.0.0Address to bind the proxy port to.
PORTAL_HTTP_PORT8001Port for the web portal.
PORTAL_HTTP_HOST127.0.0.1Address to bind the portal to. Defaults to loopback — change to 0.0.0.0 only if you need direct external access (prefer a reverse proxy instead).
API_HTTP_PORT8002Port for the REST API.
API_HTTP_HOST127.0.0.1Address to bind the API to. Defaults to loopback — change to 0.0.0.0 only if you need direct external access (prefer a reverse proxy instead).
TRUSTED_PROXIES(unset)Controls client IP resolution for audit logs and rate limiting. unset: X-Forwarded-For is ignored, remote-addr always used — for direct internet-facing deployments. *: X-Forwarded-For always trusted, leftmost token used as client IP — use when behind any proxy/load balancer and the app is not directly reachable from the internet. CIDR list (e.g. 10.0.0.0/8,172.16.0.0/12): X-Forwarded-For trusted only when remote-addr falls within the listed ranges — for precise proxy trust control.

Pull-Through Cache

VariableDefaultDescription
CACHE_ENABLEDfalseEnable blob caching. Requires a license with cache feature.
CACHE_DIR/data/cacheDirectory on disk for cached blobs. Safe to lose — it is purely a cache and will be repopulated on next pull.
CACHE_MAX_SIZE_BYTES10737418240Maximum disk usage in bytes (default: 10 GB). LRU eviction applies when reached. Example: 53687091200 for 50 GB.
CACHE_ENTRY_TTL_SECONDS86400How long a cached blob is considered fresh in seconds (default: 24 hours).
CACHE_MIN_HITS_SHORT3Hits required in the short admission window.
CACHE_WINDOW_SHORT_SECONDS600Duration of the short admission window (10 minutes).
CACHE_MIN_HITS_LONG10Hits required in the long admission window.
CACHE_WINDOW_LONG_SECONDS3600Duration of the long admission window (1 hour).

Audit Log

VariableDefaultDescription
AUDIT_ENABLEDfalseEnable audit logging. Must be set to true to record pull events.
AUDIT_RETENTION_DAYS90Days of audit log entries to retain. Older entries are pruned automatically. Controlled by license.

Upstream HTTP Client

VariableDefaultDescription
UPSTREAM_TIMEOUT_MS30000Request timeout (ms) for metadata calls to upstream registries — token fetch, manifest lookup, version check.
UPSTREAM_BLOB_TIMEOUT_MS300000Request timeout (ms) for blob/layer pulls. Covers establishing the stream; body transfer continues until EOF once headers are received.

Portal

VariableDefaultDescription
PORTAL_COOKIE_SECUREtrueSets the Secure flag on session cookies. Set to false only when running without TLS on a local or internal network.

Server

VariableDefaultDescription
JETTY_STOP_TIMEOUT_MS5000Graceful shutdown timeout (ms). Drevnix waits this long for in-flight requests to finish before forcing a shutdown.

Generating a secure ENCRYPTION_KEY

openssl rand -hex 32

Once upstream credentials are stored, the ENCRYPTION_KEY must not change. If you need to rotate it, use the change-encryption-key CLI command. This re-encrypts all stored credentials under the new key without downtime.