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

163 строки
8.3 KiB

  1. # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. ---
  6. # WeChat Bridge is a Matrix <-> WeChat bridge
  7. # Project source code URL: https://github.com/duo/matrix-wechat
  8. matrix_wechat_enabled: true
  9. # renovate: datasource=docker depName=lxduo/matrix-wechat
  10. matrix_wechat_version: 0.2.4
  11. matrix_wechat_container_image: "{{ matrix_wechat_container_image_registry_prefix }}lxduo/matrix-wechat:{{ matrix_wechat_version }}"
  12. matrix_wechat_container_image_registry_prefix: "{{ 'localhost/' if matrix_wechat_container_image_self_build else matrix_wechat_container_image_registry_prefix_upstream }}"
  13. matrix_wechat_container_image_registry_prefix_upstream: "{{ matrix_wechat_container_image_registry_prefix_upstream_default }}"
  14. matrix_wechat_container_image_registry_prefix_upstream_default: "docker.io/"
  15. matrix_wechat_container_image_force_pull: "{{ matrix_wechat_container_image.endswith(':latest') }}"
  16. matrix_wechat_container_image_self_build: false
  17. matrix_wechat_container_image_self_build_repo: "https://github.com/duo/matrix-wechat.git"
  18. matrix_wechat_container_image_self_build_branch: "{{ 'master' if matrix_wechat_version == 'latest' else matrix_wechat_version }}"
  19. # renovate: datasource=docker depName=lxduo/matrix-wechat-agent
  20. matrix_wechat_agent_version: 0.0.1
  21. matrix_wechat_agent_container_image: "{{ matrix_wechat_agent_container_image_registry_prefix }}lxduo/matrix-wechat-agent:{{ matrix_wechat_agent_version }}"
  22. matrix_wechat_agent_container_image_registry_prefix: "{{ 'localhost/' if matrix_wechat_agent_container_image_self_build else matrix_wechat_agent_container_image_registry_prefix_upstream }}"
  23. matrix_wechat_agent_container_image_registry_prefix_upstream: "{{ matrix_wechat_agent_container_image_registry_prefix_upstream_default }}"
  24. matrix_wechat_agent_container_image_registry_prefix_upstream_default: "docker.io/"
  25. matrix_wechat_agent_container_image_force_pull: "{{ matrix_wechat_agent_container_image.endswith(':latest') }}"
  26. # The agent needs to write to /home/user/.vnc.
  27. # `/home/user` is owned by `user:group` (`1000:1000`), so it needs to run with that user/group.
  28. matrix_wechat_agent_container_user_uid: 1000
  29. matrix_wechat_agent_container_user_gid: 1000
  30. matrix_wechat_agent_container_image_self_build: false
  31. matrix_wechat_agent_container_image_self_build_repo: "https://github.com/duo/matrix-wechat-agent.git"
  32. matrix_wechat_agent_container_image_self_build_branch: "{{ 'master' if matrix_wechat_agent_version == 'latest' else matrix_wechat_agent_version }}"
  33. matrix_wechat_base_path: "{{ matrix_base_data_path }}/wechat"
  34. matrix_wechat_config_path: "{{ matrix_wechat_base_path }}/config"
  35. matrix_wechat_data_path: "{{ matrix_wechat_base_path }}/data"
  36. matrix_wechat_container_src_files_path: "{{ matrix_wechat_base_path }}/container-src"
  37. matrix_wechat_agent_container_src_files_path: "{{ matrix_wechat_base_path }}/agent-container-src"
  38. matrix_wechat_homeserver_address: ""
  39. matrix_wechat_homeserver_domain: "{{ matrix_domain }}"
  40. matrix_wechat_appservice_address: 'http://matrix-wechat:8080'
  41. matrix_wechat_container_network: ""
  42. matrix_wechat_container_additional_networks: "{{ matrix_wechat_container_additional_networks_auto + matrix_wechat_container_additional_networks_custom }}"
  43. matrix_wechat_container_additional_networks_auto: []
  44. matrix_wechat_container_additional_networks_custom: []
  45. # A list of extra arguments to pass to the container
  46. matrix_wechat_container_extra_arguments: []
  47. # List of systemd services that matrix-wechat.service depends on.
  48. matrix_wechat_systemd_required_services_list: "{{ matrix_wechat_systemd_required_services_list_default + matrix_wechat_systemd_required_services_list_auto + matrix_wechat_systemd_required_services_list_custom }}"
  49. matrix_wechat_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  50. matrix_wechat_systemd_required_services_list_auto: []
  51. matrix_wechat_systemd_required_services_list_custom: []
  52. # List of systemd services that matrix-wechat.service wants
  53. matrix_wechat_systemd_wanted_services_list: []
  54. matrix_wechat_appservice_token: ''
  55. matrix_wechat_homeserver_token: ''
  56. matrix_wechat_appservice_bot_username: wechatbot
  57. matrix_wechat_command_prefix: "!wechat"
  58. # Whether or not created rooms should have federation enabled.
  59. # If false, created portal rooms will never be federated.
  60. matrix_wechat_federate_rooms: true
  61. # Database-related configuration fields.
  62. matrix_wechat_database_engine: 'postgres'
  63. matrix_wechat_database_username: 'matrix_wechat'
  64. matrix_wechat_database_password: 'some-password'
  65. matrix_wechat_database_hostname: ''
  66. matrix_wechat_database_port: 5432
  67. matrix_wechat_database_name: 'matrix_wechat'
  68. matrix_wechat_database_sslmode: disable
  69. matrix_wechat_database_connection_string: 'postgresql://{{ matrix_wechat_database_username }}:{{ matrix_wechat_database_password }}@{{ matrix_wechat_database_hostname }}:{{ matrix_wechat_database_port }}/{{ matrix_wechat_database_name }}?sslmode={{ matrix_wechat_database_sslmode }}'
  70. matrix_wechat_bridge_listen_secret: ''
  71. # Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
  72. matrix_wechat_login_shared_secret: ''
  73. matrix_wechat_login_shared_secret_map:
  74. "{{ {matrix_wechat_homeserver_domain: matrix_wechat_login_shared_secret} if matrix_wechat_login_shared_secret else {} }}"
  75. # Servers to always allow double puppeting from
  76. matrix_wechat_double_puppet_server_map:
  77. "{{ matrix_wechat_homeserver_domain: matrix_wechat_homeserver_address }}"
  78. # Enable End-to-bridge encryption
  79. matrix_wechat_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
  80. matrix_wechat_encryption_default: "{{ matrix_wechat_encryption_allow }}"
  81. # Minimum severity of journal log messages.
  82. # Valid values: fatal, error, warn, info, debug
  83. matrix_wechat_log_level: 'warn'
  84. matrix_wechat_permissions: |
  85. {{
  86. {matrix_wechat_homeserver_domain: 'user'}
  87. | combine({matrix_admin: 'admin'} if matrix_admin else {})
  88. }}
  89. # Default Wechat configuration template which covers the generic use case.
  90. # You can customize it by controlling the various variables inside it.
  91. #
  92. # For a more advanced customization, you can extend the default (see `matrix_wechat_configuration_extension_yaml`)
  93. # or completely replace this variable with your own template.
  94. matrix_wechat_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  95. matrix_wechat_configuration_extension_yaml: |
  96. # Your custom YAML configuration goes here.
  97. # This configuration extends the default starting configuration (`matrix_wechat_configuration_yaml`).
  98. #
  99. # You can override individual variables from the default configuration, or introduce new ones.
  100. #
  101. # If you need something more special, you can take full control by
  102. # completely redefining `matrix_wechat_configuration_yaml`.
  103. matrix_wechat_configuration_extension: "{{ matrix_wechat_configuration_extension_yaml | from_yaml if matrix_wechat_configuration_extension_yaml | from_yaml is mapping else {} }}"
  104. # Holds the final configuration (a combination of the default and its extension).
  105. # You most likely don't need to touch this variable. Instead, see `matrix_wechat_configuration_yaml`.
  106. matrix_wechat_configuration: "{{ matrix_wechat_configuration_yaml | from_yaml | combine(matrix_wechat_configuration_extension, recursive=True) }}"
  107. matrix_wechat_registration_yaml: |
  108. id: wechat
  109. url: {{ matrix_wechat_appservice_address }}
  110. as_token: "{{ matrix_wechat_appservice_token }}"
  111. hs_token: "{{ matrix_wechat_homeserver_token }}"
  112. # See https://github.com/mautrix/signal/issues/43
  113. sender_localpart: _bot_{{ matrix_wechat_appservice_bot_username }}
  114. rate_limited: false
  115. namespaces:
  116. users:
  117. - regex: '^@_wechat_(.*):{{ matrix_wechat_homeserver_domain | regex_escape }}$'
  118. exclusive: true
  119. - exclusive: true
  120. regex: '^@{{ matrix_wechat_appservice_bot_username | regex_escape }}:{{ matrix_wechat_homeserver_domain | regex_escape }}$'
  121. de.sorunome.msc2409.push_ephemeral: true
  122. receive_ephemeral: true
  123. matrix_wechat_registration: "{{ matrix_wechat_registration_yaml | from_yaml }}"
  124. matrix_wechat_agent_service_secret: "{{ matrix_wechat_bridge_listen_secret }}"
  125. matrix_wechat_agent_configuration_yaml: "{{ lookup('template', 'templates/agent-config.yaml.j2') }}"
  126. matrix_wechat_agent_configuration: "{{ matrix_wechat_agent_configuration_yaml | from_yaml }}"