From cb932778b6ee305f7f2d912ee2a276a72cefc022 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Mon, 11 Mar 2024 01:34:51 +0300 Subject: [PATCH] synapse. Adding Sliding Sync Proxy. --- synapse/.env.dist | 12 ++++++++++++ synapse/docker-compose.yml | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/synapse/.env.dist b/synapse/.env.dist index f9af1fa..e0b986e 100644 --- a/synapse/.env.dist +++ b/synapse/.env.dist @@ -27,5 +27,17 @@ SYNAPSE_REPORT_STATS=no #UID=991 #GID=991 +# Sliding sync settings +SS_PROXY_IMAGE_TAG=latest + +SYNCV3_SERVER=https://skobk.in +SYNCV3_DB='user=matrix-ss dbname=matrix-ss sslmode=disable host=host.docker.internal password=database_password' +SYNCV3_SECRET=very_long_and_random_secret +SS_BIND_ADDR=0.0.0.0 +SS_BIND_PORT=8889 + +SS_EXT_ADR=127.0.0.1 +SS_EXT_PORT=8889 + LOG_MAX_SIZE=5m LOG_MAX_FILE=5 diff --git a/synapse/docker-compose.yml b/synapse/docker-compose.yml index 1da57d3..935d0bb 100644 --- a/synapse/docker-compose.yml +++ b/synapse/docker-compose.yml @@ -29,6 +29,28 @@ services: max-size: "${LOG_MAX_SIZE:-5m}" max-file: "${LOG_MAX_FILE:-5}" + sliding-sync: + # https://github.com/matrix-org/sliding-sync + image: "ghcr.io/matrix-org/sliding-sync:${SS_PROXY_IMAGE_TAG:-latest}" + depends_on: + - synapse + extra_hosts: + - 'host.docker.internal:host-gateway' + ports: + - "${SS_EXT_ADR:-127.0.0.1}:${SS_EXT_PORT:-8889}:${SS_BIND_PORT:-8889}" + environment: + # https://github.com/matrix-org/sliding-sync?tab=readme-ov-file#setup + - "SYNCV3_SERVER=${SYNCV3_SERVER}" + - "SYNCV3_DB=${SYNCV3_DB}" + - "SYNCV3_SECRET=${SYNCV3_SECRET}" + - "SYNCV3_BINDADDR=${SS_BIND_ADDR:-0.0.0.0}:${SS_BIND_PORT:-8889}" + restart: unless-stopped + logging: + driver: "json-file" + options: + max-size: "${LOG_MAX_SIZE:-5m}" + max-file: "${LOG_MAX_FILE:-5}" + networks: matrix: external: true