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

546 строки
32 KiB

  1. # SPDX-FileCopyrightText: 2026 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. # An opinionated Matrix moderation bot
  6. # Project source code URL: https://github.com/maunium/meowlnir
  7. matrix_bot_meowlnir_enabled: true
  8. # renovate: datasource=docker depName=dock.mau.dev/maunium/meowlnir
  9. matrix_bot_meowlnir_version: v0.2606.0
  10. matrix_bot_meowlnir_container_image_self_build: false
  11. matrix_bot_meowlnir_container_image_self_build_repo: "https://github.com/maunium/meowlnir.git"
  12. matrix_bot_meowlnir_container_image: "{{ matrix_bot_meowlnir_container_image_registry_prefix }}{{ matrix_bot_meowlnir_container_image_registry_namespace_identifier }}:{{ matrix_bot_meowlnir_version }}"
  13. matrix_bot_meowlnir_container_image_registry_namespace_identifier: "maunium/meowlnir"
  14. matrix_bot_meowlnir_container_image_registry_prefix: "{{ 'localhost/' if matrix_bot_meowlnir_container_image_self_build else matrix_bot_meowlnir_container_image_registry_prefix_upstream }}"
  15. matrix_bot_meowlnir_container_image_registry_prefix_upstream: "{{ matrix_bot_meowlnir_container_image_registry_prefix_upstream_default }}"
  16. matrix_bot_meowlnir_container_image_registry_prefix_upstream_default: "dock.mau.dev/"
  17. matrix_bot_meowlnir_base_path: "{{ matrix_base_data_path }}/meowlnir"
  18. matrix_bot_meowlnir_config_path: "{{ matrix_bot_meowlnir_base_path }}/config"
  19. matrix_bot_meowlnir_data_path: "{{ matrix_bot_meowlnir_base_path }}/data"
  20. matrix_bot_meowlnir_bin_path: "{{ matrix_bot_meowlnir_base_path }}/bin"
  21. matrix_bot_meowlnir_container_src_files_path: "{{ matrix_bot_meowlnir_base_path }}/docker-src"
  22. matrix_bot_meowlnir_container_network: ""
  23. matrix_bot_meowlnir_container_additional_networks: "{{ matrix_bot_meowlnir_container_additional_networks_auto + matrix_bot_meowlnir_container_additional_networks_custom }}"
  24. matrix_bot_meowlnir_container_additional_networks_auto: []
  25. matrix_bot_meowlnir_container_additional_networks_custom: []
  26. # Controls whether the matrix-bot-meowlnir container exposes its HTTP port.
  27. #
  28. # Takes an "<ip>:<port>" or "<port>" value (e.g.
  29. # "127.0.0.1:29339"), or empty string to not expose.
  30. matrix_bot_meowlnir_container_http_host_bind_port: ''
  31. # A list of extra arguments to pass to the container
  32. matrix_bot_meowlnir_container_extra_arguments: []
  33. # List of systemd services that matrix-bot-meowlnir.service depends on
  34. matrix_bot_meowlnir_systemd_required_services_list: "{{ matrix_bot_meowlnir_systemd_required_services_list_default + matrix_bot_meowlnir_systemd_required_services_list_auto + matrix_bot_meowlnir_systemd_required_services_list_custom }}"
  35. matrix_bot_meowlnir_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  36. matrix_bot_meowlnir_systemd_required_services_list_auto: []
  37. matrix_bot_meowlnir_systemd_required_services_list_custom: []
  38. # List of systemd services that matrix-bot-meowlnir.service wants
  39. matrix_bot_meowlnir_systemd_wanted_services_list: []
  40. ########################################################################
  41. # #
  42. # Appservice registration #
  43. # #
  44. ########################################################################
  45. # Meowlnir runs as an appservice.
  46. # Unlike Draupnir in bot mode, it does not log in with an access token — the homeserver is told about it via a registration file.
  47. #
  48. # Bots themselves are created at runtime through Meowlnir's management API, within the user namespace declared below.
  49. # See the role's documentation page for details.
  50. matrix_bot_meowlnir_appservice_id: meowlnir
  51. # The localpart of the appservice's own user.
  52. # This user does not act as a moderation bot; it is the appservice's sender.
  53. # Individual bots get their own users.
  54. matrix_bot_meowlnir_appservice_sender_localpart: meowlnir
  55. # The prefix for bot users created via the management API.
  56. # Must line up with `matrix_bot_meowlnir_config_meowlnir4all_localpart_template`.
  57. matrix_bot_meowlnir_user_prefix: "meowlnir_"
  58. ########################################################################
  59. # #
  60. # Managed bots #
  61. # #
  62. ########################################################################
  63. # Meowlnir hosts multiple bots, each with one or more management rooms, and creates them at runtime through its management API, not from its configuration file.
  64. #
  65. # The bots listed here are created (and kept up to date) by the playbook when running with the `ensure-matrix-users-created` tag, so that you do not need to call that API yourself.
  66. #
  67. # The fields below are required on every entry, so that each bot's setup can be understood without having to know what the playbook defaults to.
  68. #
  69. # - `username`: the localpart of the bot user. Must begin with `matrix_bot_meowlnir_user_prefix`, or the homeserver will not let Meowlnir operate it. Pick it carefully — it becomes the bot's Matrix user ID and is awkward to change later.
  70. # - `displayname`: the name shown in rooms. Safe to change at any time.
  71. # - `avatar_url`: an `mxc://` URI, or an empty string for no avatar.
  72. # - `management_room_auto_create`: whether the playbook creates a management room for this bot. Mutually exclusive with `management_rooms` — see below.
  73. # - `management_rooms`: the rooms you send commands to. A list, because Meowlnir supports several per bot. Each entry needs an `id` (a room ID, not an alias) and an `encrypted` flag saying whether that room is encrypted.
  74. #
  75. # `management_room_auto_create` and `management_rooms` are mutually exclusive:
  76. #
  77. # - `management_room_auto_create: false` requires at least one entry in `management_rooms`. You create the room yourself, and invite the bot after the first run.
  78. # - `management_room_auto_create: true` requires `management_rooms` to be empty. The playbook creates the room, invites the bot's initial managers and gives them the power level needed to command the bot. The room's encryption follows `matrix_bot_meowlnir_config_encryption_enable`.
  79. #
  80. # One optional field is also recognized:
  81. #
  82. # - `initial_managers`: the users invited to a management room the playbook creates for this bot. Omit it to use `matrix_bot_meowlnir_initial_managers`. An explicitly empty list means nobody, which is an error for a bot relying on `management_room_auto_create`.
  83. #
  84. # Example:
  85. # matrix_bot_meowlnir_bots_custom:
  86. # - username: meowlnir_bot
  87. # displayname: Meowlnir
  88. # avatar_url: ""
  89. # management_room_auto_create: false
  90. # management_rooms:
  91. # - id: "!qporfwt:example.com"
  92. # encrypted: false
  93. matrix_bot_meowlnir_bots: "{{ matrix_bot_meowlnir_bots_auto + matrix_bot_meowlnir_bots_custom }}"
  94. matrix_bot_meowlnir_bots_auto: []
  95. matrix_bot_meowlnir_bots_custom: []
  96. # The users invited to management rooms that the playbook creates, and given the power level required to command the bot there.
  97. # Full Matrix user IDs (`@alice:example.com`).
  98. #
  99. # Only consulted by bots with `management_room_auto_create: true`, and only as the default for those which do not carry their own `initial_managers` list.
  100. # The playbook points this at `matrix_admin` by default.
  101. matrix_bot_meowlnir_initial_managers: []
  102. # Controls whether the bot list above is authoritative for this Meowlnir instance.
  103. #
  104. # When enabled, bots and management rooms which are registered with Meowlnir but no longer declared are removed, so that the list describes the whole installation, not merely additions to it.
  105. #
  106. # Note that removing a bot only makes Meowlnir forget it.
  107. # The bot's Matrix user is not deactivated and stays in the rooms it had joined, so clean that up separately if you want it gone for good.
  108. matrix_bot_meowlnir_bots_pruning_enabled: true
  109. # Controls whether pruning also happens when no bots are declared at all.
  110. #
  111. # Disabled by default, because an empty list is far more often a mistake (a commented-out block, an unset variable) than a genuine instruction to remove every bot.
  112. # With this off, the playbook refuses that particular run.
  113. #
  114. # Only relevant when `matrix_bot_meowlnir_bots_pruning_enabled` is enabled.
  115. matrix_bot_meowlnir_bots_pruning_on_empty_roster_enabled: false
  116. # How long to wait after starting the Meowlnir service and before creating bots.
  117. # Only waited on when the service was not already running.
  118. matrix_bot_meowlnir_bots_start_wait_time_seconds: 15
  119. # The name and topic given to management rooms that the playbook creates.
  120. # Only used by bots with `management_room_auto_create` enabled.
  121. matrix_bot_meowlnir_management_room_name: Meowlnir management room
  122. matrix_bot_meowlnir_management_room_topic: >-
  123. Moderation commands for this Meowlnir bot are sent here.
  124. # Regular expressions matching the users this appservice owns.
  125. #
  126. # Defined here, because they are used both in the appservice registration file below and when telling other components (Ketesa, for one) which users are appservice-managed.
  127. # Writing them twice invites the two from drifting apart.
  128. #
  129. # The character class covers what the Matrix specification allows in a user ID localpart.
  130. matrix_bot_meowlnir_user_regex: "^@{{ matrix_bot_meowlnir_user_prefix | regex_escape }}[a-zA-Z0-9._=/+-]+:{{ matrix_bot_meowlnir_config_homeserver_domain | regex_escape }}$"
  131. matrix_bot_meowlnir_appservice_sender_regex: "^@{{ matrix_bot_meowlnir_appservice_sender_localpart | regex_escape }}:{{ matrix_bot_meowlnir_config_homeserver_domain | regex_escape }}$"
  132. # Tokens shared between Meowlnir and the homeserver.
  133. # Set these to strong, unique values.
  134. # The playbook derives them from `matrix_homeserver_generic_secret_key` by default.
  135. matrix_bot_meowlnir_appservice_token: ''
  136. matrix_bot_meowlnir_homeserver_token: ''
  137. matrix_bot_meowlnir_registration_yaml: |
  138. id: {{ matrix_bot_meowlnir_appservice_id | to_json }}
  139. as_token: {{ matrix_bot_meowlnir_appservice_token | to_json }}
  140. hs_token: {{ matrix_bot_meowlnir_homeserver_token | to_json }}
  141. url: {{ matrix_bot_meowlnir_appservice_url | to_json }}
  142. sender_localpart: {{ matrix_bot_meowlnir_appservice_sender_localpart | to_json }}
  143. rate_limited: false
  144. namespaces:
  145. users:
  146. - exclusive: true
  147. regex: {{ matrix_bot_meowlnir_user_regex | to_json }}
  148. - exclusive: true
  149. regex: {{ matrix_bot_meowlnir_appservice_sender_regex | to_json }}
  150. {% if matrix_bot_meowlnir_config_encryption_enable %}
  151. de.sorunome.msc2409.push_ephemeral: true
  152. push_ephemeral: true
  153. receive_ephemeral: true
  154. org.matrix.msc3202: true
  155. io.element.msc4190: true
  156. {% endif %}
  157. matrix_bot_meowlnir_registration: "{{ matrix_bot_meowlnir_registration_yaml | from_yaml }}"
  158. ########################################################################
  159. # #
  160. # Configuration: homeserver #
  161. # #
  162. ########################################################################
  163. # The address that Meowlnir can use to connect to the homeserver (client-server API).
  164. matrix_bot_meowlnir_config_homeserver_address: ''
  165. # The server name (base domain) of the homeserver.
  166. matrix_bot_meowlnir_config_homeserver_domain: ''
  167. ########################################################################
  168. # #
  169. # Configuration: meowlnir #
  170. # #
  171. ########################################################################
  172. # The hostname and port that Meowlnir listens on, inside the container.
  173. matrix_bot_meowlnir_config_meowlnir_hostname: 0.0.0.0
  174. matrix_bot_meowlnir_config_meowlnir_port: 29339
  175. # The address that the homeserver can use to connect to Meowlnir.
  176. matrix_bot_meowlnir_appservice_url: "http://matrix-bot-meowlnir:{{ matrix_bot_meowlnir_config_meowlnir_port }}"
  177. # Secret for the management API (`/_meowlnir/v1/...`), which is how bots and management rooms get created.
  178. # Set to `disable` to turn the API off entirely.
  179. # The playbook derives a value from `matrix_homeserver_generic_secret_key` by default.
  180. matrix_bot_meowlnir_config_meowlnir_management_secret: ''
  181. # Secret for the `/_meowlnir/data` API.
  182. # The playbook derives a value from `matrix_homeserver_generic_secret_key` by default.
  183. matrix_bot_meowlnir_config_meowlnir_data_secret: ''
  184. # Whether the `/_meowlnir/mxauth` APIs are enabled, which allow querying certain data using any Matrix account.
  185. # Needed by the (not yet released) management web interface.
  186. matrix_bot_meowlnir_config_meowlnir_federation_auth: false
  187. # When enabled, Meowlnir does everything except take actual moderation actions.
  188. # Useful for trialling Meowlnir alongside an existing moderation bot.
  189. matrix_bot_meowlnir_config_meowlnir_dry_run: false
  190. # Whether all bots should be considered untrusted, which enables additional checks (e.g. preventing subscription to a policy list without being in the room).
  191. matrix_bot_meowlnir_config_meowlnir_untrusted: false
  192. # The ID of the management room that handles requests to the Matrix report API.
  193. # Requires `matrix_bot_meowlnir_config_reporting_enabled` to be enabled to be of use.
  194. matrix_bot_meowlnir_config_meowlnir_report_room: ''
  195. # The ID of the management room in charge of deleting rooms from the server.
  196. # Room bans are not processed in other management rooms.
  197. matrix_bot_meowlnir_config_meowlnir_room_ban_room: ''
  198. # Whether Meowlnir should load all room IDs from the Synapse database on startup.
  199. # Requires `matrix_bot_meowlnir_synapse_database_uri` to be set.
  200. matrix_bot_meowlnir_config_meowlnir_load_all_room_hashes: "{{ matrix_bot_meowlnir_synapse_database_uri != '' }}"
  201. # Entities (user IDs or server names) whose policies are ignored entirely.
  202. # A blunt safety net against overly-wide policies from subscribed lists.
  203. #
  204. # Meowlnir always ignores policies matching its own homeserver domain, so there is no need to list it here.
  205. matrix_bot_meowlnir_config_meowlnir_hacky_rule_filter: "{{ matrix_bot_meowlnir_config_meowlnir_hacky_rule_filter_auto + matrix_bot_meowlnir_config_meowlnir_hacky_rule_filter_custom }}"
  206. matrix_bot_meowlnir_config_meowlnir_hacky_rule_filter_auto: []
  207. matrix_bot_meowlnir_config_meowlnir_hacky_rule_filter_custom: []
  208. # Glob patterns matched against policy reasons.
  209. # When a policy matches, all messages from the banned target are redacted automatically.
  210. # The reason `spam` is implicit.
  211. matrix_bot_meowlnir_config_meowlnir_hacky_redact_patterns: "{{ matrix_bot_meowlnir_config_meowlnir_hacky_redact_patterns_default + matrix_bot_meowlnir_config_meowlnir_hacky_redact_patterns_auto + matrix_bot_meowlnir_config_meowlnir_hacky_redact_patterns_custom }}"
  212. matrix_bot_meowlnir_config_meowlnir_hacky_redact_patterns_default:
  213. - spam
  214. matrix_bot_meowlnir_config_meowlnir_hacky_redact_patterns_auto: []
  215. matrix_bot_meowlnir_config_meowlnir_hacky_redact_patterns_custom: []
  216. # Custom Synapse admin access tokens, per bot user ID.
  217. #
  218. # A few features (suspending or deactivating users, deleting rooms during a takedown) call Synapse's admin API, which requires the caller to be a server admin.
  219. # Bots are not server admins, so those calls fail with `M_FORBIDDEN` until a token is supplied here. Nothing else is affected.
  220. #
  221. # When left empty, each bot falls back to the appservice token. That is fine for the client-server API, but carries no admin rights.
  222. #
  223. # The key is the bot the token is used for; the token itself belongs to an administrator account.
  224. # Under Matrix Authentication Service it has to be issued by MAS, since Synapse no longer decides who is an admin. See the role's documentation page.
  225. #
  226. # Example:
  227. # matrix_bot_meowlnir_config_meowlnir_admin_tokens:
  228. # "@meowlnir_bot:example.com": "ADMIN_TOKEN_HERE"
  229. matrix_bot_meowlnir_config_meowlnir_admin_tokens: {}
  230. ########################################################################
  231. # #
  232. # Configuration: meowlnir4all (provisioning bots for other people) #
  233. # #
  234. ########################################################################
  235. # None of this is relevant unless you offer moderation bots to other users.
  236. # The management room ID that is allowed to use the `!provision` command.
  237. matrix_bot_meowlnir_config_meowlnir4all_admin_room: ''
  238. # The user ID template for newly provisioned bots.
  239. matrix_bot_meowlnir_config_meowlnir4all_localpart_template: "{{ matrix_bot_meowlnir_user_prefix }}{{ '{{ uuidgen }}' }}"
  240. matrix_bot_meowlnir_config_meowlnir4all_displayname: Administrator
  241. matrix_bot_meowlnir_config_meowlnir4all_avatar_url: ''
  242. matrix_bot_meowlnir_config_meowlnir4all_room_name: Meowlnir Management Room
  243. # The policy lists that newly provisioned bots subscribe to by default.
  244. #
  245. # Note that the order of this list is meaningful: when several lists carry a policy for the same entity, the first match wins.
  246. # Put your own list first if you want to be able to override policies from community lists with `!add-unban`.
  247. matrix_bot_meowlnir_config_meowlnir4all_default_watched_lists: "{{ matrix_bot_meowlnir_config_meowlnir4all_default_watched_lists_auto + matrix_bot_meowlnir_config_meowlnir4all_default_watched_lists_custom }}"
  248. matrix_bot_meowlnir_config_meowlnir4all_default_watched_lists_auto: []
  249. matrix_bot_meowlnir_config_meowlnir4all_default_watched_lists_custom: []
  250. ########################################################################
  251. # #
  252. # Configuration: antispam (synapse-http-antispam integration) #
  253. # #
  254. ########################################################################
  255. # Certain Meowlnir features (blocking invites and joins before they happen) require the synapse-http-antispam module: https://github.com/maunium/synapse-http-antispam
  256. #
  257. # The module has a single consumer, so this cannot be enabled at the same time as `matrix_bot_draupnir_config_web_synapseHTTPAntispam_enabled`.
  258. matrix_bot_meowlnir_synapse_http_antispam_enabled: false
  259. # Secret shared between Meowlnir and the synapse-http-antispam module.
  260. # The playbook derives a value from `matrix_homeserver_generic_secret_key` by default.
  261. matrix_bot_meowlnir_config_antispam_secret: ''
  262. # Whether Meowlnir should check local invites for spam too.
  263. matrix_bot_meowlnir_config_antispam_filter_local_invites: false
  264. # When set, Meowlnir uses this token to reject pending invites from users who get banned.
  265. # This should be an appservice token with access to all local users — the double-puppeting appservice token works well here.
  266. matrix_bot_meowlnir_config_antispam_auto_reject_invites_token: ''
  267. # Whether the management room receives a notice about blocked invites.
  268. matrix_bot_meowlnir_config_antispam_notify_management_room: false
  269. # Inviting any of the users listed here is blocked by default, unless separately allowed with the `!allow-invite` command.
  270. matrix_bot_meowlnir_config_antispam_block_invites_to: "{{ matrix_bot_meowlnir_config_antispam_block_invites_to_auto + matrix_bot_meowlnir_config_antispam_block_invites_to_custom }}"
  271. matrix_bot_meowlnir_config_antispam_block_invites_to_auto: []
  272. matrix_bot_meowlnir_config_antispam_block_invites_to_custom: []
  273. # The ID of the management room whose policies the synapse-http-antispam module consults.
  274. #
  275. # Meowlnir can host several bots, each with its own management room, so the module needs to be told which one to ask.
  276. # Required when `matrix_bot_meowlnir_synapse_http_antispam_enabled` is on.
  277. matrix_bot_meowlnir_synapse_http_antispam_management_room_id: ''
  278. # The URL that the synapse-http-antispam module targets in Meowlnir.
  279. #
  280. # Meowlnir serves the antispam API at `/_meowlnir/antispam/<management room ID>/<callback>`; the module appends the callback name to this base URL.
  281. matrix_bot_meowlnir_synapse_http_antispam_config_base_url: "{{ matrix_bot_meowlnir_appservice_url }}/_meowlnir/antispam/{{ matrix_bot_meowlnir_synapse_http_antispam_management_room_id }}"
  282. matrix_bot_meowlnir_synapse_http_antispam_config_enabled_callbacks:
  283. - user_may_invite
  284. - user_may_join_room
  285. matrix_bot_meowlnir_synapse_http_antispam_config_fail_open:
  286. user_may_invite: true
  287. user_may_join_room: true
  288. matrix_bot_meowlnir_synapse_http_antispam_config_async: {}
  289. ########################################################################
  290. # #
  291. # Configuration: policy server (MSC4284) #
  292. # #
  293. ########################################################################
  294. # Whether Meowlnir acts as a policy server, letting rooms ask it to vet events before they are accepted.
  295. # Rooms opt in by pointing at this server.
  296. #
  297. # Enabling this exposes `/_matrix/policy/` on the Matrix federation endpoint, so that other servers in the room can reach it.
  298. matrix_bot_meowlnir_policy_server_enabled: false
  299. # Whether to always issue redactions for events blocked by the policy server.
  300. matrix_bot_meowlnir_config_policy_server_always_redact: true
  301. # The Synapse-style private signing key used by the policy server.
  302. #
  303. # Must NOT be left as the literal `generate`:
  304. # Meowlnir re-runs its config upgrader on every start, so `generate` would mint a fresh key on each restart.
  305. # The playbook derives a stable key from `matrix_homeserver_generic_secret_key` by default.
  306. matrix_bot_meowlnir_config_policy_server_signing_key: ''
  307. ########################################################################
  308. # #
  309. # Configuration: reporting #
  310. # #
  311. ########################################################################
  312. # Meowlnir can intercept the report API endpoints of the client-server API, so that abuse reports land in a management room.
  313. # This requires integration with the reverse proxy in front of the homeserver, which the playbook sets up for you when using Traefik.
  314. #
  315. # Also set `matrix_bot_meowlnir_config_meowlnir_report_room` to the management room that should receive the reports.
  316. matrix_bot_meowlnir_config_reporting_enabled: false
  317. ########################################################################
  318. # #
  319. # Configuration: encryption #
  320. # #
  321. ########################################################################
  322. # Whether Meowlnir bots support end-to-end encryption.
  323. #
  324. # This requires MSC3202, MSC4190 and MSC4203 support on the homeserver, plus `experimental_features.msc2409_to_device_messages_enabled`.
  325. # On Synapse, the playbook turns these on for you when this is enabled.
  326. matrix_bot_meowlnir_config_encryption_enable: false
  327. # Pickle key used for encrypting encryption keys in the crypto store.
  328. #
  329. # A fixed constant, like the mautrix bridge roles use, and for the same reason: the crypto store can't be read with a different key than it was written with, so a value that may change would cost the bots their encryption sessions.
  330. #
  331. # When migrating a Meowlnir installation that this playbook did not set up, set this to the `pickle_key` from its old configuration file.
  332. matrix_bot_meowlnir_config_encryption_pickle_key: go.mau.fi/meowlnir
  333. ########################################################################
  334. # #
  335. # Configuration: databases #
  336. # #
  337. ########################################################################
  338. matrix_bot_meowlnir_database_engine: postgres
  339. matrix_bot_meowlnir_database_username: matrix_bot_meowlnir
  340. matrix_bot_meowlnir_database_password: ''
  341. matrix_bot_meowlnir_database_hostname: ''
  342. matrix_bot_meowlnir_database_port: 5432
  343. matrix_bot_meowlnir_database_name: matrix_bot_meowlnir
  344. matrix_bot_meowlnir_database_sslmode: disable
  345. matrix_bot_meowlnir_database_connection_string: "postgresql://{{ matrix_bot_meowlnir_database_username }}:{{ matrix_bot_meowlnir_database_password }}@{{ matrix_bot_meowlnir_database_hostname }}:{{ matrix_bot_meowlnir_database_port }}/{{ matrix_bot_meowlnir_database_name }}?sslmode={{ matrix_bot_meowlnir_database_sslmode }}"
  346. matrix_bot_meowlnir_config_database_max_open_conns: 20
  347. matrix_bot_meowlnir_config_database_max_idle_conns: 2
  348. matrix_bot_meowlnir_config_database_max_conn_idle_time: ''
  349. matrix_bot_meowlnir_config_database_max_conn_lifetime: ''
  350. # Access to the Synapse database.
  351. # Optional: it powers room-hash lookups used by the room takedown features.
  352. # Leave disabled to run without it.
  353. #
  354. # Upstream expects a user with read-only (SELECT) permissions.
  355. # The playbook does not create one, so enabling the integration below hands Meowlnir the same credentials Synapse itself uses — which grant write access too.
  356. # Enable it only if you are comfortable with that; otherwise set `matrix_bot_meowlnir_synapse_database_uri` yourself, pointing at a read-only user you have created.
  357. matrix_bot_meowlnir_synapse_database_integration_enabled: false
  358. # Only Postgres is supported.
  359. # Example:
  360. # matrix_bot_meowlnir_synapse_database_uri: postgresql://user:password@matrix-postgres:5432/synapse?sslmode=disable
  361. matrix_bot_meowlnir_synapse_database_uri: ''
  362. matrix_bot_meowlnir_config_synapse_db_max_open_conns: 2
  363. matrix_bot_meowlnir_config_synapse_db_max_idle_conns: 1
  364. matrix_bot_meowlnir_config_synapse_db_max_conn_idle_time: ''
  365. matrix_bot_meowlnir_config_synapse_db_max_conn_lifetime: ''
  366. ########################################################################
  367. # #
  368. # Configuration: logging #
  369. # #
  370. ########################################################################
  371. matrix_bot_meowlnir_config_logging_min_level: info
  372. matrix_bot_meowlnir_config_logging_writers:
  373. - type: stdout
  374. format: pretty-colored
  375. ########################################################################
  376. # #
  377. # Traefik labels #
  378. # #
  379. ########################################################################
  380. # Controls whether labels will be added that route certain paths to Meowlnir.
  381. # Regardless of whether this is enabled, it may or may not take effect due to the value of other variables.
  382. # See `matrix_synapse_container_labels_traefik_enabled` or `matrix_synapse_container_labels_matrix_related_labels_enabled`.
  383. matrix_bot_meowlnir_container_labels_traefik_enabled: "{{ matrix_bot_meowlnir_config_reporting_enabled or matrix_bot_meowlnir_policy_server_enabled }}"
  384. matrix_bot_meowlnir_container_labels_traefik_docker_network: "{{ matrix_bot_meowlnir_container_network }}"
  385. # Reports (/_matrix/client/../rooms/../report and /_matrix/client/../users/../report)
  386. #
  387. # Only `v3` is matched on purpose:
  388. # Meowlnir does not serve the legacy `r0` paths, so routing those here would break reporting for old clients.
  389. matrix_bot_meowlnir_container_labels_reporting_traefik_hostname: "{{ matrix_synapse_container_labels_traefik_hostname }}"
  390. matrix_bot_meowlnir_container_labels_reporting_traefik_path_regexp: "^/_matrix/client/v3/(rooms|users)/[^/]+/report(/.*)?$"
  391. matrix_bot_meowlnir_container_labels_reporting_traefik_rule: "Host(`{{ matrix_bot_meowlnir_container_labels_reporting_traefik_hostname }}`) && PathRegexp(`{{ matrix_bot_meowlnir_container_labels_reporting_traefik_path_regexp }}`)"
  392. matrix_bot_meowlnir_container_labels_reporting_traefik_priority: 0
  393. matrix_bot_meowlnir_container_labels_reporting_traefik_entrypoints: "{{ matrix_synapse_container_labels_traefik_entrypoints }}"
  394. matrix_bot_meowlnir_container_labels_reporting_traefik_tls: "{{ matrix_bot_meowlnir_container_labels_reporting_traefik_entrypoints != 'web' }}"
  395. matrix_bot_meowlnir_container_labels_reporting_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  396. # Policy server (/_matrix/policy), served on the federation endpoint
  397. matrix_bot_meowlnir_container_labels_policy_server_traefik_hostname: "{{ matrix_synapse_container_labels_public_federation_api_traefik_hostname }}"
  398. matrix_bot_meowlnir_container_labels_policy_server_traefik_path_prefix: /_matrix/policy
  399. matrix_bot_meowlnir_container_labels_policy_server_traefik_rule: "Host(`{{ matrix_bot_meowlnir_container_labels_policy_server_traefik_hostname }}`) && PathPrefix(`{{ matrix_bot_meowlnir_container_labels_policy_server_traefik_path_prefix }}`)"
  400. matrix_bot_meowlnir_container_labels_policy_server_traefik_priority: 0
  401. matrix_bot_meowlnir_container_labels_policy_server_traefik_entrypoints: "{{ matrix_synapse_container_labels_public_federation_api_traefik_entrypoints }}"
  402. matrix_bot_meowlnir_container_labels_policy_server_traefik_tls: "{{ matrix_bot_meowlnir_container_labels_policy_server_traefik_entrypoints != 'web' }}"
  403. matrix_bot_meowlnir_container_labels_policy_server_traefik_tls_certResolver: "{{ matrix_synapse_container_labels_traefik_tls_certResolver }}" # noqa var-naming
  404. # matrix_bot_meowlnir_container_labels_traefik_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  405. # See `../templates/labels.j2` for details.
  406. #
  407. # Example:
  408. # matrix_bot_meowlnir_container_labels_traefik_labels_additional_labels: |
  409. # my.label=1
  410. # another.label="here"
  411. matrix_bot_meowlnir_container_labels_traefik_labels_additional_labels: ''
  412. ########################################################################
  413. # #
  414. # Configuration assembly #
  415. # #
  416. ########################################################################
  417. # Default configuration template which covers the generic use case.
  418. # You can customize it by controlling the various variables inside it.
  419. #
  420. # For a more advanced customization, you can extend the default (see `matrix_bot_meowlnir_configuration_extension_yaml`) or completely replace this variable with your own template.
  421. matrix_bot_meowlnir_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  422. matrix_bot_meowlnir_configuration_extension_yaml: |
  423. # Your custom YAML configuration goes here.
  424. # This configuration extends the default starting configuration (`matrix_bot_meowlnir_configuration_yaml`).
  425. #
  426. # You can override individual variables from the default configuration, or introduce new ones.
  427. #
  428. # If you need something more special, you can take full control by completely redefining `matrix_bot_meowlnir_configuration_yaml`.
  429. matrix_bot_meowlnir_configuration_extension: "{{ matrix_bot_meowlnir_configuration_extension_yaml | from_yaml if matrix_bot_meowlnir_configuration_extension_yaml | from_yaml is mapping else {} }}"
  430. # Holds the final configuration (a combination of the default and its extension).
  431. # You most likely don't need to touch this variable.
  432. # Instead, see `matrix_bot_meowlnir_configuration_yaml`.
  433. matrix_bot_meowlnir_configuration: "{{ matrix_bot_meowlnir_configuration_yaml | from_yaml | combine(matrix_bot_meowlnir_configuration_extension, recursive=True) }}"
  434. # matrix_bot_meowlnir_restart_necessary controls whether the service will be restarted (when true) or merely started (when false) by the systemd service manager role (when conditional restart is enabled).
  435. #
  436. # This value is automatically computed during installation based on whether any configuration files, the systemd service file, or the container image changed.
  437. # The default of `false` means "no restart needed" — appropriate when the role's installation tasks haven't run (e.g., due to --tags skipping them).
  438. matrix_bot_meowlnir_restart_necessary: false