Configuration
The environment variables a self-hosted Mendloop reads, grouped by what they do.
Mendloop reads its settings from environment variables, or from .env (.env.production on a server set up with
the deploy script). Setup writes the required ones. mendloop doctor explains anything missing, without printing
a secret. Restart the processes after a change.
Required#
| Variable | Purpose |
|---|---|
DATABASE_URL |
Postgres (16, with pgvector) |
REDIS_URL |
Redis (7) |
MENDLOOP_BASE_URL |
The public address of your install, used in links and sign-in callbacks. Must be exactly https://<your domain>. |
MENDLOOP_SECRET_KEY |
Sessions and signing. Generated by setup. |
MENDLOOP_MASTER_KEY |
Wraps each organization's key; or use a KMS. Generated by setup. Back it up. |
The basics#
| Variable | Default | Purpose |
|---|---|---|
MENDLOOP_API_URL |
The API address the web app talks to | |
MENDLOOP_SIGNUP |
open |
open, invite-only or sso-only. The deploy script sets invite-only, so strangers can't sign up. |
SMTP_URL, MAIL_FROM |
Sign-in links and invites, through any SMTP provider. Password sign-in works without it. | |
GITHUB_OAUTH_CLIENT_ID, GITHUB_OAUTH_CLIENT_SECRET |
"Sign in with GitHub" (optional) | |
GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET |
"Sign in with Google" (optional) | |
MENDLOOP_LOG_LEVEL |
info |
debug, info or warning |
MENDLOOP_EDITION |
self_host |
self_host or cloud (billing and sign-up for a hosted service) |
MENDLOOP_LICENSE_KEY |
Unlocks the enterprise features in ee/ |
Storage and data#
| Variable | Default | Purpose |
|---|---|---|
STORAGE_URL |
local disk (file:///data in the image) |
Where reports, source maps and uploads go: file:///path or s3://bucket |
MENDLOOP_DATA_DIR |
./data |
Local working data. Read-only repository mirrors for root-cause analysis live in <dir>/mirrors and can be deleted at any time. |
MENDLOOP_EVENTS_RETENTION_DAYS |
30 |
Days raw events are kept. Issues keep their counts. |
Ingest#
| Variable | Default | Purpose |
|---|---|---|
MENDLOOP_INGEST_URL |
MENDLOOP_API_URL |
Public address of the ingest endpoints, used in DSNs and webhook URLs |
MENDLOOP_INGEST_RATE_LIMIT |
300 |
Events per second per project before ingest answers 429. Organizations can override it. |
MENDLOOP_EMBEDDINGS |
local |
Semantic dedupe with a small local model (downloads about 70 MB on first use), or off, which saves about 100 MB of memory |
MENDLOOP_SERVE_WORKER |
true |
mendloop serve also runs the worker as a child process unless this is false |
Models and cost#
| Variable | Default | Purpose |
|---|---|---|
LLM_GEMINI_API_KEY, LLM_OPENAI_API_KEY, LLM_DEEPSEEK_API_KEY, … |
Model keys for the whole install. Organizations can add their own, and theirs win. | |
MENDLOOP_LLM_TIMEOUT |
60 |
Seconds per model call |
MENDLOOP_LLM_NETWORK |
off switches off every model call on this server |
|
MENDLOOP_AUTO_RCA_MIN_SEVERITY |
P2 |
Issues below this severity don't start their own root-cause analysis. Repeats of the same crash are debounced for an hour, and each organization has a daily cap of 50. A person or an explicit workflow run is never gated; test mode is exempt. |
The model bill, not the server, is the cost that grows. Automatic root-cause analysis on every issue is the expensive part, so keep the severity gate unless you have a reason to lower it.
Fix verification#
| Variable | Default | Purpose |
|---|---|---|
SANDBOX_DRIVER |
ci-only |
ci-only (your CI verifies fixes), docker (a local sandbox) or gvisor |
The other SANDBOX_* settings are on the Sandbox page.
Integrations#
| Variable | Purpose |
|---|---|
SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, SLACK_SIGNING_SECRET |
Only for Add to Slack on your own server. Connect with tokens needs none of them. See Slack. |
MENDLOOP_PUBLIC_API_URL |
A public HTTPS address Slack can reach (defaults to MENDLOOP_API_URL) |
GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY, GITHUB_APP_WEBHOOK_SECRET, GITHUB_APP_SLUG |
One shared GitHub App for every organization. Set all four or none. See GitHub cloud mode. |
Monitoring Mendloop itself#
| Variable | Default | Purpose |
|---|---|---|
SENTRY_DSN |
Report the API's and worker's own errors to Sentry. Empty is off. | |
SENTRY_DSN_WEB |
The same for the web app. Baked in at build time, so rebuild after setting it. | |
SENTRY_ENVIRONMENT |
production |
|
SENTRY_TRACES_SAMPLE_RATE |
0 |
0.05 on a small server: full tracing costs CPU and Sentry quota |
BLARE_SINKS |
Chat webhooks for Mendloop's own errors, comma separated. Empty is off. | |
BLARE_ENV |
production |
Emergency stop#
| Variable | Purpose |
|---|---|
MENDLOOP_KILL_SWITCH |
1 stops every write and every run, whatever the database says. See Kill switches. |
Capacity#
These have sensible defaults. The production Compose file sets them per container (API, ingest, worker), so
change them there, not in .env.production, where a value would apply to all three processes at once.
| Variable | Default | Purpose |
|---|---|---|
MENDLOOP_DB_POOL_SIZE, MENDLOOP_DB_MAX_OVERFLOW |
5, 5 |
Database connections per process |
MENDLOOP_REDIS_MAX_CONNECTIONS |
32 |
Redis connections per process |
MENDLOOP_WORKERS, MENDLOOP_INGEST_WORKERS |
1, 1 |
Server processes for the API and ingest (2 for the API on two cores) |
MENDLOOP_LIMIT_CONCURRENCY |
0 |
Requests in flight before the API answers 503 instead of letting connections time out. 0 is no limit. Open live-update streams count. |
MENDLOOP_WORKFLOW_CONCURRENCY, MENDLOOP_JOB_CONCURRENCY, MENDLOOP_RCA_CONCURRENCY |
2, 2, 1 |
Background work at once in one worker |
MENDLOOP_EVENTS_MAXLEN, MENDLOOP_JOBS_MAXLEN |
50000, 20000 |
Redis stream caps, so a backlog can't fill Redis |
MENDLOOP_JOB_CLAIM_IDLE_SECONDS |
900 |
Seconds before another worker may take over an unacknowledged job. Keep it around 900 before running a second worker. |
.env.example in the repository lists every setting with its default.