Table of Contents

Last updated

Environment Variables

This page lists environment variables for self-hosted Windshift. Most variables have CLI flag equivalents in Configuration Options.

Required values

VariableRequired?Description
SSO_SECRETYesSession-cookie and SSO-state signing/encryption secret. Generate once with openssl rand -hex 32 and keep it stable.
BASE_URLStrongly recommendedPublic URL users access Windshift from. Required for correct links, SSO redirects, WebAuthn, calendar feeds, and runners.

Windshift accepts SESSION_SECRET as a legacy fallback when SSO_SECRET is unset. New deployments should use SSO_SECRET.

HTTP and reverse proxy

VariableDefaultDescription
PORT8080HTTP server port inside the container/process.
BASE_URL-Public URL, for example https://windshift.example.com or https://example.com/windshift.
WINDSHIFT_CONTEXT_PATH-Optional subpath such as /windshift when serving below a domain root. Set BASE_URL to the full subpath URL to match.
ALLOWED_HOSTSderived from BASE_URLComma-separated browser origins for CORS, CSRF, WebAuthn, and SSO redirect validation. This is not a Host-header request filter. Leave it unset for a single-domain deployment so Windshift derives the origin from BASE_URL. An explicit value overrides that derivation.
FORM_EMBED_ORIGINS-Comma-separated origins permitted to embed public forms.
USE_PROXYfalseTrust forwarded protocol/client-IP headers from reverse proxies.
ALLOW_INSECURE_HTTPfalseAllow browser access via plain http on non-localhost origins. Trusted LANs and testing only.
ADDITIONAL_PROXIES-Additional trusted proxy IPs, comma-separated.
DISABLE_IP_RATE_LIMITfalseDisable IP-based rate limiting. Use only behind trusted controls.

When USE_PROXY=true, ensure Windshift is reachable only from your reverse proxy. Forwarded headers are security-sensitive.

By default, a plain-HTTP BASE_URL works only for localhost. Any other HTTP hostname or IP fails at startup with Failed to create CORS middleware ... insecure origin patterns. Serve HTTPS instead. On a trusted LAN, set ALLOW_INSECURE_HTTP=true. See Docker for options.

Secrets, auth, and WebAuthn

VariableDefaultDescription
SSO_SECRETrequiredPreferred session and SSO secret.
SESSION_SECRET-Legacy fallback if SSO_SECRET is unset.
ENABLE_ADMIN_FALLBACKfalseEnable password-based admin fallback when SSO is restrictive or unavailable.
RECOVER_USER-Emergency recovery helper for user access flows.
SESSION_VALIDATION_CACHE_TTL5sHow long session-validation results are cached. Accepts a Go duration such as 5s.
SESSION_IP_BINDINGlogHandle a client-IP change on an existing session. Use log, strict, or off. Invalid values stop startup.
WEBAUTHN_RP_IDBASE_URL hostWebAuthn relying-party ID. Use a hostname, or a full HTTP or HTTPS URL from which Windshift extracts the hostname. Falls back to the process host name, which is the container ID in Docker. See WebAuthn relying-party ID in containers.
WEBAUTHN_RP_NAMEWindshiftDisplay name shown by authenticators.

The default SESSION_IP_BINDING=log records an IP change and keeps the session active. Use strict to reject a changed IP, or off to skip the comparison. Test strict with your proxy, mobile clients, and changing networks before you enforce it.

Database

