Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

239 rivejä
11 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2026 MDAD project contributors
  3. SPDX-FileCopyrightText: 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. allow_outgoing_presence = {{ matrix_tuwunel_config_allow_outgoing_presence | to_json }}
  52. {% if matrix_tuwunel_config_url_preview_domain_contains_allowlist | length > 0 %}
  53. url_preview_domain_contains_allowlist = {{ matrix_tuwunel_config_url_preview_domain_contains_allowlist | to_json }}
  54. {% endif %}
  55. {% if matrix_tuwunel_config_url_preview_domain_explicit_allowlist | length > 0 %}
  56. url_preview_domain_explicit_allowlist = {{ matrix_tuwunel_config_url_preview_domain_explicit_allowlist | to_json }}
  57. {% endif %}
  58. url_preview_check_root_domain = {{ matrix_tuwunel_config_url_preview_check_root_domain | to_json }}
  59. create_admin_room = {{ matrix_tuwunel_config_create_admin_room | to_json }}
  60. federate_admin_room = {{ matrix_tuwunel_config_federate_admin_room | to_json }}
  61. grant_admin_to_first_user = {{ matrix_tuwunel_config_grant_admin_to_first_user | to_json }}
  62. log = {{ matrix_tuwunel_config_log | to_json }}
  63. {% if matrix_tuwunel_config_turn_uris | length > 0 %}
  64. turn_uris = {{ matrix_tuwunel_config_turn_uris | to_json }}
  65. {% endif %}
  66. {% if matrix_tuwunel_config_turn_secret | length > 0 %}
  67. turn_secret = {{ matrix_tuwunel_config_turn_secret | to_json }}
  68. {% endif %}
  69. {% if matrix_tuwunel_config_turn_username | length > 0 %}
  70. turn_username = {{ matrix_tuwunel_config_turn_username | to_json }}
  71. {% endif %}
  72. {% if matrix_tuwunel_config_turn_password | length > 0 %}
  73. turn_password = {{ matrix_tuwunel_config_turn_password | to_json }}
  74. {% endif %}
  75. {% if matrix_tuwunel_config_rocksdb_compression_algo | length > 0 %}
  76. rocksdb_compression_algo = {{ matrix_tuwunel_config_rocksdb_compression_algo | to_json }}
  77. {% endif %}
  78. {% if matrix_tuwunel_config_rocksdb_compression_level | string | length > 0 %}
  79. rocksdb_compression_level = {{ matrix_tuwunel_config_rocksdb_compression_level }}
  80. {% endif %}
  81. {% if matrix_tuwunel_config_rocksdb_bottommost_compression_level | string | length > 0 %}
  82. rocksdb_bottommost_compression_level = {{ matrix_tuwunel_config_rocksdb_bottommost_compression_level }}
  83. {% endif %}
  84. rocksdb_direct_io = {{ matrix_tuwunel_config_rocksdb_direct_io | to_json }}
  85. {% if matrix_tuwunel_config_rocksdb_parallelism_threads | int > 0 %}
  86. rocksdb_parallelism_threads = {{ matrix_tuwunel_config_rocksdb_parallelism_threads }}
  87. {% endif %}
  88. {% if matrix_tuwunel_config_rocksdb_max_log_file_size | string | length > 0 %}
  89. rocksdb_max_log_file_size = {{ matrix_tuwunel_config_rocksdb_max_log_file_size }}
  90. {% endif %}
  91. {% if matrix_tuwunel_config_rocksdb_log_time_to_roll | string | length > 0 %}
  92. rocksdb_log_time_to_roll = {{ matrix_tuwunel_config_rocksdb_log_time_to_roll }}
  93. {% endif %}
  94. {% if matrix_tuwunel_config_database_backup_path | length > 0 %}
  95. database_backup_path = {{ matrix_tuwunel_config_database_backup_path | to_json }}
  96. database_backups_to_keep = {{ matrix_tuwunel_config_database_backups_to_keep }}
  97. {% endif %}
  98. {% if matrix_tuwunel_config_cache_capacity_modifier | string | length > 0 %}
  99. cache_capacity_modifier = {{ matrix_tuwunel_config_cache_capacity_modifier }}
  100. {% endif %}
  101. {% if matrix_tuwunel_config_db_cache_capacity_mb | string | length > 0 %}
  102. db_cache_capacity_mb = {{ matrix_tuwunel_config_db_cache_capacity_mb }}
  103. {% endif %}
  104. {% if matrix_tuwunel_config_db_write_buffer_capacity_mb | string | length > 0 %}
  105. db_write_buffer_capacity_mb = {{ matrix_tuwunel_config_db_write_buffer_capacity_mb }}
  106. {% endif %}
  107. {% if matrix_tuwunel_config_sentry_enabled | bool %}
  108. sentry = true
  109. {% if matrix_tuwunel_config_sentry_endpoint | length > 0 %}
  110. sentry_endpoint = {{ matrix_tuwunel_config_sentry_endpoint | to_json }}
  111. {% endif %}
  112. sentry_send_server_name = {{ matrix_tuwunel_config_sentry_send_server_name | to_json }}
  113. sentry_traces_sample_rate = {{ matrix_tuwunel_config_sentry_traces_sample_rate }}
  114. {% endif %}
  115. {% if (matrix_tuwunel_config_tls_certs | length > 0) and (matrix_tuwunel_config_tls_key | length > 0) %}
  116. [global.tls]
  117. certs = {{ matrix_tuwunel_config_tls_certs | to_json }}
  118. key = {{ matrix_tuwunel_config_tls_key | to_json }}
  119. dual_protocol = {{ matrix_tuwunel_config_tls_dual_protocol | to_json }}
  120. {% endif %}
  121. {% set well_known_keys = [
  122. matrix_tuwunel_config_well_known_client,
  123. matrix_tuwunel_config_well_known_server,
  124. matrix_tuwunel_config_well_known_support_page,
  125. matrix_tuwunel_config_well_known_support_email,
  126. matrix_tuwunel_config_well_known_support_mxid,
  127. matrix_tuwunel_config_well_known_livekit_url,
  128. ] %}
  129. {% if well_known_keys | select | list | length > 0 %}
  130. [global.well_known]
  131. {% if matrix_tuwunel_config_well_known_client | length > 0 %}
  132. client = {{ matrix_tuwunel_config_well_known_client | to_json }}
  133. {% endif %}
  134. {% if matrix_tuwunel_config_well_known_server | length > 0 %}
  135. server = {{ matrix_tuwunel_config_well_known_server | to_json }}
  136. {% endif %}
  137. {% if matrix_tuwunel_config_well_known_support_page | length > 0 %}
  138. support_page = {{ matrix_tuwunel_config_well_known_support_page | to_json }}
  139. {% endif %}
  140. {% if matrix_tuwunel_config_well_known_support_email | length > 0 %}
  141. support_email = {{ matrix_tuwunel_config_well_known_support_email | to_json }}
  142. {% endif %}
  143. {% if matrix_tuwunel_config_well_known_support_mxid | length > 0 %}
  144. support_mxid = {{ matrix_tuwunel_config_well_known_support_mxid | to_json }}
  145. {% endif %}
  146. {% if matrix_tuwunel_config_well_known_livekit_url | length > 0 %}
  147. livekit_url = {{ matrix_tuwunel_config_well_known_livekit_url | to_json }}
  148. {% endif %}
  149. {% endif %}
  150. {% if matrix_tuwunel_config_blurhashing_enabled | bool %}
  151. [global.blurhashing]
  152. components_x = {{ matrix_tuwunel_config_blurhashing_components_x }}
  153. components_y = {{ matrix_tuwunel_config_blurhashing_components_y }}
  154. blurhash_max_raw_size = {{ matrix_tuwunel_config_blurhashing_max_raw_size }}
  155. {% endif %}
  156. {% if matrix_tuwunel_config_ldap_enabled | bool %}
  157. [global.ldap]
  158. enable = true
  159. uri = {{ matrix_tuwunel_config_ldap_uri | to_json }}
  160. base_dn = {{ matrix_tuwunel_config_ldap_base_dn | to_json }}
  161. {% if matrix_tuwunel_config_ldap_bind_dn | length > 0 %}
  162. bind_dn = {{ matrix_tuwunel_config_ldap_bind_dn | to_json }}
  163. {% endif %}
  164. {% if matrix_tuwunel_config_ldap_bind_password_file | length > 0 %}
  165. bind_password_file = {{ matrix_tuwunel_config_ldap_bind_password_file | to_json }}
  166. {% endif %}
  167. filter = {{ matrix_tuwunel_config_ldap_filter | to_json }}
  168. uid_attribute = {{ matrix_tuwunel_config_ldap_uid_attribute | to_json }}
  169. name_attribute = {{ matrix_tuwunel_config_ldap_name_attribute | to_json }}
  170. {% if matrix_tuwunel_config_ldap_admin_base_dn | length > 0 %}
  171. admin_base_dn = {{ matrix_tuwunel_config_ldap_admin_base_dn | to_json }}
  172. {% endif %}
  173. {% if matrix_tuwunel_config_ldap_admin_filter | length > 0 %}
  174. admin_filter = {{ matrix_tuwunel_config_ldap_admin_filter | to_json }}
  175. {% endif %}
  176. {% endif %}
  177. {% if matrix_tuwunel_config_jwt_enabled | bool %}
  178. [global.jwt]
  179. enable = true
  180. {% if matrix_tuwunel_config_jwt_key | length > 0 %}
  181. key = {{ matrix_tuwunel_config_jwt_key | to_json }}
  182. {% endif %}
  183. format = {{ matrix_tuwunel_config_jwt_format | to_json }}
  184. algorithm = {{ matrix_tuwunel_config_jwt_algorithm | to_json }}
  185. register_user = {{ matrix_tuwunel_config_jwt_register_user | to_json }}
  186. {% if matrix_tuwunel_config_jwt_audience | length > 0 %}
  187. audience = {{ matrix_tuwunel_config_jwt_audience | to_json }}
  188. {% endif %}
  189. {% if matrix_tuwunel_config_jwt_issuer | length > 0 %}
  190. issuer = {{ matrix_tuwunel_config_jwt_issuer | to_json }}
  191. {% endif %}
  192. require_exp = {{ matrix_tuwunel_config_jwt_require_exp | to_json }}
  193. require_nbf = {{ matrix_tuwunel_config_jwt_require_nbf | to_json }}
  194. validate_exp = {{ matrix_tuwunel_config_jwt_validate_exp | to_json }}
  195. validate_nbf = {{ matrix_tuwunel_config_jwt_validate_nbf | to_json }}
  196. {% endif %}
  197. {% for idp in matrix_tuwunel_config_identity_providers %}
  198. [[global.identity_provider]]
  199. {% for key, value in idp.items() %}
  200. {{ key }} = {{ value | to_json }}
  201. {% endfor %}
  202. {% endfor %}
  203. {% for sp in matrix_tuwunel_config_storage_providers %}
  204. [global.storage_provider.{{ sp.id }}.{{ sp.kind }}]
  205. {% for key, value in sp.items() if key not in ['id', 'kind'] %}
  206. {{ key }} = {{ value | to_json }}
  207. {% endfor %}
  208. {% endfor %}