Introducing Commune
Commune is a publicly accessible Matrix client. The project started with the motivation of making communities built on Matrix accessible from the open web and with the ability to be indexed by search engines. Our primary concern was the trend in more and more communities moving to proprietary platforms like Discord where information is impossible to access from the outside. Matrix, despite supporting publicly visible rooms at the protocol level, does not allow a straightforward way of implementing clients that can display chatroom data publicly.
Working on Commune has been made possible by funds from NLnet with financial support from the European Commission’s Next Generation Internet program. Learn more at the Commune NLnet project page.
Client
The Commune client is a lightweight and fast SSR-enabled app written in Svelte. It is designed to load and render room data quickly. Most of the focus so far has been making sure the client displays room data publicly, but the eventual goal is to make Commune a fully capable Matrix client. To this end, we’ve implemented authentication with MAS, with fallback support for homeservers that don’t support MAS yet.
For obvious reasons, the client does not support E2EE rooms - the’y’re not meant to be accessed publicly. We do plan to add support for encrypted DMs, but only after working out UX and security quirks.
Bridges
Commune works well with bridged rooms, and is able to make any bridged matrix room publicly accessible, as long as the permissions are set up correctly. This means Discord or IRC communities bridged to matrix can also be accessed from the client, indexed by Google and so on.
Appservice
The main component that powers the public access part of Commune is an appservice that acts as a proxy between the client and the matrix server. This appservice originally accessed the matrix synapse database directly and provided an API for the client, but this soon proved to be too fragile, hacky and unmaintainable given the constantly moving upstream changes. We then rewrote it as a proper appservice, first in Golang and eventually in Rust. This means that the appservice will work with any server implementation that supports the appservice API. Although we’ve tested it against Conduit, much of our production work runs on Synapse.
The appservice is quite stable, robust and has worked flawlessly on a sufficiently busy homeserver. It provides an API that matches the matrix client-to-server API and uses the appservice permissions to fetch room data.
The appservice implements some basic caching to return data faster to the client, and ensure we’re not unnecessarily fetching data from the matrix server.
Documentation
Both the Commune client and the appservice repositories include instructions on how to deploy and run them. They’re very straighforward to run - but we’re working on providing additional documentation.
What comes next
When this project started, the landscape of open web access was vastly different - and our mission was to fight back against closed information silos. With LLMs indexing the web as much (if not more) than regular search engines, the calculation changes quite a bit. There are pressing ethical considerations now - are the benefits from openly accessible chatroom data worth it, when that data can be freely scooped up by AI companies to train their models? It is probably fair to say that a large part of the FOSS community would much prefer closed communities that only real humans can access.
We still think there is much value in open communities and hope to continue to improving Commune to do our part in making information accessible to all.