VariableDefaultDescription
DB_PATHwindshift.dbSQLite database file path.
POSTGRES_CONNECTION_STRING-PostgreSQL connection string. If set, PostgreSQL is used instead of SQLite.
DB_TYPE-Set to postgres to build a connection string from the POSTGRES_* variables.
POSTGRES_HOSTpostgresHost for generated PostgreSQL connection strings.
POSTGRES_PORT5432Port for generated PostgreSQL connection strings.
POSTGRES_USERwindshiftUser for generated PostgreSQL connection strings.
POSTGRES_PASSWORD-Password for generated PostgreSQL connection strings.
POSTGRES_DBwindshiftDatabase name for generated PostgreSQL connection strings.
POSTGRES_SSLMODEdisableTLS mode for a connection built from the split POSTGRES_* variables: disable, allow, prefer, require, verify-ca, or verify-full. Use require or stricter for remote or managed PostgreSQL. Invalid values fail startup.
MAX_READ_CONNS30Read connection pool size. On SQLite, it caps concurrent readers. On PostgreSQL, it sizes the pool: maximum open equals this value and maximum idle equals half. Keep it below PostgreSQL max_connections.
MAX_WRITE_CONNS1SQLite write connection pool size.
POSTGRES_REPLICA_COUNT1Number of Windshift replicas sharing PostgreSQL, used to validate the aggregate connection budget.
POSTGRES_CONNECTION_HEADROOM10PostgreSQL connections reserved for migrations, administration, and other clients when validating the connection budget.
DB_REQUEST_TIMEOUT12sMaximum database-work duration for normal HTTP requests. Accepts a Go duration such as 12s or 1m.
MAX_USER_CONCURRENCY16Maximum simultaneous in-flight /api requests per authenticated user. A burst from one user (or one agent) cannot exhaust the database. 0 disables the cap.

Recommended production form:

DB_TYPE=postgres
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=windshift
POSTGRES_PASSWORD=secret
POSTGRES_DB=windshift
# `disable` is suitable only for the bundled PostgreSQL container on the same Docker network.
# Use `require`, `verify-ca`, or `verify-full` for remote or managed PostgreSQL.
POSTGRES_SSLMODE=disable

POSTGRES_CONNECTION_STRING also accepts a full PostgreSQL URI. Keep it in the environment rather than on the command line, so credentials do not appear in process listings or shell history.

Files

VariableDefaultDescription
ATTACHMENT_PATH-Directory for uploaded file attachments. Use a persistent volume in Docker. Ignored for blobs when STORAGE_BACKEND=s3.

Attachment storage

Local disk is the default. Set STORAGE_BACKEND=s3 to keep attachment blobs in an S3-compatible bucket instead, so the container’s volume holds only the database. Uploads, downloads, previews, and diagrams all go through the selected backend; downloads stay authorized and are proxied through Windshift with ranged reads.

VariableDefaultDescription
STORAGE_BACKENDlocallocal or s3. Any other value fails at startup. s3 requires S3_BUCKET.
S3_BUCKET-Bucket for attachment blobs. Required when STORAGE_BACKEND=s3.
S3_REGION-Bucket region. AWS examples use us-east-1.
S3_ENDPOINT-Custom endpoint for S3-compatible stores. Leave empty for AWS S3.
S3_FORCE_PATH_STYLEfalsePath-style addressing. Usually true for MinIO, RustFS, and Wasabi.
S3_PREFIX-Key prefix inside the bucket, for sharing a bucket with other applications.
S3_ACCESS_KEY_ID-Static credential. Must be set together with S3_SECRET_ACCESS_KEY.
S3_SECRET_ACCESS_KEY-Static credential. Must be set together with S3_ACCESS_KEY_ID.

Leave both static credentials unset to use the standard AWS credential chain: environment, web identity/IRSA, or instance profile. Setting only one of the pair fails at startup.

GET /readyz reports bucket reachability from a cached probe, so a broken backend surfaces as a readiness failure rather than a silent upload error.

When STORAGE_BACKEND=s3 is enabled, backups of ATTACHMENT_PATH no longer cover attachment blobs. Use the bucket’s own versioning, replication, or backup mechanism. See Backup and restore for the full workflow.

SSH TUI and MCP

VariableDefaultDescription
SSH_ENABLEDfalseEnable the SSH TUI server.
SSH_PORT23234SSH server port.
SSH_HOSTlocalhostSSH server bind address.
MCP_ENABLEDfalseEnable the MCP server at /mcp.

Logging

VariableDefaultDescription
LOG_LEVELinfodebug, info, warn, or error.
LOG_FORMATtexttext, json, or logfmt. Use json for most container log pipelines.

Monitoring

