Skip to content

Setup Matrix Synapse - #153

Draft
genebean wants to merge 1 commit into
voxpupuli:productionfrom
genebean:matrix
Draft

Setup Matrix Synapse#153
genebean wants to merge 1 commit into
voxpupuli:productionfrom
genebean:matrix

Conversation

@genebean

Copy link
Copy Markdown
Collaborator

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.

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>
Comment on lines +208 to +211
"${matrix_domain} media":
location => '~ ^/_matrix/media/',
proxy => 'http://synapse_media',
;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants