Quick start
Installing a federation on a Linux machine with a domain, up to the first sign-in from the app.
The ready-made stack starts with one command: the federation server, PostgreSQL, Keycloak for sign-in, Caddy with a Let's Encrypt certificate, TURN and the call media server. Everything runs in Docker Compose on one machine.
Before you start, check the requirements: a domain pointing at the machine, and open ports.
Get the source
git clone https://github.com/serezhia/chat_playground.git comon
cd comon
git checkout v0.2.4 # the latest release, see the changelogThe server images are built from this source when you start the stack. Dart and Flutter are not needed on the host: the build runs inside Docker.
Prepare the state
python3 tools/mvp-stack.py prepare \
--host chat.example.org --port 443 --listen 0.0.0.0 --public-tls--hostis the federation's domain. It becomes the address of the federation and of its sign-in service, so choose it now: changing it later is a move.--public-tlsgets a Let's Encrypt certificate. It needs port 443 and a DNS record pointing at the machine. Without it, Caddy issues a certificate from its own authority, which apps from the stores do not trust.--listen 0.0.0.0listens on every interface (the default is local only).
The command creates the state directory .local/mvp/: configuration, random passwords and keys,
Compose files. Only its owner can read it. Do not publish it or put it in Git, and do not run
prepare again over an existing state: it refuses.
Start it
python3 tools/mvp-stack.py upup builds the images, creates the database, applies migrations, starts every service and checks
that the federation answers. The first build takes a few minutes. Afterwards, check the state with:
python3 tools/mvp-stack.py checkcheck asks /health, /ready, the federation document /.well-known/comon-federation and the
sign-in service.
Create people in Keycloak
Open https://chat.example.org/identity/admin/ and sign in as operator. The password is in
.local/mvp/stack.env on the KEYCLOAK_ADMIN_PASSWORD line; do not forward it or paste it into
logs.
- Choose the
comonrealm. - Create users and give them initial passwords (Users › Add user, then Credentials).
- Create a permanent Keycloak administrator and delete the temporary
operator, as the Keycloak documentation advises.
Self-registration and password reset in Keycloak stay off until you set them up.
Sign in from the app
Install Comon (apps), choose "Add federation" and enter chat.example.org.
The app checks the address and opens Keycloak's sign-in page in the system browser.
- On the first sign-in the app asks for a federation cloud password: it is needed to sign in on new devices (more).
- The first person to finish sign-up becomes the federation's owner. The owner sees the "Manage Federation" section in settings.
What next
- Set the federation's name, support contact and rules: federation settings.
- Test calls from outside your network: calls.
- Turn on sending video: below.
- Set up background notifications: push notifications.
- Build the web client: web client and links.
- Turn on voice transcription: voice transcription.
- Set up backups: backups.
Sending video
The ready-made stack builds the server without ffmpeg, so video can be watched but not sent. To
turn sending on, in .local/mvp/compose.yaml change the build of the federation service and add
an option:
federation:
build:
context: ./server-context
dockerfile: Dockerfile.video
command:
# … the other options unchanged
- --video-validator-config=/config/video-validator.jsonThe Dockerfile.video image has ffmpeg in an isolated sandbox and a ready
/config/video-validator.json. If push notifications are on, add the same line to
compose.push.yaml too: it repeats the whole server command. Then run up again.
Changing options
The server's options are the command of the federation service in .local/mvp/compose.yaml
(and in compose.push.yaml, if present). Add an option from the reference and
run up. On upgrades up adds to these files only what the new version needs; after an upgrade,
check that your options are still there.
Script commands
| Command | What it does |
|---|---|
prepare | Creates a new state. Refuses when the directory is not empty. |
up | Builds and starts the stack, applies migrations, updates the files for the current version, checks. |
check | Checks /health, /ready, the federation document and sign-in. |
stop | Stops the stack; data stays. |
config | Validates the Compose files. |
preflight | Checks the database before an upgrade (upgrading). |
backup, restore | Backups and restore. |
export-client | Writes client.json with public settings for your own app build. |
enable-push, admit-installation | Push notifications. |
enable-turn-tls | TURN over TLS. |
enable-transcriber | Voice transcription. |
enable-bridge, bridge-login | Bridges. |
Common options: --state <directory> (default .local/mvp) and --project <name> (the Docker
project, default comon-mvp). One comon-mvp project runs per machine: do not run two states at
once.