Configuration reference

Every environment variable an operator sets for a production deployment, which are required, and which are fixed by the compose file.

For: Administrators operating a deployment · Last updated

You configure a production deployment through the .env file that sits next to docker-compose.prod.yml (/opt/wi/.env on the AWS path). Docker Compose reads that file automatically, so you never type these values on a command line.

The app service also loads every KEY=value line of .env straight into the application's environment. Any setting in the application's WI_ namespace therefore reaches it as soon as you add the line and restart the app container. The values the compose file sets itself (listed at the end) take precedence over .env, so do not try to change those there.

After editing .env, apply the change:

cd /opt/wi
sudo docker compose -f docker-compose.prod.yml up -d

Each key must appear once. Edit an existing line rather than adding a second one.

Required#

Variable What it is
WI_MASTER_KEY Base64 AES key (16, 24 or 32 bytes) that protects the data key encrypting every stored credential. Generated once by the installer, never regenerated by it. See Master key custody. The stack will not start without it, and the application refuses to start if it is malformed or does not match the key stored in the database.
WI_SESSION_SECRET Secret that signs sign-in sessions. Generated once, for example with openssl rand -base64 32. The stack will not start without it.
WI_DOMAIN Your domain name, for example wi.example.com. The one address setting you provide: the web origin (https://<domain>), the base URLs for emailed links, webhooks, and deployed Apps, and the host Builders use for git push are all derived from it. The stack will not start without it (or, on a box with no domain, WI_ALLOWED_ORIGIN). Caddy also uses it to obtain a certificate.

Optional#

Variable Default What it does
WI_MASTER_KEY_OLD blank Set only while rotating the master key: the previous WI_MASTER_KEY, in the same format. Remove it once the Encryption keys card on Settings, Administration, Secrets says it is safe. See Rotate the master key.
WI_ALLOWED_ORIGIN https://<WI_DOMAIN> The origin your users browse to. Set it only on a box with no domain (for example http://203.0.113.10), or to include a port if you changed WI_HTTP_PORT or WI_HTTPS_PORT.
WI_PUBLIC_BASE_URL, WI_API_BASE_URL, WI_APPS_BASE_URL the origin Base URLs for emailed links, for links the API hands out (webhook trigger URLs), and for deployed Apps. Override only to point one elsewhere.
WI_DOKKU_SSH_HOST WI_DOMAIN (else the origin's host) The public hostname Builders use for their git push to deployed Apps.
WI_HTTP_PORT 80 Host port published for HTTP.
WI_HTTPS_PORT 443 Host port published for HTTPS.
WI_DOKKU_SSH_PORT 2222 Host port published for Dokku's SSH (the box's own SSH server keeps 22).
WI_IMAGE_OWNER radialventures The GitHub account or organization that owns the wi-server and wi-web images.
WI_IMAGE_TAG latest The image tag the app and web services run.
WI_DOCKER_CONFIG_DIR /root/.docker The host directory holding the registry login that the in-app updater reads. See Registry credentials for updates.
WI_SESSION_COOKIE_DOMAIN blank Scopes the session cookie to a parent domain, for example example.com. Leave blank to keep the cookie on the exact host. Setting it widens where the cookie is sent.
WI_TRIGGER_SCHEDULER dbos dbos runs Coworker triggers on their schedules. none turns off automatic firing, so triggers fire only when run by hand.
WI_FEEDBACK_SYNTHESIS_SCHEDULER dbos dbos runs the weekly feedback synthesis for companies that have the Feedback Synthesis feature turned on. none removes the schedule entirely, so syntheses run only when someone starts one.
WI_CRAWL_SCHEDULER dbos dbos re-crawls web sources hourly according to each source's refresh schedule. none removes the timer, so sources sync only when someone chooses Sync now.
WI_IMAGE_CLEANUP_SCHEDULER dbos dbos runs Docker housekeeping after each successful update and once a week, on production deployments only. none removes the timer, so cleanups run only when an admin selects Clean up now. See Docker housekeeping.
WI_INGEST_SWEEPER_SCHEDULER dbos dbos checks every ten minutes for uploaded documents that are stuck being read and marks them failed so they can be retried. none removes the check.
WI_FEEDBACK_SYNTHESIS_CHUNK_TOKENS 24000 Estimated tokens of feedback sent to the model in one call. A larger batch is split into several calls and merged.
WI_QUALITY_REVIEW_SCHEDULER dbos dbos runs the hourly automatic conversation review for companies that have Conversation quality review turned on and a review share above 0. none removes the schedule entirely, so reviews run only when a Supervisor starts one. See Conversation quality review.
WI_VALUE_ATTRIBUTION_SCHEDULER dbos dbos runs the hourly check that starts the daily Value estimates run for companies that have it turned on. none removes the schedule entirely. See Value estimates.
WI_COMPACTION_TOKEN_THRESHOLD 100000 Estimated tokens of conversation history before a Coworker's conversation is condensed to a summary.
WI_OAUTH_PROVIDER_DRIVER http How people sign in to outside systems such as GitHub. http talks to the system's own sign-in addresses saved on the connection. fake is for tests and is refused in production.
WI_CONNECTION_BROKER_DRIVER http How Coworkers' calls reach an outside system's tools. http calls the system's own server. fake is for tests and is refused in production.
WI_CENTRAL_URL https://workforceintelligenceinc.com Address of the Radial documentation service. Setup-guide links in the app open its articles. Optional: nothing in the application needs it to be reachable to start or run. In production it must be an https:// address.
WI_CRAWLER_MAX_PAGES_PER_RUN 200 Safety cap on pages one knowledge-source crawl may collect.
WI_CRAWLER_MAX_FETCHES_PER_RUN 400 Safety cap on fetches one knowledge-source crawl may make.

Fixed by the compose file#

The compose file sets these for you. Do not change them. A value in .env does not override them.

Variable Value Why it is fixed
WI_ENV prod Turns on the production boot checks.
WI_DATABASE_URL postgresql+psycopg://wi:wi@postgres:5432/wi Points at the Postgres container on the private Compose network.
WI_DATA_DIR /data The durable application volume.
DOCKER_CONFIG /run/host-docker-config Where the application finds the mounted registry login.
WI_DEPLOY_DRIVER dokku Deployed Apps run on the Dokku container.
WI_DOKKU_CONTAINER_NAME wi-prod-dokku Must match the Dokku container's name.
WI_APPS_PLATFORM_BASE_URL http://app:8300 How a deployed App's container reaches the application.
WI_DOKKU_APP_NETWORK wi-prod_default The Compose network that deployed Apps join.
WI_DOKKU_ADMIN_SSH_HOST dokku The application reaches Dokku by its service name.
WI_DOKKU_ADMIN_SSH_PORT 22 Dokku's internal SSH port, independent of the published one.

The postgres service uses the database user, password, and database name wi. The database port is not published, so only the other containers on the Compose network can reach it.

Where the files live#

Path What it holds
.env Secrets and deployment settings. Root-only, mode 0600.
docker-compose.prod.yml The stack definition, extracted from the wi-server image by install.sh (it is replaced on every run, so do not edit it).
install.sh, find-setup-token.sh The installer and the token helper.

On the AWS path all of these are in /opt/wi.