Matrix Docker Ansible eploy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

362 líneas
20 KiB

  1. # SPDX-FileCopyrightText: 2019 - 2024 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2022 Nikita Chernyi
  3. # SPDX-FileCopyrightText: 2023 Alexis Yushin
  4. # SPDX-FileCopyrightText: 2024 Charles Wright
  5. # SPDX-FileCopyrightText: 2024 Suguru Hirahara
  6. #
  7. # SPDX-License-Identifier: AGPL-3.0-or-later
  8. ---
  9. matrix_synapse_client_api_url_endpoint_public: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}://{{ matrix_server_fqn_matrix }}/_matrix/client/versions"
  10. matrix_synapse_federation_api_url_endpoint_public: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}://{{ matrix_server_fqn_matrix }}:{{ matrix_federation_public_port }}/_matrix/federation/v1/version"
  11. matrix_synapse_media_store_directory_name: "{{ matrix_synapse_media_store_path | basename }}"
  12. # Optionally: `false` to fully disable tls on outbound smtp
  13. matrix_synapse_email_smtp_enable_tls: true
  14. # Room workers handle any URL that contains a room ID, either through the client-server API or the federation API
  15. # - see https://tcpipuk.github.io/synapse/deployment/nginx.html#locationsconf
  16. matrix_synapse_workers_room_worker_client_server_endpoints:
  17. - ^/_matrix/client/.*?!(?<room>[A-Za-z0-9._=\-\/]+):[A-Za-z0-9.\-]+
  18. matrix_synapse_workers_room_worker_federation_endpoints:
  19. - ^/_matrix/federation/v[12]/(?:state_ids|get_missing_events)/(?:%21|!)(?<room>[A-Za-z0-9._=\-\/]+)(:|%3A)[A-Za-z0-9.\-]+
  20. # Sync workers handle /sync and the (now deprecated) related endpoints
  21. matrix_synapse_workers_sync_worker_client_server_endpoints:
  22. - ^/_matrix/client/(api/v1|r0|v3|unstable)/(sync|events|initialSync|rooms/[^/]+/initialSync)$
  23. # Native Sliding Sync (MSC3575) - supported on generic workers since Synapse 1.114
  24. - ^/_matrix/client/unstable/org.matrix.simplified_msc3575/sync$
  25. # Client reader workers handle generic client-server endpoints that don't contain a roomid or sync
  26. matrix_synapse_workers_client_reader_client_server_endpoints:
  27. # Keep these as grouped regex entries instead of a single huge alternation.
  28. # This preserves the existing specialized-routing policy while making future audits
  29. # and endpoint-specific edits reviewable.
  30. # Encryption and room-key APIs
  31. - ^/_matrix/client/(api/v1|r0|v3|unstable)/room_keys/
  32. - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/(query|changes|claim|room_keys/)
  33. # MSC3814 dehydrated-device APIs:
  34. # Ref: https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/devices.py#L256-L459
  35. - ^/_matrix/client/unstable/org.matrix.msc3814.v1/dehydrated_device$
  36. - ^/_matrix/client/unstable/org.matrix.msc3814.v1/dehydrated_device/[^/]*/events$
  37. # Login, registration, account, and profile APIs
  38. - ^/_matrix/client/(api/v1|r0|v3|unstable)/login
  39. - ^/_matrix/client/(api/v1|r0|v3|unstable)/register(/available|/m.login.registration_token/validity|)?
  40. - ^/_matrix/client/(api/v1|r0|v3|unstable)/password_policy
  41. - ^/_matrix/client/(api/v1|r0|v3|unstable)/profile
  42. - ^/_matrix/client/(api/v1|r0|v3|unstable)/account/(3pid|whoami|deactivate)
  43. # Room-scoped client APIs handled by client readers in the specialized-worker model
  44. - ^/_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))
  45. # Generic client discovery and lookup APIs
  46. - ^/_matrix/client/(api/v1|r0|v3|unstable)/(createRoom|publicRooms|versions|voip/turnServer|joined_rooms|search|directory/room/.*|capabilities)
  47. - ^/_matrix/client/(api/v1|r0|v3|unstable)/user/.*/filter(/|$)
  48. # MatrixRTC transport discovery:
  49. # Ref: https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/matrixrtc.py#L30-L52
  50. - ^/_matrix/client/unstable/org.matrix.msc4143/rtc/transports$
  51. # Federation reader workers handle generic federation endpoints that don't contain a roomid
  52. matrix_synapse_workers_federation_reader_federation_endpoints:
  53. - ^/_matrix/(federation/(v1|v2)|key/v2)/
  54. # A Synapse generic worker can handle both federation and client-server API endpoints.
  55. # We wish to split these, as we normally serve federation separately and don't want them mixed up.
  56. #
  57. # This is some ugly Ansible/Jinja2 hack (seen here: https://stackoverflow.com/a/47831492),
  58. # which takes a list of various strings and removes the ones NOT containing `/_matrix/client` anywhere in them.
  59. #
  60. # We intentionally don't do a diff between everything possible (`matrix_synapse_workers_generic_worker_endpoints`) and `matrix_synapse_workers_generic_worker_federation_endpoints`,
  61. # because `matrix_synapse_workers_generic_worker_endpoints` also contains things like `/_synapse/client/`, etc.
  62. # While /_synapse/client/ endpoints are somewhat client-server API-related, they're:
  63. # - neither part of the client-server API spec (and are thus, different)
  64. # - and they now include a meaningful Synapse-specific tree (`pick_idp`, `pick_username`, OIDC/SAML callbacks, rendezvous, etc.)
  65. # - some of these paths are auth-sensitive or deployment-sensitive, so we intentionally keep them out of the broad worker route model unless explicitly handled elsewhere
  66. #
  67. # Basically, we aim to cover most spec client APIs here. Skipping `/_synapse/client` is intentional and conservative.
  68. matrix_synapse_workers_generic_worker_client_server_endpoints: "{{ matrix_synapse_workers_generic_worker_endpoints | default([]) | map('regex_search', '.*/_matrix/client.*') | list | difference([none]) }}"
  69. # A Synapse generic worker can handle both federation and client-server API endpoints.
  70. # We wish to split these, as we normally serve federation separately and don't want them mixed up.
  71. #
  72. # This is some ugly Ansible/Jinja2 hack (seen here: https://stackoverflow.com/a/47831492),
  73. # which takes a list of various strings and removes the ones NOT containing `/_matrix/federation` or `/_matrix/key` anywhere in them.
  74. matrix_synapse_workers_generic_worker_federation_endpoints: "{{ matrix_synapse_workers_generic_worker_endpoints | default([]) | map('regex_search', matrix_synapse_workers_generic_worker_federation_endpoints_regex) | list | difference([none]) }}"
  75. # matrix_synapse_workers_generic_worker_federation_endpoints_regex contains the regex used in matrix_synapse_workers_generic_worker_federation_endpoints.
  76. # It's intentionally put in a separate variable, to avoid tripping ansible-lint's jinja[spacing] rule.
  77. matrix_synapse_workers_generic_worker_federation_endpoints_regex: '.*(/_matrix/federation|/_matrix/key).*'
  78. # matrix_synapse_workers_stream_writer_typing_stream_worker_client_server_endpoints contains the endpoints serviced by the `typing` stream writer.
  79. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-typing-stream
  80. matrix_synapse_workers_stream_writer_typing_stream_worker_client_server_endpoints:
  81. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing
  82. # matrix_synapse_workers_stream_writer_to_device_stream_worker_client_server_endpoints contains the endpoints serviced by the `to_device` stream writer.
  83. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-to_device-stream
  84. matrix_synapse_workers_stream_writer_to_device_stream_worker_client_server_endpoints:
  85. - ^/_matrix/client/(r0|v3|unstable)/sendToDevice/
  86. # matrix_synapse_workers_stream_writer_account_data_stream_worker_client_server_endpoints contains the endpoints serviced by the `account_data` stream writer.
  87. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-account_data-stream
  88. matrix_synapse_workers_stream_writer_account_data_stream_worker_client_server_endpoints:
  89. - ^/_matrix/client/(r0|v3|unstable)/.*/tags
  90. - ^/_matrix/client/(r0|v3|unstable)/.*/account_data
  91. # matrix_synapse_workers_stream_writer_receipts_stream_worker_client_server_endpoints contains the endpoints serviced by the `recepts` stream writer.
  92. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-receipts-stream
  93. matrix_synapse_workers_stream_writer_receipts_stream_worker_client_server_endpoints:
  94. - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt
  95. - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers
  96. # matrix_synapse_workers_stream_writer_presence_stream_worker_client_server_endpoints contains the endpoints serviced by the `presence` stream writer.
  97. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-presence-stream
  98. matrix_synapse_workers_stream_writer_presence_stream_worker_client_server_endpoints:
  99. - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/
  100. # matrix_synapse_workers_stream_writer_push_rules_stream_worker_client_server_endpoints contains the endpoints serviced by the `push_rules` stream writer.
  101. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-push_rules-stream
  102. matrix_synapse_workers_stream_writer_push_rules_stream_worker_client_server_endpoints:
  103. - ^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
  104. # matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_endpoints contains the endpoints serviced by the `device_lists` stream writer.
  105. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-device_lists-stream
  106. matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_endpoints:
  107. - ^/_matrix/client/(r0|v3)/delete_devices$
  108. - ^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/|$)
  109. - ^/_matrix/client/(r0|v3|unstable)/keys/upload(/|$)
  110. - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$
  111. - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$
  112. # matrix_synapse_workers_stream_writer_thread_subscriptions_stream_worker_client_server_endpoints contains the endpoints serviced by the `thread_subscriptions` stream writer.
  113. # Ref: https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/thread_subscriptions.py#L38-L247
  114. matrix_synapse_workers_stream_writer_thread_subscriptions_stream_worker_client_server_endpoints:
  115. - ^/_matrix/client/unstable/io.element.msc4306/rooms/.*/thread/.*/subscription$
  116. - ^/_matrix/client/unstable/io.element.msc4308/thread_subscriptions$
  117. # matrix_synapse_workers_user_dir_worker_client_server_endpoints contains the endpoints serviced by the `type = user_dir` (`app = generic_worker`) worker.
  118. # See: https://matrix-org.github.io/synapse/latest/workers.html#updating-the-user-directory
  119. matrix_synapse_workers_user_dir_worker_client_server_endpoints:
  120. - ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
  121. # matrix_synapse_workers_known_stream_writer_stream_types contains the list of stream writer stream types that the playbook recognizes.
  122. # This is used for validation purposes. If adding support for a new type, besides adding it to this list,
  123. # don't forget to actually configure it where appropriate (see worker.yaml.j2`, the nginx proxy configuration, etc).
  124. matrix_synapse_workers_known_stream_writer_stream_types: ['events', 'typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists', 'thread_subscriptions']
  125. # matrix_synapse_workers_webserving_stream_writer_types contains a list of stream writer types that serve web (client) requests.
  126. # Not all stream writers serve web requests. Some just perform background tasks.
  127. matrix_synapse_workers_webserving_stream_writer_types: ['typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists', 'thread_subscriptions']
  128. # matrix_synapse_workers_systemd_services_list contains a list of systemd services (one for each worker systemd service which serves web requests).
  129. # This list is built during runtime.
  130. # Not all workers serve web requests. Those that don't won't be injected here.
  131. matrix_synapse_webserving_workers_systemd_services_list: []
  132. # matrix_synapse_known_worker_types contains the list of known worker types.
  133. #
  134. # A worker type is different than a worker app (e.g. `generic_worker`).
  135. # For example, the `stream_writer` worker type is served by the `generic_worker` app, but is a separate type that we recognize.
  136. #
  137. # Some other types (`appservice` and `user_dir`) used to be Synapse worker apps, which got subsequently deprecated.
  138. # We still allow these types of workers and map them to the `generic_worker` app,
  139. # which is why we make sure they're part of the list below.
  140. # We use the `unique` filter because they're part of `matrix_synapse_workers_avail_list` too (for now; scheduled for removal).
  141. matrix_synapse_known_worker_types: |
  142. {{
  143. (
  144. matrix_synapse_workers_avail_list
  145. +
  146. ['stream_writer']
  147. +
  148. ['appservice']
  149. +
  150. ['user_dir']
  151. +
  152. ['background']
  153. ) | unique
  154. }}
  155. # matrix_synapse_known_instance_map_eligible_worker_types contains the list of worker types that are to be injected into `matrix_synapse_instance_map`.
  156. matrix_synapse_known_instance_map_eligible_worker_types:
  157. - stream_writer
  158. # The following section contains content that had previously been generated by a script (`workers-doc-to-yaml.awk`) processing https://github.com/element-hq/synapse/raw/master/docs/workers.md,
  159. # but is now maintained manually due to:
  160. # - the script being tripped up by the content and generating somewhat inaccurate definitions, which had to be fixed up manually.
  161. # - the script being complicated and unmaintainable
  162. ### workers:start
  163. matrix_synapse_workers_generic_worker_endpoints:
  164. # Sync requests
  165. - ^/_matrix/client/(r0|v3)/sync$
  166. - ^/_matrix/client/(api/v1|r0|v3)/events$
  167. - ^/_matrix/client/(api/v1|r0|v3)/initialSync$
  168. - ^/_matrix/client/(api/v1|r0|v3)/rooms/[^/]+/initialSync$
  169. # Native Sliding Sync (MSC3575) - supported since Synapse 1.114
  170. - ^/_matrix/client/unstable/org.matrix.simplified_msc3575/sync$
  171. # Federation requests
  172. - ^/_matrix/federation/v1/event/
  173. - ^/_matrix/federation/v1/state/
  174. - ^/_matrix/federation/v1/state_ids/
  175. - ^/_matrix/federation/v1/backfill/
  176. - ^/_matrix/federation/v1/get_missing_events/
  177. - ^/_matrix/federation/v1/publicRooms
  178. - ^/_matrix/federation/v1/query/
  179. - ^/_matrix/federation/v1/make_join/
  180. - ^/_matrix/federation/v1/make_leave/
  181. - ^/_matrix/federation/(v1|v2)/send_join/
  182. - ^/_matrix/federation/(v1|v2)/send_leave/
  183. - ^/_matrix/federation/(v1|v2)/invite/
  184. - ^/_matrix/federation/v1/event_auth/
  185. - ^/_matrix/federation/v1/timestamp_to_event/
  186. - ^/_matrix/federation/v1/exchange_third_party_invite/
  187. - ^/_matrix/federation/v1/user/devices/
  188. - ^/_matrix/key/v2/query
  189. - ^/_matrix/federation/v1/hierarchy/
  190. # Inbound federation transaction request
  191. - ^/_matrix/federation/v1/send/
  192. # Client API requests
  193. - ^/_matrix/client/(api/v1|r0|v3|unstable)/createRoom$
  194. - ^/_matrix/client/(api/v1|r0|v3|unstable)/publicRooms$
  195. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/joined_members$
  196. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$
  197. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$
  198. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$
  199. - ^/_matrix/client/v1/rooms/.*/hierarchy$
  200. - ^/_matrix/client/(v1|unstable)/rooms/.*/relations/
  201. - ^/_matrix/client/v1/rooms/.*/threads$
  202. - ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$
  203. - ^/_matrix/client/unstable/im.nheko.summary/summary/.*$
  204. - ^/_matrix/client/unstable/org.matrix.msc4143/rtc/transports$
  205. - ^/_matrix/client/(r0|v3|unstable)/account/3pid$
  206. - ^/_matrix/client/(r0|v3|unstable)/account/whoami$
  207. - ^/_matrix/client/(r0|v3|unstable)/account/deactivate$
  208. - ^/_matrix/client/versions$
  209. - ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$
  210. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/
  211. - ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$
  212. - ^/_matrix/client/v1/rooms/.*/timestamp_to_event$
  213. - ^/_matrix/client/(api/v1|r0|v3|unstable/.*)/rooms/.*/aliases
  214. - ^/_matrix/client/(api/v1|r0|v3|unstable)/search$
  215. - ^/_matrix/client/(r0|v3|unstable)/user/.*/filter(/|$)
  216. - ^/_matrix/client/(api/v1|r0|v3|unstable)/directory/room/.*$
  217. - ^/_matrix/client/(r0|v3|unstable)/capabilities$
  218. - ^/_matrix/client/(r0|v3|unstable)/notifications$
  219. # Encryption requests
  220. - ^/_matrix/client/(r0|v3|unstable)/keys/query$
  221. - ^/_matrix/client/(r0|v3|unstable)/keys/changes$
  222. - ^/_matrix/client/(r0|v3|unstable)/keys/claim$
  223. - ^/_matrix/client/(r0|v3|unstable)/room_keys/
  224. # MSC3814 dehydrated-device support:
  225. # Ref: https://github.com/element-hq/synapse/blob/b99a58719b274fcbb327fd8d7649185792bfd12c/synapse/rest/client/devices.py#L256-L459
  226. - ^/_matrix/client/unstable/org.matrix.msc3814.v1/dehydrated_device$
  227. - ^/_matrix/client/unstable/org.matrix.msc3814.v1/dehydrated_device/[^/]*/events$
  228. # Registration/login requests
  229. - ^/_matrix/client/(api/v1|r0|v3|unstable)/login$
  230. - ^/_matrix/client/(r0|v3|unstable)/register$
  231. - ^/_matrix/client/(r0|v3|unstable)/register/available$
  232. - ^/_matrix/client/v1/register/m.login.registration_token/validity$
  233. - ^/_matrix/client/(r0|v3|unstable)/password_policy$
  234. # Event sending requests
  235. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact
  236. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send
  237. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/
  238. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)$
  239. - ^/_matrix/client/(api/v1|r0|v3|unstable)/join/
  240. - ^/_matrix/client/(api/v1|r0|v3|unstable)/knock/
  241. - ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/
  242. # Unstable MSC4140 support
  243. - ^/_matrix/client/unstable/org.matrix.msc4140/delayed_events(/.*/restart)?$
  244. # Admin API requests
  245. - ^/_synapse/admin/v2/users/[^/]+$
  246. # Start of intentionally-ignored-endpoints
  247. #
  248. # We ignore these below, because they are now supposed to be owned by explicit
  249. # early stream-backed routing in the reverse proxy.
  250. #
  251. # The intended behavior is:
  252. # - if a stream writer is enabled, route to that stream writer
  253. # - otherwise, route to Synapse `main`
  254. #
  255. # Broad generic-worker routing must not decide fallback behavior for these.
  256. #
  257. # # Account data requests
  258. # - ^/_matrix/client/(r0|v3|unstable)/.*/tags
  259. # - ^/_matrix/client/(r0|v3|unstable)/.*/account_data
  260. #
  261. # # Receipts requests
  262. # - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt
  263. # - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers
  264. #
  265. # # Presence requests
  266. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/
  267. #
  268. # # Push rules requests
  269. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
  270. #
  271. # # Device lists requests
  272. # - ^/_matrix/client/(r0|v3)/delete_devices$
  273. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/|$)
  274. # - ^/_matrix/client/(r0|v3|unstable)/keys/upload(/|$)
  275. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$
  276. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$
  277. #
  278. # # Thread subscriptions requests
  279. # - ^/_matrix/client/unstable/io.element.msc4306/rooms/.*/thread/.*/subscription$
  280. # - ^/_matrix/client/unstable/io.element.msc4308/thread_subscriptions$
  281. #
  282. # # User directory search requests
  283. # - ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
  284. # End of intentionally-ignored-endpoints
  285. matrix_synapse_workers_media_repository_endpoints:
  286. # Handles the media repository. It can handle all endpoints starting with:
  287. - ^/_matrix/media/
  288. - ^/_matrix/client/v1/media/
  289. - ^/_matrix/federation/v1/media/
  290. # … and the following regular expressions matching media-specific administration APIs:
  291. - ^/_synapse/admin/v1/purge_media_cache$
  292. - ^/_synapse/admin/v1/room/.*/media.*$
  293. - ^/_synapse/admin/v1/user/.*/media.*$
  294. - ^/_synapse/admin/v1/media/.*$
  295. - ^/_synapse/admin/v1/quarantine_media/.*$
  296. - ^/_synapse/admin/v1/users/.*/media$
  297. matrix_synapse_workers_user_dir_endpoints:
  298. # Handles searches in the user directory. It can handle REST endpoints matching
  299. # the following regular expressions:
  300. - ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
  301. matrix_synapse_workers_avail_list:
  302. - appservice
  303. - client_reader
  304. - federation_reader
  305. - federation_sender
  306. - generic_worker
  307. - media_repository
  308. - pusher
  309. - room_worker
  310. - sync_worker
  311. - user_dir
  312. ### workers:end