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