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

314 строки
14 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2023 - 2024 MDAD project contributors
  3. SPDX-FileCopyrightText: 2023 - 2025 Catalan Lover <catalanlover@protonmail.com>
  4. SPDX-FileCopyrightText: 2024 Slavi Pantaleev
  5. SPDX-FileCopyrightText: 2024 Suguru Hirahara
  6. SPDX-License-Identifier: AGPL-3.0-or-later
  7. #}
  8. # Endpoint URL that Draupnir uses to interact with the Matrix homeserver (client-server API),
  9. homeserverUrl: {{ matrix_bot_draupnir_config_homeserverUrl | to_json }}
  10. # Endpoint URL that Draupnir could use to fetch events related to reports (client-server API and /_synapse/),
  11. # only set this to the public-internet homeserver client API URL, do NOT set this to the pantalaimon URL.
  12. rawHomeserverUrl: {{ matrix_bot_draupnir_config_rawHomeserverUrl | to_json }}
  13. # Matrix Access Token to use, Draupnir will only use this if pantalaimon.use is false.
  14. # This option can be loaded from a file by passing "--access-token-path <path>" at the command line,
  15. # which would allow using secret management systems such as systemd's service credentials.
  16. accessToken: {{ matrix_bot_draupnir_config_accessToken | to_json }}
  17. {% if matrix_bot_draupnir_pantalaimon_use or matrix_bot_draupnir_login_native %}
  18. # Options related to Pantalaimon (https://github.com/matrix-org/pantalaimon)
  19. pantalaimon:
  20. # Set to `true` when the bot is to login and fetch the access token on its own.
  21. #
  22. # Draupnir will log in using the given username and password once,
  23. # then store the resulting access token in a file under dataPath.
  24. use: true
  25. # The username to login with.
  26. username: {{ matrix_bot_draupnir_login | to_json }}
  27. # The password Draupnir will login with.
  28. #
  29. # After successfully logging in once, this will be ignored, so this value can be blanked after first startup.
  30. # This option can be loaded from a file by passing "--password-path <path>" at the command line,
  31. # which would allow using secret management systems such as systemd's service credentials.
  32. password: {{ matrix_bot_draupnir_password | to_json }}
  33. {% endif %}
  34. # Experimental usage of the matrix-bot-sdk rust crypto. This can not be used with Pantalaimon.
  35. # Make sure Pantalaimon is disabled in Draupnir's configuration.
  36. #
  37. # Warning: At this time this is not considered production safe.
  38. experimentalRustCrypto: {{ matrix_bot_draupnir_config_experimentalRustCrypto | to_json }}
  39. # The path Draupnir will store its state/data in, leave default ("/data/storage") when using containers.
  40. dataPath: "/data"
  41. # If true (the default), Draupnir will only accept invites from users present in managementRoom.
  42. autojoinOnlyIfManager: true
  43. # If `autojoinOnlyIfManager` is false, only the members in this space can invite
  44. # the bot to new rooms.
  45. #acceptInvitesFromSpace: "!qporfwt:example.com"
  46. # Whether Draupnir should report ignored invites to the management room (if autojoinOnlyIfManager is true).
  47. recordIgnoredInvites: false
  48. # The room ID (or room alias) of the management room, anyone in this room can issue commands to Draupnir.
  49. #
  50. # Draupnir has no more granular access controls other than this, be sure you trust everyone in this room - secure it!
  51. #
  52. # This should be a room alias or room ID - not a matrix.to URL.
  53. #
  54. # Note: By default, Draupnir is fairly verbose - expect a lot of messages in this room.
  55. # (see verboseLogging to adjust this a bit.)
  56. managementRoom: {{ matrix_bot_draupnir_config_managementRoom | to_json }}
  57. # Deprecated and will be removed in a future version.
  58. # Running with verboseLogging is unsupported.
  59. # Whether Draupnir should log a lot more messages in the room,
  60. # mainly involves "all-OK" messages, and debugging messages for when Draupnir checks bans in a room.
  61. verboseLogging: false
  62. # The log level of terminal (or container) output,
  63. # can be one of DEBUG, INFO, WARN and ERROR, in increasing order of importance and severity.
  64. #
  65. # This should be at INFO or DEBUG in order to get support for Draupnir problems.
  66. logLevel: "INFO"
  67. # Whether or not Draupnir should synchronize policy lists immediately after startup.
  68. # Equivalent to running '!draupnir sync'.
  69. syncOnStartup: true
  70. # Whether or not Draupnir should check moderation permissions in all protected rooms on startup.
  71. # Equivalent to running `!draupnir verify`.
  72. verifyPermissionsOnStartup: true
  73. # Whether or not Draupnir should actually apply bans and policy lists,
  74. # turn on to trial some untrusted configuration or lists.
  75. noop: false
  76. # Whether or not Draupnir should apply `m.room.server_acl` events.
  77. # DO NOT change this to `true` unless you are very confident that you know what you are doing.
  78. disableServerACL: {{ matrix_bot_draupnir_config_disableServerACL | to_json }}
  79. # A case-insensitive list of ban reasons to have the bot also automatically redact the user's messages for.
  80. #
  81. # If the bot sees you ban a user with a reason that is an (exact case-insensitive) match to this list,
  82. # it will also remove the user's messages automatically.
  83. #
  84. # Typically this is useful to avoid having to give two commands to the bot.
  85. # Advanced: Use asterisks to have the reason match using "globs"
  86. # (f.e. "spam*testing" would match "spam for testing" as well as "spamtesting").
  87. #
  88. # See here for more info: https://www.digitalocean.com/community/tools/glob
  89. # Note: Keep in mind that glob is NOT regex!
  90. automaticallyRedactForReasons:
  91. - "spam"
  92. - "advertising"
  93. # Whether or not to add all joined rooms to the "protected rooms" list
  94. # (excluding the management room and watched policy list rooms, see below).
  95. #
  96. # Note that this effectively makes the protectedRooms and associated commands useless
  97. # for regular rooms.
  98. #
  99. # Note: the management room is *excluded* from this condition.
  100. # Explicitly add it as a protected room to protect it.
  101. #
  102. # Note: Ban list rooms the bot is watching but didn't create will not be protected.
  103. # Explicitly add these rooms as a protected room list if you want them protected.
  104. protectAllJoinedRooms: false
  105. # Increase this delay to have Draupnir wait longer between two consecutive backgrounded
  106. # operations. The total duration of operations will be longer, but the homeserver won't
  107. # be affected as much. Conversely, decrease this delay to have Draupnir chain operations
  108. # faster. The total duration of operations will generally be shorter, but the performance
  109. # of the homeserver may be more impacted.
  110. backgroundDelayMS: 500
  111. # Server administration commands, these commands will only work if Draupnir is
  112. # a global server administrator, and the bot's server is a Synapse instance.
  113. admin:
  114. # Whether or not Draupnir can temporarily take control of any eligible account from the local homeserver who's in the room
  115. # (with enough permissions) to "make" a user an admin.
  116. #
  117. # This only works if a local user with enough admin permissions is present in the room.
  118. enableMakeRoomAdminCommand: {{ matrix_bot_draupnir_config_admin_enableMakeRoomAdminCommand | to_json }}
  119. # Misc options for command handling and commands
  120. commands:
  121. # Whether or not the `!draupnir` prefix is necessary to submit commands.
  122. #
  123. # If `true`, will allow commands like `!ban`, `!help`, etc.
  124. #
  125. # Note: Draupnir can also be pinged by display name instead of having to use
  126. # the !draupnir prefix. For example, "my_moderator_bot: ban @spammer:example.org"
  127. # will address only my_moderator_bot.
  128. allowNoPrefix: false
  129. # Any additional bot prefixes that Draupnir will listen to. i.e. adding `mod` will allow `!mod help`.
  130. additionalPrefixes:
  131. - "draupnir-bot"
  132. - "draupnir_bot"
  133. - "draupnir"
  134. # The default reasons to be prompted with if the reason is missing from a ban command.
  135. ban:
  136. defaultReasons:
  137. - "spam"
  138. - "brigading"
  139. - "harassment"
  140. - "disagreement"
  141. # Configuration specific to certain toggle-able protections
  142. #protections:
  143. # # Configuration for the wordlist plugin, which can ban users based if they say certain
  144. # # blocked words shortly after joining.
  145. # wordlist:
  146. # # A list of case-insensitive keywords that the WordList protection will watch for from new users.
  147. # #
  148. # # WordList will ban users who use these words when first joining a room, so take caution when selecting them.
  149. # #
  150. # # The word list protection does not support regular expressions at this time.
  151. # # The configuration in the past stated support for Regex erroneously.
  152. # #
  153. # words:
  154. # - "LoReM"
  155. # - "IpSuM"
  156. # - "DoLoR"
  157. # - "aMeT"
  158. #
  159. # # For how long (in minutes) the user is "new" to the WordList plugin.
  160. # #
  161. # # After this time, the user will no longer be banned for using a word in the above wordlist.
  162. # #
  163. # # Set to zero to disable the timeout and make users *always* appear "new".
  164. # # (users will always be banned if they say a bad word)
  165. # minutesBeforeTrusting: 20
  166. # The room state backing store writes a copy of the room state for all protected
  167. # rooms to the data directory.
  168. # It is recommended to enable this option unless you deploy Draupnir close to the
  169. # homeserver and know that Draupnir is starting up quickly. If your homeserver can
  170. # respond quickly to Draupnir's requests for `/state` then you might not need this option.
  171. roomStateBackingStore:
  172. enabled: {{ matrix_bot_draupnir_config_roomStateBackingStore_enabled | to_json }}
  173. # Safe mode provides recovery options for some failure modes when Draupnir
  174. # fails to start. For example, if the bot fails to resolve a room alias in
  175. # a watched list, or if the server has parted from a protected room and can't
  176. # find a way back in. Safe mode will provide different options to recover from
  177. # these. Such as unprotecting the room or unwatching the policy list.
  178. # By default Draupnir will boot into safe mode only when the failure mode
  179. # is recoverable.
  180. # It may be desirable to prevent the bot from starting into safe mode if you have
  181. # a pager system when Draupnir is down, as Draupnir could prevent your monitoring
  182. # system from identifying a failure to start.
  183. #safeMode:
  184. # # The option for entering safe mode when Draupnir fails to start up.
  185. # # - "RecoveryOnly" will only start the bot in safe mode when there are recovery options available. This is the default.
  186. # # - "Never" will never start the bot in safe mode when Draupnir fails to start normally.
  187. # # - "Always" will always start the bot in safe mode when Draupnir fails to start normally.
  188. # bootOption: RecoveryOnly
  189. # Options for advanced monitoring of the health of the bot.
  190. health:
  191. # healthz options. These options are best for use in container environments
  192. # like Kubernetes to detect how healthy the service is. The bot will report
  193. # that it is unhealthy until it is able to process user requests. Typically
  194. # this means that it'll flag itself as unhealthy for a number of minutes
  195. # before saying "Now monitoring rooms" and flagging itself healthy.
  196. #
  197. # Health is flagged through HTTP status codes, defined below.
  198. healthz:
  199. # Whether the healthz integration should be enabled (default false)
  200. enabled: false
  201. # The port to expose the webserver on. Defaults to 8080.
  202. port: 8080
  203. # The address to listen for requests on. Defaults to all addresses.
  204. address: "0.0.0.0"
  205. # The path to expose the monitoring endpoint at. Defaults to `/healthz`
  206. endpoint: "/healthz"
  207. # The HTTP status code which reports that the bot is healthy/ready to
  208. # process requests. Typically this should not be changed. Defaults to
  209. # 200.
  210. healthyStatus: 200
  211. # The HTTP status code which reports that the bot is not healthy/ready.
  212. # Defaults to 418.
  213. unhealthyStatus: 418
  214. # Sentry options. Sentry is a tool used to receive/collate/triage runtime
  215. # errors and performance issues. Skip this section if you do not wish to use
  216. # Sentry.
  217. sentry:
  218. # The key used to upload Sentry data to the server.
  219. # dsn: "https://XXXXXXXXX@example.com/YYY
  220. # Frequency of performance monitoring.
  221. # A number in [0.0, 1.0], where 0.0 means "don't bother with tracing"
  222. # and 1.0 means "trace performance at every opportunity".
  223. # tracesSampleRate: 0.5
  224. {% if matrix_bot_draupnir_config_web_enabled %}
  225. # Options for exposing web APIs.
  226. web:
  227. # Whether to enable web APIs.
  228. enabled: true
  229. # The port to expose the webserver on. Defaults to 8080.
  230. port: {{ matrix_bot_draupnir_config_web_port | to_json }}
  231. # The address to listen for requests on. Defaults to only the current
  232. # computer.
  233. address: "0.0.0.0"
  234. # Alternative setting to open to the entire web. Be careful,
  235. # as this will increase your security perimeter:
  236. #
  237. # address: "0.0.0.0"
  238. # A web API designed to intercept Matrix API
  239. # POST /_matrix/client/r0/rooms/{roomId}/report/{eventId}
  240. # and display readable abuse reports in the moderation room.
  241. #
  242. # If you wish to take advantage of this feature, you will need
  243. # to configure a reverse proxy, see e.g. test/nginx.conf
  244. abuseReporting:
  245. # Whether to enable this feature.
  246. enabled: {{ matrix_bot_draupnir_config_web_abuseReporting | to_json }}
  247. # Whether to setup a endpoints for synapse-http-antispam
  248. # https://github.com/maunium/synapse-http-antispam
  249. # this is required for some features of Draupnir,
  250. # such as support for room takedown policies.
  251. #
  252. # Please FOLLOW the instructions here:
  253. # https://the-draupnir-project.github.io/draupnir-documentation/bot/synapse-http-antispam
  254. synapseHTTPAntispam:
  255. enabled: {{ matrix_bot_draupnir_config_web_synapseHTTPAntispam_enabled | to_json }}
  256. # This is a secret that you must place into your synapse module config
  257. # https://github.com/maunium/synapse-http-antispam?tab=readme-ov-file#configuration
  258. authorization: {{ matrix_bot_draupnir_config_web_synapseHTTPAntispam_authorization | to_json }}
  259. {% endif %}
  260. # FIXME: This configuration option is currently broken in the playbook as admin APIs cannot
  261. # be accessed from containers. See https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3389
  262. # and https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3308
  263. # Whether or not to actively poll synapse for abuse reports, to be used
  264. # instead of intercepting client calls to synapse's abuse endpoint, when that
  265. # isn't possible/practical.
  266. #pollReports: false
  267. # Whether or not new reports, received either by webapi or polling,
  268. # should be printed to our managementRoom.
  269. displayReports: {{ matrix_bot_draupnir_config_displayReports | to_json }}