Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

244 строки
11 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2025 - 2026 MDAD project contributors
  3. SPDX-FileCopyrightText: 2025 - 2026 Slavi Pantaleev
  4. SPDX-License-Identifier: AGPL-3.0-or-later
  5. #}
  6. ### Tuwunel configuration rendered by matrix-docker-ansible-deploy.
  7. ###
  8. ### This file only emits options exposed as Ansible variables. All other knobs
  9. ### keep tuwunel's upstream defaults. To override anything not surfaced here,
  10. ### use `matrix_tuwunel_environment_variables_extension` (env vars override TOML)
  11. ### or replace the template via `matrix_tuwunel_template_tuwunel_config`.
  12. ###
  13. ### Reference: https://matrix-construct.github.io/tuwunel/configuration.html
  14. [global]
  15. server_name = {{ matrix_tuwunel_config_server_name | to_json }}
  16. address = "0.0.0.0"
  17. port = {{ matrix_tuwunel_config_port_number }}
  18. database_path = "/var/lib/tuwunel"
  19. max_request_size = {{ matrix_tuwunel_config_max_request_size }}
  20. new_user_displayname_suffix = {{ matrix_tuwunel_config_new_user_displayname_suffix | to_json }}
  21. allow_registration = {{ matrix_tuwunel_config_allow_registration | to_json }}
  22. {% if matrix_tuwunel_config_registration_token | length > 0 %}
  23. registration_token = {{ matrix_tuwunel_config_registration_token | to_json }}
  24. {% endif %}
  25. {% if matrix_tuwunel_config_yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse | bool %}
  26. yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse = true
  27. {% endif %}
  28. {% if matrix_tuwunel_config_emergency_password | length > 0 %}
  29. emergency_password = {{ matrix_tuwunel_config_emergency_password | to_json }}
  30. {% endif %}
  31. allow_encryption = {{ matrix_tuwunel_config_allow_encryption | to_json }}
  32. allow_room_creation = {{ matrix_tuwunel_config_allow_room_creation | to_json }}
  33. default_room_version = {{ matrix_tuwunel_config_default_room_version | to_json }}
  34. {% if matrix_tuwunel_config_auto_join_rooms | length > 0 %}
  35. auto_join_rooms = {{ matrix_tuwunel_config_auto_join_rooms | to_json }}
  36. {% endif %}
  37. allow_federation = {{ matrix_tuwunel_config_allow_federation | to_json }}
  38. trusted_servers = {{ matrix_tuwunel_config_trusted_servers | to_json }}
  39. {% if matrix_tuwunel_config_allowed_remote_server_names | length > 0 %}
  40. allowed_remote_server_names_experimental = {{ matrix_tuwunel_config_allowed_remote_server_names | to_json }}
  41. {% endif %}
  42. {% if matrix_tuwunel_config_forbidden_remote_server_names | length > 0 %}
  43. forbidden_remote_server_names = {{ matrix_tuwunel_config_forbidden_remote_server_names | to_json }}
  44. {% endif %}
  45. {% if matrix_tuwunel_config_forbidden_remote_room_directory_server_names | length > 0 %}
  46. forbidden_remote_room_directory_server_names = {{ matrix_tuwunel_config_forbidden_remote_room_directory_server_names | to_json }}
  47. {% endif %}
  48. {% if matrix_tuwunel_config_prevent_media_downloads_from | length > 0 %}
  49. prevent_media_downloads_from = {{ matrix_tuwunel_config_prevent_media_downloads_from | to_json }}
  50. {% endif %}
  51. ip_range_denylist = {{ matrix_tuwunel_config_ip_range_denylist | to_json }}
  52. enable_policy_servers = {{ matrix_tuwunel_config_enable_policy_servers | to_json }}
  53. policy_server_request_timeout = {{ matrix_tuwunel_config_policy_server_request_timeout }}
  54. msc3664_related_event_match = {{ matrix_tuwunel_config_msc3664_related_event_match | to_json }}
  55. allow_outgoing_presence = {{ matrix_tuwunel_config_allow_outgoing_presence | to_json }}
  56. {% if matrix_tuwunel_config_url_preview_domain_contains_allowlist | length > 0 %}
  57. url_preview_domain_contains_allowlist = {{ matrix_tuwunel_config_url_preview_domain_contains_allowlist | to_json }}
  58. {% endif %}
  59. {% if matrix_tuwunel_config_url_preview_domain_explicit_allowlist | length > 0 %}
  60. url_preview_domain_explicit_allowlist = {{ matrix_tuwunel_config_url_preview_domain_explicit_allowlist | to_json }}
  61. {% endif %}
  62. url_preview_check_root_domain = {{ matrix_tuwunel_config_url_preview_check_root_domain | to_json }}
  63. create_admin_room = {{ matrix_tuwunel_config_create_admin_room | to_json }}
  64. federate_admin_room = {{ matrix_tuwunel_config_federate_admin_room | to_json }}
  65. grant_admin_to_first_user = {{ matrix_tuwunel_config_grant_admin_to_first_user | to_json }}
  66. log = {{ matrix_tuwunel_config_log | to_json }}
  67. {% if matrix_tuwunel_config_turn_uris | length > 0 %}
  68. turn_uris = {{ matrix_tuwunel_config_turn_uris | to_json }}
  69. {% endif %}
  70. {% if matrix_tuwunel_config_turn_secret | length > 0 %}
  71. turn_secret = {{ matrix_tuwunel_config_turn_secret | to_json }}
  72. {% endif %}
  73. {% if matrix_tuwunel_config_turn_username | length > 0 %}
  74. turn_username = {{ matrix_tuwunel_config_turn_username | to_json }}
  75. {% endif %}
  76. {% if matrix_tuwunel_config_turn_password | length > 0 %}
  77. turn_password = {{ matrix_tuwunel_config_turn_password | to_json }}
  78. {% endif %}
  79. {% if matrix_tuwunel_config_rocksdb_compression_algo | length > 0 %}
  80. rocksdb_compression_algo = {{ matrix_tuwunel_config_rocksdb_compression_algo | to_json }}
  81. {% endif %}
  82. {% if matrix_tuwunel_config_rocksdb_compression_level | string | length > 0 %}
  83. rocksdb_compression_level = {{ matrix_tuwunel_config_rocksdb_compression_level }}
  84. {% endif %}
  85. {% if matrix_tuwunel_config_rocksdb_bottommost_compression_level | string | length > 0 %}
  86. rocksdb_bottommost_compression_level = {{ matrix_tuwunel_config_rocksdb_bottommost_compression_level }}
  87. {% endif %}
  88. rocksdb_direct_io = {{ matrix_tuwunel_config_rocksdb_direct_io | to_json }}
  89. {% if matrix_tuwunel_config_rocksdb_parallelism_threads | int > 0 %}
  90. rocksdb_parallelism_threads = {{ matrix_tuwunel_config_rocksdb_parallelism_threads }}
  91. {% endif %}
  92. {% if matrix_tuwunel_config_rocksdb_max_log_file_size | string | length > 0 %}
  93. rocksdb_max_log_file_size = {{ matrix_tuwunel_config_rocksdb_max_log_file_size }}
  94. {% endif %}
  95. {% if matrix_tuwunel_config_rocksdb_log_time_to_roll | string | length > 0 %}
  96. rocksdb_log_time_to_roll = {{ matrix_tuwunel_config_rocksdb_log_time_to_roll }}
  97. {% endif %}
  98. {% if matrix_tuwunel_config_database_backup_path | length > 0 %}
  99. database_backup_path = {{ matrix_tuwunel_config_database_backup_path | to_json }}
  100. database_backups_to_keep = {{ matrix_tuwunel_config_database_backups_to_keep }}
  101. {% endif %}
  102. {% if matrix_tuwunel_config_cache_capacity_modifier | string | length > 0 %}
  103. cache_capacity_modifier = {{ matrix_tuwunel_config_cache_capacity_modifier }}
  104. {% endif %}
  105. {% if matrix_tuwunel_config_db_cache_capacity_mb | string | length > 0 %}
  106. db_cache_capacity_mb = {{ matrix_tuwunel_config_db_cache_capacity_mb }}
  107. {% endif %}
  108. {% if matrix_tuwunel_config_db_write_buffer_capacity_mb | string | length > 0 %}
  109. db_write_buffer_capacity_mb = {{ matrix_tuwunel_config_db_write_buffer_capacity_mb }}
  110. {% endif %}
  111. {% if matrix_tuwunel_config_sentry_enabled | bool %}
  112. sentry = true
  113. {% if matrix_tuwunel_config_sentry_endpoint | length > 0 %}
  114. sentry_endpoint = {{ matrix_tuwunel_config_sentry_endpoint | to_json }}
  115. {% endif %}
  116. sentry_send_server_name = {{ matrix_tuwunel_config_sentry_send_server_name | to_json }}
  117. sentry_traces_sample_rate = {{ matrix_tuwunel_config_sentry_traces_sample_rate }}
  118. {% endif %}
  119. {% if (matrix_tuwunel_config_tls_certs | length > 0) and (matrix_tuwunel_config_tls_key | length > 0) %}
  120. [global.tls]
  121. certs = {{ matrix_tuwunel_config_tls_certs | to_json }}
  122. key = {{ matrix_tuwunel_config_tls_key | to_json }}
  123. dual_protocol = {{ matrix_tuwunel_config_tls_dual_protocol | to_json }}
  124. {% endif %}
  125. {% set well_known_keys = [
  126. matrix_tuwunel_config_well_known_client,
  127. matrix_tuwunel_config_well_known_server,
  128. matrix_tuwunel_config_well_known_support_page,
  129. matrix_tuwunel_config_well_known_support_email,
  130. matrix_tuwunel_config_well_known_support_mxid,
  131. matrix_tuwunel_config_well_known_livekit_url,
  132. ] %}
  133. {% if well_known_keys | select | list | length > 0 %}
  134. [global.well_known]
  135. {% if matrix_tuwunel_config_well_known_client | length > 0 %}
  136. client = {{ matrix_tuwunel_config_well_known_client | to_json }}
  137. {% endif %}
  138. {% if matrix_tuwunel_config_well_known_server | length > 0 %}
  139. server = {{ matrix_tuwunel_config_well_known_server | to_json }}
  140. {% endif %}
  141. {% if matrix_tuwunel_config_well_known_support_page | length > 0 %}
  142. support_page = {{ matrix_tuwunel_config_well_known_support_page | to_json }}
  143. {% endif %}
  144. {% if matrix_tuwunel_config_well_known_support_email | length > 0 %}
  145. support_email = {{ matrix_tuwunel_config_well_known_support_email | to_json }}
  146. {% endif %}
  147. {% if matrix_tuwunel_config_well_known_support_mxid | length > 0 %}
  148. support_mxid = {{ matrix_tuwunel_config_well_known_support_mxid | to_json }}
  149. {% endif %}
  150. {% if matrix_tuwunel_config_well_known_livekit_url | length > 0 %}
  151. livekit_url = {{ matrix_tuwunel_config_well_known_livekit_url | to_json }}
  152. {% endif %}
  153. {% endif %}
  154. {% if matrix_tuwunel_config_blurhashing_enabled | bool %}
  155. [global.blurhashing]
  156. components_x = {{ matrix_tuwunel_config_blurhashing_components_x }}
  157. components_y = {{ matrix_tuwunel_config_blurhashing_components_y }}
  158. blurhash_max_raw_size = {{ matrix_tuwunel_config_blurhashing_max_raw_size }}
  159. {% endif %}
  160. {% if matrix_tuwunel_config_ldap_enabled | bool %}
  161. [global.ldap]
  162. enable = true
  163. uri = {{ matrix_tuwunel_config_ldap_uri | to_json }}
  164. base_dn = {{ matrix_tuwunel_config_ldap_base_dn | to_json }}
  165. {% if matrix_tuwunel_config_ldap_bind_dn | length > 0 %}
  166. bind_dn = {{ matrix_tuwunel_config_ldap_bind_dn | to_json }}
  167. {% endif %}
  168. {% if matrix_tuwunel_config_ldap_bind_password_file | length > 0 %}
  169. bind_password_file = {{ matrix_tuwunel_config_ldap_bind_password_file | to_json }}
  170. {% endif %}
  171. filter = {{ matrix_tuwunel_config_ldap_filter | to_json }}
  172. uid_attribute = {{ matrix_tuwunel_config_ldap_uid_attribute | to_json }}
  173. {% if matrix_tuwunel_config_ldap_admin_base_dn | length > 0 %}
  174. admin_base_dn = {{ matrix_tuwunel_config_ldap_admin_base_dn | to_json }}
  175. {% endif %}
  176. {% if matrix_tuwunel_config_ldap_admin_filter | length > 0 %}
  177. admin_filter = {{ matrix_tuwunel_config_ldap_admin_filter | to_json }}
  178. {% endif %}
  179. {% endif %}
  180. {% if matrix_tuwunel_config_jwt_enabled | bool %}
  181. [global.jwt]
  182. enable = true
  183. {% if matrix_tuwunel_config_jwt_key | length > 0 %}
  184. key = {{ matrix_tuwunel_config_jwt_key | to_json }}
  185. {% endif %}
  186. format = {{ matrix_tuwunel_config_jwt_format | to_json }}
  187. algorithm = {{ matrix_tuwunel_config_jwt_algorithm | to_json }}
  188. register_user = {{ matrix_tuwunel_config_jwt_register_user | to_json }}
  189. {% if matrix_tuwunel_config_jwt_audience | length > 0 %}
  190. audience = {{ matrix_tuwunel_config_jwt_audience | to_json }}
  191. {% endif %}
  192. {% if matrix_tuwunel_config_jwt_issuer | length > 0 %}
  193. issuer = {{ matrix_tuwunel_config_jwt_issuer | to_json }}
  194. {% endif %}
  195. require_exp = {{ matrix_tuwunel_config_jwt_require_exp | to_json }}
  196. require_nbf = {{ matrix_tuwunel_config_jwt_require_nbf | to_json }}
  197. validate_exp = {{ matrix_tuwunel_config_jwt_validate_exp | to_json }}
  198. validate_nbf = {{ matrix_tuwunel_config_jwt_validate_nbf | to_json }}
  199. {% endif %}
  200. {% for idp in matrix_tuwunel_config_identity_providers %}
  201. [[global.identity_provider]]
  202. {% for key, value in idp.items() %}
  203. {{ key }} = {{ value | to_json }}
  204. {% endfor %}
  205. {% endfor %}
  206. {% for sp in matrix_tuwunel_config_storage_providers %}
  207. [global.storage_provider.{{ sp.id }}.{{ sp.kind }}]
  208. {% for key, value in sp.items() if key not in ['id', 'kind'] %}
  209. {{ key }} = {{ value | to_json }}
  210. {% endfor %}
  211. {% endfor %}