example-config.yaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. # 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 whatsapp 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. # Application service host/registration related details.
  16. # Changing these values requires regeneration of the registration.
  17. appservice:
  18. # The address that the homeserver can use to connect to this appservice.
  19. address: http://localhost:29318
  20. # The hostname and port where this appservice should listen.
  21. hostname: 0.0.0.0
  22. port: 29318
  23. # Database config.
  24. database:
  25. # The database type. "sqlite3" and "postgres" are supported.
  26. type: sqlite3
  27. # The database URI.
  28. # SQLite: File name is enough. https://github.com/mattn/go-sqlite3#connection-string
  29. # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
  30. # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql
  31. uri: mautrix-whatsapp.db
  32. # Maximum number of connections. Mostly relevant for Postgres.
  33. max_open_conns: 20
  34. max_idle_conns: 2
  35. # Settings for provisioning API
  36. provisioning:
  37. # Prefix for the provisioning API paths.
  38. prefix: /_matrix/provision/v1
  39. # Shared secret for authentication. If set to "generate", a random secret will be generated,
  40. # or if set to "disable", the provisioning API will be disabled.
  41. shared_secret: generate
  42. # The unique ID of this appservice.
  43. id: whatsapp
  44. # Appservice bot details.
  45. bot:
  46. # Username of the appservice bot.
  47. username: whatsappbot
  48. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  49. # to leave display name/avatar as-is.
  50. displayname: WhatsApp bridge bot
  51. avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr
  52. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  53. as_token: "This value is generated when generating the registration"
  54. hs_token: "This value is generated when generating the registration"
  55. # Prometheus config.
  56. metrics:
  57. # Enable prometheus metrics?
  58. enabled: false
  59. # IP and port where the metrics listener should be. The path is always /metrics
  60. listen: 127.0.0.1:8001
  61. # Config for things that are directly sent to WhatsApp.
  62. whatsapp:
  63. # Device name that's shown in the "WhatsApp Web" section in the mobile app.
  64. os_name: Mautrix-WhatsApp bridge
  65. # Browser name that determines the logo shown in the mobile app.
  66. # Must be "unknown" for a generic icon or a valid browser name if you want a specific icon.
  67. # List of valid browser names: https://github.com/tulir/whatsmeow/blob/2a72655ef600a7fd7a2e98d53ec6da029759c4b8/binary/proto/def.proto#L1582-L1594
  68. browser_name: unknown
  69. # Bridge config
  70. bridge:
  71. # Localpart template of MXIDs for WhatsApp users.
  72. # {{.}} is replaced with the phone number of the WhatsApp user.
  73. username_template: whatsapp_{{.}}
  74. # Displayname template for WhatsApp users.
  75. # {{.PushName}} - nickname set by the WhatsApp user
  76. # {{.BusinessName}} - validated WhatsApp business name
  77. # {{.Phone}} - phone number (international format)
  78. # The following variables are also available, but will cause problems on multi-user instances:
  79. # {{.FullName}} - full name from contact list
  80. # {{.FirstName}} - first name from contact list
  81. displayname_template: "{{if .PushName}}{{.PushName}}{{else if .BusinessName}}{{.BusinessName}}{{else}}{{.JID}}{{end}} (WA)"
  82. # Should the bridge send a read receipt from the bridge bot when a message has been sent to WhatsApp?
  83. delivery_receipts: false
  84. # Should incoming calls send a message to the Matrix room?
  85. call_start_notices: true
  86. # Should another user's cryptographic identity changing send a message to Matrix?
  87. identity_change_notices: false
  88. # Should a "reactions not yet supported" warning be sent to the Matrix room when a user reacts to a message?
  89. reaction_notices: true
  90. portal_message_buffer: 128
  91. # Settings for handling history sync payloads. These settings only apply right after login,
  92. # because the phone only sends the history sync data once, and there's no way to re-request it
  93. # (other than logging out and back in again).
  94. history_sync:
  95. # Should the bridge create portals for chats in the history sync payload?
  96. create_portals: true
  97. # Maximum age of chats in seconds to create portals for. Set to 0 to create portals for all chats in sync payload.
  98. max_age: 604800
  99. # Enable backfilling history sync payloads from WhatsApp using batch sending?
  100. # This requires a server with MSC2716 support, which is currently an experimental feature in synapse.
  101. # It can be enabled by setting experimental_features -> msc2716_enabled to true in homeserver.yaml.
  102. # Note that as of Synapse 1.46, there are still some bugs with the implementation, especially if using event persistence workers.
  103. backfill: false
  104. # Use double puppets for backfilling?
  105. # In order to use this, the double puppets must be in the appservice's user ID namespace
  106. # (because the bridge can't use the double puppet access token with batch sending).
  107. # This only affects double puppets on the local server, double puppets on other servers will never be used.
  108. double_puppet_backfill: false
  109. # Should the bridge request a full sync from the phone when logging in?
  110. # This bumps the size of history syncs from 3 months to 1 year.
  111. request_full_sync: false
  112. # Should puppet avatars be fetched from the server even if an avatar is already set?
  113. user_avatar_sync: true
  114. # Should Matrix users leaving groups be bridged to WhatsApp?
  115. bridge_matrix_leave: true
  116. # Should the bridge sync with double puppeting to receive EDUs that aren't normally sent to appservices.
  117. sync_with_custom_puppets: true
  118. # Should the bridge update the m.direct account data event when double puppeting is enabled.
  119. # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
  120. # and is therefore prone to race conditions.
  121. sync_direct_chat_list: false
  122. # When double puppeting is enabled, users can use `!wa toggle` to change whether
  123. # presence and read receipts are bridged. These settings set the default values.
  124. # Existing users won't be affected when these are changed.
  125. default_bridge_receipts: true
  126. default_bridge_presence: true
  127. # Servers to always allow double puppeting from
  128. double_puppet_server_map:
  129. example.com: https://example.com
  130. # Allow using double puppeting from any server with a valid client .well-known file.
  131. double_puppet_allow_discovery: false
  132. # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
  133. #
  134. # If set, double puppeting will be enabled automatically for local users
  135. # instead of users having to find an access token and run `login-matrix`
  136. # manually.
  137. login_shared_secret_map:
  138. example.com: foobar
  139. # Should the bridge explicitly set the avatar and room name for private chat portal rooms?
  140. private_chat_portal_meta: false
  141. # Should Matrix m.notice-type messages be bridged?
  142. bridge_notices: true
  143. # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
  144. # This field will automatically be changed back to false after it, except if the config file is not writable.
  145. resend_bridge_info: false
  146. # When using double puppeting, should muted chats be muted in Matrix?
  147. mute_bridging: false
  148. # When using double puppeting, should archived chats be moved to a specific tag in Matrix?
  149. # Note that WhatsApp unarchives chats when a message is received, which will also be mirrored to Matrix.
  150. # This can be set to a tag (e.g. m.lowpriority), or null to disable.
  151. archive_tag: null
  152. # Same as above, but for pinned chats. The favorite tag is called m.favourite
  153. pinned_tag: null
  154. # Should mute status and tags only be bridged when the portal room is created?
  155. tag_only_on_create: true
  156. # Should WhatsApp status messages be bridged into a Matrix room?
  157. # Disabling this won't affect already created status broadcast rooms.
  158. enable_status_broadcast: true
  159. # Should the status broadcast room be muted and moved into low priority by default?
  160. # This is only applied when creating the room, the user can unmute/untag it later.
  161. mute_status_broadcast: true
  162. # Should the bridge use thumbnails from WhatsApp?
  163. # They're disabled by default due to very low resolution.
  164. whatsapp_thumbnail: false
  165. # Allow invite permission for user. User can invite any bots to room with whatsapp
  166. # users (private chat and groups)
  167. allow_user_invite: false
  168. # Whether or not created rooms should have federation enabled.
  169. # If false, created portal rooms will never be federated.
  170. federate_rooms: true
  171. # The prefix for commands. Only required in non-management rooms.
  172. command_prefix: "!wa"
  173. # Messages sent upon joining a management room.
  174. # Markdown is supported. The defaults are listed below.
  175. management_room_text:
  176. # Sent when joining a room.
  177. welcome: "Hello, I'm a WhatsApp bridge bot."
  178. # Sent when joining a management room and the user is already logged in.
  179. welcome_connected: "Use `help` for help."
  180. # Sent when joining a management room and the user is not logged in.
  181. welcome_unconnected: "Use `help` for help or `login` to log in."
  182. # Optional extra text sent when joining a management room.
  183. additional_help: ""
  184. # End-to-bridge encryption support options.
  185. #
  186. # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
  187. encryption:
  188. # Allow encryption, work in group chat rooms with e2ee enabled
  189. allow: false
  190. # Default to encryption, force-enable encryption in all portals the bridge creates
  191. # This will cause the bridge bot to be in private chats for the encryption to work properly.
  192. # It is recommended to also set private_chat_portal_meta to true when using this.
  193. default: false
  194. # Options for automatic key sharing.
  195. key_sharing:
  196. # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
  197. # You must use a client that supports requesting keys from other users to use this feature.
  198. allow: false
  199. # Require the requesting device to have a valid cross-signing signature?
  200. # This doesn't require that the bridge has verified the device, only that the user has verified it.
  201. # Not yet implemented.
  202. require_cross_signing: false
  203. # Require devices to be verified by the bridge?
  204. # Verification by the bridge is not yet implemented.
  205. require_verification: true
  206. # Permissions for using the bridge.
  207. # Permitted values:
  208. # relay - Talk through the relaybot (if enabled), no access otherwise
  209. # user - Access to use the bridge to chat with a WhatsApp account.
  210. # admin - User level and some additional administration tools
  211. # Permitted keys:
  212. # * - All Matrix users
  213. # domain - All users on that homeserver
  214. # mxid - Specific user
  215. permissions:
  216. "*": relay
  217. "example.com": user
  218. "@admin:example.com": admin
  219. # Settings for relay mode
  220. relay:
  221. # Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any
  222. # authenticated user into a relaybot for that chat.
  223. enabled: false
  224. # Should only admins be allowed to set themselves as relay users?
  225. admin_only: true
  226. # The formats to use when sending messages to WhatsApp via the relaybot.
  227. message_formats:
  228. m.text: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}"
  229. m.notice: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}"
  230. m.emote: "* <b>{{ .Sender.Displayname }}</b> {{ .Message }}"
  231. m.file: "<b>{{ .Sender.Displayname }}</b> sent a file"
  232. m.image: "<b>{{ .Sender.Displayname }}</b> sent an image"
  233. m.audio: "<b>{{ .Sender.Displayname }}</b> sent an audio file"
  234. m.video: "<b>{{ .Sender.Displayname }}</b> sent a video"
  235. m.location: "<b>{{ .Sender.Displayname }}</b> sent a location"
  236. # Logging config.
  237. logging:
  238. # The directory for log files. Will be created if not found.
  239. directory: ./logs
  240. # Available variables: .Date for the file date and .Index for different log files on the same day.
  241. # Set this to null to disable logging to file.
  242. file_name_format: "{{.Date}}-{{.Index}}.log"
  243. # Date format for file names in the Go time format: https://golang.org/pkg/time/#pkg-constants
  244. file_date_format: "2006-01-02"
  245. # Log file permissions.
  246. file_mode: 0o600
  247. # Timestamp format for log entries in the Go time format.
  248. timestamp_format: "Jan _2, 2006 15:04:05"
  249. # Minimum severity for log messages printed to stdout/stderr. This doesn't affect the log file.
  250. # Options: debug, info, warn, error, fatal
  251. print_level: debug