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

277 строки
16 KiB

  1. # SPDX-FileCopyrightText: 2019 - 2024 MDAD project contributors
  2. # SPDX-FileCopyrightText: 2019 - 2026 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_container_image_self_build: false
  21. matrix_mautrix_telegram_container_image_self_build_repo: "https://mau.dev/mautrix/telegram.git"
  22. matrix_mautrix_telegram_container_image_self_build_branch: "{{ 'main' if matrix_mautrix_telegram_version == 'latest' else matrix_mautrix_telegram_version }}"
  23. # renovate: datasource=docker depName=dock.mau.dev/mautrix/telegram
  24. matrix_mautrix_telegram_version: v0.2606.0
  25. # See: https://mau.dev/mautrix/telegram/container_registry
  26. matrix_mautrix_telegram_container_image: "{{ matrix_mautrix_telegram_container_image_registry_prefix }}mautrix/telegram:{{ matrix_mautrix_telegram_version }}"
  27. matrix_mautrix_telegram_container_image_registry_prefix: "{{ 'localhost/' if matrix_mautrix_telegram_container_image_self_build else matrix_mautrix_telegram_container_image_registry_prefix_upstream }}"
  28. matrix_mautrix_telegram_container_image_registry_prefix_upstream: "{{ matrix_mautrix_telegram_container_image_registry_prefix_upstream_default }}"
  29. matrix_mautrix_telegram_container_image_registry_prefix_upstream_default: "dock.mau.dev/"
  30. matrix_mautrix_telegram_base_path: "{{ matrix_base_data_path }}/mautrix-telegram"
  31. matrix_mautrix_telegram_config_path: "{{ matrix_mautrix_telegram_base_path }}/config"
  32. matrix_mautrix_telegram_data_path: "{{ matrix_mautrix_telegram_base_path }}/data"
  33. matrix_mautrix_telegram_container_src_files_path: "{{ matrix_mautrix_telegram_base_path }}/docker-src"
  34. matrix_mautrix_telegram_homeserver_address: ""
  35. matrix_mautrix_telegram_homeserver_domain: '{{ matrix_domain }}'
  36. # Whether asynchronous uploads via MSC2246 should be enabled for media.
  37. # Requires a homeserver that supports MSC2246 (https://github.com/matrix-org/matrix-spec-proposals/pull/2246).
  38. matrix_mautrix_telegram_homeserver_async_media: false
  39. matrix_mautrix_telegram_appservice_address: 'http://matrix-mautrix-telegram:8080'
  40. # Scheme of the bridge's public address (see `matrix_mautrix_telegram_bridge_public_address`).
  41. matrix_mautrix_telegram_scheme: https
  42. # The public base URL at which this bridge's HTTP API is reachable from outside (when exposed).
  43. # Used for the provisioning API's external-server (OpenID) flow and for public media links.
  44. matrix_mautrix_telegram_bridge_public_address: "{{ (matrix_mautrix_telegram_scheme + '://' + matrix_mautrix_telegram_exposure_hostname + matrix_mautrix_telegram_exposure_path_prefix) if matrix_mautrix_telegram_exposure_enabled else '' }}"
  45. matrix_mautrix_telegram_msc4190_enabled: "{{ matrix_bridges_msc4190_enabled }}"
  46. matrix_mautrix_telegram_self_sign_enabled: "{{ matrix_bridges_self_sign_enabled }}"
  47. matrix_mautrix_telegram_command_prefix: "!tg"
  48. # Get your own API keys at https://my.telegram.org/apps
  49. matrix_mautrix_telegram_api_id: ''
  50. matrix_mautrix_telegram_api_hash: ''
  51. matrix_mautrix_telegram_container_network: ""
  52. matrix_mautrix_telegram_container_additional_networks: "{{ matrix_mautrix_telegram_container_additional_networks_auto + matrix_mautrix_telegram_container_additional_networks_custom }}"
  53. matrix_mautrix_telegram_container_additional_networks_auto: []
  54. matrix_mautrix_telegram_container_additional_networks_custom: []
  55. # matrix_mautrix_telegram_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  56. # See `../templates/labels.j2` for details.
  57. #
  58. # To inject your own other container labels, see `matrix_mautrix_telegram_container_labels_additional_labels`.
  59. matrix_mautrix_telegram_container_labels_traefik_enabled: true
  60. matrix_mautrix_telegram_container_labels_traefik_docker_network: "{{ matrix_mautrix_telegram_container_network }}"
  61. matrix_mautrix_telegram_container_labels_traefik_entrypoints: web-secure
  62. matrix_mautrix_telegram_container_labels_traefik_tls_certResolver: default # noqa var-naming
  63. # Controls whether labels will be added that expose mautrix-telegram's metrics
  64. matrix_mautrix_telegram_container_labels_metrics_enabled: "{{ matrix_mautrix_telegram_metrics_enabled and matrix_mautrix_telegram_metrics_proxying_enabled }}"
  65. matrix_mautrix_telegram_container_labels_metrics_traefik_rule: "Host(`{{ matrix_mautrix_telegram_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_mautrix_telegram_metrics_proxying_path_prefix }}`)"
  66. matrix_mautrix_telegram_container_labels_metrics_traefik_priority: 0
  67. matrix_mautrix_telegram_container_labels_metrics_traefik_entrypoints: "{{ matrix_mautrix_telegram_container_labels_traefik_entrypoints }}"
  68. matrix_mautrix_telegram_container_labels_metrics_traefik_tls: "{{ matrix_mautrix_telegram_container_labels_metrics_traefik_entrypoints != 'web' }}"
  69. matrix_mautrix_telegram_container_labels_metrics_traefik_tls_certResolver: "{{ matrix_mautrix_telegram_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  70. matrix_mautrix_telegram_container_labels_metrics_middleware_basic_auth_enabled: false
  71. # See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users
  72. matrix_mautrix_telegram_container_labels_metrics_middleware_basic_auth_users: ''
  73. # Controls whether labels will be added that expose mautrix-telegram's HTTP API
  74. # (used by tools like mautrix-manager for bridge login) at `https://<hostname><path_prefix>`.
  75. matrix_mautrix_telegram_container_labels_exposure_enabled: "{{ matrix_mautrix_telegram_exposure_enabled }}"
  76. matrix_mautrix_telegram_container_labels_exposure_traefik_rule: "Host(`{{ matrix_mautrix_telegram_exposure_hostname }}`) && PathPrefix(`{{ matrix_mautrix_telegram_exposure_path_prefix }}`)"
  77. matrix_mautrix_telegram_container_labels_exposure_traefik_priority: 0
  78. matrix_mautrix_telegram_container_labels_exposure_traefik_entrypoints: "{{ matrix_mautrix_telegram_container_labels_traefik_entrypoints }}"
  79. matrix_mautrix_telegram_container_labels_exposure_traefik_tls: "{{ matrix_mautrix_telegram_container_labels_exposure_traefik_entrypoints != 'web' }}"
  80. matrix_mautrix_telegram_container_labels_exposure_traefik_tls_certResolver: "{{ matrix_mautrix_telegram_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  81. # matrix_mautrix_telegram_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  82. # See `../templates/labels.j2` for details.
  83. #
  84. # Example:
  85. # matrix_mautrix_telegram_container_labels_additional_labels: |
  86. # my.label=1
  87. # another.label="here"
  88. matrix_mautrix_telegram_container_labels_additional_labels: ''
  89. # A list of extra arguments to pass to the container
  90. matrix_mautrix_telegram_container_extra_arguments: []
  91. # List of systemd services that matrix-mautrix-telegram.service depends on.
  92. 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 }}"
  93. matrix_mautrix_telegram_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  94. matrix_mautrix_telegram_systemd_required_services_list_auto: []
  95. matrix_mautrix_telegram_systemd_required_services_list_custom: []
  96. # List of systemd services that matrix-mautrix-telegram.service wants
  97. matrix_mautrix_telegram_systemd_wanted_services_list: []
  98. matrix_mautrix_telegram_appservice_token: ''
  99. matrix_mautrix_telegram_homeserver_token: ''
  100. matrix_mautrix_telegram_appservice_bot_username: telegrambot
  101. # Minimum severity of journal log messages.
  102. # Valid values: fatal, error, warn, info, debug, trace
  103. matrix_mautrix_telegram_logging_level: 'warn'
  104. # Whether or not created rooms should have federation enabled.
  105. # If false, created portal rooms will never be federated.
  106. matrix_mautrix_telegram_federate_rooms: true
  107. # Whether or not metrics endpoint should be enabled.
  108. # Enabling them is usually enough for a local (in-container) Prometheus to consume them.
  109. # If metrics need to be consumed by another (external) Prometheus server, consider exposing them via `matrix_mautrix_telegram_metrics_proxying_enabled`.
  110. matrix_mautrix_telegram_metrics_enabled: false
  111. # Controls whether metrics should be proxied (exposed) on a public URL
  112. matrix_mautrix_telegram_metrics_proxying_enabled: false
  113. matrix_mautrix_telegram_metrics_proxying_hostname: ''
  114. matrix_mautrix_telegram_metrics_proxying_path_prefix: ''
  115. # Controls whether mautrix-telegram's HTTP API is exposed publicly (used by tools like mautrix-manager for bridge login).
  116. matrix_mautrix_telegram_exposure_enabled: false
  117. matrix_mautrix_telegram_exposure_hostname: ''
  118. matrix_mautrix_telegram_exposure_path_prefix: ''
  119. # Database-related configuration fields.
  120. #
  121. # To use SQLite, stick to these defaults.
  122. #
  123. # To use Postgres:
  124. # - change the engine (`matrix_mautrix_telegram_database_engine: 'postgres'`)
  125. # - adjust your database credentials via the `matrix_mautrix_telegram_database_*` variables
  126. matrix_mautrix_telegram_database_engine: 'sqlite'
  127. matrix_mautrix_telegram_sqlite_database_path_local: "{{ matrix_mautrix_telegram_data_path }}/mautrix-telegram.db"
  128. matrix_mautrix_telegram_sqlite_database_path_in_container: "/data/mautrix-telegram.db"
  129. matrix_mautrix_telegram_database_username: 'matrix_mautrix_telegram'
  130. matrix_mautrix_telegram_database_password: 'some-password'
  131. matrix_mautrix_telegram_database_hostname: ''
  132. matrix_mautrix_telegram_database_port: 5432
  133. matrix_mautrix_telegram_database_name: 'matrix_mautrix_telegram'
  134. matrix_mautrix_telegram_database_sslmode: disable
  135. matrix_mautrix_telegram_database_connection_string: 'postgresql://{{ 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 }}?sslmode={{ matrix_mautrix_telegram_database_sslmode }}'
  136. matrix_mautrix_telegram_appservice_database_type: "{{ {
  137. 'sqlite': 'sqlite3-fk-wal',
  138. 'postgres': 'postgres',
  139. }[matrix_mautrix_telegram_database_engine] }}"
  140. matrix_mautrix_telegram_appservice_database_uri: "{{ {
  141. 'sqlite': matrix_mautrix_telegram_sqlite_database_path_in_container,
  142. 'postgres': matrix_mautrix_telegram_database_connection_string,
  143. }[matrix_mautrix_telegram_database_engine] }}"
  144. matrix_mautrix_telegram_double_puppet_secrets: "{{ matrix_mautrix_telegram_double_puppet_secrets_auto | combine(matrix_mautrix_telegram_double_puppet_secrets_custom) }}"
  145. matrix_mautrix_telegram_double_puppet_secrets_auto: {}
  146. matrix_mautrix_telegram_double_puppet_secrets_custom: {}
  147. # Displayname template for Telegram users.
  148. # Available variables:
  149. # {{ .FullName }} - the full name of the Telegram user
  150. # {{ .FirstName }} - the first name of the Telegram user
  151. # {{ .LastName }} - the last name of the Telegram user
  152. # {{ .Username }} - the primary username of the Telegram user, if the user has one
  153. # {{ .UserID }} - the internal user ID of the Telegram user
  154. # {{ .Deleted }} - true if the user has been deleted, false otherwise
  155. matrix_mautrix_telegram_network_displayname_template: '{% raw %}{{ if .Deleted }}Deleted account {{ .UserID }}{{ else }}{{ .FullName }}{{ end }}{% endraw %}'
  156. # Enable End-to-bridge encryption
  157. matrix_mautrix_telegram_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
  158. matrix_mautrix_telegram_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
  159. matrix_mautrix_telegram_bridge_encryption_require: false
  160. matrix_mautrix_telegram_bridge_encryption_key_sharing_allow: "{{ matrix_mautrix_telegram_bridge_encryption_allow }}"
  161. # This pickle key value is backward-compatible with the legacy (Python) bridge.
  162. # See: https://mau.dev/mautrix/telegram/-/blob/v0.2604.0/cmd/mautrix-telegram/legacymigrate.go
  163. matrix_mautrix_telegram_bridge_encryption_pickle_key: mautrix.bridge.e2ee
  164. matrix_mautrix_telegram_bridge_personal_filtering_spaces: true
  165. matrix_mautrix_telegram_provisioning_shared_secret: ''
  166. matrix_mautrix_telegram_public_media_signing_key: ''
  167. matrix_mautrix_telegram_bridge_permissions: |
  168. {{
  169. {'*': 'relay', matrix_mautrix_telegram_homeserver_domain: 'user'}
  170. | combine({matrix_admin: 'admin'} if matrix_admin else {})
  171. }}
  172. # Enable bridge relay functionality
  173. matrix_mautrix_telegram_bridge_relay_enabled: "{{ matrix_bridges_relay_enabled }}"
  174. # Only allow admins on this home server to set themselves as a relay user
  175. matrix_mautrix_telegram_bridge_relay_admin_only: true
  176. # List of user login IDs which anyone can set as a relay, as long as the relay user is in the room.
  177. matrix_mautrix_telegram_bridge_relay_default_relays: []
  178. # Controls whether to do backfilling at all.
  179. matrix_mautrix_telegram_backfill_enabled: true
  180. # Default mautrix-telegram configuration template which covers the generic use case.
  181. # You can customize it by controlling the various variables inside it.
  182. #
  183. # For a more advanced customization, you can extend the default (see `matrix_mautrix_telegram_configuration_extension_yaml`)
  184. # or completely replace this variable with your own template.
  185. matrix_mautrix_telegram_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  186. matrix_mautrix_telegram_configuration_extension_yaml: |
  187. # Your custom YAML configuration goes here.
  188. # This configuration extends the default starting configuration (`matrix_mautrix_telegram_configuration_yaml`).
  189. #
  190. # You can override individual variables from the default configuration, or introduce new ones.
  191. #
  192. # If you need something more special, you can take full control by
  193. # completely redefining `matrix_mautrix_telegram_configuration_yaml`.
  194. 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 {} }}"
  195. # Holds the final configuration (a combination of the default and its extension).
  196. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_telegram_configuration_yaml`.
  197. matrix_mautrix_telegram_configuration: "{{ matrix_mautrix_telegram_configuration_yaml | from_yaml | combine(matrix_mautrix_telegram_configuration_extension, recursive=True) }}"
  198. matrix_mautrix_telegram_registration_yaml: |
  199. id: telegram
  200. url: {{ matrix_mautrix_telegram_appservice_address }}
  201. as_token: "{{ matrix_mautrix_telegram_appservice_token }}"
  202. hs_token: "{{ matrix_mautrix_telegram_homeserver_token }}"
  203. # See https://github.com/mautrix/signal/issues/43
  204. sender_localpart: _bot_{{ matrix_mautrix_telegram_appservice_bot_username }}
  205. rate_limited: false
  206. namespaces:
  207. users:
  208. - exclusive: true
  209. regex: '^@telegram_.+:{{ matrix_mautrix_telegram_homeserver_domain | regex_escape }}$'
  210. - exclusive: true
  211. regex: '^@{{ matrix_mautrix_telegram_appservice_bot_username | regex_escape }}:{{ matrix_mautrix_telegram_homeserver_domain | regex_escape }}$'
  212. de.sorunome.msc2409.push_ephemeral: true
  213. receive_ephemeral: true
  214. io.element.msc4190: {{ matrix_mautrix_telegram_msc4190_enabled | to_json }}
  215. matrix_mautrix_telegram_registration: "{{ matrix_mautrix_telegram_registration_yaml | from_yaml }}"
  216. # matrix_mautrix_telegram_restart_necessary controls whether the service
  217. # will be restarted (when true) or merely started (when false) by the
  218. # systemd service manager role (when conditional restart is enabled).
  219. #
  220. # This value is automatically computed during installation based on whether
  221. # any configuration files, the systemd service file, or the container image changed.
  222. # The default of `false` means "no restart needed" — appropriate when the role's
  223. # installation tasks haven't run (e.g., due to --tags skipping them).
  224. matrix_mautrix_telegram_restart_necessary: false