From dafac35a0e80698078cd2c3757ff8fc323bd2bf0 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 14 Mar 2026 01:42:08 +0200 Subject: [PATCH] matrix-synapse: route stream-backed client endpoints explicitly and add `device_lists` stream writer support Some client API endpoints (e.g. keys/upload) are backed by Synapse stream writers and should not rely on broad worker regexes or route-order fallthrough for correctness. When explicit per-stream routing is missing, requests may be captured by generic, room, or client_reader workers, instead of: - going to the configured stream writer - or to `main` when that stream writer is not enabled This refactors synapse-reverse-proxy-companion's routing so that web-facing stream-backed endpoint families are handled explicitly and early, with deterministic writer-or-main fallback. Add first-class support for the missing `device_lists` stream writer, generalize the same routing model to `push_rules`, and remove stale broad-route ownership for device-list-sensitive endpoints. --- roles/custom/matrix-synapse/defaults/main.yml | 22 +++- .../matrix-synapse/tasks/validate_config.yml | 1 + ...ix-synapse-reverse-proxy-companion.conf.j2 | 115 +++++++++++------- roles/custom/matrix-synapse/vars/main.yml | 47 +++++-- 4 files changed, 129 insertions(+), 56 deletions(-) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index 1418e3b39..4deeec07f 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -934,6 +934,8 @@ matrix_synapse_workers_presets: stream_writer_account_data_stream_workers_count: 0 stream_writer_receipts_stream_workers_count: 0 stream_writer_presence_stream_workers_count: 0 + stream_writer_push_rules_stream_workers_count: 0 + stream_writer_device_lists_stream_workers_count: 0 one-of-each: room_workers_count: 0 sync_workers_count: 0 @@ -952,6 +954,8 @@ matrix_synapse_workers_presets: stream_writer_account_data_stream_workers_count: 1 stream_writer_receipts_stream_workers_count: 1 stream_writer_presence_stream_workers_count: 1 + stream_writer_push_rules_stream_workers_count: 0 + stream_writer_device_lists_stream_workers_count: 0 specialized-workers: room_workers_count: 1 sync_workers_count: 1 @@ -970,6 +974,8 @@ matrix_synapse_workers_presets: stream_writer_account_data_stream_workers_count: 1 stream_writer_receipts_stream_workers_count: 1 stream_writer_presence_stream_workers_count: 1 + stream_writer_push_rules_stream_workers_count: 0 + stream_writer_device_lists_stream_workers_count: 0 # Controls whether the matrix-synapse container exposes the various worker ports # (see `port` and `metrics_port` in `matrix_synapse_workers_enabled_list`) outside of the container. @@ -1064,6 +1070,14 @@ matrix_synapse_workers_stream_writer_receipts_stream_workers_count: "{{ matrix_s # The count of these workers can only be 0 or 1. matrix_synapse_workers_stream_writer_presence_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_presence_stream_workers_count'] }}" +# matrix_synapse_workers_stream_writer_push_rules_stream_workers_count controls how many stream writers that handle the `push_rules` stream to spawn. +# The count of these workers can only be 0 or 1. +matrix_synapse_workers_stream_writer_push_rules_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_push_rules_stream_workers_count'] }}" + +# matrix_synapse_workers_stream_writer_device_lists_stream_workers_count controls how many stream writers that handle the `device_lists` stream to spawn. +# More than 1 worker is also supported of this type. +matrix_synapse_workers_stream_writer_device_lists_stream_workers_count: "{{ matrix_synapse_workers_presets[matrix_synapse_workers_preset]['stream_writer_device_lists_stream_workers_count'] }}" + # A list of stream writer workers to enable. This list is built automatically based on other variables. # You're encouraged to enable/disable stream writer workers by setting `matrix_synapse_workers_stream_writer_*_stream_workers_count` variables, instead of adjusting this list manually. matrix_synapse_workers_stream_writers: | @@ -1081,6 +1095,10 @@ matrix_synapse_workers_stream_writers: | ([{'stream': 'receipts'}] * matrix_synapse_workers_stream_writer_receipts_stream_workers_count | int) + ([{'stream': 'presence'}] * matrix_synapse_workers_stream_writer_presence_stream_workers_count | int) + + + ([{'stream': 'push_rules'}] * matrix_synapse_workers_stream_writer_push_rules_stream_workers_count | int) + + + ([{'stream': 'device_lists'}] * matrix_synapse_workers_stream_writer_device_lists_stream_workers_count | int) }} matrix_synapse_workers_stream_writers_container_arguments: [] @@ -1998,9 +2016,11 @@ matrix_synapse_reverse_proxy_companion_synapse_stream_writer_to_device_stream_wo matrix_synapse_reverse_proxy_companion_synapse_stream_writer_account_data_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_account_data_stream_worker_client_server_endpoints }}" matrix_synapse_reverse_proxy_companion_synapse_stream_writer_receipts_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_receipts_stream_worker_client_server_endpoints }}" matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_presence_stream_worker_client_server_endpoints }}" +matrix_synapse_reverse_proxy_companion_synapse_stream_writer_push_rules_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_push_rules_stream_worker_client_server_endpoints }}" +matrix_synapse_reverse_proxy_companion_synapse_stream_writer_device_lists_stream_worker_client_server_locations: "{{ matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_endpoints }}" matrix_synapse_reverse_proxy_companion_synapse_media_repository_locations: "{{ matrix_synapse_workers_media_repository_endpoints | default([]) }}" matrix_synapse_reverse_proxy_companion_synapse_user_dir_locations: "{{ matrix_synapse_workers_user_dir_worker_client_server_endpoints | default([]) }}" -matrix_synapse_reverse_proxy_companion_client_server_main_override_locations_regex: ^/_matrix/client/(api/v1|r0|v3|unstable)/(account/3pid/|directory/list/room/|pushrules/|rooms/[^/]+/(forget|upgrade|report)|login/sso/redirect/|register) +matrix_synapse_reverse_proxy_companion_client_server_main_override_locations_regex: ^/_matrix/client/(api/v1|r0|v3|unstable)/(account/3pid/|directory/list/room/|rooms/[^/]+/(forget|upgrade|report)|login/sso/redirect/|register) matrix_synapse_reverse_proxy_companion_client_server_sso_override_locations_regex: ^(/_matrix/client/(api/v1|r0|v3|unstable)/login/sso/redirect|/_synapse/client/(pick_username|(new_user_consent|oidc/callback|pick_idp|sso_register)$)) # Related to MSC4108 (https://github.com/matrix-org/matrix-spec-proposals/pull/4108) matrix_synapse_reverse_proxy_companion_client_server_qr_code_login_locations_regex: ^(/_matrix/client/(unstable|v1)/org.matrix.msc4108/rendezvous|/_synapse/client/rendezvous)$ diff --git a/roles/custom/matrix-synapse/tasks/validate_config.yml b/roles/custom/matrix-synapse/tasks/validate_config.yml index 67d3c5836..6ad3205d1 100644 --- a/roles/custom/matrix-synapse/tasks/validate_config.yml +++ b/roles/custom/matrix-synapse/tasks/validate_config.yml @@ -149,6 +149,7 @@ - "matrix_synapse_workers_stream_writer_account_data_stream_workers_count" - "matrix_synapse_workers_stream_writer_receipts_stream_workers_count" - "matrix_synapse_workers_stream_writer_presence_stream_workers_count" + - "matrix_synapse_workers_stream_writer_push_rules_stream_workers_count" - name: Fail when mixing generic workers with new specialized workers ansible.builtin.fail: diff --git a/roles/custom/matrix-synapse/templates/reverse_proxy_companion/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 b/roles/custom/matrix-synapse/templates/reverse_proxy_companion/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 index 20af557ca..ce5ef6edc 100644 --- a/roles/custom/matrix-synapse/templates/reverse_proxy_companion/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 +++ b/roles/custom/matrix-synapse/templates/reverse_proxy_companion/nginx/conf.d/matrix-synapse-reverse-proxy-companion.conf.j2 @@ -10,8 +10,54 @@ {% set stream_writer_account_data_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'account_data') | list %} {% set stream_writer_receipts_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'receipts') | list %} {% set stream_writer_presence_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'presence') | list %} +{% set stream_writer_push_rules_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'push_rules') | list %} +{% set stream_writer_device_lists_stream_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'stream_writer') | selectattr('stream_writer_stream', 'equalto', 'device_lists') | list %} {% set media_repository_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'media_repository') | list %} {% set user_dir_workers = matrix_synapse_reverse_proxy_companion_synapse_workers_list | selectattr('type', 'equalto', 'user_dir') | list %} +{% set stream_writer_client_server_routes = [ + { + 'doc_url': 'https://matrix-org.github.io/synapse/latest/workers.html#the-typing-stream', + 'workers': stream_writer_typing_stream_workers, + 'locations': matrix_synapse_reverse_proxy_companion_synapse_stream_writer_typing_stream_worker_client_server_locations, + 'upstream': 'stream_writer_typing_stream_workers_upstream', + }, + { + 'doc_url': 'https://matrix-org.github.io/synapse/latest/workers.html#the-to_device-stream', + 'workers': stream_writer_to_device_stream_workers, + 'locations': matrix_synapse_reverse_proxy_companion_synapse_stream_writer_to_device_stream_worker_client_server_locations, + 'upstream': 'stream_writer_to_device_stream_workers_upstream', + }, + { + 'doc_url': 'https://matrix-org.github.io/synapse/latest/workers.html#the-account_data-stream', + 'workers': stream_writer_account_data_stream_workers, + 'locations': matrix_synapse_reverse_proxy_companion_synapse_stream_writer_account_data_stream_worker_client_server_locations, + 'upstream': 'stream_writer_account_data_stream_workers_upstream', + }, + { + 'doc_url': 'https://matrix-org.github.io/synapse/latest/workers.html#the-receipts-stream', + 'workers': stream_writer_receipts_stream_workers, + 'locations': matrix_synapse_reverse_proxy_companion_synapse_stream_writer_receipts_stream_worker_client_server_locations, + 'upstream': 'stream_writer_receipts_stream_workers_upstream', + }, + { + 'doc_url': 'https://matrix-org.github.io/synapse/latest/workers.html#the-presence-stream', + 'workers': stream_writer_presence_stream_workers, + 'locations': matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_worker_client_server_locations, + 'upstream': 'stream_writer_presence_stream_workers_upstream', + }, + { + 'doc_url': 'https://matrix-org.github.io/synapse/latest/workers.html#the-push_rules-stream', + 'workers': stream_writer_push_rules_stream_workers, + 'locations': matrix_synapse_reverse_proxy_companion_synapse_stream_writer_push_rules_stream_worker_client_server_locations, + 'upstream': 'stream_writer_push_rules_stream_workers_upstream', + }, + { + 'doc_url': 'https://matrix-org.github.io/synapse/latest/workers.html#the-device_lists-stream', + 'workers': stream_writer_device_lists_stream_workers, + 'locations': matrix_synapse_reverse_proxy_companion_synapse_stream_writer_device_lists_stream_worker_client_server_locations, + 'upstream': 'stream_writer_device_lists_stream_workers_upstream', + }, +] %} {% macro render_worker_upstream(name, workers, load_balance) %} upstream {{ name }} { @@ -41,6 +87,23 @@ {% endfor %} {% endmacro %} +{% macro render_locations_to_upstream_or_main(locations, workers, upstream_name) %} + {% for location in locations %} + location ~ {{ location }} { + {% if workers | length > 0 %} + proxy_pass http://{{ upstream_name }}$request_uri; + proxy_http_version 1.1; + proxy_set_header Connection ""; + {% else %} + {# Use the embedded DNS resolver in Docker containers to discover the service #} + resolver {{ matrix_synapse_reverse_proxy_companion_http_level_resolver }} valid=5s; + set $backend "{{ matrix_synapse_reverse_proxy_companion_client_api_addr }}"; + proxy_pass http://$backend; + {% endif %} + } + {% endfor %} +{% endmacro %} + {% macro render_locations_to_upstream_with_whoami_sync_worker_router(locations, upstream_name) %} {% for location in locations %} location ~ {{ location }} { @@ -100,25 +163,11 @@ map $request_uri $room_name { {{- render_worker_upstream('generic_workers_upstream', generic_workers, 'hash $http_x_forwarded_for;') }} {% endif %} - {% if stream_writer_typing_stream_workers | length > 0 %} - {{- render_worker_upstream('stream_writer_typing_stream_workers_upstream', stream_writer_typing_stream_workers, '') }} - {% endif %} - - {% if stream_writer_to_device_stream_workers | length > 0 %} - {{- render_worker_upstream('stream_writer_to_device_stream_workers_upstream', stream_writer_to_device_stream_workers, '') }} - {% endif %} - - {% if stream_writer_account_data_stream_workers | length > 0 %} - {{- render_worker_upstream('stream_writer_account_data_stream_workers_upstream', stream_writer_account_data_stream_workers, '') }} - {% endif %} - - {% if stream_writer_receipts_stream_workers | length > 0 %} - {{- render_worker_upstream('stream_writer_receipts_stream_workers_upstream', stream_writer_receipts_stream_workers, '') }} - {% endif %} - - {% if stream_writer_presence_stream_workers | length > 0 %} - {{- render_worker_upstream('stream_writer_presence_stream_workers_upstream', stream_writer_presence_stream_workers, '') }} + {% for stream_writer_client_server_route in stream_writer_client_server_routes %} + {% if stream_writer_client_server_route.workers | length > 0 %} + {{- render_worker_upstream(stream_writer_client_server_route.upstream, stream_writer_client_server_route.workers, '') }} {% endif %} + {% endfor %} {% if media_repository_workers | length > 0 %} {{- render_worker_upstream('media_repository_workers_upstream', media_repository_workers, 'least_conn;') }} @@ -186,36 +235,16 @@ server { {# Workers redirects BEGIN #} + {% for stream_writer_client_server_route in stream_writer_client_server_routes %} + # {{ stream_writer_client_server_route.doc_url }} + {{ render_locations_to_upstream_or_main(stream_writer_client_server_route.locations, stream_writer_client_server_route.workers, stream_writer_client_server_route.upstream) }} + {% endfor %} + {% if generic_workers | length > 0 %} # https://matrix-org.github.io/synapse/latest/workers.html#synapseappgeneric_worker {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_generic_worker_client_server_locations, 'generic_workers_upstream') }} {% endif %} - {% if stream_writer_typing_stream_workers | length > 0 %} - # https://matrix-org.github.io/synapse/latest/workers.html#the-typing-stream - {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_typing_stream_worker_client_server_locations, 'stream_writer_typing_stream_workers_upstream') }} - {% endif %} - - {% if stream_writer_to_device_stream_workers | length > 0 %} - # https://matrix-org.github.io/synapse/latest/workers.html#the-to_device-stream - {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_to_device_stream_worker_client_server_locations, 'stream_writer_to_device_stream_workers_upstream') }} - {% endif %} - - {% if stream_writer_account_data_stream_workers | length > 0 %} - # https://matrix-org.github.io/synapse/latest/workers.html#the-account_data-stream - {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_account_data_stream_worker_client_server_locations, 'stream_writer_account_data_stream_workers_upstream') }} - {% endif %} - - {% if stream_writer_receipts_stream_workers | length > 0 %} - # https://matrix-org.github.io/synapse/latest/workers.html#the-receipts-stream - {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_receipts_stream_worker_client_server_locations, 'stream_writer_receipts_stream_workers_upstream') }} - {% endif %} - - {% if stream_writer_presence_stream_workers | length > 0 %} - # https://matrix-org.github.io/synapse/latest/workers.html#the-presence-stream - {{ render_locations_to_upstream(matrix_synapse_reverse_proxy_companion_synapse_stream_writer_presence_stream_worker_client_server_locations, 'stream_writer_presence_stream_workers_upstream') }} - {% endif %} - {% if room_workers | length > 0 %} # room workers # https://tcpipuk.github.io/synapse/deployment/workers.html diff --git a/roles/custom/matrix-synapse/vars/main.yml b/roles/custom/matrix-synapse/vars/main.yml index 55943645b..6cf07e58b 100644 --- a/roles/custom/matrix-synapse/vars/main.yml +++ b/roles/custom/matrix-synapse/vars/main.yml @@ -31,7 +31,7 @@ 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|upload/|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|devices)|versions|voip/turnServer|joined_rooms|search|user/.*/filter(/|$)|directory/room/.*|capabilities) + - ^/_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|devices)|versions|voip/turnServer|joined_rooms|search|user/.*/filter(/|$)|directory/room/.*|capabilities) # Federation reader workers handle generic federation endpoints that don't contain a roomid matrix_synapse_workers_federation_reader_federation_endpoints: @@ -93,6 +93,20 @@ matrix_synapse_workers_stream_writer_receipts_stream_worker_client_server_endpoi matrix_synapse_workers_stream_writer_presence_stream_worker_client_server_endpoints: - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/ +# matrix_synapse_workers_stream_writer_push_rules_stream_worker_client_server_endpoints contains the endpoints serviced by the `push_rules` stream writer. +# See: https://matrix-org.github.io/synapse/latest/workers.html#the-push_rules-stream +matrix_synapse_workers_stream_writer_push_rules_stream_worker_client_server_endpoints: + - ^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/ + +# matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_endpoints contains the endpoints serviced by the `device_lists` stream writer. +# See: https://matrix-org.github.io/synapse/latest/workers.html#the-device_lists-stream +matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_endpoints: + - ^/_matrix/client/(r0|v3)/delete_devices$ + - ^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/|$) + - ^/_matrix/client/(r0|v3|unstable)/keys/upload(/|$) + - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$ + - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$ + # matrix_synapse_workers_user_dir_worker_client_server_endpoints contains the endpoints serviced by the `type = user_dir` (`app = generic_worker`) worker. # See: https://matrix-org.github.io/synapse/latest/workers.html#updating-the-user-directory matrix_synapse_workers_user_dir_worker_client_server_endpoints: @@ -101,11 +115,11 @@ matrix_synapse_workers_user_dir_worker_client_server_endpoints: # matrix_synapse_workers_known_stream_writer_stream_types contains the list of stream writer stream types that the playbook recognizes. # This is used for validation purposes. If adding support for a new type, besides adding it to this list, # don't forget to actually configure it where appropriate (see worker.yaml.j2`, the nginx proxy configuration, etc). -matrix_synapse_workers_known_stream_writer_stream_types: ['events', 'typing', 'to_device', 'account_data', 'receipts', 'presence'] +matrix_synapse_workers_known_stream_writer_stream_types: ['events', 'typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists'] # matrix_synapse_workers_webserving_stream_writer_types contains a list of stream writer types that serve web (client) requests. # Not all stream writers serve web requests. Some just perform background tasks. -matrix_synapse_workers_webserving_stream_writer_types: ['typing', 'to_device', 'account_data', 'receipts', 'presence'] +matrix_synapse_workers_webserving_stream_writer_types: ['typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists'] # matrix_synapse_workers_systemd_services_list contains a list of systemd services (one for each worker systemd service which serves web requests). # This list is built during runtime. @@ -190,7 +204,6 @@ matrix_synapse_workers_generic_worker_endpoints: - ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$ - ^/_matrix/client/(r0|v3|unstable)/account/3pid$ - ^/_matrix/client/(r0|v3|unstable)/account/whoami$ - - ^/_matrix/client/(r0|v3|unstable)/devices$ - ^/_matrix/client/versions$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/ @@ -208,9 +221,6 @@ matrix_synapse_workers_generic_worker_endpoints: - ^/_matrix/client/(r0|v3|unstable)/keys/changes$ - ^/_matrix/client/(r0|v3|unstable)/keys/claim$ - ^/_matrix/client/(r0|v3|unstable)/room_keys/ - - ^/_matrix/client/(r0|v3|unstable)/keys/upload$ - - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$ - - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$ # Registration/login requests - ^/_matrix/client/(api/v1|r0|v3|unstable)/login$ @@ -236,11 +246,14 @@ matrix_synapse_workers_generic_worker_endpoints: # Start of intentionally-ignored-endpoints # - # We ignore these below, because they're better sent to dedicated workers (various stream writers). - # If a stream writer is enabled, the endpoint should be routed to the stream writer, not to a generic worker. - # If a stream writer of a given type is not enabled, then a generic worker may process it. - # Because it's difficult to handle these individually based on which stream writer is enabled and which isn't, - # we just disable them here. + # We ignore these below, because they are now supposed to be owned by explicit + # early stream-backed routing in the reverse proxy. + # + # The intended behavior is: + # - if a stream writer is enabled, route to that stream writer + # - otherwise, route to Synapse `main` + # + # Broad generic-worker routing must not decide fallback behavior for these. # # # Account data requests # - ^/_matrix/client/(r0|v3|unstable)/.*/tags @@ -253,6 +266,16 @@ matrix_synapse_workers_generic_worker_endpoints: # # Presence requests # - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/ # + # # Push rules requests + # - ^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/ + # + # # Device lists requests + # - ^/_matrix/client/(r0|v3)/delete_devices$ + # - ^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/|$) + # - ^/_matrix/client/(r0|v3|unstable)/keys/upload(/|$) + # - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$ + # - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$ + # # # User directory search requests # - ^/_matrix/client/(r0|v3|unstable)/user_directory/search$ # End of intentionally-ignored-endpoints