example-config.yaml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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: sqlite3
  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: mautrix-discord.db
  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. # You should disable bridge -> sync_with_custom_puppets when this is enabled.
  54. ephemeral_events: false
  55. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  56. as_token: "This value is generated when generating the registration"
  57. hs_token: "This value is generated when generating the registration"
  58. # Bridge config
  59. bridge:
  60. # Localpart template of MXIDs for Discord users.
  61. # {{.}} is replaced with the internal ID of the Discord user.
  62. username_template: discord_{{.}}
  63. # Displayname template for Discord users.
  64. # Available fields:
  65. # .ID - Internal user ID
  66. # .Username - User's displayname on Discord
  67. # .Discriminator - The 4 numbers after the name on Discord
  68. # .Bot - Whether the user is a bot
  69. # .System - Whether the user is an official system user
  70. displayname_template: '{{.Username}}#{{.Discriminator}} {{if .Bot}} (bot){{end}}'
  71. channelname_template: '{{if .Guild}}{{.Guild}} - {{end}}{{if .Folder}}{{.Folder}} - {{end}}{{.Name}} (D)'
  72. portal_message_buffer: 128
  73. # Should the bridge send a read receipt from the bridge bot when a message has been sent to Discord?
  74. delivery_receipts: false
  75. # Should the bridge use space-restricted join rules instead of invite-only for guild rooms?
  76. # This can avoid unnecessary invite events in guild rooms when members are synced in.
  77. restricted_rooms: true
  78. # Should the bridge sync with double puppeting to receive EDUs that aren't normally sent to appservices.
  79. sync_with_custom_puppets: true
  80. # Should the bridge update the m.direct account data event when double puppeting is enabled.
  81. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  82. # and is therefore prone to race conditions.
  83. sync_direct_chat_list: false
  84. # Whether or not created rooms should have federation enabled.
  85. # If false, created portal rooms will never be federated.
  86. federate_rooms: true
  87. # Servers to always allow double puppeting from
  88. double_puppet_server_map:
  89. example.com: https://example.com
  90. # Allow using double puppeting from any server with a valid client .well-known file.
  91. double_puppet_allow_discovery: false
  92. # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
  93. #
  94. # If set, double puppeting will be enabled automatically for local users
  95. # instead of users having to find an access token and run `login-matrix`
  96. # manually.
  97. login_shared_secret_map:
  98. example.com: foobar
  99. # The prefix for commands. Only required in non-management rooms.
  100. command_prefix: '!discord'
  101. # Messages sent upon joining a management room.
  102. # Markdown is supported. The defaults are listed below.
  103. management_room_text:
  104. # Sent when joining a room.
  105. welcome: "Hello, I'm a Discord bridge bot."
  106. # Sent when joining a management room and the user is already logged in.
  107. welcome_connected: "Use `help` for help."
  108. # Sent when joining a management room and the user is not logged in.
  109. welcome_unconnected: "Use `help` for help or `login` to log in."
  110. # Optional extra text sent when joining a management room.
  111. additional_help: ""
  112. # End-to-bridge encryption support options.
  113. #
  114. # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
  115. encryption:
  116. # Allow encryption, work in group chat rooms with e2ee enabled
  117. allow: false
  118. # Default to encryption, force-enable encryption in all portals the bridge creates
  119. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  120. # It is recommended to also set private_chat_portal_meta to true when using this.
  121. default: false
  122. # Options for automatic key sharing.
  123. key_sharing:
  124. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  125. # You must use a client that supports requesting keys from other users to use this feature.
  126. allow: false
  127. # Require the requesting device to have a valid cross-signing signature?
  128. # This doesn't require that the bridge has verified the device, only that the user has verified it.
  129. # Not yet implemented.
  130. require_cross_signing: false
  131. # Require devices to be verified by the bridge?
  132. # Verification by the bridge is not yet implemented.
  133. require_verification: true
  134. # Settings for provisioning API
  135. provisioning:
  136. # Prefix for the provisioning API paths.
  137. prefix: /_matrix/provision
  138. # Shared secret for authentication. If set to "generate", a random secret will be generated,
  139. # or if set to "disable", the provisioning API will be disabled.
  140. shared_secret: generate
  141. # Permissions for using the bridge.
  142. # Permitted values:
  143. # relay - Talk through the relaybot (if enabled), no access otherwise
  144. # user - Access to use the bridge to chat with a Discord account.
  145. # admin - User level and some additional administration tools
  146. # Permitted keys:
  147. # * - All Matrix users
  148. # domain - All users on that homeserver
  149. # mxid - Specific user
  150. permissions:
  151. "*": relay
  152. "example.com": user
  153. "@admin:example.com": admin
  154. logging:
  155. directory: ./logs
  156. file_name_format: '{{.Date}}-{{.Index}}.log'
  157. file_date_format: "2006-01-02"
  158. file_mode: 384
  159. timestamp_format: Jan _2, 2006 15:04:05
  160. print_level: debug
  161. print_json: false
  162. file_json: false