example-config.yaml 13 KB

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