example-config.yaml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # Homeserver details.
  2. homeserver:
  3. # The address that this appservice can use to connect to the homeserver.
  4. address: https://matrix.org
  5. # The domain of the homeserver (for MXIDs, etc).
  6. domain: matrix.org
  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. # The unique ID of this appservice.
  27. id: whatsapp
  28. # Appservice bot details.
  29. bot:
  30. # Username of the appservice bot.
  31. username: whatsappbot
  32. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  33. # to leave display name/avatar as-is.
  34. displayname: WhatsApp bridge bot
  35. avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr
  36. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  37. as_token: "This value is generated when generating the registration"
  38. hs_token: "This value is generated when generating the registration"
  39. # Bridge config
  40. bridge:
  41. # Localpart template of MXIDs for WhatsApp users.
  42. # {{.}} is replaced with the phone number of the WhatsApp user.
  43. username_template: whatsapp_{{.}}
  44. # Displayname template for WhatsApp users.
  45. # {{.Notify}} - nickname set by the WhatsApp user
  46. # {{.Jid}} - phone number (international format)
  47. # The following variables are also available, but will cause problems on multi-user instances:
  48. # {{.Name}} - display name from contact list
  49. # {{.Short}} - short display name from contact list
  50. displayname_template: "{{if .Notify}}{{.Notify}}{{else}}{{.Jid}}{{end}} (WA)"
  51. # Localpart template for per-user room grouping community IDs.
  52. # The bridge will create these communities and add all of the specific user's portals to the community.
  53. # {{.Localpart}} is the MXID localpart and {{.Server}} is the MXID server part of the user.
  54. community_template: whatsapp_{{.Localpart}}={{.Server}}
  55. # WhatsApp connection timeout in seconds.
  56. connection_timeout: 20
  57. # Number of times to regenerate QR code when logging in.
  58. # The regenerated QR code is sent as an edit and essentially multiplies the login timeout (20 seconds)
  59. login_qr_regen_count: 2
  60. # Maximum number of times to retry connecting on connection error.
  61. max_connection_attempts: 3
  62. # Number of seconds to wait between connection attempts.
  63. # Negative numbers are exponential backoff: -connection_retry_delay + 1 + 2^attempts
  64. connection_retry_delay: -1
  65. # Whether or not the bridge should send a notice to the user's management room when it retries connecting.
  66. # If false, it will only report when it stops retrying.
  67. report_connection_retry: true
  68. # Maximum number of seconds to wait for chats to be sent at startup.
  69. # If this is too low and you have lots of chats, it could cause backfilling to fail.
  70. chat_list_wait: 30
  71. # Maximum number of seconds to wait to sync portals before force unlocking message processing.
  72. # If this is too low and you have lots of chats, it could cause backfilling to fail.
  73. portal_sync_wait: 600
  74. # Whether or not to send call start/end notices to Matrix.
  75. call_notices:
  76. start: true
  77. end: true
  78. # Number of chats to sync for new users.
  79. initial_chat_sync_count: 10
  80. # Number of old messages to fill when creating new portal rooms.
  81. initial_history_fill_count: 20
  82. # Maximum number of chats to sync when recovering from downtime.
  83. # Set to -1 to sync all new chats during downtime.
  84. recovery_chat_sync_limit: -1
  85. # Whether or not to sync history when recovering from downtime.
  86. recovery_history_backfill: true
  87. # Maximum number of seconds since last message in chat to skip
  88. # syncing the chat in any case. This setting will take priority
  89. # over both recovery_chat_sync_limit and initial_chat_sync_count.
  90. # Default is 3 days = 259200 seconds
  91. sync_max_chat_age: 259200
  92. # Whether or not to sync with custom puppets to receive EDUs that
  93. # are not normally sent to appservices.
  94. sync_with_custom_puppets: true
  95. # Whether or not to invite own WhatsApp user's Matrix puppet into private
  96. # chat portals when backfilling if needed.
  97. # This always uses the default puppet instead of custom puppets due to
  98. # rate limits and timestamp massaging.
  99. invite_own_puppet_for_backfilling: true
  100. # Whether or not to explicitly set the avatar and room name for private
  101. # chat portal rooms. This can be useful if the previous field works fine,
  102. # but causes room avatar/name bugs.
  103. private_chat_portal_meta: false
  104. # Allow invite permission for user. User can invite any bots to room with whatsapp
  105. # users (private chat and groups)
  106. allow_user_invite: false
  107. # The prefix for commands. Only required in non-management rooms.
  108. command_prefix: "!wa"
  109. # Permissions for using the bridge.
  110. # Permitted values:
  111. # user - Access to use the bridge to chat with a WhatsApp account.
  112. # admin - User level and some additional administration tools
  113. # Permitted keys:
  114. # * - All Matrix users
  115. # domain - All users on that homeserver
  116. # mxid - Specific user
  117. permissions:
  118. "example.com": user
  119. "@admin:example.com": admin
  120. # Logging config.
  121. logging:
  122. # The directory for log files. Will be created if not found.
  123. directory: ./logs
  124. # Available variables: .Date for the file date and .Index for different log files on the same day.
  125. file_name_format: "{{.Date}}-{{.Index}}.log"
  126. # Date format for file names in the Go time format: https://golang.org/pkg/time/#pkg-constants
  127. file_date_format: 2006-01-02
  128. # Log file permissions.
  129. file_mode: 0600
  130. # Timestamp format for log entries in the Go time format.
  131. timestamp_format: Jan _2, 2006 15:04:05
  132. # Minimum severity for log messages.
  133. # Options: debug, info, warn, error, fatal
  134. print_level: debug