VariableDefaultDescription
WINDSHIFT_METRICS_TOKEN-Optional bearer token for the Prometheus /metrics endpoint. When set, requests must send Authorization: Bearer <token>. When unset, the endpoint is public.

The metrics endpoint is public by default. Set WINDSHIFT_METRICS_TOKEN to a long random value to require a bearer token, or restrict the path at the reverse proxy. The token check runs in the Windshift process, so it also applies when a caller reaches /metrics without passing through the proxy. It does not replace network controls. See Prometheus metrics.

Outbound TLS

VariableDefaultDescription
TLS_SKIP_VERIFYfalseDisable certificate-chain and hostname verification for outbound HTTPS, SMTP, IMAP, and LDAP connections.

Keep this setting false in production. Set it to true only when every affected destination is trusted and uses a certificate that Windshift cannot verify. The setting applies to the whole process.

Plugins

VariableDefaultDescription
DISABLE_PLUGINSfalseDisable the plugin system entirely.
PLUGIN_DIR-Primary plugin directory.
PLUGIN_DIRS-Additional plugin directories, comma-separated.

Operator policy

VariableDefaultDescription
WINDSHIFT_OPERATOR_POLICY-Path to a deployment-owned JSON policy file that denies capabilities and sets instance-wide ceilings. Read at startup; a change requires a restart. See Operator policy.

The equivalent CLI flag is --operator-policy.

Private network egress

VariableDefaultDescription
ALLOW_LOCAL_CONNECTIONStrueAllow server-side HTTP clients (SCM, Jira, LLM, OIDC, webhooks, SMTP) to reach local, loopback, and private-network addresses.

By default, Windshift allows server-side outbound HTTP to local, loopback, and private-network addresses. To restore private-address blocking, set the variable to false:

ALLOW_LOCAL_CONNECTIONS=false

The equivalent CLI setting is:

./windshift --allow-local-connections=false

This is a global switch. When set to false, integrations cannot reach private endpoints such as a self-hosted SCM, Jira Data Center, private identity provider, local LLM server, internal webhook target, or internal SMTP server. Use network policy to keep sensitive endpoints, such as cloud metadata services and admin panels, out of reach of the Windshift host.

See Production-ready self-hosting for normal and hardened deployment profiles.

Process memory and cache budget

VariableDefaultDescription
WINDSHIFT_MEMORY_LIMIT_MB2048 MiBTotal Windshift process-memory budget. Values below 512 MiB fail at startup.

The value uses MiB. It overrides --memory-limit-mb when both are set. Windshift gives the Go runtime an 80% soft heap target and gives BigCache 25% of the process budget, capped at 512 MiB. This is not a hard RSS limit. Set the container memory limit to at least the declared process budget.

Administrators can inspect the resolved budget, cache capacity, entries, hits, misses, and evictions under Admin → Diagnostics → Cache memory.

AI and LLM

VariableDefaultDescription
LLM_PROVIDERS_FILE-Path to a custom LLM provider catalog JSON file.
AI_PROMPTS_DIR/data/prompts in DockerDirectory for custom AI prompt overrides.
LLM_ENDPOINT-Legacy/fallback OpenAI-compatible inference endpoint. Prefer AI Connections in the admin UI.

Public AI providers work without extra configuration. Local and internal models, such as Ollama, LM Studio, and internal gateways, work by default because ALLOW_LOCAL_CONNECTIONS defaults to true. Keep the default to use them.

Create a Local / Custom AI connection. Use the base URL that the Windshift host can reach, such as http://localhost:11434/v1, http://host.docker.internal:11434/v1, or http://172.17.0.1:11434/v1.

Set ALLOW_LOCAL_CONNECTIONS=false to block local and private endpoints. The switch is global, so it blocks every local and private destination, not only AI connections.

Coding agent runner

The coding-agent runner is opt-in. See Coding Agent Runner before enabling these.

VariableDefaultDescription
CODING_AGENT_ENABLEDfalseSet to true to enable the coding-agent system. The Windshift server then runs as an orchestrator only: it dispatches runs but executes no agent containers itself.
CODING_AGENT_WS_API_URLBASE_URL + /apiAPI URL agent containers use to reach Windshift. Override when BASE_URL is not reachable from containers (for example a localhost URL). Must end in /api.

