Skip to content

Configuration ​

DepGate is configured with environment variables. The names are the same in every production setup: .env in deploy/all-in-one/ and deploy/app-only/ (each has an .env.example that lists them with explanations), and the ConfigMap depgate-config and Secret depgate-secrets in deploy/kubernetes/. Restart DepGate to apply a change: ./3-run.sh with Compose, kubectl rollout restart deployment/depgate on Kubernetes.

Settings that Security users change in the web interface (repositories, single sign-on, email, webhooks, log streaming, the artifact cache, the registry token lifetime and the gateway security controls) are stored in the database and need no restart.

Required ​

VariableDescription
GATEWAY_URLThe address people and package clients use, for example https://depgate.example.com. Download links in registry responses are built from it.
JWT_SECRETSecret that signs sessions and registry tokens. Generate it with openssl rand -hex 32 and keep it: changing it signs everyone out and invalidates every registry token.
ADMIN_EMAILThe first Security account, created on first start on an empty database only. Changing it later does nothing.
ADMIN_PASSWORDIts initial password, read at that first start only. Change it in the web interface afterwards; both variables may then be removed.
DEPGATE_IMAGE, DEPGATE_VERSIONThe image and tag to run (Compose setups; ghcr.io/secmods/depgate and the release version). On Kubernetes: images: in kustomization.yaml.

Server and HTTPS ​

VariableDefaultDescription
DISABLE_SSLfalsetrue serves plain HTTP only, for TLS on your own proxy or load balancer.
TLS_CERT_FILE, TLS_KEY_FILE/certs/tls.crt, /certs/tls.keyCertificate (full chain) and private key, in PEM. Reloaded automatically when the files change.
HTTPS_PORT, HTTP_PORT443, 80Host ports.
HTTP_BIND0.0.0.0Host address for the HTTP port. 127.0.0.1 when your proxy runs on the same host.
HTTP_REDIRECTtrueWith HTTPS on, redirect HTTP to HTTPS. false closes the HTTP port.
TRUST_PROXY1 with DISABLE_SSL, otherwise falseWhich proxies may set X-Forwarded-For: false, a number of hops, or a list of addresses and CIDR ranges.
UI_URLGATEWAY_URLThe address of the web interface, used in email links and in the Package check link of block responses.
DOCS_URLnoneThe documentation site linked from Help → Documentation in the sidebar, for example an internal copy. Unset hides the link.
MANAGEMENT_PORT9464 in DockerPrivate port for /metrics, /healthz and /readyz.
LOG_LEVELinfodebug, info, warn or error.
DEPGATE_INSTANCE_NAMEthe host of GATEWAY_URLThe installation's name in streamed events.

Database (PostgreSQL) ​

VariableDefaultDescription
DB_HOST, DB_PORTlocalhost, 5432Server address.
DB_USER, DB_PASSWORD, DB_NAMEdepgateCredentials and database.
DB_SSLfalseEncrypt the connection.
DB_SSL_CA_FILEnoneCA certificate (PEM) to verify the server, for example /certs/ca.crt.
DB_POOL_SIZE20Connections per replica.

Redis ​

VariableDefaultDescription
REDIS_URLredis://localhost:6379Cache and job queues. Use rediss:// for TLS; put the password in the URL. Requires maxmemory-policy noeviction.
QUEUE_REDIS_URLREDIS_URLOptional separate Redis for the job queues.
QUEUE_PREFIXdepgateKey prefix, to share one Redis between several installations.
WORKERSallWhich queues this replica processes: all, none, or a list of webhooks, scheduled, email, monitor.

Outbound network ​

VariableDescription
NODE_USE_ENV_PROXY1 sends outgoing requests through the proxy below.
HTTP_PROXY, HTTPS_PROXYThe outbound proxy, for example http://proxy.example.com:3128.
NO_PROXYHosts reached directly: internal registries, webhook endpoints.
NODE_EXTRA_CA_CERTSExtra CA certificates trusted for outgoing TLS. /certs/ca.crt in Docker.

Authentication and email ​

VariableDefaultDescription
UI_SESSION_EXPIRES_IN1hBrowser session lifetime.
INVITE_EXPIRY_HOURS168How long an invitation link works.
PASSWORD_RESET_EXPIRY_MINUTES60How long a password reset link works.
LOGIN_FAILURE_LIMIT_PER_EMAIL, LOGIN_FAILURE_LIMIT_PER_IP10, 100Failed password sign-ins per 15 minutes before sign-in waits. 0 removes the limit.
LOGIN_FAILURE_AUDIT_PER_MINUTE20Failed sign-ins written to the Audit Log per address and minute; the rest are only counted.
SSO_RATE_LIMIT600Requests per address and 10 minutes to the single sign-on endpoints. 0 removes the limit.
SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_PASSWORD, SMTP_FROMnoneMail server. Settings saved under Settings → Email take precedence.

