Matrix Docker Ansible eploy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

222 líneas
14 KiB

  1. # SPDX-FileCopyrightText: 2023 - 2024 MDAD project contributors
  2. # SPDX-FileCopyrightText: 2023 - 2026 Catalan Lover <catalanlover@protonmail.com>
  3. # SPDX-FileCopyrightText: 2023 Samuel Meenzen
  4. # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev
  5. #
  6. # SPDX-License-Identifier: AGPL-3.0-or-later
  7. ---
  8. # A moderation tool for Matrix
  9. # Project source code URL: https://github.com/the-draupnir-project/Draupnir
  10. matrix_bot_draupnir_enabled: true
  11. # renovate: datasource=docker depName=depName=ghcr.io/the-draupnir-project/draupnir
  12. matrix_bot_draupnir_version: "v3.0.0"
  13. matrix_bot_draupnir_container_image_self_build: false
  14. matrix_bot_draupnir_container_image_self_build_repo: "https://github.com/the-draupnir-project/Draupnir.git"
  15. matrix_bot_draupnir_container_image: "{{ matrix_bot_draupnir_container_image_registry_prefix }}{{ matrix_bot_draupnir_container_image_registry_namespace_identifier }}:{{ matrix_bot_draupnir_version }}"
  16. matrix_bot_draupnir_container_image_registry_namespace_identifier: "the-draupnir-project/draupnir"
  17. matrix_bot_draupnir_container_image_registry_prefix: "{{ 'localhost/' if matrix_bot_draupnir_container_image_self_build else matrix_bot_draupnir_container_image_registry_prefix_upstream }}"
  18. matrix_bot_draupnir_container_image_registry_prefix_upstream: "{{ matrix_bot_draupnir_container_image_registry_prefix_upstream_default }}"
  19. matrix_bot_draupnir_container_image_registry_prefix_upstream_default: "ghcr.io/"
  20. matrix_bot_draupnir_base_path: "{{ matrix_base_data_path }}/draupnir"
  21. matrix_bot_draupnir_config_path: "{{ matrix_bot_draupnir_base_path }}/config"
  22. matrix_bot_draupnir_data_path: "{{ matrix_bot_draupnir_base_path }}/data"
  23. matrix_bot_draupnir_container_src_files_path: "{{ matrix_bot_draupnir_base_path }}/docker-src"
  24. # Force restart tag is used to control if the tag that is used is rolling or not.
  25. # When both Draupnir roles are enabled, we only force restart if they are on the same
  26. # version string and that version string matches the moving tag.
  27. matrix_bot_draupnir_force_restart_tag: "latest"
  28. # Force restart the service on all runs only when both roles are enabled, both roles
  29. # are using the same version string, and that version is the moving tag.
  30. matrix_bot_draupnir_force_restart: "if {{ matrix_bot_draupnir_enabled | bool and matrix_appservice_draupnir_for_all_enabled | bool and matrix_bot_draupnir_version == matrix_appservice_draupnir_for_all_version and matrix_bot_draupnir_version == matrix_bot_draupnir_force_restart_tag }} then true else false end"
  31. matrix_bot_draupnir_config_web_enabled: "{{ matrix_bot_draupnir_config_web_abuseReporting or matrix_bot_draupnir_config_web_synapseHTTPAntispam_enabled }}" # noqa var-naming
  32. matrix_bot_draupnir_config_web_abuseReporting: false # noqa var-naming
  33. matrix_bot_draupnir_config_web_port: 8080
  34. # These variables are used for turning on the integration between the synapseHTTPAntispam module and Draupnir.
  35. # Authorisation is a shared secret between Draupnir and the module just like is used by Appservices and the homeserver
  36. # therefore the same creation mechanism is used here too.
  37. matrix_bot_draupnir_config_web_synapseHTTPAntispam_enabled: false # noqa var-naming
  38. matrix_bot_draupnir_config_web_synapseHTTPAntispam_authorization: '' # noqa var-naming
  39. matrix_bot_draupnir_config_displayReports: "{{ matrix_bot_draupnir_config_web_abuseReporting }}" # noqa var-naming
  40. matrix_bot_draupnir_container_network: ""
  41. matrix_bot_draupnir_container_additional_networks: "{{ matrix_bot_draupnir_container_additional_networks_auto + matrix_bot_draupnir_container_additional_networks_custom }}"
  42. matrix_bot_draupnir_container_additional_networks_auto: []
  43. matrix_bot_draupnir_container_additional_networks_custom: []
  44. # Controls whether the matrix-bot-draupnir container exposes its HTTP port (tcp/80 in the container).
  45. #
  46. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:8766"), or empty string to not expose.
  47. matrix_bot_draupnir_container_http_host_bind_port: ''
  48. # A list of extra arguments to pass to the container
  49. matrix_bot_draupnir_container_extra_arguments: []
  50. # List of systemd services that matrix-bot-draupnir.service depends on
  51. matrix_bot_draupnir_systemd_required_services_list: "{{ matrix_bot_draupnir_systemd_required_services_list_default + matrix_bot_draupnir_systemd_required_services_list_auto + matrix_bot_draupnir_systemd_required_services_list_custom }}"
  52. matrix_bot_draupnir_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  53. matrix_bot_draupnir_systemd_required_services_list_auto: []
  54. matrix_bot_draupnir_systemd_required_services_list_custom: []
  55. # List of systemd services that matrix-bot-draupnir.service wants
  56. matrix_bot_draupnir_systemd_wanted_services_list: []
  57. # Whether Draupnir should talk to the homeserver through Pantalaimon
  58. # If true, then other variables must be provided including pointing
  59. # `matrix_bot_draupnir_config_homeserverUrl` to the Pantalaimon URL.
  60. #
  61. # The upstream project discourages enabling this option, because it is
  62. # known that running Draupnir along with Pantalaimon breaks all workflows that involve
  63. # answering prompts with reactions. (Hint: a lot of workflows rely on them.)
  64. matrix_bot_draupnir_pantalaimon_use: false
  65. # If you choose to accept the risks of using Pantalaimon in your installation
  66. # against the upstream advice, you can enable this to disable the warning about using it.
  67. matrix_bot_draupnir_pantalaimon_breakage_ignore: false
  68. # Tells the bot if it should use its native E2EE support in the form of experimental Rust Crypto in the bot SDK.
  69. # This option is mutually exclusive with `matrix_bot_draupnir_pantalaimon_use`.
  70. # Rust Crypto requires a clean access token that has not touched E2EE so curl is recommended as a method to obtain it.
  71. matrix_bot_draupnir_config_experimentalRustCrypto: false # noqa var-naming
  72. # The access token for the bot user. Required if Pantalaimon is NOT used.
  73. # (Otherwise provide `matrix_bot_draupnir_pantalaimon_username` and `matrix_bot_draupnir_pantalaimon_password` instead.)
  74. matrix_bot_draupnir_config_accessToken: "" # noqa var-naming
  75. # Username and password for the bot. Required if Pantalaimon is used.
  76. # (Otherwise provide `matrix_bot_draupnir_config_accessToken` instead.)
  77. matrix_bot_draupnir_pantalaimon_username: ""
  78. matrix_bot_draupnir_pantalaimon_password: ""
  79. # Username and password the bot uses for logging in directly. If Pantalaimon is used,
  80. # these values become the values of `matrix_bot_draupnir_pantalaimon_username` and `matrix_bot_draupnir_pantalaimon_password`
  81. # These config options do not follow the common naming schema as to not cause user confusion over them being called Pantalaimon when using native login.
  82. matrix_bot_draupnir_login: "{{ matrix_bot_draupnir_pantalaimon_username if matrix_bot_draupnir_pantalaimon_use == 'true' else 'bot.draupnir' }}"
  83. matrix_bot_draupnir_password: "{{ matrix_bot_draupnir_pantalaimon_password }}"
  84. # Controls if we activate the config block for Pantalaimon for now. Its name will
  85. # probably be changed for our usecase due to Draupnir's push to scrub Pantalaimon from the codebase.
  86. # This configuration option does not follow the common naming schema as its not controlling a config key directly.
  87. matrix_bot_draupnir_login_native: false
  88. # The room ID where people can use the bot. The bot has no access controls, so
  89. # anyone in this room can use the bot - secure your room!
  90. # This should be a room alias or room ID - not a matrix.to URL.
  91. # Note: Draupnir is fairly verbose - expect a lot of messages from it.
  92. matrix_bot_draupnir_config_managementRoom: "" # noqa var-naming
  93. # Endpoint URL that Draupnir uses to interact with the Matrix homeserver (client-server API).
  94. # Set this to the Pantalaimon URL if you're using that.
  95. matrix_bot_draupnir_config_homeserverUrl: "" # noqa var-naming
  96. # Endpoint URL that Draupnir could use to fetch events related to reports (client-server API and /_synapse/).
  97. # Only set this to the public-internet homeserver client API URL. Do NOT set this to the Pantalaimon URL.
  98. matrix_bot_draupnir_config_rawHomeserverUrl: "" # noqa var-naming
  99. # Disable Server ACL is used if you do not want to give the bot the right to apply Server ACLs in rooms without complaints from the bot.
  100. # This setting is described the following way in the configuration.
  101. #
  102. # Whether or not Draupnir should apply `m.room.server_acl` events.
  103. # DO NOT change this to `true` unless you are very confident that you know what you are doing.
  104. # It is recommended to consult with people from the upstream project beforehand.
  105. #
  106. # It is exposed here because it is common enough to be valid to expose.
  107. matrix_bot_draupnir_config_disableServerACL: false # noqa var-naming
  108. # Control if Draupnir wants for the Synapse Admin API to be exposed internally to containers, therefore giving Draupnir Access.
  109. matrix_bot_draupnir_admin_api_enabled: "{{ matrix_bot_draupnir_config_admin_enableMakeRoomAdminCommand }}"
  110. # Controls if the Draupnir room hijack command is activated or not.
  111. # Also see `matrix_bot_draupnir_admin_api_enabled`.
  112. matrix_bot_draupnir_config_admin_enableMakeRoomAdminCommand: false # noqa var-naming
  113. # Controls if the room state backing store is activated.
  114. # Room state backing store makes restarts of the bot lightning fast as the bot does not suffer from amnesia.
  115. # This config option has diminished improvements for bots on extremely fast homeservers or very very small bots on fast homeservers.
  116. matrix_bot_draupnir_config_roomStateBackingStore_enabled: true # noqa var-naming
  117. matrix_bot_draupnir_web_url: 'http://matrix-bot-draupnir'
  118. # This controls the URL that the module targets in Draupnir.
  119. matrix_bot_draupnir_synapse_http_antispam_config_base_url: "{{ matrix_bot_draupnir_web_url }}:{{ matrix_bot_draupnir_config_web_port }}/api/1/spam_check"
  120. # These variables control the configuration of the Synapse module as the configuration is highly consumer dependent.
  121. # Therefore the module is configured from Draupnir because the consumer of the module determines what settings are relevant.
  122. matrix_bot_draupnir_synapse_http_antispam_config_enabled_callbacks:
  123. - user_may_invite
  124. - user_may_join_room
  125. matrix_bot_draupnir_synapse_http_antispam_config_fail_open:
  126. user_may_invite: true
  127. user_may_join_room: true
  128. matrix_bot_draupnir_synapse_http_antispam_config_async: {}
  129. # Default configuration template which covers the generic use case.
  130. # You can customize it by controlling the various variables inside it.
  131. #
  132. # For a more advanced customization, you can extend the default (see `matrix_bot_draupnir_configuration_extension_yaml`)
  133. # or completely replace this variable with your own template.
  134. matrix_bot_draupnir_configuration_yaml: "{{ lookup('template', 'templates/production.yaml.j2') }}"
  135. matrix_bot_draupnir_configuration_extension_yaml: |
  136. # Your custom YAML configuration goes here.
  137. # This configuration extends the default starting configuration (`matrix_bot_draupnir_configuration_yaml`).
  138. #
  139. # You can override individual variables from the default configuration, or introduce new ones.
  140. #
  141. # If you need something more special, you can take full control by
  142. # completely redefining `matrix_bot_draupnir_configuration_yaml`.
  143. matrix_bot_draupnir_configuration_extension: "{{ matrix_bot_draupnir_configuration_extension_yaml | from_yaml if matrix_bot_draupnir_configuration_extension_yaml | from_yaml is mapping else {} }}"
  144. # Holds the final configuration (a combination of the default and its extension).
  145. # You most likely don't need to touch this variable. Instead, see `matrix_bot_draupnir_configuration_yaml`.
  146. matrix_bot_draupnir_configuration: "{{ matrix_bot_draupnir_configuration_yaml | from_yaml | combine(matrix_bot_draupnir_configuration_extension, recursive=True) }}"
  147. # Controls whether labels will be added that redirect the /_matrix/client/../rooms/../report paths to Draupnir
  148. # Following these recommendations (https://github.com/element-hq/synapse/blob/master/docs/reverse_proxy.md), by default, we don't.
  149. # Regardless of whether this is enabled, it may or may not take effect due to the value of other variables.
  150. # See `matrix_synapse_container_labels_traefik_enabled` or `matrix_synapse_container_labels_matrix_related_labels_enabled`
  151. matrix_bot_draupnir_container_labels_traefik_enabled: false
  152. matrix_bot_draupnir_container_labels_traefik_docker_network: "{{ matrix_draupnir_bot_container_network }}"
  153. matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_hostname: "{{ matrix_synapse_container_labels_traefik_hostname }}" # noqa var-naming
  154. matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_path_regexp: "^/_matrix/client/(r0|v3)/rooms/([^/]*)/report/(.*)$" # noqa var-naming
  155. matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_rule: "Host(`{{ matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_hostname }}`) && PathRegexp(`{{ matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_path_regexp }}`)" # noqa var-naming
  156. matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_priority: 0 # noqa var-naming
  157. matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}" # noqa var-naming
  158. matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_tls: "{{ matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_entrypoints != 'web' }}" # noqa var-naming
  159. matrix_bot_draupnir_container_labels_web_abuseReporting_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  160. # matrix_bot_draupnir_container_labels_traefik_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  161. # See `../templates/labels.j2` for details.
  162. #
  163. # Example:
  164. # matrix_bot_draupnir_container_labels_traefik_labels_additional_labels: |
  165. # my.label=1
  166. # another.label="here"
  167. matrix_bot_draupnir_container_labels_traefik_labels_additional_labels: ''
  168. # matrix_bot_draupnir_restart_necessary controls whether the service
  169. # will be restarted (when true) or merely started (when false) by the
  170. # systemd service manager role (when conditional restart is enabled).
  171. #
  172. # This value is automatically computed during installation based on whether
  173. # any configuration files, the systemd service file, or the container image changed.
  174. # The default of `false` means "no restart needed" — appropriate when the role's
  175. # installation tasks haven't run (e.g., due to --tags skipping them).
  176. matrix_bot_draupnir_restart_necessary: false