example-config.yaml 11 KB

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