Coming soon. The Wiki is in active development, so features and these docs may still change. Early adopters: contact us for access.

Environment variables

The environment variables the Wiki's server and web app read: what each does, its default, and where to set it

Environment variables are for what a server needs before it can read its settings (the encryption key, the database on first boot) and for per-server tuning. Everything else is a setting: stored encrypted in PostgreSQL, changed in Settings, and the same on every server at once (see Settings reference).

1. Where to set them

Running the Wiki asSet them in
A service (systemd)An EnvironmentFile= readable only by the service user, for example /etc/wiki/server.env (mode 0600)
Containers you builddocker run -e NAME=value or --env-file; secrets from your orchestrator's secret store
  • A value the server can't read (a duration that isn't one, a number out of range) stops it at startup with a message naming the variable.
  • Durations are written 30s, 15m, 24h. Sizes are bytes unless the name says otherwise. Schedules are cron expressions (minute hour day month weekday, UTC).
  • Some defaults apply only until an administrator saves the matching settings page; the page then wins on every server.

In a cluster, give every server the same values, except the per-server ones (PORT, BIND_ADDR, NODE_DISPLAY_NAME, directories, LOG_LEVEL).

2. Bootstrap

VariableDefaultMeaning
CONFIG_ENCRYPTION_KEYnone, requiredEncrypts the bootstrap file and every credential stored in the database. Required on every start; the same on every server; keep it with your backups
DATABASE_URLnonePostgreSQL URL. Needed on a server's first start (and for setup); then saved, encrypted, in the bootstrap file. Add pool_max_conns=N and sslmode=verify-full as needed
BOOTSTRAP_FILE_PATH./data/bootstrap.encWhere the server keeps its encrypted bootstrap file. Per server; keep it on persistent disk
PORT8080The server's HTTP port
BIND_ADDR127.0.0.1Address the server listens on
FRONTEND_URLhttp://localhost:3000 (set it: the web app listens on 3002)Where the web app is; also the default allowed CORS origin. Set it to the Wiki's address
CORS_ALLOWED_ORIGINSFRONTEND_URLComma-separated origins allowed to call the API from a browser
APP_ENVemptydevelopment prints the log as readable lines instead of JSON; leave it unset in production

3. Setup and recovery

VariableDefaultMeaning
SETUP_TOKENrandom, new on every startThe setup key the wizard needs. Set it to choose it
SETUP_CONFIG_FILEemptyA setup file for unattended setup; same as --setup-config
SETUP_UPLOAD_DIR./data/setup-uploadWhere a backup uploaded to the wizard's Restore from a backup waits
RECOVERY_TOKENrandomThe key of the recovery page
LICENSE_BANNER_DAYS30Super admins see a banner this many days before the licence expires (0 turns it off)

4. Reverse proxy and web app

VariableDefaultMeaning
TRUSTED_PROXIES127.0.0.0/8,::1/128Proxies whose forwarding headers the server trusts (IPs or CIDRs). List the web app and every proxy in front
FRONTEND_BEHIND_PROXYfalseWeb app: true when a proxy in front sets X-Forwarded-For, -Host and -Proto. Then only the proxy may reach the web app's port
FRONTEND_API_BODY_LIMIT33554432 (32 MiB)Web app: largest /api request it forwards. Uploads to a page have their own 201 MiB limit
BACKEND_URLhttp://127.0.0.1:8080Web app: where the server is
CSP_ENFORCEunset (enforced)Web app: false sends the Content-Security-Policy report-only

5. Sign-in and sessions

VariableDefaultMeaning
AUTH_LOCKOUT_THRESHOLD, AUTH_LOCKOUT_WINDOW, AUTH_LOCKOUT_DURATION5, 15m, 15mWrong passwords that lock an account, how long they count, how long it stays locked
AUTH_IP_RATE_LIMIT, AUTH_IP_RATE_WINDOW20, 15mFailed sign-ins and unknown tokens per address before it's blocked
AUTH_PASSWORD_MIN_LENGTH12Minimum password length (8–64)
AUTH_SESSION_LIFETIME, AUTH_REMEMBER_SESSION_LIFETIME24h, 168hLongest session without and with Remember me (until saved in Settings → Security → Sessions)
AUTH_MAX_SESSIONS5Sessions per person
AUTH_COOKIE_DOMAIN, AUTH_COOKIE_SECUREthe host, trueSession cookies: their domain, and HTTPS only
AUTH_PASSWORD_RESET_TTL, AUTH_INVITATION_TTL30m, 168hLifetimes of password reset and invitation links
AUTH_LOGIN_HISTORY_RETENTION_DAYS90Days of sign-in history kept
SSO_ENFORCEMENT_OVERRIDEfalseEmergency only: true ignores Require single sign-on on this server so an administrator can sign in with a password while the identity provider is down

