Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

241 wiersze
13 KiB

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