Web client and links
Comon in the browser on your domain, the /u/, /join/ and /call/ link pages, and opening links straight in the apps.
Web client
The web client is the same Comon app built for the browser. The ready-made stack serves it at
https://<domain>/app/ from the comon_web image (Caddy, port 8080 inside the network, no TLS).
It is built on a machine with the Flutter version from mise.toml (Flutter does not run inside Docker):
mise run build:web -- .local/mvp/web-context
python3 tools/mvp-stack.py upThe script runs flutter build web --wasm --release and puts the build into web-context/site;
up turns on the web service as soon as an index.html is there. Rebuild the web client on every
upgrade.
The server must know the web client's address, or sign-in in the browser will not return to the app:
--web-client=https://<domain>/app (the ready-made stack adds it).
Image settings
The variables live in web.env in the state. Values may contain only URL and base64url characters.
| Variable | Meaning |
|---|---|
COMON_WEB_BASE_PATH | The client's path, such as /app (/ by default). |
COMON_WEB_MODE | multi (default: people choose a federation) or single (only yours). |
COMON_WEB_HOME_FEDERATION | The default federation; required for single. |
COMON_WEB_ENVIRONMENT | dev, stage or prod (default). |
COMON_WEB_PUSH_RELAY_ORIGIN, COMON_WEB_PUSH_RELAY_AUDIENCE, COMON_WEB_PUSH_RELAY_PUBLIC_KEY, COMON_WEB_VAPID_PUBLIC_KEY | The relay for Web Push: address, audience, receipt key and VAPID public key. All four or none. |
COMON_WEB_SENTRY_DSN | Where error reports go; without it nothing is sent. |
At start the image writes comon-web.json from these variables. Your own file mounted at
/config/comon-web.json replaces the generated one entirely.
For the web client to get notifications, the relay needs a webpush section with its address and
VAPID key (push notifications). For calls from networks where
UDP is blocked you need TURN over TLS.
The image sends strict headers: isolation for wasm (Cross-Origin-Opener-Policy,
Cross-Origin-Embedder-Policy), a same-origin-only Content-Security-Policy,
Referrer-Policy: no-referrer. Files with a hash in their names are cached for a year, entry points
are not cached.
Check:
curl -sI https://<domain>/app/ | grep -i -E 'cache-control|cross-origin|content-security'
curl -s https://<domain>/app/comon-web.jsonLink pages
The server answers the links https://<domain>/u/<name>, /join/<code> and /call/<code> itself
(and the old /@name, /+code): it shows a script-free page in Russian or English, with a preview
and "open in the app", "open the web version" and "download" buttons. What opens on which device is
in Comon links.
| Option | What it changes |
|---|---|
--link-scheme | The scheme the page opens the app with. comon by default. |
--web-client | Where "open the web version" leads. |
--client-update-url | "Download" links per platform (app versions). |
Invite and call pages are hidden from search engines. One address may open at most 60 link pages a minute; past that pages come without a preview.
Opening links straight in the apps
On iPhone, Mac and Android the system can open a domain's links right in the app, without the browser. That takes two sides:
-
The server names the apps the domain trusts:
--apple-app-id=<team id>.<bundle id> # repeatable --android-app=<package>:<certificate SHA-256> # repeatableThe server then serves
/.well-known/apple-app-site-associationand/.well-known/assetlinks.json. Without the options both paths answer 404. -
The app must be built with this domain (Associated Domains on Apple, an App Links filter on Android). The official builds know only
comon.chat, so for your own domain this works only with your own build.
Without that, links still work: the federation's page opens, and its button passes the link to the
app through the comon:// scheme. On Windows and Linux it always works this way: the installer
registers the scheme.
Links inside messages the app opens itself on any domain: it checks the federation document at that address.
The federation's public pages
/rules, /child-safety and /delete-account show the rules, child safety standards and how to
delete an account, in the language from ?lang=ru|en or the browser's header. Their text comes from
the federation settings; app stores require such pages.