Dendrite: Difference between revisions

From IM Wiki
Jump to navigation Jump to search
Matrix>Wanderer
m Made grammar more natural at end of the page.
Matrix>Admin
m Fixed typos and unnecessary capitalization of words
Line 1: Line 1:
{{Expansion|This article is lacking information, sources, and article documentation. It also includes odd wording and structure. Further research and improvement needed.}}
{{Expansion|This article is lacking information, sources, and article documentation. It also includes odd wording and structure. Further research and improvement needed.}}


'''Denrite''' is a second-generation open source Matrix [[Homeserver]] written in Go. It's an alternative to [[Synapse]]. Both of these homeservers implement 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.
'''Dendrite''' is a second-generation open source Matrix [[homeserver]] written in Go. It's an alternative to [[Synapse]]. Both of these homeservers implement 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 ==
== The disadvantages of Dendrite ==
Line 7: Line 7:
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 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]].
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 asynchronous language and in the way it works, it is better (and faster) to just run in [[Monolith Mode|monolith mode]] rater than [[Polylith Mode|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|Matrix Foundation]], one such example would be the [[Telodendria]] homeserver implementation in pure C.
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|Matrix Foundation]], one such example would be the [[Telodendria]] homeserver implementation in pure C.
Line 23: Line 23:
}}
}}


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


{{bc|
{{bc|
Line 35: Line 35:
}}
}}


Now, open {{ic|dendrite.yaml}} in your favourite editor such as Vim.
Now, open {{ic|dendrite.yaml}} in your favorite editor such as Vim.


=== Configuration ===
=== Configuration ===
Line 41: Line 41:
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.
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 {{ic|global.server_name}}. If you are not delegating, you should just use the domain name of the hosted server (such as localhost).
First and foremost you may want to set up [[delegation]] and use the domain name for the delegated domain in {{ic|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 {{ic|global.database}} should be set up to use a URL something like this:
Then we must set up the database. Dendrite recommends PostgreSQL, and by following the directions the {{ic|global.database}} should be set up to use a URL something like this:

Revision as of 16:01, 16 January 2024

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)

Dendrite is a second-generation open source Matrix homeserver written in Go. It's an alternative to Synapse. Both of these homeservers implement 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 asynchronous 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 favorite 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 this:

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.

Next, 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.

The 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.