Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

236 řádky
12 KiB

  1. # mautrix-whatsapp is a Matrix <-> Whatsapp bridge
  2. # See: https://github.com/tulir/mautrix-whatsapp
  3. matrix_mautrix_whatsapp_enabled: true
  4. # See: https://mau.dev/tulir/mautrix-whatsapp/container_registry
  5. matrix_mautrix_whatsapp_docker_image: "dock.mau.dev/tulir/mautrix-whatsapp:latest"
  6. matrix_mautrix_whatsapp_docker_image_force_pull: "{{ matrix_mautrix_whatsapp_docker_image.endswith(':latest') }}"
  7. matrix_mautrix_whatsapp_base_path: "{{ matrix_base_data_path }}/mautrix-whatsapp"
  8. matrix_mautrix_whatsapp_config_path: "{{ matrix_mautrix_whatsapp_base_path }}/config"
  9. matrix_mautrix_whatsapp_data_path: "{{ matrix_mautrix_whatsapp_base_path }}/data"
  10. matrix_mautrix_whatsapp_homeserver_address: "http://matrix-synapse:8008"
  11. matrix_mautrix_whatsapp_homeserver_domain: "{{ matrix_domain }}"
  12. matrix_mautrix_whatsapp_appservice_address: "http://matrix-mautrix-whatsapp:8080"
  13. # A list of extra arguments to pass to the container
  14. matrix_mautrix_whatsapp_container_extra_arguments: []
  15. # List of systemd services that matrix-mautrix-whatsapp.service depends on.
  16. matrix_mautrix_whatsapp_systemd_required_services_list: ['docker.service']
  17. # List of systemd services that matrix-mautrix-whatsapp.service wants
  18. matrix_mautrix_whatsapp_systemd_wanted_services_list: []
  19. matrix_mautrix_whatsapp_appservice_token: ''
  20. matrix_mautrix_whatsapp_homeserver_token: ''
  21. # Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
  22. matrix_mautrix_whatsapp_login_shared_secret: ''
  23. # Default mautrix-whatsapp configuration template which covers the generic use case.
  24. # You can customize it by controlling the various variables inside it.
  25. #
  26. # For a more advanced customization, you can extend the default (see `matrix_mautrix_whatsapp_configuration_extension_yaml`)
  27. # or completely replace this variable with your own template.
  28. matrix_mautrix_whatsapp_configuration_yaml: |
  29. # Homeserver details.
  30. homeserver:
  31. # The address that this appservice can use to connect to the homeserver.
  32. address: {{ matrix_mautrix_whatsapp_homeserver_address }}
  33. # The domain of the homeserver (for MXIDs, etc).
  34. domain: {{ matrix_mautrix_whatsapp_homeserver_domain }}
  35. # Application service host/registration related details.
  36. # Changing these values requires regeneration of the registration.
  37. appservice:
  38. # The address that the homeserver can use to connect to this appservice.
  39. address: {{ matrix_mautrix_whatsapp_appservice_address }}
  40. # The hostname and port where this appservice should listen.
  41. hostname: 0.0.0.0
  42. port: 8080
  43. # Database config.
  44. database:
  45. # The database type. "sqlite3" and "postgres" are supported.
  46. type: sqlite3
  47. # The database URI.
  48. # SQLite: File name is enough. https://github.com/mattn/go-sqlite3#connection-string
  49. # Postgres: Connection string. For example, postgres://user:password@host/database
  50. uri: mautrix-whatsapp.db
  51. # Maximum number of connections. Mostly relevant for Postgres.
  52. max_open_conns: 20
  53. max_idle_conns: 2
  54. # Path to the Matrix room state store.
  55. state_store_path: ./mx-state.json
  56. # The unique ID of this appservice.
  57. id: whatsapp
  58. # Appservice bot details.
  59. bot:
  60. # Username of the appservice bot.
  61. username: whatsappbot
  62. # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
  63. # to leave display name/avatar as-is.
  64. displayname: WhatsApp bridge bot
  65. avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr
  66. # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
  67. as_token: "{{ matrix_mautrix_whatsapp_appservice_token }}"
  68. hs_token: "{{ matrix_mautrix_whatsapp_homeserver_token }}"
  69. # Bridge config
  70. bridge:
  71. # Localpart template of MXIDs for WhatsApp users.
  72. # {{ '{{.}}' }} is replaced with the phone number of the WhatsApp user.
  73. username_template: "{{ 'whatsapp_{{.}}' }}"
  74. # Displayname template for WhatsApp users.
  75. # {{ '{{.Notify'}}' }} - nickname set by the WhatsApp user
  76. # {{ '{{.Jid}}' }} - phone number (international format)
  77. # The following variables are also available, but will cause problems on multi-user instances:
  78. # {{ '{{.Name}}' }} - display name from contact list
  79. # {{ '{{.Short}}' }} - short display name from contact list
  80. displayname_template: "{{ '{{if .Notify}}{{.Notify}}{{else}}{{.Jid}}{{end}} (WA)' }}"
  81. # WhatsApp connection timeout in seconds.
  82. connection_timeout: 20
  83. # Maximum number of times to retry connecting on connection error.
  84. max_connection_attempts: 3
  85. # Number of seconds to wait between connection attempts.
  86. # Negative numbers are exponential backoff: -connection_retry_delay + 1 + 2^attempts
  87. connection_retry_delay: -1
  88. # Whether or not the bridge should send a notice to the user's management room when it retries connecting.
  89. # If false, it will only report when it stops retrying.
  90. report_connection_retry: true
  91. # Maximum number of seconds to wait for chats to be sent at startup.
  92. # If this is too low and you have lots of chats, it could cause backfilling to fail.
  93. chat_list_wait: 30
  94. # Maximum number of seconds to wait to sync portals before force unlocking message processing.
  95. # If this is too low and you have lots of chats, it could cause backfilling to fail.
  96. portal_sync_wait: 600
  97. # Whether or not to send call start/end notices to Matrix.
  98. call_notices:
  99. start: true
  100. end: true
  101. # Number of chats to sync for new users.
  102. initial_chat_sync_count: 10
  103. # Number of old messages to fill when creating new portal rooms.
  104. initial_history_fill_count: 20
  105. # Maximum number of chats to sync when recovering from downtime.
  106. # Set to -1 to sync all new chats during downtime.
  107. recovery_chat_sync_limit: -1
  108. # Whether or not to sync history when recovering from downtime.
  109. recovery_history_backfill: true
  110. # Maximum number of seconds since last message in chat to skip
  111. # syncing the chat in any case. This setting will take priority
  112. # over both recovery_chat_sync_limit and initial_chat_sync_count.
  113. # Default is 3 days = 259200 seconds
  114. sync_max_chat_age: 259200
  115. # Whether or not to sync with custom puppets to receive EDUs that
  116. # are not normally sent to appservices.
  117. sync_with_custom_puppets: true
  118. # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
  119. #
  120. # If set, custom puppets will be enabled automatically for local users
  121. # instead of users having to find an access token and run `login-matrix`
  122. # manually.
  123. login_shared_secret: {{ matrix_mautrix_whatsapp_login_shared_secret|to_json }}
  124. # Whether or not to invite own WhatsApp user's Matrix puppet into private
  125. # chat portals when backfilling if needed.
  126. # This always uses the default puppet instead of custom puppets due to
  127. # rate limits and timestamp massaging.
  128. invite_own_puppet_for_backfilling: true
  129. # Whether or not to explicitly set the avatar and room name for private
  130. # chat portal rooms. This can be useful if the previous field works fine,
  131. # but causes room avatar/name bugs.
  132. private_chat_portal_meta: false
  133. # Allow invite permission for user. User can invite any bots to room with whatsapp
  134. # users (private chat and groups)
  135. allow_user_invite: false
  136. # The prefix for commands. Only required in non-management rooms.
  137. command_prefix: "!wa"
  138. # Permissions for using the bridge.
  139. # Permitted values:
  140. # user - Access to use the bridge to chat with a WhatsApp account.
  141. # admin - User level and some additional administration tools
  142. # Permitted keys:
  143. # * - All Matrix users
  144. # domain - All users on that homeserver
  145. # mxid - Specific user
  146. permissions:
  147. "{{ matrix_mautrix_whatsapp_homeserver_domain }}": user
  148. relaybot:
  149. # Whether or not relaybot support is enabled.
  150. enabled: false
  151. # The management room for the bot. This is where all status notifications are posted and
  152. # in this room, you can use `!wa <command>` instead of `!wa relaybot <command>`. Omitting
  153. # the command prefix completely like in user management rooms is not possible.
  154. management: '!foo:example.com'
  155. # List of users to invite to all created rooms that include the relaybot.
  156. invites: []
  157. # The formats to use when sending messages to WhatsApp via the relaybot.
  158. message_formats:
  159. m.text: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: {{ '{{ .Message }}' }}"
  160. m.notice: "<b>{{ '{{ .Sender.Displayname }}' }}</b>:: {{ '{{ .Message }}' }}"
  161. m.emote: "* <b>{{ '{{ .Sender.Displayname }}' }}</b>: {{ '{{ .Message }}' }}"
  162. m.file: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent a file"
  163. m.image: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent an image"
  164. m.audio: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent an audio file"
  165. m.video: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent a video"
  166. m.location: "<b>{{ '{{ .Sender.Displayname }}' }}</b>: sent a location"
  167. # Logging config.
  168. logging:
  169. # The directory for log files. Will be created if not found.
  170. directory: ./logs
  171. # Available variables: .Date for the file date and .Index for different log files on the same day.
  172. file_name_format: "{{ '{{.Date}}-{{.Index}}.log' }}"
  173. # Date format for file names in the Go time format: https://golang.org/pkg/time/#pkg-constants
  174. file_date_format: "2006-01-02"
  175. # Log file permissions.
  176. file_mode: 0600
  177. # Timestamp format for log entries in the Go time format.
  178. timestamp_format: "Jan _2, 2006 15:04:05"
  179. # Minimum severity for log messages.
  180. # Options: debug, info, warn, error, fatal
  181. print_level: debug
  182. matrix_mautrix_whatsapp_configuration_extension_yaml: |
  183. # Your custom YAML configuration goes here.
  184. # This configuration extends the default starting configuration (`matrix_mautrix_whatsapp_configuration_yaml`).
  185. #
  186. # You can override individual variables from the default configuration, or introduce new ones.
  187. #
  188. # If you need something more special, you can take full control by
  189. # completely redefining `matrix_mautrix_whatsapp_configuration_yaml`.
  190. matrix_mautrix_whatsapp_configuration_extension: "{{ matrix_mautrix_whatsapp_configuration_extension_yaml|from_yaml if matrix_mautrix_whatsapp_configuration_extension_yaml|from_yaml is mapping else {} }}"
  191. # Holds the final configuration (a combination of the default and its extension).
  192. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_whatsapp_configuration_yaml`.
  193. matrix_mautrix_whatsapp_configuration: "{{ matrix_mautrix_whatsapp_configuration_yaml|from_yaml|combine(matrix_mautrix_whatsapp_configuration_extension, recursive=True) }}"
  194. matrix_mautrix_whatsapp_registration_yaml: |
  195. id: whatsapp
  196. url: {{ matrix_mautrix_whatsapp_appservice_address }}
  197. as_token: "{{ matrix_mautrix_whatsapp_appservice_token }}"
  198. hs_token: "{{ matrix_mautrix_whatsapp_homeserver_token }}"
  199. sender_localpart: whatsappbot
  200. rate_limited: false
  201. namespaces:
  202. users:
  203. - regex: '^@whatsapp_[0-9]+:{{ matrix_mautrix_whatsapp_homeserver_domain|regex_escape }}$'
  204. exclusive: true
  205. matrix_mautrix_whatsapp_registration: "{{ matrix_mautrix_whatsapp_registration_yaml|from_yaml }}"