Dendrite is a second-generation Matrix homeserver written in Go!

Dendrite Build Status Dendrite Dendrite Dev

Dendrite is a second-generation Matrix homeserver written in Go. It intends to provide an efficient, reliable and scalable alternative to Synapse:

  • 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 same test suite as Synapse as well as a brand new Go test suite.
  • Scalable: can run on multiple machines and eventually scale to massive homeserver deployments.

As of October 2020, Dendrite has now entered beta which means:

  • Dendrite is ready for early adopters. We recommend running in Monolith mode with a PostgreSQL database.
  • Dendrite has periodic semver releases. We intend to release new versions as we land significant features.
  • Dendrite supports database schema upgrades between releases. This means you should never lose your messages when upgrading Dendrite.
  • Breaking changes will not occur on minor releases. This means you can safely upgrade Dendrite without modifying your database or config file.

This does not mean:

  • Dendrite is bug-free. It has not yet been battle-tested in the real world and so will be error prone initially.
  • All of the CS/Federation APIs are implemented. We are tracking progress via a script called 'Are We Synapse Yet?'. In particular, presence and push notifications are entirely missing from Dendrite. See CHANGES.md for updates.
  • Dendrite is ready for massive homeserver deployments. You cannot shard each microservice, only run each one on a different machine.

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. In the future, we will be able to scale up to gigantic servers (equivalent to matrix.org) via polylith mode.

If you have further questions, please take a look at our FAQ or join us in:

Requirements

To build Dendrite, you will need Go 1.13 or later.

For a usable federating Dendrite deployment, you will also need:

  • A domain name (or subdomain)
  • 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:

  • 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

The Federation Tester can be used to verify your deployment.

Get started

If you wish to build a fully-federating Dendrite instance, see INSTALL.md. For running in Docker, see build/docker.

The following instructions are enough to get Dendrite started as a non-federating test deployment using self-signed certificates and SQLite databases:

$ git clone https://github.com/matrix-org/dendrite
$ cd dendrite
$ ./build.sh

# Generate a Matrix signing key for federation (required)
$ ./bin/generate-keys --private-key matrix_key.pem

# Generate a self-signed certificate (optional, but a valid TLS certificate is normally
# needed for Matrix federation/clients to work properly!)
$ ./bin/generate-keys --tls-cert server.crt --tls-key server.key

# 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.
$ cp dendrite-config.yaml dendrite.yaml

# Build and run the server:
$ ./bin/dendrite-monolith-server --tls-cert server.crt --tls-key server.key --config dendrite.yaml

Then point your favourite Matrix client at http://localhost:8008 or https://localhost:8448.

Progress

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 updates with CI. As of November 2020 we're at around 58% CS API coverage and 83% Federation coverage, though check CI for the latest numbers. In practice, this means you can communicate locally and via federation with Synapse servers such as matrix.org reasonably well. There's a long list of features that are not implemented, notably:

  • Push
  • Search and Context
  • User Directory
  • Presence
  • Guests

We are prioritising features that will benefit single-user homeservers first (e.g Receipts, E2E) rather than features that massive deployments may be interested in (User Directory, OpenID, Guests, Admin APIs, AS API). This means Dendrite supports amongst others:

  • Core room functionality (creating rooms, invites, auth rules)
  • Federation in rooms v1-v6
  • Backfilling locally and via federation
  • Accounts, Profiles and Devices
  • Published room lists
  • Typing
  • Media APIs
  • Redaction
  • Tagging
  • E2E keys and device lists
  • Receipts

Contributing

We would be grateful for any help on issues marked as 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.

