Matrix Docker Ansible eploy
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

254 行
15 KiB

  1. # SPDX-FileCopyrightText: 2019 - 2024 MDAD project contributors
  2. # SPDX-FileCopyrightText: 2019 - 2025 Slavi Pantaleev
  3. # SPDX-FileCopyrightText: 2020 Johanna Dorothea Reichmann
  4. # SPDX-FileCopyrightText: 2020 Marcel Partap
  5. # SPDX-FileCopyrightText: 2021 Aaron Raimist
  6. # SPDX-FileCopyrightText: 2021 Panagiotis Georgiadis
  7. # SPDX-FileCopyrightText: 2022 - 2023 Nikita Chernyi
  8. # SPDX-FileCopyrightText: 2022 László Várady
  9. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  10. # SPDX-FileCopyrightText: 2022 Olivér Falvai
  11. # SPDX-FileCopyrightText: 2022 Vincent Post
  12. # SPDX-FileCopyrightText: 2023 Samuel Meenzen
  13. # SPDX-FileCopyrightText: 2024 Pierre 'McFly' Marty
  14. #
  15. # SPDX-License-Identifier: AGPL-3.0-or-later
  16. ---
  17. # mautrix-telegram is a Matrix <-> Telegram bridge
  18. # Project source code URL: https://github.com/mautrix/telegram
  19. matrix_mautrix_telegram_enabled: true
  20. matrix_mautrix_telegram_scheme: https
  21. matrix_mautrix_telegram_hostname: ''
  22. matrix_mautrix_telegram_path_prefix: ''
  23. matrix_mautrix_telegram_lottieconverter_container_image_self_build: false
  24. matrix_mautrix_telegram_lottieconverter_container_image_self_build_mask_arch: false
  25. matrix_mautrix_telegram_lottieconverter_docker_repo: "https://mau.dev/tulir/lottieconverter.git"
  26. matrix_mautrix_telegram_lottieconverter_docker_repo_version: "master"
  27. matrix_mautrix_telegram_lottieconverter_docker_src_files_path: "{{ matrix_base_data_path }}/lotticonverter/docker-src"
  28. matrix_mautrix_telegram_lottieconverter_docker_image: "{{ matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix }}tulir/lottieconverter:alpine-3.16" # needs to be adjusted according to the FROM clause of Dockerfile of mautrix-telegram
  29. matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix: "{{ 'localhost/' if matrix_mautrix_telegram_lottieconverter_container_image_self_build else matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix_upstream }}"
  30. matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix_upstream: "{{ matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix_upstream_default }}"
  31. matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix_upstream_default: "dock.mau.dev/"
  32. matrix_mautrix_telegram_container_image_self_build: false
  33. matrix_mautrix_telegram_docker_repo: "https://mau.dev/mautrix/telegram.git"
  34. matrix_mautrix_telegram_docker_repo_version: "{{ 'master' if matrix_mautrix_telegram_version == 'latest' else matrix_mautrix_telegram_version }}"
  35. matrix_mautrix_telegram_docker_src_files_path: "{{ matrix_base_data_path }}/mautrix-telegram/docker-src"
  36. # renovate: datasource=docker depName=dock.mau.dev/mautrix/telegram
  37. matrix_mautrix_telegram_version: v0.15.2
  38. # See: https://mau.dev/mautrix/telegram/container_registry
  39. matrix_mautrix_telegram_docker_image: "{{ matrix_mautrix_telegram_docker_image_registry_prefix }}mautrix/telegram:{{ matrix_mautrix_telegram_version }}"
  40. matrix_mautrix_telegram_docker_image_registry_prefix: "{{ 'localhost/' if matrix_mautrix_telegram_container_image_self_build else matrix_mautrix_telegram_docker_image_registry_prefix_upstream }}"
  41. matrix_mautrix_telegram_docker_image_registry_prefix_upstream: "{{ matrix_mautrix_telegram_docker_image_registry_prefix_upstream_default }}"
  42. matrix_mautrix_telegram_docker_image_registry_prefix_upstream_default: "dock.mau.dev/"
  43. matrix_mautrix_telegram_docker_image_force_pull: "{{ matrix_mautrix_telegram_docker_image.endswith(':latest') }}"
  44. matrix_mautrix_telegram_base_path: "{{ matrix_base_data_path }}/mautrix-telegram"
  45. matrix_mautrix_telegram_config_path: "{{ matrix_mautrix_telegram_base_path }}/config"
  46. matrix_mautrix_telegram_data_path: "{{ matrix_mautrix_telegram_base_path }}/data"
  47. matrix_mautrix_telegram_command_prefix: "!tg"
  48. matrix_mautrix_telegram_bridge_permissions: |
  49. {{
  50. {'*': 'relaybot', matrix_mautrix_telegram_homeserver_domain: 'full'}
  51. | combine({matrix_admin: 'admin'} if matrix_admin else {})
  52. }}
  53. # Get your own API keys at https://my.telegram.org/apps
  54. matrix_mautrix_telegram_api_id: ''
  55. matrix_mautrix_telegram_api_hash: ''
  56. matrix_mautrix_telegram_bot_token: disabled
  57. # Define the filter-mode
  58. matrix_mautrix_telegram_filter_mode: "blacklist"
  59. # Whether or not the public-facing endpoints should be enabled (web-based login)
  60. matrix_mautrix_telegram_appservice_public_enabled: true
  61. # Mautrix telegram public endpoint to log in to telegram
  62. # Use an uuid so it's not easily discoverable.
  63. # Example: /741a0483-ba17-4682-9900-30bd7269f1cc
  64. matrix_mautrix_telegram_public_endpoint: "{{ matrix_mautrix_telegram_path_prefix }}"
  65. matrix_mautrix_telegram_homeserver_address: ""
  66. matrix_mautrix_telegram_homeserver_domain: '{{ matrix_domain }}'
  67. matrix_mautrix_telegram_appservice_address: 'http://matrix-mautrix-telegram:8080'
  68. matrix_mautrix_telegram_appservice_public_external: '{{ matrix_mautrix_telegram_scheme }}://{{ matrix_mautrix_telegram_hostname }}{{ matrix_mautrix_telegram_public_endpoint }}'
  69. matrix_mautrix_telegram_appservice_bot_username: telegrambot
  70. # Specifies the default log level for all bridge loggers.
  71. matrix_mautrix_telegram_logging_level: WARNING
  72. # Whether or not created rooms should have federation enabled.
  73. # If false, created portal rooms will never be federated.
  74. matrix_mautrix_telegram_federate_rooms: true
  75. # Controls whether the matrix-mautrix-telegram container exposes its HTTP port (tcp/8080 in the container).
  76. #
  77. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9006"), or empty string to not expose.
  78. matrix_mautrix_telegram_container_http_host_bind_port: ''
  79. matrix_mautrix_telegram_container_network: ""
  80. matrix_mautrix_telegram_container_additional_networks: "{{ matrix_mautrix_telegram_container_additional_networks_auto + matrix_mautrix_telegram_container_additional_networks_custom }}"
  81. matrix_mautrix_telegram_container_additional_networks_auto: []
  82. matrix_mautrix_telegram_container_additional_networks_custom: []
  83. # matrix_mautrix_telegram_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  84. # See `../templates/labels.j2` for details.
  85. #
  86. # To inject your own other container labels, see `matrix_mautrix_telegram_container_labels_additional_labels`.
  87. matrix_mautrix_telegram_container_labels_traefik_enabled: true
  88. matrix_mautrix_telegram_container_labels_traefik_docker_network: "{{ matrix_mautrix_telegram_container_network }}"
  89. matrix_mautrix_telegram_container_labels_traefik_entrypoints: web-secure
  90. matrix_mautrix_telegram_container_labels_traefik_tls_certResolver: default # noqa var-naming
  91. # Controls whether labels will be added that expose mautrix-telegram's public endpoint
  92. matrix_mautrix_telegram_container_labels_public_endpoint_enabled: "{{ matrix_mautrix_telegram_appservice_public_enabled }}"
  93. matrix_mautrix_telegram_container_labels_public_endpoint_hostname: "{{ matrix_mautrix_telegram_hostname }}"
  94. matrix_mautrix_telegram_container_labels_public_endpoint_path_prefix: "{{ matrix_mautrix_telegram_path_prefix }}"
  95. matrix_mautrix_telegram_container_labels_public_endpoint_traefik_rule: "Host(`{{ matrix_mautrix_telegram_container_labels_public_endpoint_hostname }}`) && PathPrefix(`{{ matrix_mautrix_telegram_container_labels_public_endpoint_path_prefix }}`)"
  96. matrix_mautrix_telegram_container_labels_public_endpoint_traefik_priority: 0
  97. matrix_mautrix_telegram_container_labels_public_endpoint_traefik_entrypoints: "{{ matrix_mautrix_telegram_container_labels_traefik_entrypoints }}"
  98. matrix_mautrix_telegram_container_labels_public_endpoint_traefik_tls: "{{ matrix_mautrix_telegram_container_labels_public_endpoint_traefik_entrypoints != 'web' }}"
  99. matrix_mautrix_telegram_container_labels_public_endpoint_traefik_tls_certResolver: "{{ matrix_mautrix_telegram_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  100. # Controls whether labels will be added that expose mautrix-telegram's metrics
  101. matrix_mautrix_telegram_container_labels_metrics_enabled: "{{ matrix_mautrix_telegram_metrics_enabled and matrix_mautrix_telegram_metrics_proxying_enabled }}"
  102. matrix_mautrix_telegram_container_labels_metrics_traefik_rule: "Host(`{{ matrix_mautrix_telegram_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_mautrix_telegram_metrics_proxying_path_prefix }}`)"
  103. matrix_mautrix_telegram_container_labels_metrics_traefik_priority: 0
  104. matrix_mautrix_telegram_container_labels_metrics_traefik_entrypoints: "{{ matrix_mautrix_telegram_container_labels_traefik_entrypoints }}"
  105. matrix_mautrix_telegram_container_labels_metrics_traefik_tls: "{{ matrix_mautrix_telegram_container_labels_metrics_traefik_entrypoints != 'web' }}"
  106. matrix_mautrix_telegram_container_labels_metrics_traefik_tls_certResolver: "{{ matrix_mautrix_telegram_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  107. matrix_mautrix_telegram_container_labels_metrics_middleware_basic_auth_enabled: false
  108. # See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
  109. matrix_mautrix_telegram_container_labels_metrics_middleware_basic_auth_users: ''
  110. # matrix_mautrix_telegram_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  111. # See `../templates/labels.j2` for details.
  112. #
  113. # Example:
  114. # matrix_mautrix_telegram_container_labels_additional_labels: |
  115. # my.label=1
  116. # another.label="here"
  117. matrix_mautrix_telegram_container_labels_additional_labels: ''
  118. # A list of extra arguments to pass to the container
  119. matrix_mautrix_telegram_container_extra_arguments: []
  120. # List of systemd services that matrix-mautrix-telegram.service depends on.
  121. matrix_mautrix_telegram_systemd_required_services_list: "{{ matrix_mautrix_telegram_systemd_required_services_list_default + matrix_mautrix_telegram_systemd_required_services_list_auto + matrix_mautrix_telegram_systemd_required_services_list_custom }}"
  122. matrix_mautrix_telegram_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  123. matrix_mautrix_telegram_systemd_required_services_list_auto: []
  124. matrix_mautrix_telegram_systemd_required_services_list_custom: []
  125. # List of systemd services that matrix-mautrix-telegram.service wants
  126. matrix_mautrix_telegram_systemd_wanted_services_list: []
  127. matrix_mautrix_telegram_appservice_token: ''
  128. matrix_mautrix_telegram_homeserver_token: ''
  129. matrix_mautrix_telegram_provisioning_shared_secret: disable
  130. # Whether or not metrics endpoint should be enabled.
  131. # Enabling them is usually enough for a local (in-container) Prometheus to consume them.
  132. # If metrics need to be consumed by another (external) Prometheus server, consider exposing them via `matrix_mautrix_telegram_metrics_proxying_enabled`.
  133. matrix_mautrix_telegram_metrics_enabled: false
  134. # Controls whether metrics should be exposed on a public URL.
  135. matrix_mautrix_telegram_metrics_proxying_enabled: false
  136. matrix_mautrix_telegram_metrics_proxying_hostname: ''
  137. matrix_mautrix_telegram_metrics_proxying_path_prefix: ''
  138. # Database-related configuration fields.
  139. #
  140. # To use SQLite, stick to these defaults.
  141. #
  142. # To use Postgres:
  143. # - change the engine (`matrix_mautrix_telegram_database_engine: 'postgres'`)
  144. # - adjust your database credentials via the `matrix_mautrix_telegram_database_*` variables
  145. matrix_mautrix_telegram_database_engine: 'sqlite'
  146. matrix_mautrix_telegram_sqlite_database_path_local: "{{ matrix_mautrix_telegram_data_path }}/mautrix-telegram.db"
  147. matrix_mautrix_telegram_sqlite_database_path_in_container: "/data/mautrix-telegram.db"
  148. matrix_mautrix_telegram_database_username: 'matrix_mautrix_telegram'
  149. matrix_mautrix_telegram_database_password: 'some-password'
  150. matrix_mautrix_telegram_database_hostname: ''
  151. matrix_mautrix_telegram_database_port: 5432
  152. matrix_mautrix_telegram_database_name: 'matrix_mautrix_telegram'
  153. matrix_mautrix_telegram_database_connection_string: 'postgres://{{ matrix_mautrix_telegram_database_username }}:{{ matrix_mautrix_telegram_database_password }}@{{ matrix_mautrix_telegram_database_hostname }}:{{ matrix_mautrix_telegram_database_port }}/{{ matrix_mautrix_telegram_database_name }}'
  154. matrix_mautrix_telegram_appservice_database: "{{
  155. {
  156. 'sqlite': ('sqlite:///' + matrix_mautrix_telegram_sqlite_database_path_in_container),
  157. 'postgres': matrix_mautrix_telegram_database_connection_string,
  158. }[matrix_mautrix_telegram_database_engine]
  159. }}"
  160. matrix_mautrix_telegram_bridge_login_shared_secret_map: "{{ matrix_mautrix_telegram_bridge_login_shared_secret_map_auto | combine(matrix_mautrix_telegram_bridge_login_shared_secret_map_custom) }}"
  161. matrix_mautrix_telegram_bridge_login_shared_secret_map_auto: {}
  162. matrix_mautrix_telegram_bridge_login_shared_secret_map_custom: {}
  163. # Default configuration template which covers the generic use case.
  164. # You can customize it by controlling the various variables inside it.
  165. #
  166. # For a more advanced customization, you can extend the default (see `matrix_mautrix_telegram_configuration_extension_yaml`)
  167. # or completely replace this variable with your own template.
  168. matrix_mautrix_telegram_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  169. matrix_mautrix_telegram_configuration_extension_yaml: |
  170. # Your custom YAML configuration goes here.
  171. # This configuration extends the default starting configuration (`matrix_mautrix_telegram_configuration_yaml`).
  172. #
  173. # You can override individual variables from the default configuration, or introduce new ones.
  174. #
  175. # If you need something more special, you can take full control by
  176. # completely redefining `matrix_mautrix_telegram_configuration_yaml`.
  177. matrix_mautrix_telegram_configuration_extension: "{{ matrix_mautrix_telegram_configuration_extension_yaml | from_yaml if matrix_mautrix_telegram_configuration_extension_yaml | from_yaml is mapping else {} }}"
  178. # Holds the final configuration (a combination of the default and its extension).
  179. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_telegram_configuration_yaml`.
  180. matrix_mautrix_telegram_configuration: "{{ matrix_mautrix_telegram_configuration_yaml | from_yaml | combine(matrix_mautrix_telegram_configuration_extension, recursive=True) }}"
  181. matrix_mautrix_telegram_registration_yaml: |
  182. id: telegram
  183. as_token: "{{ matrix_mautrix_telegram_appservice_token }}"
  184. hs_token: "{{ matrix_mautrix_telegram_homeserver_token }}"
  185. namespaces:
  186. users:
  187. - exclusive: true
  188. regex: '^@telegram_.+:{{ matrix_mautrix_telegram_homeserver_domain | regex_escape }}$'
  189. - exclusive: true
  190. regex: '^@{{ matrix_mautrix_telegram_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_telegram_homeserver_domain | regex_escape }}$'
  191. aliases:
  192. - exclusive: true
  193. regex: '^#telegram_.+:{{ matrix_mautrix_telegram_homeserver_domain | regex_escape }}$'
  194. # See https://github.com/mautrix/signal/issues/43
  195. sender_localpart: _bot_{{ matrix_mautrix_telegram_appservice_bot_username }}
  196. url: {{ matrix_mautrix_telegram_appservice_address }}
  197. rate_limited: false
  198. de.sorunome.msc2409.push_ephemeral: true
  199. matrix_mautrix_telegram_registration: "{{ matrix_mautrix_telegram_registration_yaml | from_yaml }}"
  200. # Templates for defining MXID's and displaynames for users and rooms.
  201. matrix_mautrix_telegram_username_template: 'telegram_{userid}'
  202. matrix_mautrix_telegram_alias_template: 'telegram_{groupname}'
  203. matrix_mautrix_telegram_displayname_template: '{displayname} (Telegram)'
  204. # Enable End-to-bridge encryption
  205. matrix_mautrix_telegram_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
  206. matrix_mautrix_telegram_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
  207. matrix_mautrix_telegram_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_telegram_bridge_encryption_allow }}"