Skip to content

Configuration ​

Everything is configured through environment variables (packages/deploy/.env.example is the annotated template). No secret has a default: a missing or weak secret stops the server at startup. Settings that are not secret can be changed later in the admin panel where noted.

Required ​

VariableMeaning
WORK_DATABASE_URLPostgreSQL connection string. Migrations run at startup.
WORK_JWT_SECRETAt least 32 bytes (openssl rand -base64 48). Signs session tokens, derives other keys.
WORK_FRONTEND_URLThe public URL users open. https:// in production (http://localhost is accepted for development). Used for links in mail, cookies and passkeys.

Server ​

VariableDefaultMeaning
WORK_BIND_ADDR127.0.0.1:3001Where the backend listens. Do not publish it; the frontend proxies to it.
WORK_TRUST_FORWARDED_FORfalseUse the last X-Forwarded-For entry as client address. Only behind a proxy you control.
WORK_REGISTRATION_ENABLEDtrueClose self-registration once your accounts exist.
WORK_AUTH_RATE_LIMIT10Sign-in and similar attempts per address and minute.
WORK_RATE_LIMIT_BACKENDmemorypostgres shares the counters between several instances.
WORK_SCHEDULERtrueRun date-based automation triggers in this process. Safe on several instances.
BACKEND_URL (frontend)http://localhost:3001Where the Next.js proxy forwards /api/v1.

AI assistant ​

The AI features are off until a self-hosted language model is set. An admin can set it in the app (Administration → AI), which wins over these variables; they are the default for instances that do not. See AI assistant and MCP. The MCP server needs none of this.

VariableDefaultMeaning
WORK_AI_MODEL_URLunsetBase URL of your model server (OpenAI chat protocol: llama.cpp, Ollama, vLLM), e.g. http://127.0.0.1:8081. Unset and nothing set in the app = AI features off.
WORK_AI_MODEL_NAMEwork-assistantSent as model; llama.cpp ignores it, Ollama needs it.
WORK_AI_MAX_OUTPUT_TOKENS1024Longest answer, 64 to 8000 tokens.

Accounts and sign-in ​

VariableMeaning
WORK_ENCRYPTION_KEY32 bytes, base64 (openssl rand -base64 32). Encrypts stored tokens and authenticator secrets. Without it two-factor authentication and Slack are unavailable.
WORK_REQUIRE_EMAIL_VERIFICATIONSign-ups must confirm their address. Unset = on whenever SMTP is configured.
WORK_WEBAUTHN_RP_IDPasskeys are bound to a domain, by default the host of WORK_FRONTEND_URL. Set a parent domain to share passkeys across subdomains.
WORK_SSO_GOOGLE_CLIENT_ID / _CLIENT_SECRETSign in with Google. Redirect URI: <WORK_FRONTEND_URL>/api/v1/auth/sso/google/callback
WORK_SSO_GITHUB_CLIENT_ID / _CLIENT_SECRETSign in with GitHub (.../sso/github/callback).
WORK_SSO_MICROSOFT_CLIENT_ID / _CLIENT_SECRET / WORK_SSO_MICROSOFT_TENANTSign in with Microsoft. The tenant (id or domain) is required; common, organizations and consumers are refused.
WORK_SSO_SLACK_CLIENT_ID / _CLIENT_SECRET"Sign in with Slack" (a separate app from the notification app).
WORK_SSO_OIDC_ISSUER, WORK_SSO_OIDC_CLIENT_ID, WORK_SSO_OIDC_CLIENT_SECRETAny OpenID Connect provider (Keycloak, Okta, Auth0, ...). The endpoints come from <issuer>/.well-known/openid-configuration at startup; the ID token is verified.
WORK_SSO_OIDC_NAMELabel of the button (default "OpenID Connect").
WORK_SSO_OIDC_TRUST_EMAILThe provider does not send email_verified but you run it yourself.
WORK_SSO_OIDC_ALLOW_HTTPAllow an http:// issuer. Local testing only.
WORK_SAML_IDP_METADATA_FILEPath to the IdP's metadata XML. The IdP must sign the assertion. ACS URL <WORK_FRONTEND_URL>/api/v1/auth/saml/acs, SP metadata at .../auth/saml/metadata.
WORK_SAML_ENTITY_ID, WORK_SAML_SP_KEY_FILESP entity id (default: the metadata URL); optional PKCS#8 PEM to sign requests.

The first account created on an instance is its administrator. work-backend make-admin <e-mail> promotes another. Name, description, favicon and accent colour are changed in the admin panel (/admin).

E-mail ​

VariableMeaning
WORK_SMTP_HOST, WORK_SMTP_PORT (587), WORK_SMTP_USER, WORK_SMTP_PASS, WORK_SMTP_FROMOutgoing mail: password reset, confirmation, invitations, notifications, automations. Empty host disables mail.
WORK_SMTP_TLSstarttls (default), tls or none (only for a local test relay).

Files ​

VariableMeaning
WORK_STORAGElocal (default), s3 or azure. The bucket or container must be private and must exist.
WORK_UPLOAD_DIR, WORK_MAX_UPLOAD_BYTESLocal directory (default uploads) and the size limit (default 5 MiB).
WORK_S3_BUCKET, WORK_S3_REGION, WORK_S3_ENDPOINT, WORK_S3_ACCESS_KEY_ID, WORK_S3_SECRET_ACCESS_KEY, WORK_S3_ALLOW_HTTPS3 or any S3-compatible service. Without keys the environment's identity (instance role, web identity) is used.
WORK_AZURE_ACCOUNT, WORK_AZURE_CONTAINER, WORK_AZURE_ACCESS_KEY, WORK_AZURE_ENDPOINT, WORK_AZURE_ALLOW_HTTPAzure Blob Storage. Without a key a managed identity is used.

Integrations and automations ​

VariableDefaultMeaning
WORK_SLACK_CLIENT_ID / _CLIENT_SECRET-Slack notifications (needs WORK_ENCRYPTION_KEY).
WORK_WEBHOOK_ALLOW_PRIVATEfalseLet automations call internal addresses (SSRF protection off; local development only).
WORK_WEBHOOK_ALLOW_HTTPfalseAllow plain http:// webhook targets.
WORK_ALLOW_EXTERNAL_EMAILfalseLet automations mail addresses that are not project members.

One-off commands ​

CommandNeeds
work-backend openapinothing; prints the OpenAPI document
work-backend make-admin <e-mail>the usual configuration
work-backend migrate-upstream [--dry-run] [--schema NAME]WORK_MIGRATE_SOURCE_URL, see DATA-MIGRATION.md

Released under the MIT license.