2022-03-24 13:25:45 +01:00
# Dendrite
2022-05-11 16:39:36 +02:00
2022-03-24 13:25:45 +01:00
[![Build status ](https://github.com/matrix-org/dendrite/actions/workflows/dendrite.yml/badge.svg?event=push )](https://github.com/matrix-org/dendrite/actions/workflows/dendrite.yml) [![Dendrite ](https://img.shields.io/matrix/dendrite:matrix.org.svg?label=%23dendrite%3Amatrix.org&logo=matrix&server_fqdn=matrix.org )](https://matrix.to/#/#dendrite:matrix.org) [![Dendrite Dev ](https://img.shields.io/matrix/dendrite-dev:matrix.org.svg?label=%23dendrite-dev%3Amatrix.org&logo=matrix&server_fqdn=matrix.org )](https://matrix.to/#/#dendrite-dev:matrix.org)
2017-01-20 19:25:51 +01:00
2020-10-08 18:45:55 +02:00
Dendrite is a second-generation Matrix homeserver written in Go.
2021-06-07 11:10:29 +02:00
It intends to provide an **efficient** , **reliable** and **scalable** alternative to [Synapse ](https://github.com/matrix-org/synapse ):
2022-03-04 17:20:23 +01:00
- Efficient: A small memory footprint with better baseline performance than an out-of-the-box Synapse.
- Reliable: Implements the Matrix specification as written, using the
2022-04-24 20:26:20 +02:00
[same test suite ](https://github.com/matrix-org/sytest ) as Synapse as well as
a [brand new Go test suite ](https://github.com/matrix-org/complement ).
2022-03-04 17:20:23 +01:00
- Scalable: can run on multiple machines and eventually scale to massive homeserver deployments.
2020-10-08 18:45:55 +02:00
2022-09-20 15:10:30 +02:00
Dendrite is **beta** software, which means:
2022-03-04 17:20:23 +01:00
2020-10-08 18:45:55 +02:00
- Dendrite is ready for early adopters. We recommend running in Monolith mode with a PostgreSQL database.
2022-09-20 15:10:30 +02:00
- Dendrite has periodic releases. We intend to release new versions as we fix bugs and land significant features.
2020-10-08 18:45:55 +02:00
- Dendrite supports database schema upgrades between releases. This means you should never lose your messages when upgrading Dendrite.
This does not mean:
2022-03-04 17:20:23 +01:00
- Dendrite is bug-free. It has not yet been battle-tested in the real world and so will be error prone initially.
2022-08-05 11:44:08 +02:00
- Dendrite is feature-complete. There may be client or federation APIs that are not implemented.
2022-09-20 15:10:30 +02:00
- Dendrite is ready for massive homeserver deployments. There is no sharding of microservices (although it is possible to run them on separate machines) and there is no high-availability/clustering support.
2020-10-08 18:45:55 +02:00
Currently, we expect Dendrite to function well for small (10s/100s of users) homeserver deployments as well as P2P Matrix nodes in-browser or on mobile devices.
2022-09-20 15:10:30 +02:00
In the future, we will be able to scale up to gigantic servers (equivalent to `matrix.org` ) via polylith mode.
2017-01-20 19:25:51 +01:00
2020-12-07 11:20:19 +01:00
If you have further questions, please take a look at [our FAQ ](docs/FAQ.md ) or join us in:
2020-08-25 13:09:34 +02:00
2020-10-01 16:27:16 +02:00
- **[#dendrite:matrix.org](https://matrix.to/#/#dendrite:matrix.org)** - General chat about the Dendrite project, for users and server admins alike
- **[#dendrite-dev:matrix.org](https://matrix.to/#/#dendrite-dev:matrix.org)** - The place for developers, where all Dendrite development discussion happens
- **[#dendrite-alerts:matrix.org](https://matrix.to/#/#dendrite-alerts:matrix.org)** - Release notifications and important info, highly recommended for all Dendrite server admins
2020-10-08 18:45:55 +02:00
## Requirements
2022-08-05 11:44:08 +02:00
See the [Planning your Installation ](https://matrix-org.github.io/dendrite/installation/planning ) page for
more information on requirements.
2022-07-11 15:31:31 +02:00
To build Dendrite, you will need Go 1.18 or later.
2020-10-08 18:45:55 +02:00
For a usable federating Dendrite deployment, you will also need:
2022-03-04 17:20:23 +01:00
- A domain name (or subdomain)
2020-10-08 18:45:55 +02:00
- A valid TLS certificate issued by a trusted authority for that domain
- SRV records or a well-known file pointing to your deployment
Also recommended are:
2022-03-04 17:20:23 +01:00
2020-10-08 18:45:55 +02:00
- A PostgreSQL database engine, which will perform better than SQLite with many users and/or larger rooms
- A reverse proxy server, such as nginx, configured [like this sample ](https://github.com/matrix-org/dendrite/blob/master/docs/nginx/monolith-sample.conf )
The [Federation Tester ](https://federationtester.matrix.org ) can be used to verify your deployment.
## Get started
2022-05-13 12:52:42 +02:00
If you wish to build a fully-federating Dendrite instance, see [the Installation documentation ](https://matrix-org.github.io/dendrite/installation ). For running in Docker, see [build/docker ](build/docker ).
2020-07-14 13:58:00 +02:00
2020-10-08 18:45:55 +02:00
The following instructions are enough to get Dendrite started as a non-federating test deployment using self-signed certificates and SQLite databases:
2020-07-14 13:58:00 +02:00
```bash
$ git clone https://github.com/matrix-org/dendrite
$ cd dendrite
2020-10-26 23:09:13 +01:00
$ ./build.sh
2020-07-14 13:58:00 +02:00
2020-10-26 23:09:13 +01:00
# Generate a Matrix signing key for federation (required)
2020-11-18 16:11:48 +01:00
$ ./bin/generate-keys --private-key matrix_key.pem
2020-07-14 13:58:00 +02:00
2020-10-26 23:09:13 +01:00
# Generate a self-signed certificate (optional, but a valid TLS certificate is normally
# needed for Matrix federation/clients to work properly!)
2020-11-18 16:11:48 +01:00
$ ./bin/generate-keys --tls-cert server.crt --tls-key server.key
2020-10-26 23:09:13 +01:00
# Copy and modify the config file - you'll need to set a server name and paths to the keys
# at the very least, along with setting up the database connection strings.
2022-05-12 13:05:55 +02:00
$ cp dendrite-sample.monolith.yaml dendrite.yaml
2020-07-14 13:58:00 +02:00
2020-10-26 23:09:13 +01:00
# Build and run the server:
2020-11-18 16:11:48 +01:00
$ ./bin/dendrite-monolith-server --tls-cert server.crt --tls-key server.key --config dendrite.yaml
2022-04-29 10:00:28 +02:00
# Create an user account (add -admin for an admin user).
# Specify the localpart only, e.g. 'alice' for '@alice:domain.com'
2022-10-07 07:32:27 +02:00
$ ./bin/create-account --config dendrite.yaml --username alice
2020-07-14 13:58:00 +02:00
```
2020-10-26 23:09:13 +01:00
Then point your favourite Matrix client at `http://localhost:8008` or `https://localhost:8448` .
2020-07-14 13:58:00 +02:00
2022-08-05 11:44:08 +02:00
## Progress
2020-07-14 13:58:00 +02:00
We use a script called Are We Synapse Yet which checks Sytest compliance rates. Sytest is a black-box homeserver
test rig with around 900 tests. The script works out how many of these tests are passing on Dendrite and it
2022-08-12 13:55:45 +02:00
updates with CI. As of August 2022 we're at around 90% CS API coverage and 95% Federation coverage, though check
2020-07-14 13:58:00 +02:00
CI for the latest numbers. In practice, this means you can communicate locally and via federation with Synapse
2022-10-07 07:32:27 +02:00
servers such as matrix.org reasonably well, although there are still some missing features (like SSO and Third-party ID APIs).
2020-07-14 13:58:00 +02:00
We are prioritising features that will benefit single-user homeservers first (e.g Receipts, E2E) rather
2022-08-12 13:55:45 +02:00
than features that massive deployments may be interested in (OpenID, Guests, Admin APIs, AS API).
2020-07-14 13:58:00 +02:00
This means Dendrite supports amongst others:
2017-08-21 18:34:05 +02:00
2022-03-04 17:20:23 +01:00
- Core room functionality (creating rooms, invites, auth rules)
2022-05-30 12:11:21 +02:00
- Room versions 1 to 10 supported
2022-03-04 17:20:23 +01:00
- Backfilling locally and via federation
2022-05-30 12:11:21 +02:00
- Accounts, profiles and devices
2022-03-04 17:20:23 +01:00
- Published room lists
- Typing
- Media APIs
- Redaction
- Tagging
- Context
- E2E keys and device lists
- Receipts
- Push
- Guests
2022-04-06 16:23:09 +02:00
- User Directory
- Presence
2022-10-07 07:32:27 +02:00
- Fulltext search
2017-08-21 18:34:05 +02:00
2020-10-01 16:27:16 +02:00
## Contributing
2017-01-20 19:25:51 +01:00
2020-08-25 09:11:41 +02:00
We would be grateful for any help on issues marked as
[Are We Synapse Yet ](https://github.com/matrix-org/dendrite/labels/are-we-synapse-yet ). These issues
all have related Sytests which need to pass in order for the issue to be closed. Once you've written your
code, you can quickly run Sytest to ensure that the test names are now passing.
2022-08-05 11:44:08 +02:00
If you're new to the project, see our
[Contributing page ](https://matrix-org.github.io/dendrite/development/contributing ) to get up to speed, then
2020-08-25 09:11:41 +02:00
look for [Good First Issues ](https://github.com/matrix-org/dendrite/labels/good%20first%20issue ). If you're
familiar with the project, look for [Help Wanted ](https://github.com/matrix-org/dendrite/labels/help-wanted )
issues.