config.yaml.new (26098B)
1 # Homeserver details. 2 homeserver: 3 # The address that this appservice can use to connect to the homeserver. 4 address: https://matrix.example.com 5 # The domain of the homeserver (also known as server_name, used for MXIDs, etc). 6 domain: example.com 7 8 # What software is the homeserver running? 9 # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here. 10 software: standard 11 # The URL to push real-time bridge status to. 12 # If set, the bridge will make POST requests to this URL whenever a user's whatsapp connection state changes. 13 # The bridge will use the appservice as_token to authorize requests. 14 status_endpoint: null 15 # Endpoint for reporting per-message status. 16 message_send_checkpoint_endpoint: null 17 # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246? 18 async_media: false 19 20 # Should the bridge use a websocket for connecting to the homeserver? 21 # The server side is currently not documented anywhere and is only implemented by mautrix-wsproxy, 22 # mautrix-asmux (deprecated), and hungryserv (proprietary). 23 websocket: false 24 # How often should the websocket be pinged? Pinging will be disabled if this is zero. 25 ping_interval_seconds: 0 26 27 # Application service host/registration related details. 28 # Changing these values requires regeneration of the registration. 29 appservice: 30 # The address that the homeserver can use to connect to this appservice. 31 address: http://localhost:29318 32 33 # The hostname and port where this appservice should listen. 34 hostname: localhost 35 port: 29318 36 37 # Database config. 38 database: 39 # The database type. "sqlite3-fk-wal" and "postgres" are supported. 40 type: postgres 41 # The database URI. 42 # SQLite: A raw file path is supported, but `file:<path>?_txlock=immediate` is recommended. 43 # https://github.com/mattn/go-sqlite3#connection-string 44 # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable 45 # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql 46 uri: postgres://mautrix-whatsapp:password@localhost/mautrix-whatsapp?sslmode=disable 47 # Maximum number of connections. Mostly relevant for Postgres. 48 max_open_conns: 20 49 max_idle_conns: 2 50 # Maximum connection idle time and lifetime before they're closed. Disabled if null. 51 # Parsed with https://pkg.go.dev/time#ParseDuration 52 max_conn_idle_time: null 53 max_conn_lifetime: null 54 55 # The unique ID of this appservice. 56 id: whatsapp 57 # Appservice bot details. 58 bot: 59 # Username of the appservice bot. 60 username: whatsappbot 61 # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty 62 # to leave display name/avatar as-is. 63 displayname: WhatsApp bridge bot 64 avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr 65 66 # Whether or not to receive ephemeral events via appservice transactions. 67 # Requires MSC2409 support (i.e. Synapse 1.22+). 68 ephemeral_events: true 69 70 # Should incoming events be handled asynchronously? 71 # This may be necessary for large public instances with lots of messages going through. 72 # However, messages will not be guaranteed to be bridged in the same order they were sent in. 73 async_transactions: false 74 75 # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. 76 as_token: "This value is generated when generating the registration" 77 hs_token: "This value is generated when generating the registration" 78 79 # Segment-compatible analytics endpoint for tracking some events, like provisioning API login and encryption errors. 80 analytics: 81 # Hostname of the tracking server. The path is hardcoded to /v1/track 82 host: api.segment.io 83 # API key to send with tracking requests. Tracking is disabled if this is null. 84 token: null 85 # Optional user ID for tracking events. If null, defaults to using Matrix user ID. 86 user_id: null 87 88 # Prometheus config. 89 metrics: 90 # Enable prometheus metrics? 91 enabled: false 92 # IP and port where the metrics listener should be. The path is always /metrics 93 listen: 127.0.0.1:8001 94 95 # Config for things that are directly sent to WhatsApp. 96 whatsapp: 97 # Device name that's shown in the "WhatsApp Web" section in the mobile app. 98 os_name: Mautrix-WhatsApp bridge 99 # Browser name that determines the logo shown in the mobile app. 100 # Must be "unknown" for a generic icon or a valid browser name if you want a specific icon. 101 # List of valid browser names: https://github.com/tulir/whatsmeow/blob/efc632c008604016ddde63bfcfca8de4e5304da9/binary/proto/def.proto#L43-L64 102 browser_name: unknown 103 104 # Bridge config 105 bridge: 106 # Localpart template of MXIDs for WhatsApp users. 107 # {{.}} is replaced with the phone number of the WhatsApp user. 108 username_template: whatsapp_{{.}} 109 # Displayname template for WhatsApp users. 110 # {{.PushName}} - nickname set by the WhatsApp user 111 # {{.BusinessName}} - validated WhatsApp business name 112 # {{.Phone}} - phone number (international format) 113 # The following variables are also available, but will cause problems on multi-user instances: 114 # {{.FullName}} - full name from contact list 115 # {{.FirstName}} - first name from contact list 116 displayname_template: "{{or .BusinessName .PushName .JID}} (WA)" 117 # Should the bridge create a space for each logged-in user and add bridged rooms to it? 118 # Users who logged in before turning this on should run `!wa sync space` to create and fill the space for the first time. 119 personal_filtering_spaces: false 120 # Should the bridge send a read receipt from the bridge bot when a message has been sent to WhatsApp? 121 delivery_receipts: false 122 # Whether the bridge should send the message status as a custom com.beeper.message_send_status event. 123 message_status_events: false 124 # Whether the bridge should send error notices via m.notice events when a message fails to bridge. 125 message_error_notices: true 126 # Should incoming calls send a message to the Matrix room? 127 call_start_notices: true 128 # Should another user's cryptographic identity changing send a message to Matrix? 129 identity_change_notices: false 130 portal_message_buffer: 128 131 # Settings for handling history sync payloads. 132 history_sync: 133 # Enable backfilling history sync payloads from WhatsApp? 134 backfill: true 135 # The maximum number of initial conversations that should be synced. 136 # Other conversations will be backfilled on demand when receiving a message or when initiating a direct chat. 137 max_initial_conversations: -1 138 # Maximum number of messages to backfill in each conversation. 139 # Set to -1 to disable limit. 140 message_count: 50 141 # Should the bridge request a full sync from the phone when logging in? 142 # This bumps the size of history syncs from 3 months to 1 year. 143 request_full_sync: false 144 # Configuration parameters that are sent to the phone along with the request full sync flag. 145 # By default (when the values are null or 0), the config isn't sent at all. 146 full_sync_config: 147 # Number of days of history to request. 148 # The limit seems to be around 3 years, but using higher values doesn't break. 149 days_limit: null 150 # This is presumably the maximum size of the transferred history sync blob, which may affect what the phone includes in the blob. 151 size_mb_limit: null 152 # This is presumably the local storage quota, which may affect what the phone includes in the history sync blob. 153 storage_quota_mb: null 154 # If this value is greater than 0, then if the conversation's last message was more than 155 # this number of hours ago, then the conversation will automatically be marked it as read. 156 # Conversations that have a last message that is less than this number of hours ago will 157 # have their unread status synced from WhatsApp. 158 unread_hours_threshold: 0 159 160 ############################################################################### 161 # The settings below are only applicable for backfilling using batch sending, # 162 # which is no longer supported in Synapse. # 163 ############################################################################### 164 165 # Settings for media requests. If the media expired, then it will not be on the WA servers. 166 # Media can always be requested by reacting with the ♻️ (recycle) emoji. 167 # These settings determine if the media requests should be done automatically during or after backfill. 168 media_requests: 169 # Should expired media be automatically requested from the server as part of the backfill process? 170 auto_request_media: true 171 # Whether to request the media immediately after the media message is backfilled ("immediate") 172 # or at a specific time of the day ("local_time"). 173 request_method: immediate 174 # If request_method is "local_time", what time should the requests be sent (in minutes after midnight)? 175 request_local_time: 120 176 # Settings for immediate backfills. These backfills should generally be small and their main purpose is 177 # to populate each of the initial chats (as configured by max_initial_conversations) with a few messages 178 # so that you can continue conversations without losing context. 179 immediate: 180 # The number of concurrent backfill workers to create for immediate backfills. 181 # Note that using more than one worker could cause the room list to jump around 182 # since there are no guarantees about the order in which the backfills will complete. 183 worker_count: 1 184 # The maximum number of events to backfill initially. 185 max_events: 10 186 # Settings for deferred backfills. The purpose of these backfills are to fill in the rest of 187 # the chat history that was not covered by the immediate backfills. 188 # These backfills generally should happen at a slower pace so as not to overload the homeserver. 189 # Each deferred backfill config should define a "stage" of backfill (i.e. the last week of messages). 190 # The fields are as follows: 191 # - start_days_ago: the number of days ago to start backfilling from. 192 # To indicate the start of time, use -1. For example, for a week ago, use 7. 193 # - max_batch_events: the number of events to send per batch. 194 # - batch_delay: the number of seconds to wait before backfilling each batch. 195 deferred: 196 # Last Week 197 - start_days_ago: 7 198 max_batch_events: 20 199 batch_delay: 5 200 # Last Month 201 - start_days_ago: 30 202 max_batch_events: 50 203 batch_delay: 10 204 # Last 3 months 205 - start_days_ago: 90 206 max_batch_events: 100 207 batch_delay: 10 208 # The start of time 209 - start_days_ago: -1 210 max_batch_events: 500 211 batch_delay: 10 212 213 # Should puppet avatars be fetched from the server even if an avatar is already set? 214 user_avatar_sync: true 215 # Should Matrix users leaving groups be bridged to WhatsApp? 216 bridge_matrix_leave: true 217 # Should the bridge update the m.direct account data event when double puppeting is enabled. 218 # Note that updating the m.direct event is not atomic (except with mautrix-asmux) 219 # and is therefore prone to race conditions. 220 sync_direct_chat_list: false 221 # Should the bridge use MSC2867 to bridge manual "mark as unread"s from 222 # WhatsApp and set the unread status on initial backfill? 223 # This will only work on clients that support the m.marked_unread or 224 # com.famedly.marked_unread room account data. 225 sync_manual_marked_unread: true 226 # When double puppeting is enabled, users can use `!wa toggle` to change whether 227 # presence is bridged. This setting sets the default value. 228 # Existing users won't be affected when these are changed. 229 default_bridge_presence: true 230 # Send the presence as "available" to whatsapp when users start typing on a portal. 231 # This works as a workaround for homeservers that do not support presence, and allows 232 # users to see when the whatsapp user on the other side is typing during a conversation. 233 send_presence_on_typing: false 234 # Should the bridge always send "active" delivery receipts (two gray ticks on WhatsApp) 235 # even if the user isn't marked as online (e.g. when presence bridging isn't enabled)? 236 # 237 # By default, the bridge acts like WhatsApp web, which only sends active delivery 238 # receipts when it's in the foreground. 239 force_active_delivery_receipts: false 240 # Servers to always allow double puppeting from 241 double_puppet_server_map: 242 example.com: https://example.com 243 # Allow using double puppeting from any server with a valid client .well-known file. 244 double_puppet_allow_discovery: false 245 # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth 246 # 247 # If set, double puppeting will be enabled automatically for local users 248 # instead of users having to find an access token and run `login-matrix` 249 # manually. 250 login_shared_secret_map: 251 example.com: foobar 252 # Whether to explicitly set the avatar and room name for private chat portal rooms. 253 # If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms. 254 # If set to `always`, all DM rooms will have explicit names and avatars set. 255 # If set to `never`, DM rooms will never have names and avatars set. 256 private_chat_portal_meta: default 257 # Should group members be synced in parallel? This makes member sync faster 258 parallel_member_sync: false 259 # Should Matrix m.notice-type messages be bridged? 260 bridge_notices: true 261 # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run. 262 # This field will automatically be changed back to false after it, except if the config file is not writable. 263 resend_bridge_info: false 264 # When using double puppeting, should muted chats be muted in Matrix? 265 mute_bridging: false 266 # When using double puppeting, should archived chats be moved to a specific tag in Matrix? 267 # Note that WhatsApp unarchives chats when a message is received, which will also be mirrored to Matrix. 268 # This can be set to a tag (e.g. m.lowpriority), or null to disable. 269 archive_tag: null 270 # Same as above, but for pinned chats. The favorite tag is called m.favourite 271 pinned_tag: null 272 # Should mute status and tags only be bridged when the portal room is created? 273 tag_only_on_create: true 274 # Should WhatsApp status messages be bridged into a Matrix room? 275 # Disabling this won't affect already created status broadcast rooms. 276 enable_status_broadcast: true 277 # Should sending WhatsApp status messages be allowed? 278 # This can cause issues if the user has lots of contacts, so it's disabled by default. 279 disable_status_broadcast_send: true 280 # Should the status broadcast room be muted and moved into low priority by default? 281 # This is only applied when creating the room, the user can unmute it later. 282 mute_status_broadcast: true 283 # Tag to apply to the status broadcast room. 284 status_broadcast_tag: m.lowpriority 285 # Should the bridge use thumbnails from WhatsApp? 286 # They're disabled by default due to very low resolution. 287 whatsapp_thumbnail: false 288 # Allow invite permission for user. User can invite any bots to room with whatsapp 289 # users (private chat and groups) 290 allow_user_invite: false 291 # Whether or not created rooms should have federation enabled. 292 # If false, created portal rooms will never be federated. 293 federate_rooms: true 294 # Should the bridge never send alerts to the bridge management room? 295 # These are mostly things like the user being logged out. 296 disable_bridge_alerts: false 297 # Should the bridge stop if the WhatsApp server says another user connected with the same session? 298 # This is only safe on single-user bridges. 299 crash_on_stream_replaced: false 300 # Should the bridge detect URLs in outgoing messages, ask the homeserver to generate a preview, 301 # and send it to WhatsApp? URL previews can always be sent using the `com.beeper.linkpreviews` 302 # key in the event content even if this is disabled. 303 url_previews: false 304 # Send captions in the same message as images. This will send data compatible with both MSC2530 and MSC3552. 305 # This is currently not supported in most clients. 306 caption_in_message: false 307 # Send galleries as a single event? This is not an MSC (yet). 308 beeper_galleries: false 309 # Should polls be sent using MSC3381 event types? 310 extev_polls: false 311 # Should cross-chat replies from WhatsApp be bridged? Most servers and clients don't support this. 312 cross_room_replies: false 313 # Disable generating reply fallbacks? Some extremely bad clients still rely on them, 314 # but they're being phased out and will be completely removed in the future. 315 disable_reply_fallbacks: false 316 # Maximum time for handling Matrix events. Duration strings formatted for https://pkg.go.dev/time#ParseDuration 317 # Null means there's no enforced timeout. 318 message_handling_timeout: 319 # Send an error message after this timeout, but keep waiting for the response until the deadline. 320 # This is counted from the origin_server_ts, so the warning time is consistent regardless of the source of delay. 321 # If the message is older than this when it reaches the bridge, the message won't be handled at all. 322 error_after: null 323 # Drop messages after this timeout. They may still go through if the message got sent to the servers. 324 # This is counted from the time the bridge starts handling the message. 325 deadline: 120s 326 327 # The prefix for commands. Only required in non-management rooms. 328 command_prefix: "!wa" 329 330 # Messages sent upon joining a management room. 331 # Markdown is supported. The defaults are listed below. 332 management_room_text: 333 # Sent when joining a room. 334 welcome: "Hello, I'm a WhatsApp bridge bot." 335 # Sent when joining a management room and the user is already logged in. 336 welcome_connected: "Use `help` for help." 337 # Sent when joining a management room and the user is not logged in. 338 welcome_unconnected: "Use `help` for help or `login` to log in." 339 # Optional extra text sent when joining a management room. 340 additional_help: "" 341 342 # End-to-bridge encryption support options. 343 # 344 # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. 345 encryption: 346 # Allow encryption, work in group chat rooms with e2ee enabled 347 allow: false 348 # Default to encryption, force-enable encryption in all portals the bridge creates 349 # This will cause the bridge bot to be in private chats for the encryption to work properly. 350 default: false 351 # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. 352 appservice: false 353 # Require encryption, drop any unencrypted messages. 354 require: false 355 # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. 356 # You must use a client that supports requesting keys from other users to use this feature. 357 allow_key_sharing: false 358 # Should users mentions be in the event wire content to enable the server to send push notifications? 359 plaintext_mentions: false 360 # Options for deleting megolm sessions from the bridge. 361 delete_keys: 362 # Beeper-specific: delete outbound sessions when hungryserv confirms 363 # that the user has uploaded the key to key backup. 364 delete_outbound_on_ack: false 365 # Don't store outbound sessions in the inbound table. 366 dont_store_outbound: false 367 # Ratchet megolm sessions forward after decrypting messages. 368 ratchet_on_decrypt: false 369 # Delete fully used keys (index >= max_messages) after decrypting messages. 370 delete_fully_used_on_decrypt: false 371 # Delete previous megolm sessions from same device when receiving a new one. 372 delete_prev_on_new_session: false 373 # Delete megolm sessions received from a device when the device is deleted. 374 delete_on_device_delete: false 375 # Periodically delete megolm sessions when 2x max_age has passed since receiving the session. 376 periodically_delete_expired: false 377 # Delete inbound megolm sessions that don't have the received_at field used for 378 # automatic ratcheting and expired session deletion. This is meant as a migration 379 # to delete old keys prior to the bridge update. 380 delete_outdated_inbound: false 381 # What level of device verification should be required from users? 382 # 383 # Valid levels: 384 # unverified - Send keys to all device in the room. 385 # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. 386 # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). 387 # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. 388 # Note that creating user signatures from the bridge bot is not currently possible. 389 # verified - Require manual per-device verification 390 # (currently only possible by modifying the `trust` column in the `crypto_device` database table). 391 verification_levels: 392 # Minimum level for which the bridge should send keys to when bridging messages from WhatsApp to Matrix. 393 receive: unverified 394 # Minimum level that the bridge should accept for incoming Matrix messages. 395 send: unverified 396 # Minimum level that the bridge should require for accepting key requests. 397 share: cross-signed-tofu 398 # Options for Megolm room key rotation. These options allow you to 399 # configure the m.room.encryption event content. See: 400 # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for 401 # more information about that event. 402 rotation: 403 # Enable custom Megolm room key rotation settings. Note that these 404 # settings will only apply to rooms created after this option is 405 # set. 406 enable_custom: false 407 # The maximum number of milliseconds a session should be used 408 # before changing it. The Matrix spec recommends 604800000 (a week) 409 # as the default. 410 milliseconds: 604800000 411 # The maximum number of messages that should be sent with a given a 412 # session before changing it. The Matrix spec recommends 100 as the 413 # default. 414 messages: 100 415 416 # Disable rotating keys when a user's devices change? 417 # You should not enable this option unless you understand all the implications. 418 disable_device_change_key_rotation: false 419 420 # Settings for provisioning API 421 provisioning: 422 # Prefix for the provisioning API paths. 423 prefix: /_matrix/provision 424 # Shared secret for authentication. If set to "generate", a random secret will be generated, 425 # or if set to "disable", the provisioning API will be disabled. 426 shared_secret: generate 427 # Enable debug API at /debug with provisioning authentication. 428 debug_endpoints: false 429 430 # Permissions for using the bridge. 431 # Permitted values: 432 # relay - Talk through the relaybot (if enabled), no access otherwise 433 # user - Access to use the bridge to chat with a WhatsApp account. 434 # admin - User level and some additional administration tools 435 # Permitted keys: 436 # * - All Matrix users 437 # domain - All users on that homeserver 438 # mxid - Specific user 439 permissions: 440 "*": relay 441 "example.com": user 442 "@admin:example.com": admin 443 444 # Settings for relay mode 445 relay: 446 # Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any 447 # authenticated user into a relaybot for that chat. 448 enabled: false 449 # Should only admins be allowed to set themselves as relay users? 450 admin_only: true 451 # The formats to use when sending messages to WhatsApp via the relaybot. 452 message_formats: 453 m.text: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}" 454 m.notice: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}" 455 m.emote: "* <b>{{ .Sender.Displayname }}</b> {{ .Message }}" 456 m.file: "<b>{{ .Sender.Displayname }}</b> sent a file" 457 m.image: "<b>{{ .Sender.Displayname }}</b> sent an image" 458 m.audio: "<b>{{ .Sender.Displayname }}</b> sent an audio file" 459 m.video: "<b>{{ .Sender.Displayname }}</b> sent a video" 460 m.location: "<b>{{ .Sender.Displayname }}</b> sent a location" 461 462 # Logging config. See https://github.com/tulir/zeroconfig for details. 463 logging: 464 min_level: debug 465 writers: 466 - type: stdout 467 format: pretty-colored 468 - type: file 469 format: json 470 filename: ./logs/mautrix-whatsapp.log 471 max_size: 100 472 max_backups: 10 473 compress: true