These are the only CODING_AGENT_* settings the server reads. Agent containers run on windshift-runner hosts. Configure those hosts with WSRUNNER_* variables in the runner process, not the Windshift server process. Configure the agent image, Docker binary, worktree and cache location, and concurrency on the runner. See Coding Agent Runner for the runner Compose file and the full WSRUNNER_* table.

Notifications and Jira

VariableDefaultDescription
VAPID_PUBLIC_KEYauto-generatedWeb Push (VAPID) public key. Without an explicit pair, Windshift generates one on first boot, stores it in system settings, and enables push notifications. Set it with VAPID_PRIVATE_KEY only to manage or rotate the key pair deliberately.
VAPID_PRIVATE_KEYauto-generatedWeb Push (VAPID) private key. Set it with VAPID_PUBLIC_KEY when you provide a managed pair. Rotating either key invalidates existing push subscriptions. Users must subscribe again.
VAPID_SUBJECTBASE_URLContact URI or mailto: for the push subscription, sent to push services.
NOTIFICATION_FLUSH_INTERVALbuilt-inNotification write-batcher flush interval, as a Go duration (5s, 1m).
NOTIFICATION_BATCH_SIZEbuilt-inNotification write-batcher batch size.
NOTIFICATION_SYNC_INTERVALbuilt-inNotification synchronization interval.
WINDSHIFT_NOTIFICATION_BATCH_INTERVALbuilt-inEmail notification batch scheduler cadence.
JIRA_CAPTURE_PAYLOADS-Directory for Jira import request/response payload debugging.

Docker Compose .env template

# Required
DOMAIN=windshift.example.com
BASE_URL=https://windshift.example.com
SSO_SECRET=replace-with-openssl-rand-hex-32

# HTTP
PORT=8080
ALLOWED_HOSTS=windshift.example.com
USE_PROXY=true
SESSION_IP_BINDING=log

# Monitoring (optional)
# WINDSHIFT_METRICS_TOKEN=replace-with-openssl-rand-hex-32

# Storage
ATTACHMENT_PATH=/data/attachments
# STORAGE_BACKEND=s3
# S3_BUCKET=
# S3_REGION=us-east-1
# S3_ENDPOINT=
# S3_FORCE_PATH_STYLE=false
# S3_PREFIX=

# PostgreSQL
DB_TYPE=postgres
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=windshift
POSTGRES_PASSWORD=replace-with-a-strong-password
POSTGRES_DB=windshift
POSTGRES_SSLMODE=disable

# Traefik / ACME
LETSENCRYPT_EMAIL=admin@example.com

# Optional: block egress to private/loopback endpoints (local LLM, internal IdP/SCM)
# ALLOW_LOCAL_CONNECTIONS=false

# Optional: deployment-owned capability and ceiling policy
# WINDSHIFT_OPERATOR_POLICY=/data/operator-policy.json

# Keep certificate verification enabled. Do not set true for normal production use.
TLS_SKIP_VERIFY=false

Using Varlock for configuration management

Varlock is an optional CLI tool that adds schema-based validation and secret leak prevention to .env files. It works as a drop-in wrapper.

Install

# macOS
brew install dmno-dev/tap/varlock

# Linux / CI
curl -sSfL https://varlock.dev/install.sh | sh -s

Initialize

cd /path/to/windshift
varlock init

Example .env.schema

# @required @sensitive @type=string
SSO_SECRET=

# @required @type=url
# @example="https://windshift.example.com"
BASE_URL=

# @type=port @optional
PORT=8080

# @sensitive @optional
POSTGRES_PASSWORD=

# @optional @type=email
LETSENCRYPT_EMAIL=

# @optional @type=boolean
# Blocks private/loopback egress for all server-side HTTP clients when set to false.
ALLOW_LOCAL_CONNECTIONS=

Validate

varlock load

Run with validation

varlock run -- docker compose up -d