example-config.yaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. # Homeserver details.
  2. homeserver:
  3. # The address that this appservice can use to connect to the homeserver.
  4. address: https://matrix.example.com
  5. # The domain of the homeserver (also known as server_name, used for MXIDs, etc).
  6. domain: example.com
  7. # What software is the homeserver running?
  8. # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here.
  9. software: standard
  10. # The URL to push real-time bridge status to.
  11. # If set, the bridge will make POST requests to this URL whenever a user's discord connection state changes.
  12. # The bridge will use the appservice as_token to authorize requests.
  13. status_endpoint: null
  14. # Endpoint for reporting per-message status.
  15. message_send_checkpoint_endpoint: null
  16. # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246?
  17. async_media: false
  18. # Application service host/registration related details.
  19. # Changing these values requires regeneration of the registration.
  20. appservice:
  21. # The address that the homeserver can use to connect to this appservice.
  22. address: http://localhost:29334
  23. # The hostname and port where this appservice should listen.
  24. hostname: 0.0.0.0
  25. port: 29334
  26. # Database config.
  27. database:
  28. # The database type. "sqlite3-fk-wal" and "postgres" are supported.
  29. type: postgres
  30. # The database URI.
  31. # SQLite: A raw file path is supported, but `file:<path>?_txlock=immediate` is recommended.
  32. # https://github.com/mattn/go-sqlite3#connection-string
  33. # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
  34. # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql
  35. uri: postgres://user:password@host/database?sslmode=disable
  36. # Maximum number of connections. Mostly relevant for Postgres.
  37. max_open_conns: 20
  38. max_idle_conns: 2
  39. # Maximum connection idle time and lifetime before they're closed. Disabled if null.
  40. # Parsed with https://pkg.go.dev/time#ParseDuration
  41. max_conn_idle_time: null
  42. max_conn_lifetime: null
  43. # The unique ID of this appservice.
  44. id: discord
  45. # Appservice bot details.
  46. bot:
  47. # Username of the appservice bot.
  48. username: discordbot
  49. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  50. # to leave display name/avatar as-is.
  51. displayname: Discord bridge bot
  52. avatar: mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC
  53. # Whether or not to receive ephemeral events via appservice transactions.
  54. # Requires MSC2409 support (i.e. Synapse 1.22+).
  55. ephemeral_events: true
  56. # Should incoming events be handled asynchronously?
  57. # This may be necessary for large public instances with lots of messages going through.
  58. # However, messages will not be guaranteed to be bridged in the same order they were sent in.
  59. async_transactions: false
  60. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  61. as_token: "This value is generated when generating the registration"
  62. hs_token: "This value is generated when generating the registration"
  63. # Bridge config
  64. bridge:
  65. # Localpart template of MXIDs for Discord users.
  66. # {{.}} is replaced with the internal ID of the Discord user.
  67. username_template: discord_{{.}}
  68. # Displayname template for Discord users. This is also used as the room name in DMs if private_chat_portal_meta is enabled.
  69. # Available variables:
  70. # .ID - Internal user ID
  71. # .Username - User's displayname on Discord
  72. # .Discriminator - The 4 numbers after the name on Discord
  73. # .Bot - Whether the user is a bot
  74. # .System - Whether the user is an official system user
  75. displayname_template: '{{.Username}}#{{.Discriminator}}{{if .Bot}} (bot){{end}}'
  76. # Displayname template for Discord channels (bridged as rooms, or spaces when type=4).
  77. # Available variables:
  78. # .Name - Channel name, or user displayname (pre-formatted with displayname_template) in DMs.
  79. # .ParentName - Parent channel name (used for categories).
  80. # .GuildName - Guild name.
  81. # .NSFW - Whether the channel is marked as NSFW.
  82. # .Type - Channel type (see values at https://github.com/bwmarrin/discordgo/blob/v0.25.0/structs.go#L251-L267)
  83. channel_name_template: '{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}}{{else}}#{{.Name}}{{end}}'
  84. # Displayname template for Discord guilds (bridged as spaces).
  85. # Available variables:
  86. # .Name - Guild name
  87. guild_name_template: '{{.Name}}'
  88. # Should the bridge explicitly set the avatar and room name for DM portal rooms?
  89. # This is implicitly enabled in encrypted rooms.
  90. private_chat_portal_meta: false
  91. portal_message_buffer: 128
  92. # Number of private channel portals to create on bridge startup.
  93. # Other portals will be created when receiving messages.
  94. startup_private_channel_create_limit: 5
  95. # Should the bridge send a read receipt from the bridge bot when a message has been sent to Discord?
  96. delivery_receipts: false
  97. # Whether the bridge should send the message status as a custom com.beeper.message_send_status event.
  98. message_status_events: false
  99. # Whether the bridge should send error notices via m.notice events when a message fails to bridge.
  100. message_error_notices: true
  101. # Should the bridge use space-restricted join rules instead of invite-only for guild rooms?
  102. # This can avoid unnecessary invite events in guild rooms when members are synced in.
  103. restricted_rooms: true
  104. # Should the bridge automatically join the user to threads on Discord when the thread is opened on Matrix?
  105. # This only works with clients that support thread read receipts (MSC3771 added in Matrix v1.4).
  106. autojoin_thread_on_open: true
  107. # Should inline fields in Discord embeds be bridged as HTML tables to Matrix?
  108. # Tables aren't supported in all clients, but are the only way to emulate the Discord inline field UI.
  109. embed_fields_as_tables: true
  110. # Should guild channels be muted when the portal is created? This only meant for single-user instances,
  111. # it won't mute it for all users if there are multiple Matrix users in the same Discord guild.
  112. mute_channels_on_create: false
  113. # Should the bridge update the m.direct account data event when double puppeting is enabled.
  114. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  115. # and is therefore prone to race conditions.
  116. sync_direct_chat_list: false
  117. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  118. # This field will automatically be changed back to false after it, except if the config file is not writable.
  119. resend_bridge_info: false
  120. # Should incoming custom emoji reactions be bridged as mxc:// URIs?
  121. # If set to false, custom emoji reactions will be bridged as the shortcode instead, and the image won't be available.
  122. custom_emoji_reactions: true
  123. # Should the bridge attempt to completely delete portal rooms when a channel is deleted on Discord?
  124. # If true, the bridge will try to kick Matrix users from the room. Otherwise, the bridge only makes ghosts leave.
  125. delete_portal_on_channel_delete: false
  126. # Should the bridge delete all portal rooms when you leave a guild on Discord?
  127. # This only applies if the guild has no other Matrix users on this bridge instance.
  128. delete_guild_on_leave: true
  129. # Whether or not created rooms should have federation enabled.
  130. # If false, created portal rooms will never be federated.
  131. federate_rooms: true
  132. # Servers to always allow double puppeting from
  133. double_puppet_server_map:
  134. example.com: https://example.com
  135. # Allow using double puppeting from any server with a valid client .well-known file.
  136. double_puppet_allow_discovery: false
  137. # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
  138. #
  139. # If set, double puppeting will be enabled automatically for local users
  140. # instead of users having to find an access token and run `login-matrix`
  141. # manually.
  142. login_shared_secret_map:
  143. example.com: foobar
  144. # The prefix for commands. Only required in non-management rooms.
  145. command_prefix: '!discord'
  146. # Messages sent upon joining a management room.
  147. # Markdown is supported. The defaults are listed below.
  148. management_room_text:
  149. # Sent when joining a room.
  150. welcome: "Hello, I'm a Discord bridge bot."
  151. # Sent when joining a management room and the user is already logged in.
  152. welcome_connected: "Use `help` for help."
  153. # Sent when joining a management room and the user is not logged in.
  154. welcome_unconnected: "Use `help` for help or `login` to log in."
  155. # Optional extra text sent when joining a management room.
  156. additional_help: ""
  157. # End-to-bridge encryption support options.
  158. #
  159. # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
  160. encryption:
  161. # Allow encryption, work in group chat rooms with e2ee enabled
  162. allow: false
  163. # Default to encryption, force-enable encryption in all portals the bridge creates
  164. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  165. default: false
  166. # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data.
  167. appservice: false
  168. # Require encryption, drop any unencrypted messages.
  169. require: false
  170. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  171. # You must use a client that supports requesting keys from other users to use this feature.
  172. allow_key_sharing: false
  173. # What level of device verification should be required from users?
  174. #
  175. # Valid levels:
  176. # unverified - Send keys to all device in the room.
  177. # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys.
  178. # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes).
  179. # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot.
  180. # Note that creating user signatures from the bridge bot is not currently possible.
  181. # verified - Require manual per-device verification
  182. # (currently only possible by modifying the `trust` column in the `crypto_device` database table).
  183. verification_levels:
  184. # Minimum level for which the bridge should send keys to when bridging messages from WhatsApp to Matrix.
  185. receive: unverified
  186. # Minimum level that the bridge should accept for incoming Matrix messages.
  187. send: unverified
  188. # Minimum level that the bridge should require for accepting key requests.
  189. share: cross-signed-tofu
  190. # Options for Megolm room key rotation. These options allow you to
  191. # configure the m.room.encryption event content. See:
  192. # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for
  193. # more information about that event.
  194. rotation:
  195. # Enable custom Megolm room key rotation settings. Note that these
  196. # settings will only apply to rooms created after this option is
  197. # set.
  198. enable_custom: false
  199. # The maximum number of milliseconds a session should be used
  200. # before changing it. The Matrix spec recommends 604800000 (a week)
  201. # as the default.
  202. milliseconds: 604800000
  203. # The maximum number of messages that should be sent with a given a
  204. # session before changing it. The Matrix spec recommends 100 as the
  205. # default.
  206. messages: 100
  207. # Settings for provisioning API
  208. provisioning:
  209. # Prefix for the provisioning API paths.
  210. prefix: /_matrix/provision
  211. # Shared secret for authentication. If set to "generate", a random secret will be generated,
  212. # or if set to "disable", the provisioning API will be disabled.
  213. shared_secret: generate
  214. # Permissions for using the bridge.
  215. # Permitted values:
  216. # relay - Talk through the relaybot (if enabled), no access otherwise
  217. # user - Access to use the bridge to chat with a Discord account.
  218. # admin - User level and some additional administration tools
  219. # Permitted keys:
  220. # * - All Matrix users
  221. # domain - All users on that homeserver
  222. # mxid - Specific user
  223. permissions:
  224. "*": relay
  225. "example.com": user
  226. "@admin:example.com": admin
  227. logging:
  228. directory: ./logs
  229. file_name_format: '{{.Date}}-{{.Index}}.log'
  230. file_date_format: "2006-01-02"
  231. file_mode: 384
  232. timestamp_format: Jan _2, 2006 15:04:05
  233. print_level: debug
  234. print_json: false
  235. file_json: false