Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

316 行
17 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. - ^/_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)|versions|voip/turnServer|joined_rooms|search|user/.*/filter(/|$)|directory/room/.*|capabilities)
  28. # Federation reader workers handle generic federation endpoints that don't contain a roomid
  29. matrix_synapse_workers_federation_reader_federation_endpoints:
  30. - ^/_matrix/(federation/(v1|v2)|key/v2)/
  31. # A Synapse generic worker can handle both federation and client-server API endpoints.
  32. # We wish to split these, as we normally serve federation separately and don't want them mixed up.
  33. #
  34. # This is some ugly Ansible/Jinja2 hack (seen here: https://stackoverflow.com/a/47831492),
  35. # which takes a list of various strings and removes the ones NOT containing `/_matrix/client` anywhere in them.
  36. #
  37. # We intentionally don't do a diff between everything possible (`matrix_synapse_workers_generic_worker_endpoints`) and `matrix_synapse_workers_generic_worker_federation_endpoints`,
  38. # because `matrix_synapse_workers_generic_worker_endpoints` also contains things like `/_synapse/client/`, etc.
  39. # While /_synapse/client/ endpoints are somewhat client-server API-related, they're:
  40. # - neither part of the client-server API spec (and are thus, different)
  41. # - and they now include a meaningful Synapse-specific tree (`pick_idp`, `pick_username`, OIDC/SAML callbacks, rendezvous, etc.)
  42. # - 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
  43. #
  44. # Basically, we aim to cover most spec client APIs here. Skipping `/_synapse/client` is intentional and conservative.
  45. matrix_synapse_workers_generic_worker_client_server_endpoints: "{{ matrix_synapse_workers_generic_worker_endpoints | default([]) | map('regex_search', '.*/_matrix/client.*') | list | difference([none]) }}"
  46. # A Synapse generic worker can handle both federation and client-server API endpoints.
  47. # We wish to split these, as we normally serve federation separately and don't want them mixed up.
  48. #
  49. # This is some ugly Ansible/Jinja2 hack (seen here: https://stackoverflow.com/a/47831492),
  50. # which takes a list of various strings and removes the ones NOT containing `/_matrix/federation` or `/_matrix/key` anywhere in them.
  51. 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]) }}"
  52. # matrix_synapse_workers_generic_worker_federation_endpoints_regex contains the regex used in matrix_synapse_workers_generic_worker_federation_endpoints.
  53. # It's intentionally put in a separate variable, to avoid tripping ansible-lint's jinja[spacing] rule.
  54. matrix_synapse_workers_generic_worker_federation_endpoints_regex: '.*(/_matrix/federation|/_matrix/key).*'
  55. # matrix_synapse_workers_stream_writer_typing_stream_worker_client_server_endpoints contains the endpoints serviced by the `typing` stream writer.
  56. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-typing-stream
  57. matrix_synapse_workers_stream_writer_typing_stream_worker_client_server_endpoints:
  58. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing
  59. # matrix_synapse_workers_stream_writer_to_device_stream_worker_client_server_endpoints contains the endpoints serviced by the `to_device` stream writer.
  60. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-to_device-stream
  61. matrix_synapse_workers_stream_writer_to_device_stream_worker_client_server_endpoints:
  62. - ^/_matrix/client/(r0|v3|unstable)/sendToDevice/
  63. # matrix_synapse_workers_stream_writer_account_data_stream_worker_client_server_endpoints contains the endpoints serviced by the `account_data` stream writer.
  64. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-account_data-stream
  65. matrix_synapse_workers_stream_writer_account_data_stream_worker_client_server_endpoints:
  66. - ^/_matrix/client/(r0|v3|unstable)/.*/tags
  67. - ^/_matrix/client/(r0|v3|unstable)/.*/account_data
  68. # matrix_synapse_workers_stream_writer_receipts_stream_worker_client_server_endpoints contains the endpoints serviced by the `recepts` stream writer.
  69. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-receipts-stream
  70. matrix_synapse_workers_stream_writer_receipts_stream_worker_client_server_endpoints:
  71. - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt
  72. - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers
  73. # matrix_synapse_workers_stream_writer_presence_stream_worker_client_server_endpoints contains the endpoints serviced by the `presence` stream writer.
  74. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-presence-stream
  75. matrix_synapse_workers_stream_writer_presence_stream_worker_client_server_endpoints:
  76. - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/
  77. # matrix_synapse_workers_stream_writer_push_rules_stream_worker_client_server_endpoints contains the endpoints serviced by the `push_rules` stream writer.
  78. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-push_rules-stream
  79. matrix_synapse_workers_stream_writer_push_rules_stream_worker_client_server_endpoints:
  80. - ^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
  81. # matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_endpoints contains the endpoints serviced by the `device_lists` stream writer.
  82. # See: https://matrix-org.github.io/synapse/latest/workers.html#the-device_lists-stream
  83. matrix_synapse_workers_stream_writer_device_lists_stream_worker_client_server_endpoints:
  84. - ^/_matrix/client/(r0|v3)/delete_devices$
  85. - ^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/|$)
  86. - ^/_matrix/client/(r0|v3|unstable)/keys/upload(/|$)
  87. - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$
  88. - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$
  89. # matrix_synapse_workers_user_dir_worker_client_server_endpoints contains the endpoints serviced by the `type = user_dir` (`app = generic_worker`) worker.
  90. # See: https://matrix-org.github.io/synapse/latest/workers.html#updating-the-user-directory
  91. matrix_synapse_workers_user_dir_worker_client_server_endpoints:
  92. - ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
  93. # matrix_synapse_workers_known_stream_writer_stream_types contains the list of stream writer stream types that the playbook recognizes.
  94. # This is used for validation purposes. If adding support for a new type, besides adding it to this list,
  95. # don't forget to actually configure it where appropriate (see worker.yaml.j2`, the nginx proxy configuration, etc).
  96. matrix_synapse_workers_known_stream_writer_stream_types: ['events', 'typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists']
  97. # matrix_synapse_workers_webserving_stream_writer_types contains a list of stream writer types that serve web (client) requests.
  98. # Not all stream writers serve web requests. Some just perform background tasks.
  99. matrix_synapse_workers_webserving_stream_writer_types: ['typing', 'to_device', 'account_data', 'receipts', 'presence', 'push_rules', 'device_lists']
  100. # matrix_synapse_workers_systemd_services_list contains a list of systemd services (one for each worker systemd service which serves web requests).
  101. # This list is built during runtime.
  102. # Not all workers serve web requests. Those that don't won't be injected here.
  103. matrix_synapse_webserving_workers_systemd_services_list: []
  104. # matrix_synapse_known_worker_types contains the list of known worker types.
  105. #
  106. # A worker type is different than a worker app (e.g. `generic_worker`).
  107. # For example, the `stream_writer` worker type is served by the `generic_worker` app, but is a separate type that we recognize.
  108. #
  109. # Some other types (`appservice` and `user_dir`) used to be Synapse worker apps, which got subsequently deprecated.
  110. # We still allow these types of workers and map them to the `generic_worker` app,
  111. # which is why we make sure they're part of the list below.
  112. # We use the `unique` filter because they're part of `matrix_synapse_workers_avail_list` too (for now; scheduled for removal).
  113. matrix_synapse_known_worker_types: |
  114. {{
  115. (
  116. matrix_synapse_workers_avail_list
  117. +
  118. ['stream_writer']
  119. +
  120. ['appservice']
  121. +
  122. ['user_dir']
  123. +
  124. ['background']
  125. ) | unique
  126. }}
  127. # matrix_synapse_known_instance_map_eligible_worker_types contains the list of worker types that are to be injected into `matrix_synapse_instance_map`.
  128. matrix_synapse_known_instance_map_eligible_worker_types:
  129. - stream_writer
  130. # 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,
  131. # but is now maintained manually due to:
  132. # - the script being tripped up by the content and generating somewhat inaccurate definitions, which had to be fixed up manually.
  133. # - the script being complicated and unmaintainable
  134. ### workers:start
  135. matrix_synapse_workers_generic_worker_endpoints:
  136. # Sync requests
  137. - ^/_matrix/client/(r0|v3)/sync$
  138. - ^/_matrix/client/(api/v1|r0|v3)/events$
  139. - ^/_matrix/client/(api/v1|r0|v3)/initialSync$
  140. - ^/_matrix/client/(api/v1|r0|v3)/rooms/[^/]+/initialSync$
  141. # Native Sliding Sync (MSC3575) - supported since Synapse 1.114
  142. - ^/_matrix/client/unstable/org.matrix.simplified_msc3575/sync$
  143. # Federation requests
  144. - ^/_matrix/federation/v1/event/
  145. - ^/_matrix/federation/v1/state/
  146. - ^/_matrix/federation/v1/state_ids/
  147. - ^/_matrix/federation/v1/backfill/
  148. - ^/_matrix/federation/v1/get_missing_events/
  149. - ^/_matrix/federation/v1/publicRooms
  150. - ^/_matrix/federation/v1/query/
  151. - ^/_matrix/federation/v1/make_join/
  152. - ^/_matrix/federation/v1/make_leave/
  153. - ^/_matrix/federation/(v1|v2)/send_join/
  154. - ^/_matrix/federation/(v1|v2)/send_leave/
  155. - ^/_matrix/federation/(v1|v2)/invite/
  156. - ^/_matrix/federation/v1/event_auth/
  157. - ^/_matrix/federation/v1/timestamp_to_event/
  158. - ^/_matrix/federation/v1/exchange_third_party_invite/
  159. - ^/_matrix/federation/v1/user/devices/
  160. - ^/_matrix/key/v2/query
  161. - ^/_matrix/federation/v1/hierarchy/
  162. # Inbound federation transaction request
  163. - ^/_matrix/federation/v1/send/
  164. # Client API requests
  165. - ^/_matrix/client/(api/v1|r0|v3|unstable)/createRoom$
  166. - ^/_matrix/client/(api/v1|r0|v3|unstable)/publicRooms$
  167. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/joined_members$
  168. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$
  169. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$
  170. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$
  171. - ^/_matrix/client/v1/rooms/.*/hierarchy$
  172. - ^/_matrix/client/(v1|unstable)/rooms/.*/relations/
  173. - ^/_matrix/client/v1/rooms/.*/threads$
  174. - ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$
  175. - ^/_matrix/client/(r0|v3|unstable)/account/3pid$
  176. - ^/_matrix/client/(r0|v3|unstable)/account/whoami$
  177. - ^/_matrix/client/versions$
  178. - ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$
  179. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/
  180. - ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$
  181. - ^/_matrix/client/v1/rooms/.*/timestamp_to_event$
  182. - ^/_matrix/client/(api/v1|r0|v3|unstable/.*)/rooms/.*/aliases
  183. - ^/_matrix/client/(api/v1|r0|v3|unstable)/search$
  184. - ^/_matrix/client/(r0|v3|unstable)/user/.*/filter(/|$)
  185. - ^/_matrix/client/(api/v1|r0|v3|unstable)/directory/room/.*$
  186. - ^/_matrix/client/(r0|v3|unstable)/capabilities$
  187. - ^/_matrix/client/(r0|v3|unstable)/notifications$
  188. # Encryption requests
  189. - ^/_matrix/client/(r0|v3|unstable)/keys/query$
  190. - ^/_matrix/client/(r0|v3|unstable)/keys/changes$
  191. - ^/_matrix/client/(r0|v3|unstable)/keys/claim$
  192. - ^/_matrix/client/(r0|v3|unstable)/room_keys/
  193. # Registration/login requests
  194. - ^/_matrix/client/(api/v1|r0|v3|unstable)/login$
  195. - ^/_matrix/client/(r0|v3|unstable)/register$
  196. - ^/_matrix/client/(r0|v3|unstable)/register/available$
  197. - ^/_matrix/client/v1/register/m.login.registration_token/validity$
  198. - ^/_matrix/client/(r0|v3|unstable)/password_policy$
  199. # Event sending requests
  200. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact
  201. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send
  202. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/
  203. - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)$
  204. - ^/_matrix/client/(api/v1|r0|v3|unstable)/join/
  205. - ^/_matrix/client/(api/v1|r0|v3|unstable)/knock/
  206. - ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/
  207. # Unstable MSC4140 support
  208. - ^/_matrix/client/unstable/org.matrix.msc4140/delayed_events(/.*/restart)?$
  209. # Admin API requests
  210. - ^/_synapse/admin/v2/users/[^/]+$
  211. # Start of intentionally-ignored-endpoints
  212. #
  213. # We ignore these below, because they are now supposed to be owned by explicit
  214. # early stream-backed routing in the reverse proxy.
  215. #
  216. # The intended behavior is:
  217. # - if a stream writer is enabled, route to that stream writer
  218. # - otherwise, route to Synapse `main`
  219. #
  220. # Broad generic-worker routing must not decide fallback behavior for these.
  221. #
  222. # # Account data requests
  223. # - ^/_matrix/client/(r0|v3|unstable)/.*/tags
  224. # - ^/_matrix/client/(r0|v3|unstable)/.*/account_data
  225. #
  226. # # Receipts requests
  227. # - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt
  228. # - ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers
  229. #
  230. # # Presence requests
  231. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/
  232. #
  233. # # Push rules requests
  234. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
  235. #
  236. # # Device lists requests
  237. # - ^/_matrix/client/(r0|v3)/delete_devices$
  238. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/devices(/|$)
  239. # - ^/_matrix/client/(r0|v3|unstable)/keys/upload(/|$)
  240. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/device_signing/upload$
  241. # - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/signatures/upload$
  242. #
  243. # # User directory search requests
  244. # - ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
  245. # End of intentionally-ignored-endpoints
  246. matrix_synapse_workers_media_repository_endpoints:
  247. # Handles the media repository. It can handle all endpoints starting with:
  248. - ^/_matrix/media/
  249. - ^/_matrix/client/v1/media/
  250. - ^/_matrix/federation/v1/media/
  251. # … and the following regular expressions matching media-specific administration APIs:
  252. - ^/_synapse/admin/v1/purge_media_cache$
  253. - ^/_synapse/admin/v1/room/.*/media.*$
  254. - ^/_synapse/admin/v1/user/.*/media.*$
  255. - ^/_synapse/admin/v1/media/.*$
  256. - ^/_synapse/admin/v1/quarantine_media/.*$
  257. - ^/_synapse/admin/v1/users/.*/media$
  258. matrix_synapse_workers_user_dir_endpoints:
  259. # Handles searches in the user directory. It can handle REST endpoints matching
  260. # the following regular expressions:
  261. - ^/_matrix/client/(r0|v3|unstable)/user_directory/search$
  262. matrix_synapse_workers_avail_list:
  263. - appservice
  264. - client_reader
  265. - federation_reader
  266. - federation_sender
  267. - generic_worker
  268. - media_repository
  269. - pusher
  270. - room_worker
  271. - sync_worker
  272. - user_dir
  273. ### workers:end