Server options
Every startup option of the federation server and the gateway, and the migrate_database and federation_admin commands.
Options are written --name=value, flags --name. An unknown option, a flag given a value or
an option given none stops the server from starting: a typo never runs a federation on a default.
In the ready-made stack the server's command is in compose.yaml in the state (and repeated in
compose.push.yaml when push is on). Change it there and run mvp-stack.py up
(changing options).
Server
comon_federation_server
Network and addresses
| Option | Default | Meaning |
|---|---|---|
--host | 127.0.0.1 | The address to listen on. |
--port | 8443 | The port. |
--public-origin | https://localhost:<port> | The HTTPS origin the apps reach. Link pages and notification pictures live under it. |
--certificate, --private-key | test certificates from the source | TLS certificate and key. |
--behind-tls-proxy | off | Plain HTTP behind a TLS proxy. No certificate is read; the client's address comes from X-Forwarded-For. |
--development-lan | off | The development sign-in listens beyond loopback, and the public and identity origins may be localhost, a private IPv4 address or a .local name, so a phone on the same network can sign in. It lets anyone in, so it is for a local stand only. Not allowed with --oidc-config or --behind-tls-proxy. |
Identity and storage
| Option | Default | Meaning |
|---|---|---|
--federation-id | local | The federation's ID (the federation's identity). |
--data | .local/comon-federation | The data directory: the Noise key and media. |
--postgres-conninfo-file | required | A file with one libpq connection string. Every store of the federation is a schema of that database. |
--media-dir | <data>/media | Where media bytes are kept. With s3, only this process's unfinished uploads. |
--media-volume | local | local, shared or s3. The first start binds the database to the volume or bucket; a start on another one fails (scaling). |
--media-bucket-endpoint | required with s3 | The S3-compatible store (MinIO, for example), http(s)://host[:port]. |
--media-bucket | required with s3 | The bucket. Only this federation uses it. |
--media-bucket-region | us-east-1 | The bucket's region. |
--media-bucket-credentials-file | required with s3 | A JSON file {"access_key_id": "...", "secret_access_key": "..."}. |
--modules | every module of the build | <name>,...: the modules with their own storage this process serves. The others answer "not supported". |
Live updates and gateways
| Option | Default | Meaning |
|---|---|---|
--live | in-process | nats publishes live updates to the federation's gateways; needs --media-volume=shared or s3. |
--live-nats | 127.0.0.1:4222 | The NATS server, <host>:<port>. Must allow messages of 2.1 MB or more. |
--live-nats-token-file | required with nats | A file with the NATS token. |
--writers | one | many: the process serves the federation together with the others started so, on one database. Needs --live=nats and a copy of the federation's noise-server-key in --data; the first start from a backup uses one (scaling). |
--live-reconcile-interval | 30 | Seconds between checks of active profiles' feed heads. |
Sign-in
| Option | Default | Meaning |
|---|---|---|
--oidc-config | development sign-in | The OIDC provider (sign-in). |
--external-accounts | no provider | The keys that encrypt connected accounts, the Google and Yandex OAuth clients, and connecting mail and calendar servers with a password (external accounts). |
--identity-origin | the public origin | The development sign-in's origin, only without --oidc-config. |
--web-client | none | A web client address that may receive sign-in results. Repeatable. HTTPS, or HTTP on loopback. |
--profile-password-policy | required | required or optional (cloud password). |
Calls, push, media
| Option | Default | Meaning |
|---|---|---|
--call-config | calls without TURN or SFU | STUN, TURN and the SFU (calls). |
--push-config | push off | The relay and keys (push). |
--video-validator-config | video is receive-only | Paths to ffmpeg, ffprobe and the sandbox. Enables sending video and converting video stickers (sending video). |
--mail-server, --mail-server-key-file, --mail-server-hostname | none | The bundled mail server's management API, its key file and its public name (the one its certificate is for); all three or none. A hostname alone is ignored. |
--mail-noreply-address, --mail-noreply-smtp, --mail-noreply-password-file, --mail-noreply-username | none | Your own noreply@ sender for the federation's letters: the address, the SMTP server as smtps://host:465 (TLS) or smtp://host:587 (STARTTLS), the password file and the sign-in name (the address by default). The first three go together. Without them the bundled mail server sends from noreply@<domain>. |
--transcriber-url, --transcriber-model, --transcriber-key-file | none | Default speech recognition (voice transcription). |
Bots, bridges, stickers
| Option | Default | Meaning |
|---|---|---|
--bot-config | everyone, up to 20 bots | Who may create bots and how many (bots and bridges). |
--bot-private-webhooks | off | Allow bot webhooks to private addresses. Development only. |
--no-demo-bot | @demo_bot on | Turns off the built-in demo bot. |
--bridge-config | bridges off | Networks to mirror, the bridge process, media budget and who may mirror. |
--telegram-bot-token-file | importing off | The token of your own Telegram bot, through which the federation imports sticker sets. |
People and limits
| Option | Default | Meaning |
|---|---|---|
--contacts-mode | directory | address-book, directory or hidden, until a mode is chosen in the federation settings (federation settings). |
--maximum-messages-per-profile | 50000 | How many messages each profile keeps. |
--media-quota-bytes | 50 GiB | Media of one profile. |
--media-storage-bytes | 1 TiB | Media of the whole server. |
--media-file-bytes | 1 GiB | One file, no more than the protocol limit. |
The other limits are not configurable (limits).
Apps and links
| Option | Default | Meaning |
|---|---|---|
--minimum-client-level | 29 | The oldest app level the server serves. Not below 29 (app versions). |
--recommended-client-level | the minimum | The level the app suggests updating to. Not below the minimum. |
--client-update-url | none | <platform>=<https url>, once each for android, ios, macos, windows, linux, web. |
--link-scheme | comon | The scheme link pages open the app with (link pages). |
--apple-app-id | none | <team id>.<bundle id>, repeatable or comma-separated: an iOS or macOS app that opens the federation's links itself. |
--android-app | none | <package>:<certificate SHA-256>, repeatable or comma-separated: the same for Android. |
Restore and reports
| Option | Default | Meaning |
|---|---|---|
--restored-backup | none | <name>: the stores were restored from this backup (restoring). |
--accept-missing-media | off | Start after a restore even if media files are missing. |
--sentry-dsn | none | Where the server sends error reports. Without it nothing is sent (operations). |
--sentry-environment | prod | The environment in reports. |
--sentry-traces-sample-rate | 0.1 | The share of traced requests, from 0 to 1. |
Gateway
comon_federation_gateway accepts the apps' connections and passes them to the primary server
(scaling).
| Option | Default | Meaning |
|---|---|---|
--federation-id | required | The primary server's federation ID. |
--noise-key-file | required | A copy of the primary server's noise-server-key. |
--host, --port | 127.0.0.1, 8443 | Address and port. |
--certificate, --private-key | required without --behind-tls-proxy | TLS certificate and key. |
--behind-tls-proxy | off | Plain HTTP behind a TLS proxy. |
--live | nats | There is no other choice. |
--live-nats, --live-nats-token-file, --live-reconcile-interval | as on the server | The bus to the primary server. |
--media-volume | none | shared or s3: the gateway reads downloads from the primary server's media itself, after the server allows each piece. Without it the primary server reads every download. |
--media-dir | required with shared | The primary server's shared media volume, mounted read-only. |
--media-bucket-endpoint, --media-bucket, --media-bucket-region, --media-bucket-credentials-file | as on the server, required with s3 | The primary server's bucket. |
migrate_database
Creates and upgrades the database schema. The server never changes the schema itself and will not
start on a database older or newer than itself. The ready-made stack runs the command before the
server on every up.
migrate_database --postgres-conninfo-file=<file> # apply missing migrations
migrate_database --postgres-conninfo-file=<file> --check # only check; exit code 1 on a mismatch
migrate_database --postgres-conninfo-file=<file> --preflight # check the data before an upgradeMigrations are applied in one transaction under a lock, so two concurrent runs never apply a step twice.
federation_admin
Offline administration. The server must be stopped (offline commands).
| Command | What it does |
|---|---|
list | Who holds which role. |
grant-owner --profile=<id> | Make a profile the owner. |
set-roles --profile=<id> --roles=<id>,... | Assign roles. |
incidents | Background processing that has stopped. |
redrive --target=<profile> --scope=<scope> --seq=<n> | Restart one of them. |
restores | Restores from backups. |
release-outbound | After a restore, send scheduled messages and bot webhooks again. |
check-stickers | Run stored Lottie stickers through today's checks and list the ones they refuse. Changes nothing. |
Common options: --data=<data directory>, --postgres-conninfo-file=<file>,
--federation-id=<id>.