Server Configuration
The backend loads its configuration with app-config. Every setting can come from a file or from an environment variable.
Configuration Sources
Section titled “Configuration Sources”The backend reads these files from backend/:
.app-config.jsonmaps each setting to an environment variable and gives its fallback. For example,portreadsPORTand falls back to50051..app-config.<environment>.yamloverrides settings for one environment..app-config.development.yamlsets up local development: the state directory, the dev Meilisearch key and the dev LiveKit keys..app-config.schema.yamldescribes every setting. app-config refuses to start the server when the loaded values don’t match it.
The generated backend configuration reference lists every setting.
Derived Settings
Section titled “Derived Settings”Some settings default to paths inside the state directory (STATE_DIR, or $XDG_STATE_HOME/mzchat when it is unset):
databaseUrldefaults tofile:<state dir>/backend.db.jwtSecretdefaults to the contents of<state dir>/jwt.secret. The backend generates that file on first start. Deleting it logs every user out.meiliDbPathdefaults to<state dir>/meilisearch.
Optional services stay off until they are configured:
- Search needs
MEILI_URL. - Voice calls need
LIVEKIT_API_KEYandLIVEKIT_API_SECRET. - S3 uploads need
S3_ENDPOINT,S3_ACCESS_KEYandS3_SECRET_KEY. Without S3, uploads go toUPLOADS_PATH. - The IRC bridge needs
IRC_ENABLE=true.
Example
Section titled “Example”export PORT=50059export STATE_DIR=/var/lib/mzchatexport CANONICAL_ADDRESS=https://chat.example.combun run src/main.ts serve