Skip to content

A /sync proxy for encrypted Matrix appservices

License

Notifications You must be signed in to change notification settings

mautrix/syncproxy

Repository files navigation

mautrix-syncproxy

A "proxy" microservice that runs Matrix C-S /sync on the server and pushes to-device events and other encryption-related things through the usual appservice transaction system.

This was designed for use with mautrix-wsproxy and the android-sms bridge to significantly reduce battery usage of the persistent foreground process (an idle websocket doesn't take much battery, but a HTTP request every 30 seconds does).

This partially implements MSC3202 and the to-device part of MSC2409.

Setup

You can download a prebuilt executable from the CI or GitHub releases. The executables are statically compiled and have no dependencies. Alternatively, you can build from source:

  1. Have Go 1.16 or higher installed.
  2. Clone the repository (git clone https://github.com/mautrix/syncproxy.git).
  3. Build with go build -o mautrix-syncproxy. The resulting executable will be in the current directory named mautrix-syncproxy.

Configuring is done via environment variables.

  • LISTEN_ADDRESS - The address where to listen.
  • HOMESERVER_URL - The address to Synapse. If using workers, it is sufficient to have access to the GET /sync and POST /user/{userId}/filter endpoints.
  • DATABASE_URL - Database for storing sync tokens. SQLite and Postgres are supported: sqlite:///mautrix-syncproxy.db or postgres://user:pass@host/db
  • SHARED_SECRET - The shared secret for adding new sync targets. You should generate a random string here, e.g. pwgen -snc 50 1
  • DEBUG - If set, debug logs will be enabled.

Since this is most useful with mautrix-wsproxy, the docker-compose instructions can be found in the mautrix-wsproxy readme.

Releases

No releases published

Sponsor this project

 

Packages

No packages published