example-config.yaml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. # Application service host/registration related details.
  8. # Changing these values requires regeneration of the registration.
  9. appservice:
  10. # The address that the homeserver can use to connect to this appservice.
  11. address: http://localhost:29318
  12. # The hostname and port where this appservice should listen.
  13. hostname: 0.0.0.0
  14. port: 29318
  15. # Database config.
  16. database:
  17. # The database type. "sqlite3" and "postgres" are supported.
  18. type: sqlite3
  19. # The database URI.
  20. # SQLite: File name is enough. https://github.com/mattn/go-sqlite3#connection-string
  21. # Postgres: Connection string. For example, postgres://user:password@host/database
  22. uri: mautrix-whatsapp.db
  23. # Maximum number of connections. Mostly relevant for Postgres.
  24. max_open_conns: 20
  25. max_idle_conns: 2
  26. # Settings for provisioning API
  27. provisioning:
  28. # Prefix for the provisioning API paths.
  29. prefix: /_matrix/provision/v1
  30. # Shared secret for authentication. If set to "disable", the provisioning API will be disabled.
  31. shared_secret: disable
  32. # The unique ID of this appservice.
  33. id: whatsapp
  34. # Appservice bot details.
  35. bot:
  36. # Username of the appservice bot.
  37. username: whatsappbot
  38. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  39. # to leave display name/avatar as-is.
  40. displayname: WhatsApp bridge bot
  41. avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr
  42. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  43. as_token: "This value is generated when generating the registration"
  44. hs_token: "This value is generated when generating the registration"
  45. # Bridge config
  46. bridge:
  47. # Localpart template of MXIDs for WhatsApp users.
  48. # {{.}} is replaced with the phone number of the WhatsApp user.
  49. username_template: whatsapp_{{.}}
  50. # Displayname template for WhatsApp users.
  51. # {{.Notify}} - nickname set by the WhatsApp user
  52. # {{.Jid}} - phone number (international format)
  53. # The following variables are also available, but will cause problems on multi-user instances:
  54. # {{.Name}} - display name from contact list
  55. # {{.Short}} - short display name from contact list
  56. displayname_template: "{{if .Notify}}{{.Notify}}{{else}}{{.Jid}}{{end}} (WA)"
  57. # Localpart template for per-user room grouping community IDs.
  58. # On startup, the bridge will try to create these communities, add all of the specific user's
  59. # portals to the community, and invite the Matrix user to it.
  60. # (Note that, by default, non-admins might not have your homeserver's permission to create
  61. # communities.)
  62. # {{.Localpart}} is the MXID localpart and {{.Server}} is the MXID server part of the user.
  63. community_template: whatsapp_{{.Localpart}}={{.Server}}
  64. # WhatsApp connection timeout in seconds.
  65. connection_timeout: 20
  66. # Number of times to regenerate QR code when logging in.
  67. # The regenerated QR code is sent as an edit and essentially multiplies the login timeout (20 seconds)
  68. login_qr_regen_count: 2
  69. # Maximum number of times to retry connecting on connection error.
  70. max_connection_attempts: 3
  71. # Number of seconds to wait between connection attempts.
  72. # Negative numbers are exponential backoff: -connection_retry_delay + 1 + 2^attempts
  73. connection_retry_delay: -1
  74. # Whether or not the bridge should send a notice to the user's management room when it retries connecting.
  75. # If false, it will only report when it stops retrying.
  76. report_connection_retry: true
  77. # Maximum number of seconds to wait for chats to be sent at startup.
  78. # If this is too low and you have lots of chats, it could cause backfilling to fail.
  79. chat_list_wait: 30
  80. # Maximum number of seconds to wait to sync portals before force unlocking message processing.
  81. # If this is too low and you have lots of chats, it could cause backfilling to fail.
  82. portal_sync_wait: 600
  83. # Whether or not to send call start/end notices to Matrix.
  84. call_notices:
  85. start: true
  86. end: true
  87. # Number of chats to sync for new users.
  88. initial_chat_sync_count: 10
  89. # Number of old messages to fill when creating new portal rooms.
  90. initial_history_fill_count: 20
  91. # Maximum number of chats to sync when recovering from downtime.
  92. # Set to -1 to sync all new chats during downtime.
  93. recovery_chat_sync_limit: -1
  94. # Whether or not to sync history when recovering from downtime.
  95. recovery_history_backfill: true
  96. # Maximum number of seconds since last message in chat to skip
  97. # syncing the chat in any case. This setting will take priority
  98. # over both recovery_chat_sync_limit and initial_chat_sync_count.
  99. # Default is 3 days = 259200 seconds
  100. sync_max_chat_age: 259200
  101. # Whether or not to sync with custom puppets to receive EDUs that
  102. # are not normally sent to appservices.
  103. sync_with_custom_puppets: true
  104. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  105. #
  106. # If set, custom puppets will be enabled automatically for local users
  107. # instead of users having to find an access token and run `login-matrix`
  108. # manually.
  109. login_shared_secret: null
  110. # Whether or not to invite own WhatsApp user's Matrix puppet into private
  111. # chat portals when backfilling if needed.
  112. # This always uses the default puppet instead of custom puppets due to
  113. # rate limits and timestamp massaging.
  114. invite_own_puppet_for_backfilling: true
  115. # Whether or not to explicitly set the avatar and room name for private
  116. # chat portal rooms. This can be useful if the previous field works fine,
  117. # but causes room avatar/name bugs.
  118. private_chat_portal_meta: false
  119. # Allow invite permission for user. User can invite any bots to room with whatsapp
  120. # users (private chat and groups)
  121. allow_user_invite: false
  122. # The prefix for commands. Only required in non-management rooms.
  123. command_prefix: "!wa"
  124. # Permissions for using the bridge.
  125. # Permitted values:
  126. # relaybot - Talk through the relaybot (if enabled), no access otherwise
  127. # user - Access to use the bridge to chat with a WhatsApp account.
  128. # admin - User level and some additional administration tools
  129. # Permitted keys:
  130. # * - All Matrix users
  131. # domain - All users on that homeserver
  132. # mxid - Specific user
  133. permissions:
  134. "*": relaybot
  135. "example.com": user
  136. "@admin:example.com": admin
  137. relaybot:
  138. # Whether or not relaybot support is enabled.
  139. enabled: false
  140. # The management room for the bot. This is where all status notifications are posted and
  141. # in this room, you can use `!wa <command>` instead of `!wa relaybot <command>`. Omitting
  142. # the command prefix completely like in user management rooms is not possible.
  143. management: !foo:example.com
  144. # List of users to invite to all created rooms that include the relaybot.
  145. invites: []
  146. # The formats to use when sending messages to WhatsApp via the relaybot.
  147. message_formats:
  148. m.text: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}"
  149. m.notice: "<b>{{ .Sender.Displayname }}</b>: {{ .Message }}"
  150. m.emote: "* <b>{{ .Sender.Displayname }}</b> {{ .Message }}"
  151. m.file: "<b>{{ .Sender.Displayname }}</b> sent a file"
  152. m.image: "<b>{{ .Sender.Displayname }}</b> sent an image"
  153. m.audio: "<b>{{ .Sender.Displayname }}</b> sent an audio file"
  154. m.video: "<b>{{ .Sender.Displayname }}</b> sent a video"
  155. m.location: "<b>{{ .Sender.Displayname }}</b> sent a location"
  156. # Logging config.
  157. logging:
  158. # The directory for log files. Will be created if not found.
  159. directory: ./logs
  160. # Available variables: .Date for the file date and .Index for different log files on the same day.
  161. file_name_format: "{{.Date}}-{{.Index}}.log"
  162. # Date format for file names in the Go time format: https://golang.org/pkg/time/#pkg-constants
  163. file_date_format: 2006-01-02
  164. # Log file permissions.
  165. file_mode: 0600
  166. # Timestamp format for log entries in the Go time format.
  167. timestamp_format: Jan _2, 2006 15:04:05
  168. # Minimum severity for log messages.
  169. # Options: debug, info, warn, error, fatal
  170. print_level: debug