Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

368 lines
22 KiB

  1. #jinja2: lstrip_blocks: True
  2. # Homeserver details.
  3. homeserver:
  4. # The address that this appservice can use to connect to the homeserver.
  5. address: {{ matrix_mautrix_discord_homeserver_address | to_json }}
  6. # The domain of the homeserver (also known as server_name, used for MXIDs, etc).
  7. domain: {{ matrix_mautrix_discord_homeserver_domain | to_json }}
  8. # What software is the homeserver running?
  9. # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here.
  10. software: standard
  11. # The URL to push real-time bridge status to.
  12. # If set, the bridge will make POST requests to this URL whenever a user's discord connection state changes.
  13. # The bridge will use the appservice as_token to authorize requests.
  14. status_endpoint: null
  15. # Endpoint for reporting per-message status.
  16. message_send_checkpoint_endpoint: null
  17. # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246?
  18. async_media: {{ matrix_mautrix_discord_homeserver_async_media | to_json }}
  19. # Should the bridge use a websocket for connecting to the homeserver?
  20. # The server side is currently not documented anywhere and is only implemented by mautrix-wsproxy,
  21. # mautrix-asmux (deprecated), and hungryserv (proprietary).
  22. websocket: false
  23. # How often should the websocket be pinged? Pinging will be disabled if this is zero.
  24. ping_interval_seconds: 0
  25. # Application service host/registration related details.
  26. # Changing these values requires regeneration of the registration.
  27. appservice:
  28. # The address that the homeserver can use to connect to this appservice.
  29. address: {{ matrix_mautrix_discord_appservice_address | to_json }}
  30. # The hostname and port where this appservice should listen.
  31. hostname: 0.0.0.0
  32. port: 8080
  33. # Database config.
  34. database:
  35. # The database type. "sqlite3-fk-wal" and "postgres" are supported.
  36. type: {{ matrix_mautrix_discord_appservice_database_type | to_json }}
  37. # The database URI.
  38. # SQLite: A raw file path is supported, but `file:<path>?_txlock=immediate` is recommended.
  39. # https://github.com/mattn/go-sqlite3#connection-string
  40. # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
  41. # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql
  42. uri: {{ matrix_mautrix_discord_appservice_database_uri | to_json }}
  43. # Maximum number of connections. Mostly relevant for Postgres.
  44. max_open_conns: 20
  45. max_idle_conns: 2
  46. # Maximum connection idle time and lifetime before they're closed. Disabled if null.
  47. # Parsed with https://pkg.go.dev/time#ParseDuration
  48. max_conn_idle_time: null
  49. max_conn_lifetime: null
  50. # The unique ID of this appservice.
  51. id: discord
  52. # Appservice bot details.
  53. bot:
  54. # Username of the appservice bot.
  55. username: {{ matrix_mautrix_discord_appservice_bot_username | to_json }}
  56. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  57. # to leave display name/avatar as-is.
  58. displayname: {{ matrix_mautrix_discord_appservice_bot_displayname | to_json(ensure_ascii=False) }}
  59. avatar: {{ matrix_mautrix_discord_appservice_bot_avatar | to_json }}
  60. # Whether or not to receive ephemeral events via appservice transactions.
  61. # Requires MSC2409 support (i.e. Synapse 1.22+).
  62. ephemeral_events: true
  63. # Should incoming events be handled asynchronously?
  64. # This may be necessary for large public instances with lots of messages going through.
  65. # However, messages will not be guaranteed to be bridged in the same order they were sent in.
  66. async_transactions: false
  67. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  68. as_token: {{ matrix_mautrix_discord_appservice_token | to_json }}
  69. hs_token: {{ matrix_mautrix_discord_homeserver_token | to_json }}
  70. # Bridge config
  71. bridge:
  72. # Localpart template of MXIDs for Discord users.
  73. # {% raw %}{{.}}{% endraw %} is replaced with the internal ID of the Discord user.
  74. username_template: {{ matrix_mautrix_discord_bridge_username_template | to_json }}
  75. # Displayname template for Discord users. This is also used as the room name in DMs if private_chat_portal_meta is enabled.
  76. # Available variables:
  77. # .ID - Internal user ID
  78. # .Username - Legacy display/username on Discord
  79. # .GlobalName - New displayname on Discord
  80. # .Discriminator - The 4 numbers after the name on Discord
  81. # .Bot - Whether the user is a bot
  82. # .System - Whether the user is an official system user
  83. # .Webhook - Whether the user is a webhook and is not an application
  84. # .Application - Whether the user is an application
  85. displayname_template: {{ matrix_mautrix_discord_bridge_displayname_template | to_json }}
  86. # Displayname template for Discord channels (bridged as rooms, or spaces when type=4).
  87. # Available variables:
  88. # .Name - Channel name, or user displayname (pre-formatted with displayname_template) in DMs.
  89. # .ParentName - Parent channel name (used for categories).
  90. # .GuildName - Guild name.
  91. # .NSFW - Whether the channel is marked as NSFW.
  92. # .Type - Channel type (see values at https://github.com/bwmarrin/discordgo/blob/v0.25.0/structs.go#L251-L267)
  93. channel_name_template: {{ matrix_mautrix_discord_bridge_channel_name_template | to_json }}
  94. # Displayname template for Discord guilds (bridged as spaces).
  95. # Available variables:
  96. # .Name - Guild name
  97. guild_name_template: {{ matrix_mautrix_discord_bridge_guild_name_template | to_json }}
  98. # Whether to explicitly set the avatar and room name for private chat portal rooms.
  99. # If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms.
  100. # If set to `always`, all DM rooms will have explicit names and avatars set.
  101. # If set to `never`, DM rooms will never have names and avatars set.
  102. private_chat_portal_meta: default
  103. # Publicly accessible base URL that Discord can use to reach the bridge, used for avatars in relay mode.
  104. # If not set, avatars will not be bridged. Only the /mautrix-discord/avatar/{server}/{id}/{hash} endpoint is used on this address.
  105. # This should not have a trailing slash, the endpoint above will be appended to the provided address.
  106. public_address: {{ matrix_mautrix_discord_bridge_public_address | to_json }}
  107. # A random key used to sign the avatar URLs. The bridge will only accept requests with a valid signature.
  108. avatar_proxy_key: {{ matrix_mautrix_discord_bridge_avatar_proxy_key | to_json }}
  109. portal_message_buffer: 128
  110. # Number of private channel portals to create on bridge startup.
  111. # Other portals will be created when receiving messages.
  112. startup_private_channel_create_limit: 5
  113. # Should the bridge send a read receipt from the bridge bot when a message has been sent to Discord?
  114. delivery_receipts: false
  115. # Whether the bridge should send the message status as a custom com.beeper.message_send_status event.
  116. message_status_events: false
  117. # Whether the bridge should send error notices via m.notice events when a message fails to bridge.
  118. message_error_notices: true
  119. # Should the bridge use space-restricted join rules instead of invite-only for guild rooms?
  120. # This can avoid unnecessary invite events in guild rooms when members are synced in.
  121. restricted_rooms: {{ matrix_mautrix_discord_bridge_restricted_rooms | to_json }}
  122. # Should the bridge automatically join the user to threads on Discord when the thread is opened on Matrix?
  123. # This only works with clients that support thread read receipts (MSC3771 added in Matrix v1.4).
  124. autojoin_thread_on_open: true
  125. # Should inline fields in Discord embeds be bridged as HTML tables to Matrix?
  126. # Tables aren't supported in all clients, but are the only way to emulate the Discord inline field UI.
  127. embed_fields_as_tables: true
  128. # Should guild channels be muted when the portal is created? This only meant for single-user instances,
  129. # it won't mute it for all users if there are multiple Matrix users in the same Discord guild.
  130. mute_channels_on_create: false
  131. # Should the bridge update the m.direct account data event when double puppeting is enabled.
  132. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  133. # and is therefore prone to race conditions.
  134. sync_direct_chat_list: false
  135. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  136. # This field will automatically be changed back to false after it, except if the config file is not writable.
  137. resend_bridge_info: false
  138. # Should incoming custom emoji reactions be bridged as mxc:// URIs?
  139. # If set to false, custom emoji reactions will be bridged as the shortcode instead, and the image won't be available.
  140. custom_emoji_reactions: true
  141. # Should the bridge attempt to completely delete portal rooms when a channel is deleted on Discord?
  142. # If true, the bridge will try to kick Matrix users from the room. Otherwise, the bridge only makes ghosts leave.
  143. delete_portal_on_channel_delete: false
  144. # Should the bridge delete all portal rooms when you leave a guild on Discord?
  145. # This only applies if the guild has no other Matrix users on this bridge instance.
  146. delete_guild_on_leave: true
  147. # Whether or not created rooms should have federation enabled.
  148. # If false, created portal rooms will never be federated.
  149. federate_rooms: {{ matrix_mautrix_discord_federate_rooms | to_json }}
  150. # Prefix messages from webhooks with the profile info? This can be used along with a custom displayname_template
  151. # to better handle webhooks that change their name all the time (like ones used by bridges).
  152. prefix_webhook_messages: false
  153. # Bridge webhook avatars?
  154. enable_webhook_avatars: true
  155. # Should the bridge upload media to the Discord CDN directly before sending the message when using a user token,
  156. # like the official client does? The other option is sending the media in the message send request as a form part
  157. # (which is always used by bots and webhooks).
  158. use_discord_cdn_upload: true
  159. # Proxy for Discord connections
  160. proxy:
  161. # Should mxc uris copied from Discord be cached?
  162. # This can be `never` to never cache, `unencrypted` to only cache unencrypted mxc uris, or `always` to cache everything.
  163. # If you have a media repo that generates non-unique mxc uris, you should set this to never.
  164. cache_media: unencrypted
  165. # Settings for converting Discord media to custom mxc:// URIs instead of reuploading.
  166. # More details can be found at https://docs.mau.fi/bridges/go/discord/direct-media.html
  167. direct_media:
  168. # Should custom mxc:// URIs be used instead of reuploading media?
  169. enabled: false
  170. # The server name to use for the custom mxc:// URIs.
  171. # This server name will effectively be a real Matrix server, it just won't implement anything other than media.
  172. # You must either set up .well-known delegation from this domain to the bridge, or proxy the domain directly to the bridge.
  173. server_name: discord-media.example.com
  174. # Optionally a custom .well-known response. This defaults to `server_name:443`
  175. well_known_response:
  176. # The bridge supports MSC3860 media download redirects and will use them if the requester supports it.
  177. # Optionally, you can force redirects and not allow proxying at all by setting this to false.
  178. allow_proxy: true
  179. # Matrix server signing key to make the federation tester pass, same format as synapse's .signing.key file.
  180. # This key is also used to sign the mxc:// URIs to ensure only the bridge can generate them.
  181. server_key: ""
  182. # Settings for converting animated stickers.
  183. animated_sticker:
  184. # Format to which animated stickers should be converted.
  185. # disable - No conversion, send as-is (lottie JSON)
  186. # png - converts to non-animated png (fastest)
  187. # gif - converts to animated gif
  188. # webm - converts to webm video, requires ffmpeg executable with vp9 codec and webm container support
  189. # webp - converts to animated webp, requires ffmpeg executable with webp codec/container support
  190. target: webp
  191. # Arguments for converter. All converters take width and height.
  192. args:
  193. width: 320
  194. height: 320
  195. fps: 25 # only for webm, webp and gif (2, 5, 10, 20 or 25 recommended)
  196. # Servers to always allow double puppeting from
  197. double_puppet_server_map: {{ matrix_mautrix_discord_bridge_double_puppet_server_map | to_json }}
  198. # Allow using double puppeting from any server with a valid client .well-known file.
  199. double_puppet_allow_discovery: false
  200. # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
  201. #
  202. # If set, double puppeting will be enabled automatically for local users
  203. # instead of users having to find an access token and run `login-matrix`
  204. # manually.
  205. login_shared_secret_map: {{ matrix_mautrix_discord_bridge_login_shared_secret_map | to_json }}
  206. # The prefix for commands. Only required in non-management rooms.
  207. command_prefix: {{ matrix_mautrix_discord_bridge_command_prefix | to_json }}
  208. # Messages sent upon joining a management room.
  209. # Markdown is supported. The defaults are listed below.
  210. management_room_text:
  211. # Sent when joining a room.
  212. welcome: "Hello, I'm a Discord bridge bot."
  213. # Sent when joining a management room and the user is already logged in.
  214. welcome_connected: "Use `help` for help."
  215. # Sent when joining a management room and the user is not logged in.
  216. welcome_unconnected: "Use `help` for help or `login` to log in."
  217. # Optional extra text sent when joining a management room.
  218. additional_help: ""
  219. # Settings for backfilling messages.
  220. backfill:
  221. # Limits for forward backfilling.
  222. forward_limits:
  223. # Initial backfill (when creating portal). 0 means backfill is disabled.
  224. # A special unlimited value is not supported, you must set a limit. Initial backfill will
  225. # fetch all messages first before backfilling anything, so high limits can take a lot of time.
  226. initial:
  227. dm: 0
  228. channel: 0
  229. thread: 0
  230. # Missed message backfill (on startup).
  231. # 0 means backfill is disabled, -1 means fetch all messages since last bridged message.
  232. # When using unlimited backfill (-1), messages are backfilled as they are fetched.
  233. # With limits, all messages up to the limit are fetched first and backfilled afterwards.
  234. missed:
  235. dm: 0
  236. channel: 0
  237. thread: 0
  238. # Maximum members in a guild to enable backfilling. Set to -1 to disable limit.
  239. # This can be used as a rough heuristic to disable backfilling in channels that are too active.
  240. # Currently only applies to missed message backfill.
  241. max_guild_members: -1
  242. # End-to-bridge encryption support options.
  243. #
  244. # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
  245. encryption:
  246. # Allow encryption, work in group chat rooms with e2ee enabled
  247. allow: {{ matrix_mautrix_discord_bridge_encryption_allow | to_json }}
  248. # Default to encryption, force-enable encryption in all portals the bridge creates
  249. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  250. default: {{ matrix_mautrix_discord_bridge_encryption_default | to_json }}
  251. # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data.
  252. appservice: {{ matrix_mautrix_discord_bridge_encryption_appservice | to_json}}
  253. # Require encryption, drop any unencrypted messages.
  254. require: {{ matrix_mautrix_discord_bridge_encryption_require | to_json }}
  255. # Whether to use MSC4190 instead of appservice login to create the bridge bot device.
  256. # Requires the homeserver to support MSC4190 and the device masquerading parts of MSC3202.
  257. # Only relevant when using end-to-bridge encryption, required when using encryption with next-gen auth (MSC3861).
  258. # Changing this option requires updating the appservice registration file.
  259. msc4190: {{ matrix_mautrix_discord_msc4190_enabled | to_json }}
  260. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  261. # You must use a client that supports requesting keys from other users to use this feature.
  262. allow_key_sharing: {{ matrix_mautrix_discord_bridge_encryption_key_sharing_allow | to_json }}
  263. # Should users mentions be in the event wire content to enable the server to send push notifications?
  264. plaintext_mentions: {{ matrix_mautrix_discord_bridge_encryption_plaintext_mentions | to_json }}
  265. # Options for deleting megolm sessions from the bridge.
  266. delete_keys:
  267. # Beeper-specific: delete outbound sessions when hungryserv confirms
  268. # that the user has uploaded the key to key backup.
  269. delete_outbound_on_ack: false
  270. # Don't store outbound sessions in the inbound table.
  271. dont_store_outbound: false
  272. # Ratchet megolm sessions forward after decrypting messages.
  273. ratchet_on_decrypt: false
  274. # Delete fully used keys (index >= max_messages) after decrypting messages.
  275. delete_fully_used_on_decrypt: false
  276. # Delete previous megolm sessions from same device when receiving a new one.
  277. delete_prev_on_new_session: false
  278. # Delete megolm sessions received from a device when the device is deleted.
  279. delete_on_device_delete: false
  280. # Periodically delete megolm sessions when 2x max_age has passed since receiving the session.
  281. periodically_delete_expired: false
  282. # Delete inbound megolm sessions that don't have the received_at field used for
  283. # automatic ratcheting and expired session deletion. This is meant as a migration
  284. # to delete old keys prior to the bridge update.
  285. delete_outdated_inbound: false
  286. # What level of device verification should be required from users?
  287. #
  288. # Valid levels:
  289. # unverified - Send keys to all device in the room.
  290. # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys.
  291. # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes).
  292. # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot.
  293. # Note that creating user signatures from the bridge bot is not currently possible.
  294. # verified - Require manual per-device verification
  295. # (currently only possible by modifying the `trust` column in the `crypto_device` database table).
  296. verification_levels:
  297. # Minimum level for which the bridge should send keys to when bridging messages from WhatsApp to Matrix.
  298. receive: unverified
  299. # Minimum level that the bridge should accept for incoming Matrix messages.
  300. send: unverified
  301. # Minimum level that the bridge should require for accepting key requests.
  302. share: cross-signed-tofu
  303. # Options for Megolm room key rotation. These options allow you to
  304. # configure the m.room.encryption event content. See:
  305. # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for
  306. # more information about that event.
  307. rotation:
  308. # Enable custom Megolm room key rotation settings. Note that these
  309. # settings will only apply to rooms created after this option is
  310. # set.
  311. enable_custom: false
  312. # The maximum number of milliseconds a session should be used
  313. # before changing it. The Matrix spec recommends 604800000 (a week)
  314. # as the default.
  315. milliseconds: 604800000
  316. # The maximum number of messages that should be sent with a given a
  317. # session before changing it. The Matrix spec recommends 100 as the
  318. # default.
  319. messages: 100
  320. # Disable rotating keys when a user's devices change?
  321. # You should not enable this option unless you understand all the implications.
  322. disable_device_change_key_rotation: false
  323. # Settings for provisioning API
  324. provisioning:
  325. # Prefix for the provisioning API paths.
  326. prefix: /_matrix/provision
  327. # Shared secret for authentication. If set to "generate", a random secret will be generated,
  328. # or if set to "disable", the provisioning API will be disabled.
  329. shared_secret: {{ matrix_mautrix_discord_provisioning_shared_secret | to_json }}
  330. # Enable debug API at /debug with provisioning authentication.
  331. debug_endpoints: false
  332. # Permissions for using the bridge.
  333. # Permitted values:
  334. # relay - Talk through the relaybot (if enabled), no access otherwise
  335. # user - Access to use the bridge to chat with a Discord account.
  336. # admin - User level and some additional administration tools
  337. # Permitted keys:
  338. # * - All Matrix users
  339. # domain - All users on that homeserver
  340. # mxid - Specific user
  341. permissions: {{ matrix_mautrix_discord_bridge_permissions|to_json }}
  342. # Logging config. See https://github.com/tulir/zeroconfig for details.
  343. logging:
  344. min_level: {{ matrix_mautrix_discord_logging_level | to_json }}
  345. writers:
  346. - type: stdout
  347. format: pretty-colored