Dendrite

From IM Wiki
Revision as of 15:18, 16 January 2024 by Matrix>Ari (init)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

File:Tango-view-fullscreen.svgThis article or section needs expansion.File:Tango-view-fullscreen.svg

Reason: This article is lacking information, sources, and article documentation. It also includes odd wording and structure. Further research and improvement needed. (Discuss in Talk:Dendrite)

Denrite is a second-generation open source Matrix Homeserver written in Go. It's meant to be used as a replacement to now obsolete, yet still used Synapse, both of these homeserver implementations are implementing the client-server and server-server communication APIs to provide a decentralized network of homeservers that run Matrix. As of today it is not the most complete or stable implementation of this protocol, although it is a very minimal implementation that doesn't take a lot of resources to run and is perfect for small instances.

The disadvantages of Dendrite

As mentioned above, Dendrite is not the most stable or complete implementation of the Matrix protocol, even though they try their best, there is still a lot of work to be done regarding the stability and completeness of the implementation.

As of now, users tend to prefer Synapse for running their homeserver as although it is fairly slow and heavy, it can be made reasonable fast by using Synapse workers and multi-process communication between them, which Dendrite lacks as Go is a very asyncronous language and in the way it works, it is better (and faster) to just run in Monolith Mode rater than Polylith Mode.

Dendrite and Synapse, being the most popular server implementations, are still the de facto pieces of software to be run by Matrix users. Although some unofficial server implementations have risen from the Matrix project that are maintained by community members rather than the Matrix foundation, one such example would be the Telodendria homeserver implementation in pure C.

Setting up Dendrite

Dendrite setup is fairly simple, the true problem is the dendrite.yaml configuration file, but before that, we have to do a couple of pre-configuration changes:

Firstly, of course, we have to clone and compile Dendrite:

$ git clone https://github.com/matrix-org/dendrite
$ cd dendrite
$ go build -o bin/ ./cmd/...

Then we generate a Matrix Signing key used for Federation requests. We generate it by running the following command:

$ ./bin/generate-keys --private-key matrix_key.pem

Then we get to the real devil, editing the configuration, before that, though, we have to copy the example configuration file to the main, dendrite.yaml file:

$ cp dendrite-sample.yaml dendrite.yaml

Now, open dendrite.yaml in your favourite editor such as Vim.

Configuration

Configuration is the hard part where most people fail. This section will only cover the Dendrite configuration, web-server configuration (such as NginX) may be covered in latter sections.

First and foremost you may want to set up Delegation and use the domain name for the delegated domain in global.server_name. If you are not delegating, you should just use the domain name of the hosted server (such as localhost).

Then we must set up the database. Dendrite recommends Postgresql, and by following the directions the global.database should be set up to use a url something like

postgresql://username:password@hostname/dendrite

Of course you can also use a simpler database (such as SQLite), but that will ruin the performance and will cause issues down the road as your instance grows. A simpler database should only be used for single-user homeservers, otherwise it is suggested for you to use Postgresql.

Nextly, you should set up well_known_server_name and well_known_client_name to allow not only for incoming connections, but also delegation. Examples are shown in the configuration file.

Rest of the configuration is very clear and optional to set, everything else is determined by purely choice, configuration of the web-server and the resources available and allocated to Dendrite.