Language

Environment Variable Reference

Organised by "what happens if you leave this one out": the relative-path trap, why example values are refused by value, the price of the plaintext management channel, and the things that are deliberately not environment variables.

This page is organised by "what happens if you leave this one out" — because the real trouble with environment variables is not "not knowing the entry exists", but "giving it the wrong shape while the system obeys it literally". Every default is taken from a single source in the code (the configuration assembly in cmd/server/main.go), not copied from an example file.

The four you must settle first

MISI_HOST (default 127.0.0.1) and MISI_PORT (default 8086) decide which network card and which port the process binds to. Leave them out and it listens on the local machine only — right for a first install, wrong for a live site. MISI_TLS_MODE decides whether that port is plaintext or TLS; MISI_BASE_URL is the site's self-description of its public address (sitemap, canonical, hreflang and form callbacks all ask it).

What happens without MISI_BASE_URL: the site has no self-description of its public address. This entry and the "site address" setting in the console are two sources for the same fact, and when they disagree the public answers fork (for example the sitemap already uses the address from the environment, while the security health card still says "site address not configured"). In production set one place only: set MISI_BASE_URL.

Data and directories: the relative path is the most expensive default

MISI_DATABASE (default data/misi.db), MISI_UPLOADS (default data/uploads), MISI_PLUGINS (default plugins), MISI_THEMES, MISI_FILES (the private drive root), MISI_BACKUPS, MISI_ACME_CACHE.

A relative path means "relative to the process's current working directory". If the systemd unit omits WorkingDirectory, or the service is started some other way, the same binary goes looking for a different database file — the symptom is "the site suddenly reports itself as not installed" while the data is still exactly where it was. In production, write absolute paths for all of them. MISI_DATABASE_DRIVER defaults to sqlite, and MISI_DATABASE_POOL_SIZE defaults to 8.

Credentials and keys: copying an example value is the same as not configuring one

MISI_SECRET_KEY encrypts plugin credentials and model API keys. It refuses by value the example key in the released example file (a sufficient length is not enough), and it requires at least 16 bytes — so "copy one example line and it runs" is deliberately not a path: that value is public in the repository, and what it signs is the HMAC of the audit chain. When you rotate the key, keep the old one in MISI_SECRET_KEY_PREVIOUS, otherwise credentials already encrypted in the database cannot be read (and "cannot be read" presents as "configured but reported as unset" — two problems whose fixes are opposite).

MISI_ADMIN_USERNAME / MISI_ADMIN_PASSWORD create the administrator without the wizard: either both or neither, giving only one is refused; the password refuses example values as well. The rule is at least 8 characters, and it must contain uppercase, lowercase and digits. Leave both out and you go through the first-install wizard, with the credentials written to a file in the data directory that only the service account can read.

Exposed surfaces: every one of them has a price for opening it

MISI_IP_HTTP_ADDR is that plaintext management channel. It binds to 0.0.0.0:8086 by default and is open only during the first install, closing itself once initialisation completes. When it binds to a non-loopback address, startup records one warning that says plainly what it serves (only the management surface is reachable; the public site returns 403 there), what it costs (passwords and cookies travel in plaintext), and how to close it (set it to off; for local only, write 127.0.0.1:8086). MISI_ADMIN_IP_ALLOWLIST adds a source-address allowlist in front of the management surface.

MISI_PPROF_ADDR is the performance diagnostics port. Binding it outside the machine also requires MISI_PPROF_ALLOW_PUBLIC=1, otherwise it records one error and does not listen — that port has no authentication, and a heap dump contains passwords and sessions. An empty host (:6060) counts as "all interfaces", not as local.

MISI_TRUSTED_PROXIES is the only place that tells the system which upstream addresses' forwarding headers may be believed. Unset, the source address is taken from the real connection (the correct default); set wrongly, and you have let anyone forge their own source address.

Request guards: counting only, by default

MISI_REQUEST_GUARD_MODE defaults to detect (it counts but never blocks); you have to write enforce explicitly for it to block. The per-bucket budgets default to: front end 3000/minute, API 3000/minute, the login-and-install bucket 30/minute, scan signatures 60/minute, with a block duration of 15 minutes. MISI_REQUEST_GUARD_AUTH_MODE lets you move only the credentials bucket to enforce while the rest still follow the global setting — that is the door left open for "watch real traffic first, then decide". None of this is a WAF: there is no rule set, so do not accept it against that expectation.

Certificates

With MISI_TLS_MODE=acme you need MISI_ACME_EMAIL and MISI_ACME_ACCEPT_TOS=true — automatic issuance means agreeing to that certificate authority's terms of service, and a script should not press that button on the site owner's behalf; when it is missing the install script stops during argument checking. MISI_TLS_DOMAINS lists the domains, MISI_ACME_DIRECTORY points at a CA (the default is the production CA; using the other one for testing must be changed explicitly), and MISI_ACME_CACHE stores the account key and the domain private keys (a full-site archive takes them with it). If you already have certificates, use MISI_TLS_CERT / MISI_TLS_KEY and set the mode to static.

Behaviour switches and quotas

MISI_DEMO defaults to on (a new install seeds demo content once, so the console is not four blank pages); a real site must set MISI_DEMO=false, and "clear demo content" deletes only the rows it created. MISI_AUTO_ARCHIVE is off by default; once it is on, the number of retained copies is set by MISI_AUTO_ARCHIVE_KEEP (default 7). MISI_FILES_QUOTA_BYTES is the site-wide drive quota, default 10 GiB, and a non-positive integer is refused at registration time. MISI_OUTBOUND_ALLOW / MISI_OUTBOUND_ALLOW_HOSTS let the outbound client reach the addresses you name (loopback is refused by default, so local testing against a fake provider needs it opened explicitly). MISI_SCAFFOLD_ROOT decides whether the console's code-scaffolding commands are mounted at all — no root, none of them.

What is deliberately not an environment variable

Site time zone, model provider and API key, the three quota books, the list of translation target languages, reception mode, prompt append-requirements, human-handover thresholds — these are site configuration: you change them in the console, they go into the database, and they take effect per snapshot. Making them environment variables creates a second truth, and two truths always drift. When operations goes looking for a setting, ask first "is this a deployment fact or an operational decision": the former lives in env, the latter in the console.