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.
|
|
|
|
address: https://matrix.org
|
|
|
|
# The domain of the homeserver (for MXIDs, etc).
|
|
|
|
domain: matrix.org
|
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.
|
|
|
|
address: http://localhost:8080
|
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
|
|
|
|
port: 8080
|
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
|
|
|
|
# Postgres: Connection string. For example, postgres://user:password@host/database
|
|
|
|
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
|
|
|
|
|
2019-03-13 23:38:11 +01:00
|
|
|
# Path to the Matrix room state store.
|
|
|
|
state_store_path: ./mx-state.json
|
2018-08-16 23:11:28 +02:00
|
|
|
|
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
|
|
|
|
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
|
|
|
|
displayname_template: "{{if .Notify}}{{.Notify}}{{else}}{{.Jid}}{{end}} (WA)"
|
2018-08-16 23:11:28 +02:00
|
|
|
|
2019-05-15 23:18:43 +02:00
|
|
|
# WhatsApp connection timeout in seconds.
|
|
|
|
connection_timeout: 20
|
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
|
2019-05-30 19:25:04 +02:00
|
|
|
# Number of seconds to wait for contacts and chats to be sent at startup before syncing.
|
|
|
|
# If you have lots of chats, it might take more than a second.
|
|
|
|
contact_wait_delay: 1
|
2019-05-15 23:18:43 +02:00
|
|
|
|
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
|
|
|
|
# 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
|
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
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
2019-03-13 23:38:11 +01:00
|
|
|
# Permissions for using the bridge.
|
|
|
|
# Permitted values:
|
|
|
|
# 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:
|
|
|
|
"example.com": user
|
|
|
|
"@admin:example.com": admin
|
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
|