Matrix dendrite sliding sync proxy setup
from ludicolo@lemmy.ml to selfhosted@lemmy.world on 05 Feb 08:56
https://lemmy.ml/post/25631430

Hello everyone!

After searching and searching for a solution for my issue I think I may have stumbled upon something. I have been trying to get my matrix server up and running so that I can move on to the next project.

The issue I was running into was mobile element Client users could not join group calls. Mobile Element users need to use Element X, however Element X users cannot join my Dendrite server because I do not have sliding sync proxy set up.

I have heard that synapse has sliding sync already enabled but I have not been able to tackle synapse. Dendrite has just worked out of the box for me besides this one issue.

Originally when I was tackling the issue of sliding sync I had read somewhere that it was not compatible with dendrite. So that had crushed my hopes and dreams of using dendrite and I hadn’t looked back ever since… Until now.

I went to the official matrix sliding sync github page and wouldn’t you know it, there is a note that says:

NOTE: The proxy works fine with Dendrite and Synapse, but it doesn’t work well with Conduit due to spec violations in the state of a room in /sync. Running the proxy with Conduit will cause more expired connections (HTTP 400s) when room state changes, and log lines like WRN Accumulator.filterToNewTimelineEvents: seen the same event ID twice, ignoring.

So now I am trying to set this up with my current matrix dendrite docker image. However I don’t really understand how to follow this guide to make it talk to my pre existing containers.

Thank you all for your time!

My system software:

Ubuntu 20.04 with CasaOS and docker

The guide and documentation I followed for setting up matrix dendrite:

www.youtube.com/watch?v=TFDFR6EBG3k

wiki.opensourceisawesome.com/…/install-matrix-usi…

Official sliding sync documentation that I am trying to setup:

github.com/matrix-org/sliding-sync

Edit: I was able to get sliding sync to work using the compose file that samsy provided below! I then added the sliding sync container to the dendrite network and now I can sign in with element x and achildichat next with no “this server doesn’t support sliding sync” error!

However now these clients do not show my chats, the clients can create rooms however when backing out I still get an empty chat page for some reason.

Edit 2: I have gotten sliding sync working with dendrite! My compose url environment variable was pointing to my sliding sync url and not my matrix server url! Thank you everyone!!

#selfhosted

threaded - newest

jlh@lemmy.jlh.name on 05 Feb 10:35 next collapse

You should use synapse. Dendrite is not intended for self-hosted homeservers. You will have an easier time with calling/rtc with synapse as well.

Here is a good example of how to set up a home server, which was shown off by the devs at fosdem last weekend:

github.com/element-hq/element-docker-demo

Samsy@lemmy.ml on 05 Feb 13:52 collapse

I got exactly this config working. The compose file wasn’t the problem. I had to fiddle around with my caddy proxy setup. Do you want my settings? Or do you use something other than caddy?

ludicolo@lemmy.ml on 05 Feb 22:57 collapse

I am using cloudflare tunnels as of right now. I would be very appreciative if I could take a look at your settings!

Samsy@lemmy.ml on 06 Feb 04:52 collapse

services:
  sliding-sync:
    image: ghcr.io/matrix-org/sliding-sync:v0.99.1
    restart: unless-stopped
    ports:
      - 8881:8881
    environment:
      - SYNCV3_SECRET=yoursecret
      - SYNCV3_SERVER=https://newsub.domain.com/
      - SYNCV3_DB=user=syncv3 dbname=syncv3 sslmode=disable
        host=sliding-postgres password=secret
      - SYNCV3_BINDADDR=0.0.0.0:8881
    depends_on:
      - sliding-postgres
  sliding-postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_USER=syncv3
      - POSTGRES_PASSWORD=secret
      - POSTGRES_DB=syncv3
    volumes:
      - sliding_db_data:/var/lib/postgresql/data
volumes:
  sliding_db_data: null
networks: {}

This is my sliding compose file, and this is the Caddyfile part just for sliding:

newsub.domain.com {
        encode gzip
        header /.well-known/matrix/* Content-Type application/json
        header /.well-known/matrix/* Access-Control-Allow-Origin *
        respond /.well-known/matrix/server {"m.server":"newsub.domain.com:443"}
        respond /.well-known/matrix/client {"m.homeserver":{"base_url":"https://newsub.domain.com/"},"org.matrix.msc3575.proxy":{"url":"https://newsub.domain.com/sliding-sync"}}
        reverse_proxy /_matrix/
ludicolo@lemmy.ml on 06 Feb 08:34 collapse

I was able to get it working with this docker compose!! Thank you!

I can now sign inyo element x and schildi next! The only problem is none of my chats are showing up and when I create a new room it dissapears as soon as I back out into the chats tab.

Any idea on how to fix it? Do I need a seperate sub domain for the sliding sync proxy?

<img alt="" src="https://lemmy.ml/pictrs/image/b315e216-b679-4cb4-9209-ded89114855d.png">

<img alt="" src="https://lemmy.ml/pictrs/image/d856ad4b-396a-4ccc-bd8f-38d941bdd354.png">

Samsy@lemmy.ml on 06 Feb 12:17 collapse

Correct you need a separate subdomain.