Matrix Docker Ansible eploy
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

373 lines
24 KiB

  1. ---
  2. # matrix-static-files is a role which generates and serves `/.well-known/matrix` files for the purposes of Matrix Delegation.
  3. # It also exposes some variables which allow this role to be used for serving additional files.
  4. matrix_static_files_enabled: true
  5. matrix_static_files_ident: matrix-static-files
  6. # renovate: datasource=docker depName=joseluisq/static-web-server
  7. matrix_static_files_version: 2.24.2
  8. matrix_static_files_base_path: "{{ matrix_base_data_path }}/{{ 'static-files' if matrix_static_files_ident == 'matrix-static-files' else matrix_static_files_ident }}"
  9. matrix_static_files_config_path: "{{ matrix_static_files_base_path }}/config"
  10. matrix_static_files_public_path: "{{ matrix_static_files_base_path }}/public"
  11. matrix_static_files_public_well_known_path: "{{ matrix_static_files_public_path }}/.well-known"
  12. matrix_static_files_public_well_known_matrix_path: "{{ matrix_static_files_public_well_known_path }}/matrix"
  13. # List of systemd services that matrix-static-files.service depends on
  14. matrix_static_files_systemd_required_services_list: ['docker.service']
  15. # List of systemd services that matrix-static-files.service wants
  16. matrix_static_files_systemd_wanted_services_list: "{{ matrix_static_files_systemd_wanted_services_list_auto + matrix_static_files_systemd_wanted_services_list_custom }}"
  17. matrix_static_files_systemd_wanted_services_list_auto: []
  18. matrix_static_files_systemd_wanted_services_list_custom: []
  19. matrix_static_files_container_image: "{{ matrix_container_global_registry_prefix }}joseluisq/static-web-server:{{ matrix_static_files_container_image_tag }}"
  20. matrix_static_files_container_image_tag: "{{ 'latest' if matrix_static_files_version == 'latest' else (matrix_static_files_version + '-alpine') }}"
  21. matrix_static_files_container_image_force_pull: "{{ matrix_static_files_container_image.endswith(':latest') }}"
  22. matrix_static_files_container_network: "{{ matrix_static_files_ident }}"
  23. # A list of additional container networks that matrix-static-files would be connected to.
  24. # The playbook does not create these networks, so make sure they already exist.
  25. matrix_static_files_container_additional_networks: []
  26. # Controls whether the matrix-static-files container exposes its HTTP port (tcp/8080 in the container).
  27. #
  28. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8080"), or empty string to not expose.
  29. matrix_static_files_container_http_host_bind_port: ''
  30. # matrix_static_files_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  31. # See `../templates/labels.j2` for details.
  32. #
  33. # To inject your own other container labels, see `matrix_static_files_container_labels_additional_labels`.
  34. matrix_static_files_container_labels_traefik_enabled: true
  35. matrix_static_files_container_labels_traefik_docker_network: "{{ matrix_static_files_container_network }}"
  36. matrix_static_files_container_labels_traefik_entrypoints: web-secure
  37. matrix_static_files_container_labels_traefik_tls_certResolver: default
  38. # Controls whether labels will be added that expose the well-known public endpoint on the matrix domain.
  39. matrix_static_files_container_labels_well_known_matrix_endpoint_enabled: true
  40. matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_hostname: ''
  41. matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_path_prefix: /.well-known/matrix
  42. matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_rule: "Host(`{{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_hostname }}`) && PathPrefix(`{{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_path_prefix }}`)"
  43. matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_priority: 0
  44. matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_entrypoints: "{{ matrix_static_files_container_labels_traefik_entrypoints }}"
  45. matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_tls: "{{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_entrypoints != 'web' }}"
  46. matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_tls_certResolver: "{{ matrix_static_files_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  47. # Controls whether labels will be added that serve the base domain.
  48. #
  49. # This is similar to `matrix_static_files_container_labels_well_known_matrix_endpoint_*`, but does more.
  50. #
  51. # It's useful when you'd like to avoid setting up `/.well-known/matrix` redirects and can afford to point the base domain to the Matrix server.
  52. #
  53. # By default, these labels are configured to handle all paths for the provided base domain
  54. # (see `matrix_static_files_container_labels_base_domain_traefik_path_prefix`), not just the `/.well-known/matrix` prefix.
  55. #
  56. # By default, an index.html page is also served (see `matrix_static_files_file_index_html_enabled`).
  57. matrix_static_files_container_labels_base_domain_enabled: false
  58. matrix_static_files_container_labels_base_domain_traefik_hostname: ''
  59. matrix_static_files_container_labels_base_domain_traefik_path_prefix: /
  60. matrix_static_files_container_labels_base_domain_traefik_rule: "Host(`{{ matrix_static_files_container_labels_base_domain_traefik_hostname }}`){% if matrix_static_files_container_labels_base_domain_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_static_files_container_labels_well_known_matrix_endpoint_traefik_path_prefix }}`){% endif %}"
  61. matrix_static_files_container_labels_base_domain_traefik_priority: 0
  62. matrix_static_files_container_labels_base_domain_traefik_entrypoints: "{{ matrix_static_files_container_labels_traefik_entrypoints }}"
  63. matrix_static_files_container_labels_base_domain_traefik_tls: "{{ matrix_static_files_container_labels_base_domain_traefik_entrypoints != 'web' }}"
  64. matrix_static_files_container_labels_base_domain_traefik_tls_certResolver: "{{ matrix_static_files_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  65. # matrix_static_files_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  66. # See `../templates/labels.j2` for details.
  67. #
  68. # Example:
  69. # matrix_static_files_container_labels_additional_labels: |
  70. # my.label=1
  71. # another.label="here"
  72. matrix_static_files_container_labels_additional_labels: ''
  73. # Controls the SERVER_PORT environment variable.
  74. # See: https://static-web-server.net/configuration/environment-variables/
  75. matrix_static_files_environment_variable_server_port: 8080
  76. # Controls the SERVER_LOG_LEVEL environment variable.
  77. # See: https://static-web-server.net/configuration/environment-variables/
  78. # Valid values: error, warn, info, debug or trace
  79. matrix_static_files_environment_variable_server_log_level: error
  80. # Controls the SERVER_LOG_REMOTE_ADDRESS environment variable.
  81. # See: https://static-web-server.net/configuration/environment-variables/
  82. matrix_static_files_environment_variable_server_log_remote_address: false
  83. # Controls the SERVER_CONFIG_FILE environment variable.
  84. # See: https://static-web-server.net/configuration/environment-variables/
  85. matrix_static_files_environment_variable_server_config_file: /config/config.toml
  86. # Additional environment variables.
  87. matrix_static_files_environment_variables_additional_variables: ''
  88. # Controls the caching time (max-age property of the `Cache-Control` HTTP header) for all `/.well-known/matrix/*` files.
  89. # We use a somewhat long expires value is to prevent outages in case this is unreachable due to network failure
  90. # or due to the base domain's server completely dying.
  91. matrix_static_files_files_cache_time_hours: 4
  92. ########################################################################
  93. # #
  94. # Related to /.well-known/matrix/client #
  95. # #
  96. ########################################################################
  97. # Controls the m.homeserver/base_url property in the /.well-known/matrix/client file
  98. matrix_static_files_file_matrix_client_property_m_homeserver_base_url: "{{ matrix_homeserver_url }}"
  99. # Controls the m.identity_server/base_url property in the /.well-known/matrix/client file
  100. matrix_static_files_file_matrix_client_property_m_identity_server_base_url: "{{ matrix_identity_server_url }}"
  101. # Controls the m.integrations/managers/0/api_url property in the /.well-known/matrix/client file
  102. matrix_static_files_file_matrix_client_property_m_integrations_managers_api_url: "{{ matrix_integration_manager_rest_url }}"
  103. # Controls the m.integrations/managers/0/ui_url property in the /.well-known/matrix/client file
  104. matrix_static_files_file_matrix_client_property_m_integrations_managers_ui_url: "{{ matrix_integration_manager_ui_url }}"
  105. # Controls the io.element.jitsi/preferredDomain property in the /.well-known/matrix/client file
  106. # This specifies the domain name where a Jitsi server is self-hosted.
  107. # If set, `/.well-known/matrix/client` will suggest Element clients to use that Jitsi server.
  108. # See: https://github.com/element-hq/element-web/blob/develop/docs/jitsi.md#configuring-element-to-use-your-self-hosted-jitsi-server
  109. matrix_static_files_file_matrix_client_property_io_element_jitsi_preferred_domain: ""
  110. # Controls the org.matrix.msc3575.proxy/url (sliding sync) property in the /.well-known/matrix/client file
  111. matrix_static_files_file_matrix_client_property_org_matrix_msc3575_proxy_url: ""
  112. # Controls whether the m.tile_server configuration is added to the /.well-known/matrix/client file
  113. matrix_static_files_file_matrix_client_property_m_tile_server_entries_enabled: false
  114. # Controls the m.tile_server/map_style_url property in the /.well-known/matrix/client file
  115. matrix_static_files_file_matrix_client_property_m_tile_server_map_style_url: ""
  116. # Controls whether element related entries (io.element.e2ee) should be added to the client well-known.
  117. # By default if any of the following change from their default this would be set to true:
  118. # `matrix_static_files_file_matrix_client_property_io_element_e2ee_default`
  119. # `matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_required`
  120. # `matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_setup_methods`
  121. matrix_static_files_file_matrix_client_property_io_element_e2ee_entries_enabled: "{{ not matrix_static_files_file_matrix_client_property_io_element_e2ee_default or matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_required or matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_setup_methods | length > 0 }}"
  122. # Controls the io.element.e2ee/default property in the /.well-known/matrix/client file,
  123. # which instructs Element whether it should use End-to-End Encryption by default.
  124. # Setting this to false will update `/.well-known/matrix/client` and tell Element clients to avoid E2EE.
  125. # See: https://github.com/element-hq/element-web/blob/develop/docs/e2ee.md
  126. matrix_static_files_file_matrix_client_property_io_element_e2ee_default: true
  127. # Controls the io.element.e2ee/secure_backup_required property in the /.well-known/matrix/client file,
  128. # which instructs Element whether it should require a secure backup set up before Element can be used.
  129. # Setting this to true will update `/.well-known/matrix/client` and tell Element require a secure backup.
  130. # See: https://github.com/element-hq/element-web/blob/develop/docs/e2ee.md
  131. matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_required: false
  132. # Controls the io.element.e2ee/secure_backup_setup_methods property in the /.well-known/matrix/client file,
  133. # which instructs Element which backup methods from ["key", "passphrase"] should be used.
  134. # When an empty list is provided, Element defaults to using both.
  135. # Setting this to other than empty will update `/.well-known/matrix/client` and tell Element which method to use.
  136. # See: https://github.com/element-hq/element-web/blob/develop/docs/e2ee.md
  137. matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_setup_methods: []
  138. # Default /.well-known/matrix/client configuration template which covers the generic use case.
  139. # You can customize it by controlling the various variables inside it.
  140. #
  141. # For a more advanced customization, you can extend the default (see `matrix_static_files_file_matrix_client_configuration_extension_json`)
  142. # or completely replace this variable with your own template.
  143. matrix_static_files_file_matrix_client_configuration_json: "{{ lookup('template', 'templates/public/.well-known/matrix/client.j2') }}"
  144. # Your custom JSON configuration for /.well-known/matrix/client should go to `matrix_static_files_file_matrix_client_configuration_extension_json`.
  145. # This configuration extends the default starting configuration (`matrix_static_files_file_matrix_client_configuration_extension_json`).
  146. #
  147. # You can override individual variables from the default configuration, or introduce new ones.
  148. #
  149. # If you need something more special, you can take full control by
  150. # completely redefining `matrix_static_files_file_matrix_client_configuration_json`.
  151. #
  152. # Example configuration extension follows:
  153. #
  154. # matrix_static_files_file_matrix_client_configuration_extension_json: |
  155. # {
  156. # "m.another": "value",
  157. # "m.yet_another": 3
  158. # }
  159. matrix_static_files_file_matrix_client_configuration_extension_json: '{}'
  160. matrix_static_files_file_matrix_client_configuration_extension: "{{ matrix_static_files_file_matrix_client_configuration_extension_json | from_json if matrix_static_files_file_matrix_client_configuration_extension_json | from_json is mapping else {} }}"
  161. # Holds the final /.well-known/matrix/client configuration (a combination of the default and its extension).
  162. # You most likely don't need to touch this variable. Instead, see `matrix_static_files_file_matrix_client_configuration_json` or `matrix_static_files_file_matrix_client_configuration_extension_json`.
  163. matrix_static_files_file_matrix_client_configuration: "{{ matrix_static_files_file_matrix_client_configuration_json | combine(matrix_static_files_file_matrix_client_configuration_extension, recursive=True) }}"
  164. ########################################################################
  165. # #
  166. # /Related to /.well-known/matrix/client #
  167. # #
  168. ########################################################################
  169. ########################################################################
  170. # #
  171. # Related to /.well-known/matrix/server #
  172. # #
  173. ########################################################################
  174. # Controls whether a `/.well-known/matrix/server` file is generated and used at all.
  175. #
  176. # If you wish to rely on DNS SRV records only, you can disable this.
  177. # Using DNS SRV records implies that you'll be handling Matrix Federation API traffic (tcp/8448)
  178. # using certificates for the base domain (`matrix_domain`) and not for the
  179. # matrix domain (`matrix_server_fqn_matrix`).
  180. matrix_static_files_file_matrix_server_enabled: true
  181. # Controls the m.server property in the /.well-known/matrix/server file
  182. matrix_static_files_file_matrix_server_property_m_server: ''
  183. # Default /.well-known/matrix/server configuration template which covers the generic use case.
  184. # You can customize it by controlling the various variables inside it.
  185. #
  186. # For a more advanced customization, you can extend the default (see `matrix_static_files_file_matrix_server_configuration_extension_json`)
  187. # or completely replace this variable with your own template.
  188. matrix_static_files_file_matrix_server_configuration_json: "{{ lookup('template', 'templates/public/.well-known/matrix/server.j2') }}"
  189. # Your custom JSON configuration for /.well-known/matrix/server should go to `matrix_static_files_file_matrix_server_configuration_extension_json`.
  190. # This configuration extends the default starting configuration (`matrix_static_files_file_matrix_server_configuration_extension_json`).
  191. #
  192. # You can override individual variables from the default configuration, or introduce new ones.
  193. #
  194. # If you need something more special, you can take full control by
  195. # completely redefining `matrix_static_files_file_matrix_server_configuration_json`.
  196. #
  197. # Example configuration extension follows:
  198. #
  199. # matrix_static_files_file_matrix_server_configuration_extension_json: |
  200. # {
  201. # "m.another": "value",
  202. # "m.yet_another": 3
  203. # }
  204. matrix_static_files_file_matrix_server_configuration_extension_json: '{}'
  205. matrix_static_files_file_matrix_server_configuration_extension: "{{ matrix_static_files_file_matrix_server_configuration_extension_json | from_json if matrix_static_files_file_matrix_server_configuration_extension_json | from_json is mapping else {} }}"
  206. # Holds the final /.well-known/matrix/server configuration (a combination of the default and its extension).
  207. # You most likely don't need to touch this variable. Instead, see `matrix_static_files_file_matrix_server_configuration_json` or `matrix_static_files_file_matrix_server_configuration_extension_json`.
  208. matrix_static_files_file_matrix_server_configuration: "{{ matrix_static_files_file_matrix_server_configuration_json | combine(matrix_static_files_file_matrix_server_configuration_extension, recursive=True) }}"
  209. ########################################################################
  210. # #
  211. # /Related to /.well-known/matrix/server #
  212. # #
  213. ########################################################################
  214. ########################################################################
  215. # #
  216. # Related to /.well-known/matrix/support #
  217. # #
  218. ########################################################################
  219. # Controls whether a `/.well-known/matrix/support` file is generated and used at all.
  220. # For details about this file, see the spec: https://github.com/matrix-org/matrix-spec-proposals/pull/1929
  221. #
  222. # This is not enabled by default, as for it to be useful, other information is necessary.
  223. # See `matrix_static_files_file_matrix_support_property_m_contacts`, `matrix_static_files_file_matrix_support_property_m_support_page`, etc.
  224. matrix_static_files_file_matrix_support_enabled: "{{ matrix_static_files_matrix_support_enabled }}"
  225. # Controls the m.contacts property in the /.well-known/matrix/support file
  226. matrix_static_files_file_matrix_support_property_m_contacts: []
  227. # Controls the m.support_page property in the /.well-known/matrix/support file
  228. matrix_static_files_file_matrix_support_property_m_support_page: []
  229. # Default /.well-known/matrix/support configuration template which covers the generic use case.
  230. # You can customize it by controlling the various variables inside it.
  231. #
  232. # For a more advanced customization, you can extend the default (see `matrix_static_files_file_matrix_support_configuration_extension_json`)
  233. # or completely replace this variable with your own template.
  234. matrix_static_files_file_matrix_support_configuration_json: "{{ lookup('template', 'templates/public/.well-known/matrix/support.j2') }}"
  235. # Your custom JSON configuration for /.well-known/matrix/support should go to `matrix_static_files_file_matrix_support_configuration_extension_json`.
  236. # This configuration extends the default starting configuration (`matrix_static_files_file_matrix_support_configuration_extension_json`).
  237. #
  238. # You can override individual variables from the default configuration, or introduce new ones.
  239. #
  240. # If you need something more special, you can take full control by
  241. # completely redefining `matrix_static_files_file_matrix_support_configuration_json`.
  242. #
  243. # Example configuration extension follows:
  244. #
  245. # matrix_static_files_file_matrix_support_configuration_extension_json: |
  246. # {
  247. # "m.another": "value",
  248. # "m.yet_another": 3
  249. # }
  250. matrix_static_files_file_matrix_support_configuration_extension_json: '{}'
  251. matrix_static_files_file_matrix_support_configuration_extension: "{{ matrix_static_files_file_matrix_support_configuration_extension_json | from_json if matrix_static_files_file_matrix_support_configuration_extension_json | from_json is mapping else {} }}"
  252. # Holds the final /.well-known/matrix/support configuration (a combination of the default and its extension).
  253. # You most likely don't need to touch this variable. Instead, see `matrix_static_files_file_matrix_support_configuration_json` or `matrix_static_files_file_matrix_support_configuration_extension_json`.
  254. matrix_static_files_file_matrix_support_configuration: "{{ matrix_static_files_file_matrix_support_configuration_json | combine(matrix_static_files_file_matrix_support_configuration_extension, recursive=True) }}"
  255. ########################################################################
  256. # #
  257. # /Related to /.well-known/matrix/support #
  258. # #
  259. ########################################################################
  260. ########################################################################
  261. # #
  262. # Related to index.html #
  263. # #
  264. ########################################################################
  265. # Controls whether `matrix_static_files_file_index_html_template` would be dumped to an `index.html` file
  266. # in the public directory (matrix_static_files_public_path).
  267. #
  268. # This is useful if you have enabled serving of the base domain (matrix_static_files_container_labels_base_domain_enabled)
  269. # and wish to serve more than just the `/.well-known/matrix` files from it.
  270. #
  271. # You can also use the auxiliary role (https://github.com/mother-of-all-self-hosting/ansible-role-aux) to create files in
  272. # the public directory (matrix_static_files_public_path) by yourself.
  273. #
  274. # Because you may wish to manage these static files yourself, disabling this variable will intentionally not delete an already existing `index.html` file.
  275. matrix_static_files_file_index_html_enabled: "{{ matrix_static_files_container_labels_base_domain_enabled }}"
  276. matrix_static_files_file_index_html_template: |-
  277. <!doctype html>
  278. <meta charset="utf-8" />
  279. <html>
  280. <body>
  281. Hello from {{ matrix_static_files_container_labels_base_domain_traefik_hostname }}!
  282. </body>
  283. </html>
  284. ########################################################################
  285. # #
  286. # /Related to /index.html #
  287. # #
  288. ########################################################################
  289. # Controls whether the self-check feature should validate SSL certificates.
  290. matrix_static_files_self_check_validate_certificates: true
  291. matrix_static_files_self_check_hostname_matrix: ''
  292. matrix_static_files_self_check_hostname_identity: ''
  293. # Controls whether redirects will be followed when checking the `/.well-known/matrix/client` resource.
  294. #
  295. # As per the spec (https://matrix.org/docs/spec/client_server/r0.6.0#well-known-uri), it shouldn't be,
  296. # so we default to not following redirects as well.
  297. matrix_static_files_self_check_well_known_matrix_client_follow_redirects: none
  298. # TODO - review this one
  299. # Specifies where requests for the root URI (`/`) on the `matrix.` domain should be redirected.
  300. # If this has an empty value, they're just passed to the homeserver, which serves a static page.
  301. # If you'd like to make `https://matrix.DOMAIN` redirect to `https://element.DOMAIN` (or something of that sort), specify the domain name here.
  302. # Example value: `element.DOMAIN` (or `{{ matrix_server_fqn_element }}`).
  303. matrix_static_files_client_redirect_root_uri_to_domain: ""