For example, if the test Local device key changes get to remote servers was marked as failing, find the test file (e.g via grep or via the CI log output it's tests/50federation/40devicelists.pl ) then to run Sytest:

docker run --rm --name sytest
-v "/Users/kegan/github/sytest:/sytest"
-v "/Users/kegan/github/dendrite:/src"
-v "/Users/kegan/logs:/logs"
-v "/Users/kegan/go/:/gopath"
-e "POSTGRES=1" -e "DENDRITE_TRACE_HTTP=1"
matrixdotorg/sytest-dendrite:latest tests/50federation/40devicelists.pl

See sytest.md for the full description of these flags.

You can try running sytest outside of docker for faster runs, but the dependencies can be temperamental and we recommend using docker where possible.

cd sytest
export PERL5LIB=$HOME/lib/perl5
export PERL_MB_OPT=--install_base=$HOME
export PERL_MM_OPT=INSTALL_BASE=$HOME
./install-deps.pl

./run-tests.pl -I Dendrite::Monolith -d $PATH_TO_DENDRITE_BINARIES

Sometimes Sytest is testing the wrong thing or is flakey, so it will need to be patched. Ask on #dendrite-dev:matrix.org if you think this is the case for you and we'll be happy to help.

If you're new to the project, see CONTRIBUTING.md to get up to speed then look for Good First Issues. If you're familiar with the project, look for Help Wanted issues.

Hardware requirements

Dendrite in Monolith + SQLite works in a range of environments including iOS and in-browser via WASM.

For small homeserver installations joined on ~10s rooms on matrix.org with ~100s of users in those rooms, including some encrypted rooms:

  • Memory: uses around 100MB of RAM, with peaks at around 200MB.
  • Disk space: After a few months of usage, the database grew to around 2GB (in Monolith mode).
  • CPU: Brief spikes when processing events, typically idles at 1% CPU.

This means Dendrite should comfortably work on things like Raspberry Pis.

Owner
matrix.org
A new basis for open, interoperable, decentralised real-time communication
matrix.org
Comments
  • Implement Push Notifications

    Implement Push Notifications

    Added support for Push Notifications.according to Client-Server Push Notifications API, resolves #611.

    This PR adds a new "Pusher Database" based on the Pusher Model.

    Design thoughts 🤔

    1. Should Push Notification API be inside clientapi or in a separate component?
    2. Should Push Rules API be inside clientapi or in a separate component?
    3. What background service we should use to send /notify requests?

    What's left to do ❓

    • [x] Implement GET /_matrix/client/r0/pushers
    • [x] Implement POST /_matrix/client/r0/pushers/set
    • [x] Implement GET /_matrix/client/r0/notifications
    • [x] Implement push rules APIs - tracked in #481

    Tests 🔧

    tests/14account/01change-password.pl:

    • [x] Test 123 Pushers created with a different access token are deleted on password change...
    • [x] Test 124 Pushers created with a the same access token are not deleted on password change...

    tests/30rooms/60version_upgrade.pl:

    • [ ] Test 290 local user has push rules copied to upgraded room...
    • [ ] Test 291 remote user has push rules copied to upgraded room...

    tests/61push/01message-pushed.pl:

    • [x] Test 744 Test that a message is pushed...
    • [x] Test 745 Invites are pushed...
    • [x] Test 746 Rooms with names are correctly named in pushes...
    • [x] Test 747 Rooms with canonical alias are correctly named in pushed...
    • [x] Test 748 Rooms with many users are correctly pushed...
    • [x] Test 749 Don't get pushed for rooms you've muted...
    • [x] Test 750 Rejected events are not pushed...

    tests/61push/02add_rules.pl:

    • [x] Test 751 Can add global push rule for room...
    • [x] Test 752 Can add global push rule for sender...
    • [x] Test 753 Can add global push rule for content...
    • [x] Test 754 Can add global push rule for override...
    • [x] Test 755 Can add global push rule for underride...
    • [x] Test 756 Can add global push rule for content...
    • [x] Test 757 New rules appear before old rules by default...
    • [x] Test 758 Can add global push rule before an existing rule...
    • [x] Test 759 Can add global push rule after an existing rule...
    • [x] Test 760 Can delete a push rule...
    • [x] Test 761 Can disable a push rule...
    • [x] Test 762 Adding the same push rule twice is idempotent...

    tests/61push/03_unread_count.pl:

    • [x] Test 763 Messages that notify from another user increment notification_count...
    • [ ] Test 764 Messages that org.matrix.msc2625.mark_unread from another user increment org.matrix.msc2625.unread_count...
    • [x] Test 765 Messages that highlight from another user increment unread highlight count...

    tests/61push/05_set_actions.pl:

    • [x] Test 766 Can change the actions of default rules...
    • [x] Test 767 Changing the actions of an unknown default rule fails with 404..
    • [x] Test 768 Can change the actions of a user specified rule...
    • [x] Test 769 Changing the actions of an unknown rule fails with 404...

    tests/61push/06_get_pusher.pl:

    • [x] Test 770 Can fetch a user's pushers...

    tests/61push/06_push_rules_in_sync.pl:

    • [x] Test 771 Push rules come down in an initial /sync...
    • [x] Test 772 Adding a push rule wakes up an incremental /sync...
    • [x] Test 773 Disabling a push rule wakes up an incremental /sync...
    • [x] Test 774 Enabling a push rule wakes up an incremental /sync...
    • [x] Test 775 Setting actions for a push rule wakes up an incremental /sync...

    tests/61push/07_set_enabled.pl:

    • [x] Test 776 Can enable/disable default rules...
    • [x] Test 777 Enabling an unknown default rule fails with 404...

    tests/61push/08_rejected_pushers.pl:

    • [x] Test 778 Test that rejected pushers are removed....

    tests/61push/09_notifications_api.pl:

    • [x] Test 779 Notifications can be viewed with GET /notifications...

    tests/61push/80torture.pl:

    • [x] Test 780 Trying to add push rule with no scope fails with 400...
    • [x] Test 781 Trying to add push rule with invalid scope fails with 400...
    • [x] Test 782 Trying to add push rule with missing template fails with 400...
    • [x] Test 783 Trying to add push rule with missing rule_id fails with 400...
    • [x] Test 784 Trying to add push rule with empty rule_id fails with 400...
    • [x] Test 785 Trying to add push rule with invalid template fails with 400...
    • [x] Test 786 Trying to add push rule with rule_id with slashes fails with 400...
    • [x] Test 787 Trying to add push rule with override rule without conditions fails with 400...
    • [x] Test 788 Trying to add push rule with underride rule without conditions fails with 400...
    • [x] Test 789 Trying to add push rule with condition without kind fails with 400...
    • [x] Test 790 Trying to add push rule with content rule without pattern fails with 400...
    • [x] Test 791 Trying to add push rule with no actions fails with 400...
    • [x] Test 792 Trying to add push rule with invalid action fails with 400...
    • [x] Test 793 Trying to add push rule with invalid attr fails with 400...
    • [x] Test 794 Trying to add push rule with invalid value for enabled fails with 400...
    • [x] Test 795 Trying to get push rules with no trailing slash fails with 400...
    • [x] Test 796 Trying to get push rules with scope without trailing slash fails with 400...
    • [x] Test 797 Trying to get push rules with template without tailing slash fails with 400...
    • [x] Test 798 Trying to get push rules with unknown scope fails with 400...
    • [x] Test 799 Trying to get push rules with unknown template fails with 400...
    • [x] Test 800 Trying to get push rules with unknown attribute fails with 400...
    • [x] Test 801 Trying to get push rules with unknown rule_id fails with 404...

    Pull Request Checklist ✅

    • [x] I have added any new tests that need to pass to sytest-whitelist as specified in docs/sytest.md
    • [x] Pull request includes a sign off

    Signed-off-by: Dan Peleg <[email protected]>

  • Login method `m.login.sso` supporting GitHub and OpenID Connect

    Login method `m.login.sso` supporting GitHub and OpenID Connect

    This is a first happy case. There's nowhere for the user to select a localpart, which makes it a bit useless in production. If the identity provider doesn't provide a preferred_username in the userinfo endpoint, we fall back to the normal "highest numeric localpart" as used in registration. An overview of HTML pages that need to be served by Dendrite to cover Synapse usecases is in config/sso.py.

    A further improvement is to add a configuration option to limit who can use SSO. E.g. tying it to a custom domain using email and email_verified. After a cursory glance, I don't think Synapse has this ability, so it's a low priority.

    Tested with https://github.com/tommie/complement/commit/e08054c34b918c150bf893c6ef1989f327e77229

    Clarifications from comments

    • This PR only implements /login, not /register. Supporting user-interactive authentication requires serving HTML pages, a big (or potentially contentious) task. A previous PR implemented m.login.token as a prerequisite for this PR; supporting SSO is a multi-PR endeavour.
    • The configuration follows the code structure, and is not very user-friendly. The configuration format will evolve. It should have good defaults and make the simple cases terse.

    TODOs from comments

    • [x] Merge oauth2 and oidc config parameters when using oidc. Infer type from the existence of either.
    • [x] Implement default_provider.
    • [x] Don't validate claims_supported, since it's speced as a partial list, and completely pointless.
    • [x] Don't require the path to be non-empty in client-provided URLs.
    • [x] ~~Investigate if /register (or all) requests need to return some Unimplemented error code while user-interactive is unsupported. Cinny seems to never stop trying to register.~~

    Signed-off-by: Tommie Gannert <[email protected]>

  • Dendrite 0.6.2 fails to sync/federate

    Dendrite 0.6.2 fails to sync/federate

    Background information

    Dendrite version or git SHA: v0.6.2 (last known good was 0.6.0)
    Monolith or Polylith?: monolith
    SQLite3 or Postgres?: postgresql
    Running in Docker?: no
    go version: 1.16.13 and 1.18beta1
    Client used (if applicable): app.element.io, Hydrogen and Fluffychat
    

    Description

    Dendrite fails to receive new events for any room and fails to sync existing events to some clients as of version 0.6.2. In the clients, is shown by either frozen rooms and disconnection messages (element) or never finishing the initial sync (Fluffychat and Hydrogen). Rolling back to 0.6.0 resolves the issue.

    The following logs may be relevant:

    level=debug msg="Transaction: Failed to query room version for room!" error="context canceled" req.id= req.method=PUT req.path=/_matrix/federation/v1/send/<event 1>
    level=debug msg="Transaction: Failed to parse event JSON of event {\"auth_events\":[\"\",\"\",\"\"],\"content\":{\"algorithm\":\"m.megolm.v1.aes-sha2\",\"ciphertext\":\"\",\"device_id\":\"\",\"sender_key\":\"\",\"session_id\":\"\"},\"depth\":20,\"hashes\":{\"sha256\":\"h0hdF/eV9J+\"},\"origin\":\"matrix.org\",\"origin_server_ts\":,\"prev_events\":[\"$\"],\"prev_state\":[],\"room_id\":\"!:.\",\"sender\":\"@\",\"signatures\":{\"matrix.org\":{\"ed25519:a_RXGa\":\"h2jmBBg\"}},\"type\":\"m.room.encrypted\",\"unsigned\":{\"age_ts\":}}" error="gomatrixserverlib: unsupported room version ''" req.id=KzqABiJjMlbU req.method=PUT req.path=/_matrix/federation/v1/send/<event 1>
    http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
    

    NOTE: user data from the logs has been stripped.

  • end-to-end serverside implementation

    end-to-end serverside implementation

    1. /query
    2. /claim
    3. /upLoad
    4. /change and extension dock interface through kafka

    in order to keep fashioned to the latest implementation and what may come in the future , I add e2e module in a single server as encryptoapi , then it's painless to change implementation .

  • Sending E2EE messages dendrite -> matrix.org randomly fails to provide keys

    Sending E2EE messages dendrite -> matrix.org randomly fails to provide keys

    Background information

    • Dendrite version or git SHA: 5106cc807cf22a95420b24f6bfdd5c9ac8aa06de
    • Monolith or Polylith?: monolith
    • SQLite3 or Postgres?: postgres
    • Running in Docker?: no
    • go version: 1.17.6
    • Client used (if applicable): element android, fluffychat android, element desktop/web, nheko

    Description

    • What is the problem: "sometimes" the message recipient is not sent keys to decrypt
    • Who is affected: recipients of E2EE messages sent by dendrite users
    • How is this bug manifesting: recipient sees only a notice that a message could not be decrypted, but from the dendrite user's perspective, all the messages are readable in all clients
    • When did this first appear: not sure this has ever been reliable, sometimes it works fine for a long period, other times it randomly fails even though it's the same session sending the messages (and that client has not been restarted since the last time it was working)

    Steps to reproduce

    "Recently" I've noticed a new issue where clients will constantly spam the server with key related requests.
    I had reliability issues with sending E2EE messages before that, but now element in firefox and element desktop and nheko are constantly making key related requests in an endless loop. I don't know how to open a debug output in android but the CPU load on the phone from running Element is continuous and the network never idles when it's open.

    Describe how what happens differs from what you expected.

    E2EE should reliably work (and if it can't work there should be an error printed somewhere, not a silent failure that gives the impression the message was sent successfully).

  • Implements room tagging.

    Implements room tagging.

  • Unable to join room due to invalid signature verification

    Unable to join room due to invalid signature verification

    Problems with the certificate of the home server of one of the participants in the room, does not allow you to join the room!

    ERROR listing:

    time="2020-09-10T11:15:21.069528376Z" level=error msg="Failed to fetch key for server" func="github.com/matrix-org/gomatrixserverlib.(*DirectKeyFetcher).FetchKeys.func1" file="/root/go/pkg/mod/github.com/matrix-org/[email protected]/keyring.go:482" context=missing error="Get matrix://netwhood.online/_matrix/key/v2/server: x509: certificate is valid for matrix.netwhood.online, not netwhood.online" fetcher=DirectKeyFetcher

  • Monolithic server client API becomes unresponsive until restarted

    Monolithic server client API becomes unresponsive until restarted

    Background information

    • Dendrite version or git SHA: bca2790c678887232266c5726be79b80ddd9930b (post-dev v0.3.4 for https://github.com/matrix-org/dendrite/pull/1672)
    • Monolith or Polylith?: Monolith
    • SQLite3 or Postgres?: Postgres
    • Running in Docker?: Docker
    • go version: official images

    Description

    My Dendrite server has become unresponsive two times in a 24 hour period. This is noticed by Element web (app.element.io) saying the server is offline. The console logs show sync endpoints timing out.

    Restarting the docker container has caused the issue to resolve on both times.

    Nothing interesting found in logs that I could spot, errors mainly related to fetching of remote auth events. Will submit a log file privately that covers the second time with an issue.

    Dendrite is v0.3.4 post dev on hash bca2790c678887232266c5726be79b80ddd9930b (which is a part of https://github.com/matrix-org/dendrite/pull/1672). MSC2836 is enabled in settings.

    While the unresponsiveness continues, the logs do show activity in the federation API's.

  • State migration fails while rewriting snapshots after upgrading to v0.4.0

    State migration fails while rewriting snapshots after upgrading to v0.4.0

    Background information

    • Dendrite version or git SHA: v0.4.0
    • Monolith or Polylith?: Monolith
    • SQLite3 or Postgres?: Postgres
    • Running in Docker?: No
    • go version: 1.13.8

    Description

    I'm not sure how to interpret this error. Clearly the state storage upgrade did not complete, despite the log saying it did.

    Jul 15 22:54:01 dendrite-host dendrite-monolith-server[169231]: time="2021-07-16T03:54:01.897195913Z" level=warning msg="Rewriting snapshots 3000-3100 of 21375..." func="UpStateBlocksRefactor\n\t" file=" [2021041615092700_state_blocks_refactor.go:140]"
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: time="2021-07-16T03:54:02.667781275Z" level=warning msg="State storage upgrade complete" func="UpStateBlocksRefactor\n\t" file=" [2021041615092700_state_blocks_refactor.go:178]"
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: time="2021-07-16T03:54:02.679749124Z" level=panic msg="failed to connect to room server db" func="NewInternalAPI\n\t" file=" [roomserver.go:54]" error="RunDeltas: Failed run migration: ERROR 2021041615092700_state_blocks_refactor.go: failed to run Go migration function func(*sql.Tx) error: cannot xref null state block with snapshot 13936: sql: no rows in result set"
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: panic: (*logrus.Entry) (0x1261380,0xc00011e230)
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: goroutine 1 [running]:
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: github.com/sirupsen/logrus.(*Entry).log(0xc00011e1c0, 0x0, 0xc000198240, 0x23)
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]:         github.com/sirupsen/[email protected]/entry.go:259 +0x2e2
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: github.com/sirupsen/logrus.(*Entry).Log(0xc00011e1c0, 0x0, 0xc000271b88, 0x1, 0x1)
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]:         github.com/sirupsen/[email protected]/entry.go:285 +0x86
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: github.com/sirupsen/logrus.(*Entry).Logf(0xc00011e1c0, 0x0, 0x1297d7d, 0x23, 0x0, 0x0, 0x0)
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]:         github.com/sirupsen/[email protected]/entry.go:330 +0xe2
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: github.com/sirupsen/logrus.(*Entry).Panicf(...)
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]:         github.com/sirupsen/[email protected]/entry.go:368
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: github.com/matrix-org/dendrite/roomserver.NewInternalAPI(0xc00011c630, 0x146f860, 0xc0002a1cb0, 0xc0000c7580, 0x149ad00)
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]:         github.com/matrix-org/dendrite@/roomserver/roomserver.go:54 +0x237
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]: main.main()
    Jul 15 22:54:02 dendrite-host dendrite-monolith-server[169231]:         github.com/matrix-org/dendrite@/cmd/dendrite-monolith-server/main.go:86 +0x27c
    Jul 15 22:54:02 dendrite-host systemd[1]: dendrite.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    Jul 15 22:54:02 dendrite-host systemd[1]: dendrite.service: Failed with result 'exit-code'.
    

    Steps to reproduce

    • Upgrade Dendrite to v0.4.0
    • Dendrite attempts state migration on start
  • storage: state NIDs missing from the database (0 != 1)

    storage: state NIDs missing from the database (0 != 1)"

    Background information

    • Dendrite version or git SHA: Dendrite version 0.3.11+464b908b
    • Monolith or Polylith?: mono
    • SQLite3 or Postgres?: psql
    • Running in Docker?: no f way
    • go version: go version go1.14 linux/amd64

    Description

    After git pull nothing works anymore, POSTs get 500 internal server errors

    ERRO[2021-04-26T21:14:14.000494976Z] [github.com/matrix-org/dendrite/clientapi/routing/membership.go:385] checkMemberInRoom
             QueryCurrentState: could not query membership for user  error="storage: state NIDs missing from the database (0 != 1)" req.id=dlCjrEVVp0pJ req.method=POST req.path="/_matrix/client/r0/rooms/!yomrOFwgFXzmeMAbzX:matrix.org/read_markers" user_id="@grin:dendrite.grin.hu"
    
  • Handle trailing slashes at the end of paths

    Handle trailing slashes at the end of paths

    The HTTP routers Dendrite uses see /foo/bar and /foo/bar/ as two different routes. We'd ideally not want that, because Synapse and sytest sometimes add trailing slashes at the end of paths even though the specs doesn't use any.

    This might require a bit of research but should be quite straightforward.

  • Support listening on Unix socket

    Support listening on Unix socket

    Dendrite currently only supports listening on TCP ports, one for HTTP and one for HTTPS. Since it is already designed with reverse proxies in mind, it would be much more helpful to support listening on a Unix domain socket.

    Unix domain sockets are much simpler and efficient, particularly with regards to access control: configuring them to only be usable by desired users (e.g. nginx) allows connections to remain secure from other users on the server without requiring TLS or other complications like listening on the loopback interface does.

    This also has the obvious benefit of not having to keep track of arbitrary ports and addresses.

    When implementing this, it is vital that permissions for the socket are configurable: if anyone can access it, it is only marginally better than a loopback address.

  • Federated backfill broken for medium/large sized rooms since v0.10.8

    Federated backfill broken for medium/large sized rooms since v0.10.8

    Background information

    • Dendrite version or git SHA: v0.10.8
    • Monolith or Polylith?: Monolith
    • SQLite3 or Postgres?: Postgres
    • Running in Docker?: No
    • go version: 1.19.3
    • Client used (if applicable): Element 1.11.17

    Description

    • What is the problem: Newly joined remote rooms don't backfill the history, they just show "You can't see earlier messages". It seems to work for smaller rooms (less than 100 events) but I'm not sure if that's the cause.
    • Who is affected: Dendrite clients joining remote Synapse rooms
    • How is this bug manifesting: The room fails to backfill after first join, can't see history. Logs don't display erorrs or wanings, just "backfilled 0 events".
    • When did this first appear: Since v0.10.8, main as of today affected as well

    Steps to reproduce

    • Try to join a remote room hosted a Synapse homeserver (preferably with a longer than 100 message history)
    • After join, backfilling won't work. It'll just display "You can't see earlier messages" instead of showing the room history.

    When Dendrite attempts the backfill request, the remote Synapse server appears to log the backfill events in its log, but the Dendrite server just shows the following in the log:

    level=info msg="backfilled 0 events"

    In a smaller room, though, it works fine:

    level=info msg="backfilled 77 events"

    In v0.10.7 and v0.10.6 (versions I tested) everything works as expected, with the backfill appearing in the client and the Dendrite log showing the following, even with very large and old rooms:

    level=info msg="backfilled 100 events"

    In all said rooms there are only local users of said homeservers.

    I can't see any warnings or errors related to this so if there are other ways to debug the issue I'd be glad to provide more information.

    Notes

    I say "federated" because I only tried joining remote rooms, but I don't know if this also happens with local rooms.

  • "enable_outbound" goes out of control and pegs the CPU

    Background information

    • Dendrite version or git SHA: 0.10.8+76db8e90
    • Monolith or Polylith?: Monolith
    • SQLite3 or Postgres?: Postgres
    • Running in Docker?: No
    • go version: 1.19.3
    • Client used (if applicable): Element, Cinny

    Description

    • What is the problem: When presence.enable_outbound is enabled, my VPS goes under complete load, showing an "Average load" of 40. In htop, this means all cores are nothing but red bars. That is, if my SSH connection even survives...
    • Who is affected: My server (and my VPS' hypervisor, probably)
    • How is this bug manifesting: presence.enable_outbound: true shows a lot of m.presence events being sent. My guess: There is no rate limiting in place, meaning it will just infinitly barf them out - and, depending on how many servers/rooms are involved, this can easily become a lot. I am not in #matrix:matrix.org, but only in a few small channels - the Dendrite channels amongst them, IPFS, a few old Gitter ones and Telegram 1:1s.
    • When did this first appear: Today. I was moving between verrsions and upgraded from 0.10.6 to .7 and then .8. Once the bug manifested, I changed to building from main in hopes of this being fixed...Well, it's not.

    Steps to reproduce

    git clone ...
    git checkout tags/v0.10.8
    mv .git .gitx # Works around a broken build
    ./build.sh
    mv .gitx .git
    nano .../dendrite.yaml # set presence.enable_outbound: true
    systemctl start matrix-dendrite # I use a SystemD unit
    

    Ultimatively, I'd like to be able to see some performance stats logged to tell what exactly is making my server go absolutely crazy. For now, I have this disabled and it seems fine. But for better or for worse, I would like to enable it eventually.

    Thanks and kind regards, Ingwie

  • Initial Store & Forward Implementation

    Initial Store & Forward Implementation

    This adds store & forward relays into dendrite for p2p. A few things have changed:

    • new relay api serves new http endpoints for s&f federation
    • updated outbound federation queueing which will attempt to forward using s&f if appropriate
    • database entries to track s&f relays for other nodes
  • Signing in with uppercase username breaks device list updates

    Signing in with uppercase username breaks device list updates

    Background information

    • Dendrite version or git SHA: 0.10.8+ed497aa
    • Monolith or Polylith?: Monolith
    • SQLite3 or Postgres?: sqlite
    • Running in Docker?: yes
    • go version:
    • Client used (if applicable): famedlysdk, but shouldn't matter

    Description

    • What is the problem: If I sign in using Bob instead of bob, I get a device list update for @Bob:localhost instead of @bob:localhost with only one entry
    • Who is affected: Uhhh, everyone who uses an uppercase username to sign in?
    • How is this bug manifesting: Wrong device lists, that break e2ee
    • When did this first appear:

    Steps to reproduce

    • curl -fS -XPOST -d '{"username":"bob", "password":"Something", "inhibit_login":true, "auth": {"type":"m.login.dummy"}}' "http://$IP_ADDRESS/_matrix/client/r0/register"
    • then login using Bob as the identifier for the user
    • login succeeds
    • If you share an encrypted room with bob, you will get a device list update for @Bob:servername instead of @bob:servername

    I would expect device lists to always use the exact mxid instead of the casing from /login.

    Logs:

    # Normal login using "bob"
    
    Updating device keys for {@bob:famedlysdk.test: []}
    
    Response {@bob:famedlysdk.test: {pnv71Ijt: Instance of 'MatrixDeviceKeys'}}
    
    # Login using "Bob"
    
    [Matrix] Successfully connected as Bob with http://127.0.0.1
    
    Updating device keys for {@Bob:famedlysdk.test: []}
    
    Response {@Bob:famedlysdk.test: {2Cfqnc6M: Instance of 'MatrixDeviceKeys'}}
    

    Notice how the latter does not include the devices form "bob" and uses the wrong mxid in the response.

Avatar generation library for GO language
Avatar generation library for GO language

GOvatar GOvatar is an avatar generation library written in GO Install To install the library and command-line program, use the following: $ go get -u

Dec 29, 2022
Go package captcha implements generation and verification of image and audio CAPTCHAs.
Go package captcha implements generation and verification of image and audio CAPTCHAs.

Package captcha ⚠️ Warning: this captcha can be broken by advanced OCR captcha breaking algorithms. import "github.com/dchest/captcha" Package captch

Dec 30, 2022
Procedural texture generation package.
Procedural texture generation package.

Texture Generation A package for the procedural generation of textures. Based on the ideas contained in the Bryce 3D deep texture editor. More example

Sep 8, 2022
A Go-language library for the automatic generation of image collages.

CollageCreator is a Go-language library for the automatic generation of image collages.

Jan 29, 2022
Simple ANSi to PNG converter written in pure Go

AnsiGo Description AnsiGo is a simple ANSi to PNG converter written in pure Go. It converts files containing ANSi sequences (.ANS) into PNG images. Fo

May 17, 2022
Super fast static photo and video gallery generator (written in Go and HTML/CSS/native JS)

fastgallery Fast static photo and video gallery generator Super fast (written in Go and C, concurrent, uses fastest image/video libraries, 4-8 times f

Dec 4, 2022
Storage and image processing server written in Go
Storage and image processing server written in Go

Mort An S3-compatible image processing server written in Go. Still in active development. Features HTTP server Resize, Rotate, SmartCrop Convert (JPEG

Jan 7, 2023
An image resizing server written in Go
An image resizing server written in Go

picfit picfit is a reusable Go server to manipulate images (resize, thumbnail, etc.). It will act as a proxy on your storage engine and will be served

Dec 24, 2022
A path tracer written in Go.
A path tracer written in Go.

pt: a golang path tracer This is a CPU-only, unidirectional path tracing engine written in Go. It has lots of features and a simple API. Features Supp

Jan 5, 2023
Pixelizer is an efficient image pixelizer written in go

Pixelizer is an image pixelizer written in go. It allows very simple and intuitive CLI pixelization. Installation To install Pixelizer, you

Nov 10, 2022
Gorched is terminal based game written in Go inspired by "The Mother of all games" Scorched Earth

Gorched Gorched is terminal based game written in Go inspired by "The Mother of all games" Scorched Earth. How the game looks like depends on your ter

Dec 13, 2022
GameBoy Color emulator written in golang.
GameBoy Color emulator written in golang.

?? Worldwide 日本語のドキュメントはこちら GameBoyColor emulator written in golang. This emulator can play almost all ROMs work without problems and has many feature

Dec 26, 2022
Quake 2 Level Renderer written in Go and OpenGL
Quake 2 Level Renderer written in Go and OpenGL

go-quake2 Quake 2 Map Renderer written in Go and OpenGL. Features Loads any BSP file from Quake 2 Free roam around the environment Renders only a smal

Jan 4, 2023
Favicon service written in Go
Favicon service written in Go

favicon-service (besticon) This is a favicon service: Supports favicon.ico and apple-touch-icon.png Simple URL API Fallback icon generation Docker ima

Dec 17, 2022
A captcha library written in golang
A captcha library written in golang

gocaptcha 一个简单的Go语言实现的验证码 图片实例 简介 基于Golang实现的图片验证码生成库,可以实现随机字母个数,随机直线,随机噪点等。可以设置任意多字体,每个验证码随机选一种字体展示。 实例 使用: go get github.com/lifei6671/gocaptcha/

Dec 29, 2022
A simple API written in Go that creates badges in SVG format, based on the requested route.

A simple API written in Go that creates badges in SVG format, based on the requested route. Those graphics can be used to style README.md files, or to add tags to webpages.

Jul 2, 2021
ColorX is a library to determine the most prominent color in an image written in golang

ColorX is a library to determine the most prominent color in an image. ColorX doesn't use any sort of complex algorithms to calculate the prominent color, it simply loops over the image pixels and returns the color that occurs the most.

Nov 11, 2021
Pbm - Package ppm implements a Portable Bit Map (PBM) image decoder and encoder written in Go

Package pbm import "github.com/slashformotion/pbm" Package pbm implements a Portable Bit Map (PBM) image decoder and encoder. The supported image col

Jan 5, 2022
A simulation to see what's the result among normal people、rich-second generation、hard-working people

A simulation to see what's the result of competion among normal people、rich-second generation and hard-working people. 假设: 一个社会集体中有部分富二代,部分努力的人,多数是普通人

Feb 20, 2022
A multi-pass compiler written in Go comprised of scanner, recursive-descent parser, generation of AST, intermediate representation (ILOC), and code generation (Armv8).

GoLite Project - Go Huskies! This is a project conducted and led in the course MPCS 51300 Compilers at the University of Chicago. In a group of two, w

Jan 10, 2022