Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

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