Docs

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

OptionDefaultMeaning
--host127.0.0.1The address to listen on.
--port8443The port.
--public-originhttps://localhost:<port>The HTTPS origin the apps reach. Link pages and notification pictures live under it.
--certificate, --private-keytest certificates from the sourceTLS certificate and key.
--behind-tls-proxyoffPlain HTTP behind a TLS proxy. No certificate is read; the client's address comes from X-Forwarded-For.
--development-lanoffThe 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

OptionDefaultMeaning
--federation-idlocalThe federation's ID (the federation's identity).
--data.local/comon-federationThe data directory: the Noise key and media.
--postgres-conninfo-filerequiredA file with one libpq connection string. Every store of the federation is a schema of that database.
--media-dir<data>/mediaWhere media bytes are kept. With s3, only this process's unfinished uploads.
--media-volumelocallocal, shared or s3. The first start binds the database to the volume or bucket; a start on another one fails (scaling).
--media-bucket-endpointrequired with s3The S3-compatible store (MinIO, for example), http(s)://host[:port].
--media-bucketrequired with s3The bucket. Only this federation uses it.
--media-bucket-regionus-east-1The bucket's region.
--media-bucket-credentials-filerequired with s3A JSON file {"access_key_id": "...", "secret_access_key": "..."}.
--modulesevery module of the build<name>,...: the modules with their own storage this process serves. The others answer "not supported".

Live updates and gateways

OptionDefaultMeaning
--livein-processnats publishes live updates to the federation's gateways; needs --media-volume=shared or s3.
--live-nats127.0.0.1:4222The NATS server, <host>:<port>. Must allow messages of 2.1 MB or more.
--live-nats-token-filerequired with natsA file with the NATS token.
--writersonemany: 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-interval30Seconds between checks of active profiles' feed heads.

Sign-in

OptionDefaultMeaning
--oidc-configdevelopment sign-inThe OIDC provider (sign-in).
--external-accountsno providerThe keys that encrypt connected accounts, the Google and Yandex OAuth clients, and connecting mail and calendar servers with a password (external accounts).
--identity-originthe public originThe development sign-in's origin, only without --oidc-config.
--web-clientnoneA web client address that may receive sign-in results. Repeatable. HTTPS, or HTTP on loopback.
--profile-password-policyrequiredrequired or optional (cloud password).

Calls, push, media

OptionDefaultMeaning
--call-configcalls without TURN or SFUSTUN, TURN and the SFU (calls).
--push-configpush offThe relay and keys (push).
--video-validator-configvideo is receive-onlyPaths to ffmpeg, ffprobe and the sandbox. Enables sending video and converting video stickers (sending video).
--mail-server, --mail-server-key-file, --mail-server-hostnamenoneThe 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-usernamenoneYour 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-filenoneDefault speech recognition (voice transcription).

Bots, bridges, stickers

OptionDefaultMeaning
--bot-configeveryone, up to 20 botsWho may create bots and how many (bots and bridges).
--bot-private-webhooksoffAllow bot webhooks to private addresses. Development only.
--no-demo-bot@demo_bot onTurns off the built-in demo bot.
--bridge-configbridges offNetworks to mirror, the bridge process, media budget and who may mirror.
--telegram-bot-token-fileimporting offThe token of your own Telegram bot, through which the federation imports sticker sets.

People and limits

OptionDefaultMeaning
--contacts-modedirectoryaddress-book, directory or hidden, until a mode is chosen in the federation settings (federation settings).
--maximum-messages-per-profile50000How many messages each profile keeps.
--media-quota-bytes50 GiBMedia of one profile.
--media-storage-bytes1 TiBMedia of the whole server.
--media-file-bytes1 GiBOne file, no more than the protocol limit.

The other limits are not configurable (limits).

OptionDefaultMeaning
--minimum-client-level29The oldest app level the server serves. Not below 29 (app versions).
--recommended-client-levelthe minimumThe level the app suggests updating to. Not below the minimum.
--client-update-urlnone<platform>=<https url>, once each for android, ios, macos, windows, linux, web.
--link-schemecomonThe scheme link pages open the app with (link pages).
--apple-app-idnone<team id>.<bundle id>, repeatable or comma-separated: an iOS or macOS app that opens the federation's links itself.
--android-appnone<package>:<certificate SHA-256>, repeatable or comma-separated: the same for Android.

Restore and reports

OptionDefaultMeaning
--restored-backupnone<name>: the stores were restored from this backup (restoring).
--accept-missing-mediaoffStart after a restore even if media files are missing.
--sentry-dsnnoneWhere the server sends error reports. Without it nothing is sent (operations).
--sentry-environmentprodThe environment in reports.
--sentry-traces-sample-rate0.1The share of traced requests, from 0 to 1.

Gateway

comon_federation_gateway accepts the apps' connections and passes them to the primary server (scaling).

OptionDefaultMeaning
--federation-idrequiredThe primary server's federation ID.
--noise-key-filerequiredA copy of the primary server's noise-server-key.
--host, --port127.0.0.1, 8443Address and port.
--certificate, --private-keyrequired without --behind-tls-proxyTLS certificate and key.
--behind-tls-proxyoffPlain HTTP behind a TLS proxy.
--livenatsThere is no other choice.
--live-nats, --live-nats-token-file, --live-reconcile-intervalas on the serverThe bus to the primary server.
--media-volumenoneshared 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-dirrequired with sharedThe primary server's shared media volume, mounted read-only.
--media-bucket-endpoint, --media-bucket, --media-bucket-region, --media-bucket-credentials-fileas on the server, required with s3The 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 upgrade

Migrations 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).

CommandWhat it does
listWho holds which role.
grant-owner --profile=<id>Make a profile the owner.
set-roles --profile=<id> --roles=<id>,...Assign roles.
incidentsBackground processing that has stopped.
redrive --target=<profile> --scope=<scope> --seq=<n>Restart one of them.
restoresRestores from backups.
release-outboundAfter a restore, send scheduled messages and bot webhooks again.
check-stickersRun 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>.

On this page