6. Rate limits

Defaults until saved in Settings → Security → Rate limits (see Rate limits); 0 turns a limit off. The Wiki's own limits (Q&A posts, calendar reads and writes, page views reported by anonymous readers) are built in.

VariableDefaultMeaning
RATE_LIMIT_PREAUTH10000Requests per minute per address before sign-in is checked
RATE_LIMIT600Per minute per person in the browser
RATE_LIMIT_ANON60Per minute per address for anonymous requests
RATE_LIMIT_WS20WebSocket connections per minute per address
RATE_LIMIT_SETUP30Per minute per address in setup and recovery mode
RATE_LIMIT_DRY_RUNfalsetrue logs requests over a limit instead of refusing them

7. Database, Redis and cluster

VariableDefaultMeaning
DB_CONNECT_TIMEOUT30sHow long a starting server keeps trying the database
DB_SLOW_QUERY_THRESHOLD500msQueries slower than this are logged as warnings
NODE_DISPLAY_NAMEemptyThis server's name in Settings → Clustering
CLUSTER_HEARTBEAT_INTERVAL, CLUSTER_DEAD_THRESHOLD, CLUSTER_LEADER_GRACE10s, 3, 5Heartbeats, and missed ones before a server, or the leader, is replaced
CLUSTER_DEAD_NODE_TTL, CLUSTER_EVENT_RETENTION_DAYS24h, 7When servers that left drop off the list; days of cluster events kept
READ_CACHE_ENABLEDtruePer-server cache of roles and settings; false reads the database every time
READ_CACHE_CHECK_INTERVAL, READ_CACHE_MAX_AGE, READ_CACHE_MAX_ENTRIES1s, 5m, 20000How often it checks for changes, the longest it keeps an item, items per kind

Redis, storage and the licence are not environment variables: they're entered in the setup wizard (or setup file), stored encrypted, and changed in Settings or on the recovery page.

8. Logging, audit and metrics

VariableDefaultMeaning
LOG_LEVELinfodebug, info, warn, error; change it live in Settings → Logging
LOG_REDACT_ENABLEDtrueRemove secrets from log lines
LOG_FILE_ENABLED, LOG_FILE_DIRtrue, ./data/logsThis server's log files
AUDIT_LOG_RETENTION_DAYS90Days of audit log kept
METRICS_ADDRoffA separate listener serving /metrics without authentication: bind it to a private interface. See Monitoring
METRICS_TOKENoffAlso serve /metrics on the main port to Authorization: Bearer <token>
SYSTEM_CHECK_INTERVAL1hHow often each server runs its system check

9. Scheduler, events and plugins

VariableDefaultMeaning
SCHEDULER_LOCK_TTL, SCHEDULER_SHUTDOWN_GRACE_PERIOD5m, 30sHow long a job's lock lasts without renewal; time running jobs get on shutdown
PAGINATION_CURSOR_SECRETunsetSigns paging cursors so clients can't forge them. Recommended; the same on every server
EVENT_MAX_ATTEMPTS, EVENT_OUTBOX_RETENTION_DAYS8, 7Retries and retention of durable event deliveries
AUTOMATION_WEBHOOK_ALLOW_PRIVATE, AUTOMATION_WEBHOOK_ALLOW_HTTPfalseAllow webhooks to private addresses, or plain http
PLUGIN_SIGNING_REQUIREDtrueRefuse plugins not signed by a trusted key
PLUGIN_MAX_PACKAGE_SIZE20 MiBLargest plugin package
PLUGIN_DATABASE_URLthe main databasePut plugin schemas on another PostgreSQL database

Most scheduled jobs' times and retention are changed in Settings → Advanced → Scheduled jobs instead (see Scheduled jobs); backups in Settings → Backups (see Backups).