Matrix Docker Ansible eploy
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

280 rindas
15 KiB

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