From 31df17d210cae2ce8a246a1ebad5c0f45f93b12b Mon Sep 17 00:00:00 2001 From: x4u <14617923-x4u@users.noreply.gitlab.com> Date: Sat, 22 Jul 2023 02:56:20 +0000 Subject: [PATCH 1/2] Create SYNCV3.md --- SYNCV3.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 SYNCV3.md diff --git a/SYNCV3.md b/SYNCV3.md new file mode 100644 index 00000000..882faaf9 --- /dev/null +++ b/SYNCV3.md @@ -0,0 +1,52 @@ +## 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! -- 2.45.2 From 95ab586037b0ba653b99e4e47a18282c63a83a44 Mon Sep 17 00:00:00 2001 From: x4u <14617923-x4u@users.noreply.gitlab.com> Date: Sat, 22 Jul 2023 02:57:41 +0000 Subject: [PATCH 2/2] Clean up typography --- SYNCV3.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/SYNCV3.md b/SYNCV3.md index 882faaf9..e8bb6c7f 100644 --- a/SYNCV3.md +++ b/SYNCV3.md @@ -10,8 +10,7 @@ For the homeserver to work with next-generation clients like Element X, you'll n $ 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 - +$ 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. @@ -26,8 +25,7 @@ $ SYNCV3_SECRET=$(cat .secret) SYNCV3_SERVER="https://your.server.name" SYNCV3_D "org.matrix.msc3575.proxy": { "url": "https://your.sliding.sync.proxy.name" } -} - +} ``` 5. Add configurations to your server along the following lines: @@ -45,8 +43,7 @@ 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! -- 2.45.2