Skip to content

Commit 3b27ce2

Browse files
authored
Merge pull request #1404 from aaronraimist/v3
Allow workers to serve new v3 APIs
2 parents 2e73dac + f8fe68b commit 3b27ce2

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

roles/matrix-nginx-proxy/templates/nginx/conf.d/matrix-synapse.conf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ server {
120120
{% endfor %}
121121
{% if matrix_nginx_proxy_synapse_presence_disabled %}
122122
# FIXME: keep in sync with synapse workers documentation manually
123-
location ~ ^/_matrix/client/(api/v1|r0|unstable)/presence/[^/]+/status {
123+
location ~ ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/[^/]+/status {
124124
proxy_pass http://frontend_proxy_upstream$request_uri;
125125
proxy_set_header Host $host;
126126
}

roles/matrix-synapse/files/workers-doc-to-yaml.awk

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ enable_parsing {
8686

8787
# FIXME: https://github.com/matrix-org/synapse/issues/7530
8888
# https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/456#issuecomment-719015911
89-
if (api_endpoint_regex == "^/_matrix/client/(r0|unstable)/auth/.*/fallback/web$") {
89+
if (api_endpoint_regex == "^/_matrix/client/(r0|v3|unstable)/auth/.*/fallback/web$") {
9090
worker_stanza_append(" # FIXME: possible bug with SSO and multiple generic workers\n")
9191
worker_stanza_append(" # see https://github.com/matrix-org/synapse/issues/7530\n")
9292
worker_stanza_append(" # " api_endpoint_regex linefeed)

roles/matrix-synapse/vars/workers.yml

+35-35
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ matrix_synapse_workers_generic_worker_endpoints:
55
# expressions:
66

77
# Sync requests
8-
- ^/_matrix/client/(v2_alpha|r0)/sync$
9-
- ^/_matrix/client/(api/v1|v2_alpha|r0)/events$
10-
- ^/_matrix/client/(api/v1|r0)/initialSync$
11-
- ^/_matrix/client/(api/v1|r0)/rooms/[^/]+/initialSync$
8+
- ^/_matrix/client/(v2_alpha|r0|v3)/sync$
9+
- ^/_matrix/client/(api/v1|v2_alpha|r0|v3)/events$
10+
- ^/_matrix/client/(api/v1|r0|v3)/initialSync$
11+
- ^/_matrix/client/(api/v1|r0|v3)/rooms/[^/]+/initialSync$
1212

1313
# Federation requests
1414
- ^/_matrix/federation/v1/event/
@@ -39,40 +39,40 @@ matrix_synapse_workers_generic_worker_endpoints:
3939
- ^/_matrix/federation/v1/send/
4040

4141
# Client API requests
42-
- ^/_matrix/client/(api/v1|r0|unstable)/createRoom$
43-
- ^/_matrix/client/(api/v1|r0|unstable)/publicRooms$
44-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/joined_members$
45-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/context/.*$
46-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/members$
47-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/state$
42+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/createRoom$
43+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/publicRooms$
44+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/joined_members$
45+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$
46+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$
47+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$
4848
- ^/_matrix/client/unstable/org.matrix.msc2946/rooms/.*/spaces$
4949
- ^/_matrix/client/unstable/org.matrix.msc2946/rooms/.*/hierarchy$
5050
- ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$
51-
- ^/_matrix/client/(api/v1|r0|unstable)/account/3pid$
52-
- ^/_matrix/client/(api/v1|r0|unstable)/devices$
53-
- ^/_matrix/client/(api/v1|r0|unstable)/keys/query$
54-
- ^/_matrix/client/(api/v1|r0|unstable)/keys/changes$
51+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/account/3pid$
52+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/devices$
53+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/query$
54+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/changes$
5555
- ^/_matrix/client/versions$
56-
- ^/_matrix/client/(api/v1|r0|unstable)/voip/turnServer$
57-
- ^/_matrix/client/(api/v1|r0|unstable)/joined_groups$
58-
- ^/_matrix/client/(api/v1|r0|unstable)/publicised_groups$
59-
- ^/_matrix/client/(api/v1|r0|unstable)/publicised_groups/
60-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/event/
61-
- ^/_matrix/client/(api/v1|r0|unstable)/joined_rooms$
62-
- ^/_matrix/client/(api/v1|r0|unstable)/search$
56+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$
57+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_groups$
58+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/publicised_groups$
59+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/publicised_groups/
60+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/
61+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$
62+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/search$
6363

6464
# Registration/login requests
65-
- ^/_matrix/client/(api/v1|r0|unstable)/login$
66-
- ^/_matrix/client/(r0|unstable)/register$
65+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/login$
66+
- ^/_matrix/client/(r0|v3|unstable)/register$
6767
- ^/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity$
6868

6969
# Event sending requests
70-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/redact
71-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/send
72-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/state/
73-
- ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)$
74-
- ^/_matrix/client/(api/v1|r0|unstable)/join/
75-
- ^/_matrix/client/(api/v1|r0|unstable)/profile/
70+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact
71+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send
72+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/
73+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)$
74+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/join/
75+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/
7676

7777

7878
# Additionally, the following REST endpoints can be handled for GET requests:
@@ -86,15 +86,15 @@ matrix_synapse_workers_generic_worker_endpoints:
8686
# for the room are in flight:
8787

8888
# FIXME: ADDITIONAL CONDITIONS REQUIRED: to be enabled manually
89-
# ^/_matrix/client/(api/v1|r0|unstable)/rooms/.*/messages$
89+
# ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/messages$
9090

9191
# Additionally, the following endpoints should be included if Synapse is configured
9292
# to use SSO (you only need to include the ones for whichever SSO provider you're
9393
# using):
9494

9595
# for all SSO providers
9696
# FIXME: ADDITIONAL CONDITIONS REQUIRED: to be enabled manually
97-
# ^/_matrix/client/(api/v1|r0|unstable)/login/sso/redirect
97+
# ^/_matrix/client/(api/v1|r0|v3|unstable)/login/sso/redirect
9898
# ^/_synapse/client/pick_idp$
9999
# ^/_synapse/client/pick_username
100100
# ^/_synapse/client/new_user_consent$
@@ -110,7 +110,7 @@ matrix_synapse_workers_generic_worker_endpoints:
110110

111111
# CAS requests.
112112
# FIXME: ADDITIONAL CONDITIONS REQUIRED: to be enabled manually
113-
# ^/_matrix/client/(api/v1|r0|unstable)/login/cas/ticket$
113+
# ^/_matrix/client/(api/v1|r0|v3|unstable)/login/cas/ticket$
114114

115115
# Ensure that all SSO logins go to a single process.
116116
# For multiple workers not handling the SSO endpoints properly, see
@@ -292,7 +292,7 @@ matrix_synapse_workers_user_dir_endpoints:
292292
# Handles searches in the user directory. It can handle REST endpoints matching
293293
# the following regular expressions:
294294

295-
- ^/_matrix/client/(api/v1|r0|unstable)/user_directory/search$
295+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/user_directory/search$
296296

297297
# When using this worker you must also set `update_user_directory: False` in the
298298
# shared configuration file to stop the main synapse running background
@@ -303,13 +303,13 @@ matrix_synapse_workers_frontend_proxy_endpoints:
303303
# load from the main synapse. It can handle REST endpoints matching the following
304304
# regular expressions:
305305

306-
- ^/_matrix/client/(api/v1|r0|unstable)/keys/upload
306+
- ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/upload
307307

308308
# If `use_presence` is False in the homeserver config, it can also handle REST
309309
# endpoints matching the following regular expressions:
310310

311311
# FIXME: ADDITIONAL CONDITIONS REQUIRED: to be enabled manually
312-
# ^/_matrix/client/(api/v1|r0|unstable)/presence/[^/]+/status
312+
# ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/[^/]+/status
313313

314314
# This "stub" presence handler will pass through `GET` request but make the
315315
# `PUT` effectively a no-op.

0 commit comments

Comments
 (0)