Package check ​

VariableDefaultDescription
PACKAGE_CHECK_RATE_LIMIT30Checks per user per minute. 0 removes the limit.
PACKAGE_CHECK_TIMEOUT_MS10000Time limit of one check.

Caching ​

VariableDefaultDescription
NPM_METADATA_TTL300Seconds npm metadata is considered fresh.
NPM_METADATA_STALE_TTL3600Seconds stale npm metadata may still be served while it is refreshed.
METADATA_TTL, METADATA_STALE_TTLnpm valuesThe same for the other ecosystems.
NPM_NEGATIVE_TTL, METADATA_NEGATIVE_TTL60Seconds a "not found" answer is cached.
NPM_MEMORY_CACHE_MB128In-process cache per replica. 0 turns it off.
FACTS_CACHE_TTL86400Seconds licenses and publish dates are cached.
OSV_CACHE_TTL3600Seconds vulnerability results are cached. A newly published vulnerability is enforced within this time.

Shorter stale windows reduce Redis memory use. See Requirements → Sizing.

Artifact cache ​

Package files from public registries, kept on each replica's local disk. See Artifact cache. Every variable except ARTIFACT_CACHE_DIR is a default: Settings → Artifact cache can change it at runtime.

VariableDefaultDescription
ARTIFACT_CACHE_ENABLEDfalse (true in every production setup in deploy/)Turns the cache on. Settings → Artifact cache can switch it on or off and overrides this value.
ARTIFACT_CACHE_DIR/var/lib/depgate/artifactsCache directory on local SSD. One directory per replica; never share it.
ARTIFACT_CACHE_MAX_SIZE_GBnone, required when enabledMost disk the cache uses on each replica, in GB of 1024³ bytes. DepGate does not start when ARTIFACT_CACHE_ENABLED is true and no size is set here or in Settings. Never more than the disk's free space.
ARTIFACT_CACHE_MAX_FILES200000Most files on each replica.
ARTIFACT_CACHE_MAX_AGE_DAYS30Days after which a stored file is downloaded again. 0 turns it off.
ARTIFACT_CACHE_MAX_IDLE_DAYS7Days without a download after which a file is removed. 0 turns it off.
ARTIFACT_CACHE_MAX_FILE_MB1024Larger files are served but not stored.

Data sources ​

VariableDefaultDescription
OSV_API_URLhttps://api.osv.devVulnerability data.
DEPS_DEV_ENABLEDtrueFill missing licenses and publish dates from deps.dev, for public packages only.
SCORECARD_ENABLEDtrueOpenSSF Scorecard lookups for Project health policies. false makes those policies never match.
EPSS_ENABLEDtrueDaily EPSS sync. false leaves every EPSS score unknown.
EPSS_FEED_URLFIRST's daily filePoint it at an internal mirror for air-gapped installations.
EPSS_SYNC_INTERVAL_HOURS24How often EPSS syncs.
EPSS_STALE_AFTER_HOURS72When the interface warns that EPSS data is old.
MALICIOUS_FEED_URL, MALICIOUS_FEED_ARCHIVE_URLthe public feedSource of the malware list. Point them at a mirror for air-gapped installations.
MALICIOUS_SYNC_INTERVAL_HOURS1Hours between malware feed syncs. 0 disables the schedule.

Decision Ledger, Audit Log and log streaming ​

VariableDefaultDescription
LEDGER_RETENTION_DAYS180How long Decision Ledger rows are kept. 0 keeps them forever.
AUDIT_RETENTION_DAYS730How long Audit Log entries are kept. 0 keeps them forever.
EVENT_STREAM_MAX_LEN200000Events kept for a log streaming destination that falls behind. Older events are lost beyond it.

Webhooks and jobs ​

VariableDefaultDescription
WEBHOOK_COALESCE_SECONDS300Window in which identical package_blocked and malware_requested alerts are grouped. 0 sends each one.
WEBHOOK_MAX_ATTEMPTS8Attempts per webhook delivery.
WEBHOOK_BACKOFF_MS30000First retry delay; it doubles each attempt.
WEBHOOK_DELIVERY_RETENTION_DAYS30How long delivery history is kept.
WEBHOOK_DISABLE_AFTER_FAILURES20Consecutive failures before a webhook is turned off. 0 never.

Monitoring and namespace protection ​

VariableDefaultDescription
MONITOR_RETENTION_DAYS90A version nobody downloaded for this many days drops out of the monitoring report. 0 keeps everything.
MONITOR_MAX_ROWS_PER_POLICY50000Rows kept per monitoring policy.
NAMESPACE_COLLISION_INTERVAL_HOURS24How often the namespace collision check runs while it is turned on.

Released under the MIT License.