Setup Matrix Synapse - #153
Conversation
This sets up a role and various profiles to run a Synapse server via docker compose. The setup defines multiple workers so that it is scalable and accounts for heavier than standard federation traffic seeing as most accounts will originate on matrix.org instead of on this Matrix servier. Significant parts of this code were generated by Claude and via Google's Antigravity IDE. In Claude's web interface, the Sonnet 4.6 model was used. In Antigravity, the Gemini Pro 3.1 (High) model was used. Attribution to both is provided both in this text and via Co-authored-by entries in the commit. Co-authored-by: Claude <claude@anthropic.com> Co-authored-by: Antigravity <antigravity@google.com>
| "${matrix_domain} media": | ||
| location => '~ ^/_matrix/media/', | ||
| proxy => 'http://synapse_media', | ||
| ; |
There was a problem hiding this comment.
This is only handling the deprecated pre-1.11 media paths, you'll also need to proxy /_matrix/client/.*/media/ to the media worker for the authenticated paths.
There was a problem hiding this comment.
if we are not on pre-1.11 we could change it to: /_matrix/client/v1/media
| proxy_read_timeout => '60s', | ||
| ; | ||
| "${matrix_domain} client paths": | ||
| location => '~ ^/_matrix/client/.*/(user|rooms/.*/initialSync)', |
There was a problem hiding this comment.
Is this regex correct? /_matrix/client/.*/user and /_matrix/client/.*/rooms/.*/initialSync sounds like a strange selection.
The first part will only match queries handling user's sync filters, account data, room-specific account data, OpenID requests, and room tagging.
Whereas the second part will only match peeking into unjoined rooms - for summary purposes.
| "${matrix_domain} client sync": | ||
| location => '~ ^/_matrix/client/.*/sync$', | ||
| proxy => 'http://synapse_media', | ||
| proxy_read_timeout => '60s', |
There was a problem hiding this comment.
I'd be very careful with putting a time limit on the sync endpoint, since the timeout is up to the client to specify.
If a client were to call sync with ?timeout=61, and not receive anything that would constitute a sync during that period, then this setting would regularly cause their client to drop connection
This sets up a role and various profiles to run a Synapse server via docker compose. The setup defines multiple workers so that it is scalable and accounts for heavier than standard federation traffic seeing as most accounts will originate on matrix.org instead of on this Matrix servier.
Significant parts of this code were generated by Claude and via Google's Antigravity IDE. In Claude's web interface, the Sonnet 4.6 model was used. In Antigravity, the Gemini Pro 3.1 (High) model was used. Attribution to both is provided both in this text and via Co-authored-by entries in the commit.