2018-08-13 00:00:23 +02:00
|
|
|
# Homeserver details.
|
|
|
|
homeserver:
|
2019-03-13 23:38:11 +01:00
|
|
|
# The address that this appservice can use to connect to the homeserver.
|
2019-11-10 20:22:11 +01:00
|
|
|
address: https://example.com
|
2019-03-13 23:38:11 +01:00
|
|
|
# The domain of the homeserver (for MXIDs, etc).
|
2019-11-10 20:22:11 +01:00
|
|
|
domain: example.com
|
2018-08-13 00:00:23 +02:00
|
|
|
|
|
|
|
# Application service host/registration related details.
|
|
|
|
# Changing these values requires regeneration of the registration.
|
|
|
|
appservice:
|
2019-03-13 23:38:11 +01:00
|
|
|
# The address that the homeserver can use to connect to this appservice.
|
2019-07-28 17:29:30 +02:00
|
|
|
address: http://localhost:29318
|
2018-08-13 00:00:23 +02:00
|
|
|
|
2019-03-13 23:38:11 +01:00
|
|
|
# The hostname and port where this appservice should listen.
|
|
|
|
hostname: 0.0.0.0
|
2019-07-28 17:29:30 +02:00
|
|
|
port: 29318
|
2018-08-13 00:00:23 +02:00
|
|
|
|
2019-03-13 23:38:11 +01:00
|
|
|
# Database config.
|
|
|
|
database:
|
|
|
|
# The database type. "sqlite3" and "postgres" are supported.
|
|
|
|
type: sqlite3
|
|
|
|
# The database URI.
|
|
|
|
# SQLite: File name is enough. https://github.com/mattn/go-sqlite3#connection-string
|
2020-04-12 09:41:53 +02:00
|
|
|
# Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
|
2019-03-13 23:38:11 +01:00
|
|
|
uri: mautrix-whatsapp.db
|
2019-05-17 22:33:27 +02:00
|
|
|
# Maximum number of connections. Mostly relevant for Postgres.
|
|
|
|
max_open_conns: 20
|
|
|
|
max_idle_conns: 2
|
|
|
|
|
2020-02-09 19:32:14 +01:00
|
|
|
# Settings for provisioning API
|
|
|
|
provisioning:
|
|
|
|
# Prefix for the provisioning API paths.
|
|
|
|
prefix: /_matrix/provision/v1
|
|
|
|
# Shared secret for authentication. If set to "disable", the provisioning API will be disabled.
|
|
|
|
shared_secret: disable
|
|
|
|
|
2019-03-13 23:38:11 +01:00
|
|
|
# The unique ID of this appservice.
|
|
|
|
id: whatsapp
|
|
|
|
# Appservice bot details.
|
|
|
|
bot:
|
|
|
|
# Username of the appservice bot.
|
|
|
|
username: whatsappbot
|
|
|
|
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
|
|
|
|
# to leave display name/avatar as-is.
|
|
|
|
displayname: WhatsApp bridge bot
|
|
|
|
avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr
|
2018-08-13 00:00:23 +02:00
|
|
|
|
2019-03-13 23:38:11 +01:00
|
|
|
# Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
|
|
|
|
as_token: "This value is generated when generating the registration"
|
|
|
|
hs_token: "This value is generated when generating the registration"
|
2018-08-13 00:00:23 +02:00
|
|
|
|
2020-06-17 16:50:06 +02:00
|
|
|
metrics:
|
|
|
|
# Whether or not to enable prometheus metrics
|
|
|
|
enabled: false
|
|
|
|
# IP and port where the metrics listener should be. The path is always /metrics
|
|
|
|
listen: 127.0.0.1:8001
|
|
|
|
|
2020-06-25 16:59:44 +02:00
|
|
|
whatsapp:
|
2020-08-27 00:14:54 +02:00
|
|
|
# Device name that's shown in the "WhatsApp Web" section in the mobile app.
|
|
|
|
os_name: Mautrix-WhatsApp bridge
|
|
|
|
# Browser name that determines the logo shown in the mobile app. If the name is unrecognized, a generic icon is shown.
|
|
|
|
# Use the name of an actual browser (Chrome, Firefox, Safari, IE, Edge, Opera) if you want a specific icon.
|
|
|
|
browser_name: mx-wa
|
2020-06-25 16:59:44 +02:00
|
|
|
|
2019-04-06 21:41:25 +02:00
|
|
|
# Bridge config
|
2018-08-13 00:00:23 +02:00
|
|
|
bridge:
|
2019-03-13 23:38:11 +01:00
|
|
|
# Localpart template of MXIDs for WhatsApp users.
|
|
|
|
# {{.}} is replaced with the phone number of the WhatsApp user.
|
|
|
|
username_template: whatsapp_{{.}}
|
|
|
|
# Displayname template for WhatsApp users.
|
|
|
|
# {{.Notify}} - nickname set by the WhatsApp user
|
|
|
|
# {{.Jid}} - phone number (international format)
|
|
|
|
# The following variables are also available, but will cause problems on multi-user instances:
|
|
|
|
# {{.Name}} - display name from contact list
|
|
|
|
# {{.Short}} - short display name from contact list
|
2020-04-06 00:05:39 +02:00
|
|
|
# To use multiple if's, you need to use: {{else if .Name}}, for example:
|
|
|
|
# "{{if .Notify}}{{.Notify}}{{else if .Name}}{{.Name}}{{else}}{{.Jid}}{{end}} (WA)"
|
2019-03-13 23:38:11 +01:00
|
|
|
displayname_template: "{{if .Notify}}{{.Notify}}{{else}}{{.Jid}}{{end}} (WA)"
|
2019-08-10 14:24:53 +02:00
|
|
|
# Localpart template for per-user room grouping community IDs.
|
2020-01-21 14:19:49 +01:00
|
|
|
# On startup, the bridge will try to create these communities, add all of the specific user's
|
|
|
|
# portals to the community, and invite the Matrix user to it.
|
|
|
|
# (Note that, by default, non-admins might not have your homeserver's permission to create
|
|
|
|
# communities.)
|
2019-08-10 14:24:53 +02:00
|
|
|
# {{.Localpart}} is the MXID localpart and {{.Server}} is the MXID server part of the user.
|
2021-01-16 01:47:23 +01:00
|
|
|
# whatsapp_{{.Localpart}}={{.Server}} is a good value that should work for any user.
|
|
|
|
community_template: null
|
2018-08-16 23:11:28 +02:00
|
|
|
|
2019-05-15 23:18:43 +02:00
|
|
|
# WhatsApp connection timeout in seconds.
|
|
|
|
connection_timeout: 20
|
2020-05-24 16:28:30 +02:00
|
|
|
# If WhatsApp doesn't respond within connection_timeout, should the bridge try to fetch the message
|
|
|
|
# to see if it was actually bridged? Use this if you have problems with sends timing out but actually
|
|
|
|
# succeeding.
|
|
|
|
fetch_message_on_timeout: false
|
2020-05-25 10:17:47 +02:00
|
|
|
# Whether or not the bridge should send a read receipt from the bridge bot when a message has been
|
|
|
|
# sent to WhatsApp. If fetch_message_on_timeout is enabled, a successful post-timeout fetch will
|
|
|
|
# trigger a read receipt too.
|
|
|
|
delivery_receipts: false
|
2019-07-17 23:14:04 +02:00
|
|
|
# Number of times to regenerate QR code when logging in.
|
|
|
|
# The regenerated QR code is sent as an edit and essentially multiplies the login timeout (20 seconds)
|
|
|
|
login_qr_regen_count: 2
|
2019-05-17 22:33:27 +02:00
|
|
|
# Maximum number of times to retry connecting on connection error.
|
|
|
|
max_connection_attempts: 3
|
2019-05-28 13:09:49 +02:00
|
|
|
# Number of seconds to wait between connection attempts.
|
|
|
|
# Negative numbers are exponential backoff: -connection_retry_delay + 1 + 2^attempts
|
|
|
|
connection_retry_delay: -1
|
2019-05-17 22:33:27 +02:00
|
|
|
# Whether or not the bridge should send a notice to the user's management room when it retries connecting.
|
|
|
|
# If false, it will only report when it stops retrying.
|
|
|
|
report_connection_retry: true
|
2021-02-05 18:26:26 +01:00
|
|
|
# Whether or not the bridge should reconnect even if WhatsApp says another web client connected.
|
|
|
|
aggressive_reconnect: false
|
2019-08-24 23:25:29 +02:00
|
|
|
# Maximum number of seconds to wait for chats to be sent at startup.
|
|
|
|
# If this is too low and you have lots of chats, it could cause backfilling to fail.
|
2019-08-30 19:57:08 +02:00
|
|
|
chat_list_wait: 30
|
|
|
|
# Maximum number of seconds to wait to sync portals before force unlocking message processing.
|
|
|
|
# If this is too low and you have lots of chats, it could cause backfilling to fail.
|
|
|
|
portal_sync_wait: 600
|
2020-07-23 19:10:21 +02:00
|
|
|
user_message_buffer: 1024
|
|
|
|
portal_message_buffer: 128
|
2019-05-15 23:18:43 +02:00
|
|
|
|
2019-08-24 21:42:03 +02:00
|
|
|
# Whether or not to send call start/end notices to Matrix.
|
|
|
|
call_notices:
|
|
|
|
start: true
|
|
|
|
end: true
|
|
|
|
|
2019-05-22 15:46:18 +02:00
|
|
|
# Number of chats to sync for new users.
|
|
|
|
initial_chat_sync_count: 10
|
|
|
|
# Number of old messages to fill when creating new portal rooms.
|
|
|
|
initial_history_fill_count: 20
|
2020-06-08 19:51:24 +02:00
|
|
|
# Whether or not notifications should be turned off while filling initial history.
|
|
|
|
# Only applicable when using double puppeting.
|
|
|
|
initial_history_disable_notifications: false
|
2019-05-22 15:46:18 +02:00
|
|
|
# Maximum number of chats to sync when recovering from downtime.
|
|
|
|
# Set to -1 to sync all new chats during downtime.
|
|
|
|
recovery_chat_sync_limit: -1
|
|
|
|
# Whether or not to sync history when recovering from downtime.
|
|
|
|
recovery_history_backfill: true
|
2021-02-09 22:41:14 +01:00
|
|
|
# Whether or not portal info should be fetched from the server when syncing,
|
|
|
|
# instead of relying on finding any changes in the message history.
|
|
|
|
# If you get 599 errors often, you should try disabling this.
|
|
|
|
chat_meta_sync: true
|
|
|
|
# Whether or not puppet avatars should be fetched from the server even if an avatar is already set.
|
|
|
|
# If you get 599 errors often, you should try disabling this.
|
|
|
|
user_avatar_sync: true
|
2021-02-10 21:15:23 +01:00
|
|
|
# Whether or not Matrix users leaving groups should be bridged to WhatsApp
|
|
|
|
bridge_matrix_leave: true
|
2019-05-23 19:25:46 +02:00
|
|
|
# Maximum number of seconds since last message in chat to skip
|
|
|
|
# syncing the chat in any case. This setting will take priority
|
|
|
|
# over both recovery_chat_sync_limit and initial_chat_sync_count.
|
|
|
|
# Default is 3 days = 259200 seconds
|
|
|
|
sync_max_chat_age: 259200
|
2019-05-22 15:46:18 +02:00
|
|
|
|
2019-05-24 01:33:26 +02:00
|
|
|
# Whether or not to sync with custom puppets to receive EDUs that
|
|
|
|
# are not normally sent to appservices.
|
|
|
|
sync_with_custom_puppets: true
|
2020-08-22 12:07:55 +02:00
|
|
|
# Whether or not to update the m.direct account data event when double puppeting is enabled.
|
|
|
|
# Note that updating the m.direct event is not atomic (except with mautrix-asmux)
|
|
|
|
# and is therefore prone to race conditions.
|
|
|
|
sync_direct_chat_list: false
|
2020-07-10 15:26:55 +02:00
|
|
|
# When double puppeting is enabled, users can use `!wa toggle` to change whether or not
|
|
|
|
# presence and read receipts are bridged. These settings set the default values.
|
|
|
|
# Existing users won't be affected when these are changed.
|
|
|
|
default_bridge_receipts: true
|
|
|
|
default_bridge_presence: true
|
2019-12-30 19:21:04 +01:00
|
|
|
# Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
|
|
|
|
#
|
|
|
|
# If set, custom puppets will be enabled automatically for local users
|
|
|
|
# instead of users having to find an access token and run `login-matrix`
|
|
|
|
# manually.
|
|
|
|
login_shared_secret: null
|
2019-05-24 01:33:26 +02:00
|
|
|
|
2019-06-01 19:03:29 +02:00
|
|
|
# Whether or not to invite own WhatsApp user's Matrix puppet into private
|
|
|
|
# chat portals when backfilling if needed.
|
|
|
|
# This always uses the default puppet instead of custom puppets due to
|
|
|
|
# rate limits and timestamp massaging.
|
|
|
|
invite_own_puppet_for_backfilling: true
|
|
|
|
# Whether or not to explicitly set the avatar and room name for private
|
|
|
|
# chat portal rooms. This can be useful if the previous field works fine,
|
|
|
|
# but causes room avatar/name bugs.
|
|
|
|
private_chat_portal_meta: false
|
2021-02-26 15:10:57 +01:00
|
|
|
# Whether or not Matrix m.notice-type messages should be bridged.
|
|
|
|
bridge_notices: true
|
2020-06-15 19:28:04 +02:00
|
|
|
# Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
|
|
|
|
# This field will automatically be changed back to false after it,
|
|
|
|
# except if the config file is not writable.
|
|
|
|
resend_bridge_info: false
|
2021-04-19 21:14:32 +02:00
|
|
|
# When using double puppeting, should muted chats be muted in Matrix?
|
|
|
|
mute_bridging: false
|
|
|
|
# When using double puppeting, should archived chats be moved to a specific tag in Matrix?
|
|
|
|
# Note that WhatsApp unarchives chats when a message is received, which will also be mirrored to Matrix.
|
|
|
|
# This can be set to a tag (e.g. m.lowpriority), or null to disable.
|
|
|
|
archive_tag: null
|
2021-04-20 15:32:23 +02:00
|
|
|
# Same as above, but for pinned chats. The favorite tag is called m.favourite
|
|
|
|
pinned_tag: null
|
2021-04-29 10:57:05 +02:00
|
|
|
# Whether or not mute status and tags should only be bridged when the portal room is created.
|
|
|
|
tag_only_on_create: true
|
2019-06-01 19:03:29 +02:00
|
|
|
|
2020-06-10 14:26:14 +02:00
|
|
|
# Whether or not thumbnails from WhatsApp should be sent.
|
|
|
|
# They're disabled by default due to very low resolution.
|
|
|
|
whatsapp_thumbnail: false
|
|
|
|
|
2019-08-10 14:24:53 +02:00
|
|
|
# Allow invite permission for user. User can invite any bots to room with whatsapp
|
2019-07-16 11:16:17 +02:00
|
|
|
# users (private chat and groups)
|
|
|
|
allow_user_invite: false
|
|
|
|
|
2019-03-13 23:38:11 +01:00
|
|
|
# The prefix for commands. Only required in non-management rooms.
|
|
|
|
command_prefix: "!wa"
|
2018-08-16 23:11:28 +02:00
|
|
|
|
2020-05-09 01:03:59 +02:00
|
|
|
# End-to-bridge encryption support options. This requires login_shared_secret to be configured
|
|
|
|
# in order to get a device for the bridge bot.
|
|
|
|
#
|
|
|
|
# Additionally, https://github.com/matrix-org/synapse/pull/5758 is required if using a normal
|
|
|
|
# application service.
|
|
|
|
encryption:
|
|
|
|
# Allow encryption, work in group chat rooms with e2ee enabled
|
|
|
|
allow: false
|
|
|
|
# Default to encryption, force-enable encryption in all portals the bridge creates
|
|
|
|
# This will cause the bridge bot to be in private chats for the encryption to work properly.
|
2020-05-12 21:25:55 +02:00
|
|
|
# It is recommended to also set private_chat_portal_meta to true when using this.
|
2020-05-09 01:03:59 +02:00
|
|
|
default: false
|
2020-08-05 13:58:46 +02:00
|
|
|
# Options for automatic key sharing.
|
|
|
|
key_sharing:
|
|
|
|
# Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
|
|
|
|
# You must use a client that supports requesting keys from other users to use this feature.
|
|
|
|
allow: false
|
|
|
|
# Require the requesting device to have a valid cross-signing signature?
|
|
|
|
# This doesn't require that the bridge has verified the device, only that the user has verified it.
|
|
|
|
# Not yet implemented.
|
|
|
|
require_cross_signing: false
|
|
|
|
# Require devices to be verified by the bridge?
|
|
|
|
# Verification by the bridge is not yet implemented.
|
|
|
|
require_verification: true
|
2020-05-09 01:03:59 +02:00
|
|
|
|
2019-03-13 23:38:11 +01:00
|
|
|
# Permissions for using the bridge.
|
|
|
|
# Permitted values:
|
2019-11-10 20:22:11 +01:00
|
|
|
# relaybot - Talk through the relaybot (if enabled), no access otherwise
|
2019-03-13 23:38:11 +01:00
|
|
|
# user - Access to use the bridge to chat with a WhatsApp account.
|
|
|
|
# admin - User level and some additional administration tools
|
|
|
|
# Permitted keys:
|
|
|
|
# * - All Matrix users
|
|
|
|
# domain - All users on that homeserver
|
|
|
|
# mxid - Specific user
|
|
|
|
permissions:
|
2019-11-10 20:22:11 +01:00
|
|
|
"*": relaybot
|
2019-03-13 23:38:11 +01:00
|
|
|
"example.com": user
|
|
|
|
"@admin:example.com": admin
|
2018-08-13 00:00:23 +02:00
|
|
|
|
2019-11-10 20:22:11 +01:00
|
|
|
relaybot:
|
|
|
|
# Whether or not relaybot support is enabled.
|
|
|
|
enabled: false
|
|
|
|
# The management room for the bot. This is where all status notifications are posted and
|
|
|
|
# in this room, you can use `!wa <command>` instead of `!wa relaybot <command>`. Omitting
|
|
|
|
# the command prefix completely like in user management rooms is not possible.
|
2020-10-19 15:06:12 +02:00
|
|
|
management: "!foo:example.com"
|
2019-11-10 20:22:11 +01:00
|
|
|
# List of users to invite to all created rooms that include the relaybot.
|
|
|
|
invites: []
|
|
|
|
# The formats to use when sending messages to WhatsApp via the relaybot.
|
|
|
|
message_formats:
|
|
|
|
m.text: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}"
|
|
|
|
m.notice: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}"
|
|
|
|
m.emote: "* <b>{{ .Sender.Displayname }}</b> {{ .Message }}"
|
|
|
|
m.file: "<b>{{ .Sender.Displayname }}</b> sent a file"
|
|
|
|
m.image: "<b>{{ .Sender.Displayname }}</b> sent an image"
|
|
|
|
m.audio: "<b>{{ .Sender.Displayname }}</b> sent an audio file"
|
|
|
|
m.video: "<b>{{ .Sender.Displayname }}</b> sent a video"
|
|
|
|
m.location: "<b>{{ .Sender.Displayname }}</b> sent a location"
|
|
|
|
|
2018-08-13 00:00:23 +02:00
|
|
|
# Logging config.
|
|
|
|
logging:
|
2019-03-13 23:38:11 +01:00
|
|
|
# The directory for log files. Will be created if not found.
|
|
|
|
directory: ./logs
|
|
|
|
# Available variables: .Date for the file date and .Index for different log files on the same day.
|
|
|
|
file_name_format: "{{.Date}}-{{.Index}}.log"
|
|
|
|
# Date format for file names in the Go time format: https://golang.org/pkg/time/#pkg-constants
|
|
|
|
file_date_format: 2006-01-02
|
|
|
|
# Log file permissions.
|
|
|
|
file_mode: 0600
|
|
|
|
# Timestamp format for log entries in the Go time format.
|
|
|
|
timestamp_format: Jan _2, 2006 15:04:05
|
|
|
|
# Minimum severity for log messages.
|
|
|
|
# Options: debug, info, warn, error, fatal
|
|
|
|
print_level: debug
|