mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-03-25 22:17:25 +00:00
matrix-synapse: split client_reader routes into grouped regexes
The client_reader route bucket had collapsed into one long alternation, which made small worker-audit edits hard to review. Any endpoint change rewrote the whole regex and obscured whether we were changing routing policy or just maintaining the route list. Refactor the variable into grouped regex entries with comments instead. This keeps the current specialized-worker policy intact: nginx still renders the client_reader locations in the same block, and the routes still target the same upstream bucket. The goal here is to make future doc/code audits, additions, and removals mechanical and reviewable. This also matches MDAD's current worker model, where generic workers are not mixed with the specialized room/sync/client/federation reader routing buckets, so there is no need to derive this from the generic worker map. Refs: -b99a58719b/docs/workers.md (historical-apps)-b99a58719b/docs/workers.md (synapseappgeneric_worker)
This commit is contained in:
@@ -31,7 +31,31 @@ matrix_synapse_workers_sync_worker_client_server_endpoints:
|
||||
|
||||
# Client reader workers handle generic client-server endpoints that don't contain a roomid or sync
|
||||
matrix_synapse_workers_client_reader_client_server_endpoints:
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/(room_keys/|keys/(query|changes|claim|room_keys/)|login|register(/available|/m.login.registration_token/validity|)|password_policy|profile|rooms/.*/(joined_members|context/.*|members|state|hierarchy|relations/|event/|aliases|timestamp_to_event|redact|send|state/|(join|invite|leave|ban|unban|kick))|createRoom|publicRooms|account/(3pid|whoami|deactivate)|versions|voip/turnServer|joined_rooms|search|user/.*/filter(/|$)|directory/room/.*|capabilities)|^/_matrix/client/unstable/org.matrix.msc4143/rtc/transports$
|
||||
# Keep these as grouped regex entries instead of a single huge alternation.
|
||||
# This preserves the existing specialized-routing policy while making future audits
|
||||
# and endpoint-specific edits reviewable.
|
||||
|
||||
# Encryption and room-key APIs
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/room_keys/
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/(query|changes|claim|room_keys/)
|
||||
|
||||
# Login, registration, account, and profile APIs
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/login
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/register(/available|/m.login.registration_token/validity|)?
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/password_policy
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/profile
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/account/(3pid|whoami|deactivate)
|
||||
|
||||
# Room-scoped client APIs handled by client readers in the specialized-worker model
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(joined_members|context/.*|members|state|hierarchy|relations/|event/|aliases|timestamp_to_event|redact|send|state/|(join|invite|leave|ban|unban|kick))
|
||||
|
||||
# Generic client discovery and lookup APIs
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/(createRoom|publicRooms|versions|voip/turnServer|joined_rooms|search|directory/room/.*|capabilities)
|
||||
- ^/_matrix/client/(api/v1|r0|v3|unstable)/user/.*/filter(/|$)
|
||||
|
||||
# MatrixRTC transport discovery:
|
||||
# Ref: https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/matrixrtc.py#L30-L52
|
||||
- ^/_matrix/client/unstable/org.matrix.msc4143/rtc/transports$
|
||||
|
||||
# Federation reader workers handle generic federation endpoints that don't contain a roomid
|
||||
matrix_synapse_workers_federation_reader_federation_endpoints:
|
||||
|
||||
Reference in New Issue
Block a user