diff --git a/SYNCV3.md b/SYNCV3.md new file mode 100644 index 00000000..e8bb6c7f --- /dev/null +++ b/SYNCV3.md @@ -0,0 +1,49 @@ +## Deploy Notes for Sliding Sync (Go) + +For the homeserver to work with next-generation clients like Element X, you'll need to set up sliding sync ([MSC3575](https://github.com/matrix-org/matrix-spec-proposals/blob/kegan/sync-v3/proposals/3575-sync.md)). The following instructions supplement the official [set-up guide](https://github.com/matrix-org/sliding-sync/blob/main/docs/Landing.md) and [tutorial](https://en.miki.community/wiki/Matrix_Tutorial_7), and focus on the use case of Conduit: + +1. Install and [configure](https://www.postgresql.org/docs/16/postgres-user.html) PostgreSQL. This is only used for the sliding sync proxy, and does not conflict with the RocksDB used in Conduit. + +2. Install the Go language if not present. In the source tree of sliding-sync: + +```bash +$ createdb syncv3 +$ echo -n "$(openssl rand -hex 32)" > .secret # this MUST remain the same throughout the lifetime of the database created above. +$ go build ./cmd/syncv3 +$ SYNCV3_SECRET=$(cat .secret) SYNCV3_SERVER="https://your.server.name" SYNCV3_DB="user=$(whoami) dbname=syncv3 sslmode=disable" SYNCV3_BINDADDR=0.0.0.0:8008 ./syncv3 # the 'user' would be the owner of syncv3 +``` + +3. Select the name of your sliding sync proxy, such as `sync.your.server.name`, and create an `A` record for it with your DNS service. + +4. Create `/path/to/document/root/.well-known/matrix/client`, and paste in: + +```json +{ + "m.homeserver": { + "base_url": "https://your.server.name" + }, + "org.matrix.msc3575.proxy": { + "url": "https://your.sliding.sync.proxy.name" + } +} +``` + +5. Add configurations to your server along the following lines: + +```apache +# An Apache example using port 443 + + + +ServerName your.sliding.sync.proxy.name + +# Add TLS configurations here + +AllowEncodedSlashes NoDecode +ProxyPass /_matrix/ http://0.0.0.0:8008/_matrix/ nocanon +ProxyPassReverse /_matrix/ http://0.0.0.0:8008/_matrix/ + + +``` + +6. Note that the first sync with Element X can feel a bit slow. Be patient!