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

243 строки
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. allow_outgoing_presence = {{ matrix_tuwunel_config_allow_outgoing_presence | to_json }}
  55. {% if matrix_tuwunel_config_url_preview_domain_contains_allowlist | length > 0 %}
  56. url_preview_domain_contains_allowlist = {{ matrix_tuwunel_config_url_preview_domain_contains_allowlist | to_json }}
  57. {% endif %}
  58. {% if matrix_tuwunel_config_url_preview_domain_explicit_allowlist | length > 0 %}
  59. url_preview_domain_explicit_allowlist = {{ matrix_tuwunel_config_url_preview_domain_explicit_allowlist | to_json }}
  60. {% endif %}
  61. url_preview_check_root_domain = {{ matrix_tuwunel_config_url_preview_check_root_domain | to_json }}
  62. create_admin_room = {{ matrix_tuwunel_config_create_admin_room | to_json }}
  63. federate_admin_room = {{ matrix_tuwunel_config_federate_admin_room | to_json }}
  64. grant_admin_to_first_user = {{ matrix_tuwunel_config_grant_admin_to_first_user | to_json }}
  65. log = {{ matrix_tuwunel_config_log | to_json }}
  66. {% if matrix_tuwunel_config_turn_uris | length > 0 %}
  67. turn_uris = {{ matrix_tuwunel_config_turn_uris | to_json }}
  68. {% endif %}
  69. {% if matrix_tuwunel_config_turn_secret | length > 0 %}
  70. turn_secret = {{ matrix_tuwunel_config_turn_secret | to_json }}
  71. {% endif %}
  72. {% if matrix_tuwunel_config_turn_username | length > 0 %}
  73. turn_username = {{ matrix_tuwunel_config_turn_username | to_json }}
  74. {% endif %}
  75. {% if matrix_tuwunel_config_turn_password | length > 0 %}
  76. turn_password = {{ matrix_tuwunel_config_turn_password | to_json }}
  77. {% endif %}
  78. {% if matrix_tuwunel_config_rocksdb_compression_algo | length > 0 %}
  79. rocksdb_compression_algo = {{ matrix_tuwunel_config_rocksdb_compression_algo | to_json }}
  80. {% endif %}
  81. {% if matrix_tuwunel_config_rocksdb_compression_level | string | length > 0 %}
  82. rocksdb_compression_level = {{ matrix_tuwunel_config_rocksdb_compression_level }}
  83. {% endif %}
  84. {% if matrix_tuwunel_config_rocksdb_bottommost_compression_level | string | length > 0 %}
  85. rocksdb_bottommost_compression_level = {{ matrix_tuwunel_config_rocksdb_bottommost_compression_level }}
  86. {% endif %}
  87. rocksdb_direct_io = {{ matrix_tuwunel_config_rocksdb_direct_io | to_json }}
  88. {% if matrix_tuwunel_config_rocksdb_parallelism_threads | int > 0 %}
  89. rocksdb_parallelism_threads = {{ matrix_tuwunel_config_rocksdb_parallelism_threads }}
  90. {% endif %}
  91. {% if matrix_tuwunel_config_rocksdb_max_log_file_size | string | length > 0 %}
  92. rocksdb_max_log_file_size = {{ matrix_tuwunel_config_rocksdb_max_log_file_size }}
  93. {% endif %}
  94. {% if matrix_tuwunel_config_rocksdb_log_time_to_roll | string | length > 0 %}
  95. rocksdb_log_time_to_roll = {{ matrix_tuwunel_config_rocksdb_log_time_to_roll }}
  96. {% endif %}
  97. {% if matrix_tuwunel_config_database_backup_path | length > 0 %}
  98. database_backup_path = {{ matrix_tuwunel_config_database_backup_path | to_json }}
  99. database_backups_to_keep = {{ matrix_tuwunel_config_database_backups_to_keep }}
  100. {% endif %}
  101. {% if matrix_tuwunel_config_cache_capacity_modifier | string | length > 0 %}
  102. cache_capacity_modifier = {{ matrix_tuwunel_config_cache_capacity_modifier }}
  103. {% endif %}
  104. {% if matrix_tuwunel_config_db_cache_capacity_mb | string | length > 0 %}
  105. db_cache_capacity_mb = {{ matrix_tuwunel_config_db_cache_capacity_mb }}
  106. {% endif %}
  107. {% if matrix_tuwunel_config_db_write_buffer_capacity_mb | string | length > 0 %}
  108. db_write_buffer_capacity_mb = {{ matrix_tuwunel_config_db_write_buffer_capacity_mb }}
  109. {% endif %}
  110. {% if matrix_tuwunel_config_sentry_enabled | bool %}
  111. sentry = true
  112. {% if matrix_tuwunel_config_sentry_endpoint | length > 0 %}
  113. sentry_endpoint = {{ matrix_tuwunel_config_sentry_endpoint | to_json }}
  114. {% endif %}
  115. sentry_send_server_name = {{ matrix_tuwunel_config_sentry_send_server_name | to_json }}
  116. sentry_traces_sample_rate = {{ matrix_tuwunel_config_sentry_traces_sample_rate }}
  117. {% endif %}
  118. {% if (matrix_tuwunel_config_tls_certs | length > 0) and (matrix_tuwunel_config_tls_key | length > 0) %}
  119. [global.tls]
  120. certs = {{ matrix_tuwunel_config_tls_certs | to_json }}
  121. key = {{ matrix_tuwunel_config_tls_key | to_json }}
  122. dual_protocol = {{ matrix_tuwunel_config_tls_dual_protocol | to_json }}
  123. {% endif %}
  124. {% set well_known_keys = [
  125. matrix_tuwunel_config_well_known_client,
  126. matrix_tuwunel_config_well_known_server,
  127. matrix_tuwunel_config_well_known_support_page,
  128. matrix_tuwunel_config_well_known_support_email,
  129. matrix_tuwunel_config_well_known_support_mxid,
  130. matrix_tuwunel_config_well_known_livekit_url,
  131. ] %}
  132. {% if well_known_keys | select | list | length > 0 %}
  133. [global.well_known]
  134. {% if matrix_tuwunel_config_well_known_client | length > 0 %}
  135. client = {{ matrix_tuwunel_config_well_known_client | to_json }}
  136. {% endif %}
  137. {% if matrix_tuwunel_config_well_known_server | length > 0 %}
  138. server = {{ matrix_tuwunel_config_well_known_server | to_json }}
  139. {% endif %}
  140. {% if matrix_tuwunel_config_well_known_support_page | length > 0 %}
  141. support_page = {{ matrix_tuwunel_config_well_known_support_page | to_json }}
  142. {% endif %}
  143. {% if matrix_tuwunel_config_well_known_support_email | length > 0 %}
  144. support_email = {{ matrix_tuwunel_config_well_known_support_email | to_json }}
  145. {% endif %}
  146. {% if matrix_tuwunel_config_well_known_support_mxid | length > 0 %}
  147. support_mxid = {{ matrix_tuwunel_config_well_known_support_mxid | to_json }}
  148. {% endif %}
  149. {% if matrix_tuwunel_config_well_known_livekit_url | length > 0 %}
  150. livekit_url = {{ matrix_tuwunel_config_well_known_livekit_url | to_json }}
  151. {% endif %}
  152. {% endif %}
  153. {% if matrix_tuwunel_config_blurhashing_enabled | bool %}
  154. [global.blurhashing]
  155. components_x = {{ matrix_tuwunel_config_blurhashing_components_x }}
  156. components_y = {{ matrix_tuwunel_config_blurhashing_components_y }}
  157. blurhash_max_raw_size = {{ matrix_tuwunel_config_blurhashing_max_raw_size }}
  158. {% endif %}
  159. {% if matrix_tuwunel_config_ldap_enabled | bool %}
  160. [global.ldap]
  161. enable = true
  162. uri = {{ matrix_tuwunel_config_ldap_uri | to_json }}
  163. base_dn = {{ matrix_tuwunel_config_ldap_base_dn | to_json }}
  164. {% if matrix_tuwunel_config_ldap_bind_dn | length > 0 %}
  165. bind_dn = {{ matrix_tuwunel_config_ldap_bind_dn | to_json }}
  166. {% endif %}
  167. {% if matrix_tuwunel_config_ldap_bind_password_file | length > 0 %}
  168. bind_password_file = {{ matrix_tuwunel_config_ldap_bind_password_file | to_json }}
  169. {% endif %}
  170. filter = {{ matrix_tuwunel_config_ldap_filter | to_json }}
  171. uid_attribute = {{ matrix_tuwunel_config_ldap_uid_attribute | to_json }}
  172. name_attribute = {{ matrix_tuwunel_config_ldap_name_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 %}