example-config.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. # Homeserver details.
  2. homeserver:
  3. # The address that this appservice can use to connect to the homeserver.
  4. address: https://example.com
  5. # The domain of the homeserver (for MXIDs, etc).
  6. domain: example.com
  7. # The URL to push real-time bridge status to.
  8. # If set, the bridge will make POST requests to this URL whenever a user's whatsapp connection state changes.
  9. # The bridge will use the appservice as_token to authorize requests.
  10. status_endpoint: null
  11. # Application service host/registration related details.
  12. # Changing these values requires regeneration of the registration.
  13. appservice:
  14. # The address that the homeserver can use to connect to this appservice.
  15. address: http://localhost:29318
  16. # The hostname and port where this appservice should listen.
  17. hostname: 0.0.0.0
  18. port: 29318
  19. # Database config.
  20. database:
  21. # The database type. "sqlite3" and "postgres" are supported.
  22. type: sqlite3
  23. # The database URI.
  24. # SQLite: File name is enough. https://github.com/mattn/go-sqlite3#connection-string
  25. # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
  26. # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql
  27. uri: mautrix-whatsapp.db
  28. # Maximum number of connections. Mostly relevant for Postgres.
  29. max_open_conns: 20
  30. max_idle_conns: 2
  31. # Settings for provisioning API
  32. provisioning:
  33. # Prefix for the provisioning API paths.
  34. prefix: /_matrix/provision/v1
  35. # Shared secret for authentication. If set to "disable", the provisioning API will be disabled.
  36. shared_secret: disable
  37. # The unique ID of this appservice.
  38. id: whatsapp
  39. # Appservice bot details.
  40. bot:
  41. # Username of the appservice bot.
  42. username: whatsappbot
  43. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  44. # to leave display name/avatar as-is.
  45. displayname: WhatsApp bridge bot
  46. avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr
  47. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  48. as_token: "This value is generated when generating the registration"
  49. hs_token: "This value is generated when generating the registration"
  50. metrics:
  51. # Whether or not to enable prometheus metrics
  52. enabled: false
  53. # IP and port where the metrics listener should be. The path is always /metrics
  54. listen: 127.0.0.1:8001
  55. whatsapp:
  56. # Device name that's shown in the "WhatsApp Web" section in the mobile app.
  57. os_name: Mautrix-WhatsApp bridge
  58. # Browser name that determines the logo shown in the mobile app. If the name is unrecognized, a generic icon is shown.
  59. # Use the name of an actual browser (Chrome, Firefox, Safari, IE, Edge, Opera) if you want a specific icon.
  60. browser_name: mx-wa
  61. # Bridge config
  62. bridge:
  63. # Localpart template of MXIDs for WhatsApp users.
  64. # {{.}} is replaced with the phone number of the WhatsApp user.
  65. username_template: whatsapp_{{.}}
  66. # Displayname template for WhatsApp users.
  67. # {{.PushName}} - nickname set by the WhatsApp user
  68. # {{.BusinessName}} - validated WhatsApp business name
  69. # {{.Phone}} - phone number (international format)
  70. # The following variables are also available, but will cause problems on multi-user instances:
  71. # {{.FullName}} - full name from contact list
  72. # {{.FirstName}} - first name from contact list
  73. displayname_template: "{{if .PushName}}{{.PushName}}{{else if .BusinessName}}{{.BusinessName}}{{else}}{{.JID}}{{end}} (WA)"
  74. # Whether or not the bridge should send a read receipt from the bridge bot when a message has been
  75. # sent to WhatsApp. If fetch_message_on_timeout is enabled, a successful post-timeout fetch will
  76. # trigger a read receipt too.
  77. delivery_receipts: false
  78. # Maximum number of times to retry connecting on connection error.
  79. max_connection_attempts: 3
  80. # Number of seconds to wait between connection attempts.
  81. # Negative numbers are exponential backoff: -connection_retry_delay + 1 + 2^attempts
  82. connection_retry_delay: -1
  83. # Whether or not the bridge should send a notice to the user's management room when it retries connecting.
  84. # If false, it will only report when it stops retrying.
  85. report_connection_retry: true
  86. portal_message_buffer: 128
  87. # Whether or not to send call start/end notices to Matrix.
  88. call_notices:
  89. start: true
  90. end: true
  91. history_sync:
  92. # Whether to create portals from history sync payloads from WhatsApp.
  93. create_portals: true
  94. # Whether to enable backfilling history sync payloads from WhatsApp using batch sending
  95. # This requires a server with MSC2716 support, which is currently an experimental feature in synapse.
  96. # It can be enabled by setting experimental_features -> enable_msc2716 to true in homeserver.yaml.
  97. backfill: false
  98. # Whether to use custom puppet for backfilling.
  99. # In order to use this, the custom puppets must be in the appservice's user ID namespace.
  100. double_puppet_backfill: false
  101. # Whether or not puppet avatars should be fetched from the server even if an avatar is already set.
  102. user_avatar_sync: true
  103. # Whether or not Matrix users leaving groups should be bridged to WhatsApp
  104. bridge_matrix_leave: true
  105. # Whether or not to sync with custom puppets to receive EDUs that
  106. # are not normally sent to appservices.
  107. sync_with_custom_puppets: true
  108. # Whether or not to update the m.direct account data event when double puppeting is enabled.
  109. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  110. # and is therefore prone to race conditions.
  111. sync_direct_chat_list: false
  112. # When double puppeting is enabled, users can use `!wa toggle` to change whether or not
  113. # presence and read receipts are bridged. These settings set the default values.
  114. # Existing users won't be affected when these are changed.
  115. default_bridge_receipts: true
  116. default_bridge_presence: true
  117. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  118. #
  119. # If set, custom puppets will be enabled automatically for local users
  120. # instead of users having to find an access token and run `login-matrix`
  121. # manually.
  122. login_shared_secret: null
  123. # Whether to explicitly set the avatar and room name for private chat portal rooms.
  124. private_chat_portal_meta: false
  125. # Whether Matrix m.notice-type messages should be bridged.
  126. bridge_notices: true
  127. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  128. # This field will automatically be changed back to false after it, except if the config file is not writable.
  129. resend_bridge_info: false
  130. # When using double puppeting, should muted chats be muted in Matrix?
  131. mute_bridging: false
  132. # When using double puppeting, should archived chats be moved to a specific tag in Matrix?
  133. # Note that WhatsApp unarchives chats when a message is received, which will also be mirrored to Matrix.
  134. # This can be set to a tag (e.g. m.lowpriority), or null to disable.
  135. archive_tag: null
  136. # Same as above, but for pinned chats. The favorite tag is called m.favourite
  137. pinned_tag: null
  138. # Whether or not mute status and tags should only be bridged when the portal room is created.
  139. tag_only_on_create: true
  140. # Whether or not WhatsApp status messages should be bridged into a Matrix room.
  141. # Disabling this won't affect already created status broadcast rooms.
  142. enable_status_broadcast: true
  143. # Whether or not thumbnails from WhatsApp should be sent.
  144. # They're disabled by default due to very low resolution.
  145. whatsapp_thumbnail: false
  146. # Allow invite permission for user. User can invite any bots to room with whatsapp
  147. # users (private chat and groups)
  148. allow_user_invite: false
  149. # The prefix for commands. Only required in non-management rooms.
  150. command_prefix: "!wa"
  151. # End-to-bridge encryption support options.
  152. #
  153. # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
  154. encryption:
  155. # Allow encryption, work in group chat rooms with e2ee enabled
  156. allow: false
  157. # Default to encryption, force-enable encryption in all portals the bridge creates
  158. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  159. # It is recommended to also set private_chat_portal_meta to true when using this.
  160. default: false
  161. # Options for automatic key sharing.
  162. key_sharing:
  163. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  164. # You must use a client that supports requesting keys from other users to use this feature.
  165. allow: false
  166. # Require the requesting device to have a valid cross-signing signature?
  167. # This doesn't require that the bridge has verified the device, only that the user has verified it.
  168. # Not yet implemented.
  169. require_cross_signing: false
  170. # Require devices to be verified by the bridge?
  171. # Verification by the bridge is not yet implemented.
  172. require_verification: true
  173. # Permissions for using the bridge.
  174. # Permitted values:
  175. # relaybot - Talk through the relaybot (if enabled), no access otherwise
  176. # user - Access to use the bridge to chat with a WhatsApp account.
  177. # admin - User level and some additional administration tools
  178. # Permitted keys:
  179. # * - All Matrix users
  180. # domain - All users on that homeserver
  181. # mxid - Specific user
  182. permissions:
  183. "*": relaybot
  184. "example.com": user
  185. "@admin:example.com": admin
  186. relay:
  187. # Whether relay mode should be allowed. If allowed, `!signal set-relay` can be used to turn any
  188. # authenticated user into a relaybot for that chat.
  189. enabled: false
  190. # Should only admins be allowed to set themselves as relay users?
  191. admin_only: true
  192. # The formats to use when sending messages to WhatsApp via the relaybot.
  193. message_formats:
  194. m.text: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}"
  195. m.notice: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}"
  196. m.emote: "* <b>{{ .Sender.Displayname }}</b> {{ .Message }}"
  197. m.file: "<b>{{ .Sender.Displayname }}</b> sent a file"
  198. m.image: "<b>{{ .Sender.Displayname }}</b> sent an image"
  199. m.audio: "<b>{{ .Sender.Displayname }}</b> sent an audio file"
  200. m.video: "<b>{{ .Sender.Displayname }}</b> sent a video"
  201. m.location: "<b>{{ .Sender.Displayname }}</b> sent a location"
  202. # Logging config.
  203. logging:
  204. # The directory for log files. Will be created if not found.
  205. directory: ./logs
  206. # Available variables: .Date for the file date and .Index for different log files on the same day.
  207. file_name_format: "{{.Date}}-{{.Index}}.log"
  208. # Date format for file names in the Go time format: https://golang.org/pkg/time/#pkg-constants
  209. file_date_format: 2006-01-02
  210. # Log file permissions.
  211. file_mode: 0600
  212. # Timestamp format for log entries in the Go time format.
  213. timestamp_format: Jan _2, 2006 15:04:05
  214. # Minimum severity for log messages.
  215. # Options: debug, info, warn, error, fatal
  216. print_level: debug