Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

121 lines
6.4 KiB

  1. # mautrix-whatsapp is a Matrix <-> Whatsapp bridge
  2. # See: https://github.com/mautrix/whatsapp
  3. matrix_mautrix_whatsapp_enabled: true
  4. matrix_mautrix_whatsapp_container_image_self_build: false
  5. matrix_mautrix_whatsapp_container_image_self_build_repo: "https://mau.dev/mautrix/whatsapp.git"
  6. matrix_mautrix_whatsapp_container_image_self_build_branch: "{{ 'master' if matrix_mautrix_whatsapp_version == 'latest' else matrix_mautrix_whatsapp_version }}"
  7. matrix_mautrix_whatsapp_version: latest
  8. # See: https://mau.dev/mautrix/whatsapp/container_registry
  9. matrix_mautrix_whatsapp_docker_image: "{{ matrix_mautrix_whatsapp_docker_image_name_prefix }}mautrix/whatsapp:{{ matrix_mautrix_whatsapp_version }}"
  10. matrix_mautrix_whatsapp_docker_image_name_prefix: "{{ 'localhost/' if matrix_mautrix_whatsapp_container_image_self_build else 'dock.mau.dev/' }}"
  11. matrix_mautrix_whatsapp_docker_image_force_pull: "{{ matrix_mautrix_whatsapp_docker_image.endswith(':latest') }}"
  12. matrix_mautrix_whatsapp_base_path: "{{ matrix_base_data_path }}/mautrix-whatsapp"
  13. matrix_mautrix_whatsapp_config_path: "{{ matrix_mautrix_whatsapp_base_path }}/config"
  14. matrix_mautrix_whatsapp_data_path: "{{ matrix_mautrix_whatsapp_base_path }}/data"
  15. matrix_mautrix_whatsapp_docker_src_files_path: "{{ matrix_mautrix_whatsapp_base_path }}/docker-src"
  16. matrix_mautrix_whatsapp_homeserver_address: "{{ matrix_homeserver_container_url }}"
  17. matrix_mautrix_whatsapp_homeserver_domain: "{{ matrix_domain }}"
  18. matrix_mautrix_whatsapp_appservice_address: "http://matrix-mautrix-whatsapp:8080"
  19. # A list of extra arguments to pass to the container
  20. matrix_mautrix_whatsapp_container_extra_arguments: []
  21. # List of systemd services that matrix-mautrix-whatsapp.service depends on.
  22. matrix_mautrix_whatsapp_systemd_required_services_list: ['docker.service']
  23. # List of systemd services that matrix-mautrix-whatsapp.service wants
  24. matrix_mautrix_whatsapp_systemd_wanted_services_list: []
  25. matrix_mautrix_whatsapp_appservice_token: ''
  26. matrix_mautrix_whatsapp_homeserver_token: ''
  27. matrix_mautrix_whatsapp_appservice_bot_username: whatsappbot
  28. # Database-related configuration fields.
  29. #
  30. # To use SQLite, stick to these defaults.
  31. #
  32. # To use Postgres:
  33. # - change the engine (`matrix_mautrix_whatsapp_database_engine: 'postgres'`)
  34. # - adjust your database credentials via the `matrix_mautrix_whatsapp_database_*` variables
  35. matrix_mautrix_whatsapp_database_engine: 'sqlite'
  36. matrix_mautrix_whatsapp_sqlite_database_path_local: "{{ matrix_mautrix_whatsapp_data_path }}/mautrix-whatsapp.db"
  37. matrix_mautrix_whatsapp_sqlite_database_path_in_container: "/data/mautrix-whatsapp.db"
  38. matrix_mautrix_whatsapp_database_username: 'matrix_mautrix_whatsapp'
  39. matrix_mautrix_whatsapp_database_password: 'some-password'
  40. matrix_mautrix_whatsapp_database_hostname: 'matrix-postgres'
  41. matrix_mautrix_whatsapp_database_port: 5432
  42. matrix_mautrix_whatsapp_database_name: 'matrix_mautrix_whatsapp'
  43. matrix_mautrix_whatsapp_database_connection_string: 'postgresql://{{ matrix_mautrix_whatsapp_database_username }}:{{ matrix_mautrix_whatsapp_database_password }}@{{ matrix_mautrix_whatsapp_database_hostname }}:{{ matrix_mautrix_whatsapp_database_port }}/{{ matrix_mautrix_whatsapp_database_name }}?sslmode=disable'
  44. matrix_mautrix_whatsapp_appservice_database_type: "{{
  45. {
  46. 'sqlite': 'sqlite3',
  47. 'postgres':'postgres',
  48. }[matrix_mautrix_whatsapp_database_engine]
  49. }}"
  50. matrix_mautrix_whatsapp_appservice_database_uri: "{{
  51. {
  52. 'sqlite': matrix_mautrix_whatsapp_sqlite_database_path_in_container,
  53. 'postgres': matrix_mautrix_whatsapp_database_connection_string,
  54. }[matrix_mautrix_whatsapp_database_engine]
  55. }}"
  56. # Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
  57. matrix_mautrix_whatsapp_login_shared_secret: ''
  58. matrix_mautrix_whatsapp_bridge_login_shared_secret_map:
  59. "{{ {matrix_mautrix_whatsapp_homeserver_domain: matrix_mautrix_whatsapp_login_shared_secret} if matrix_mautrix_whatsapp_login_shared_secret else {} }}"
  60. # Servers to always allow double puppeting from
  61. matrix_mautrix_whatsapp_bridge_double_puppet_server_map:
  62. "{{ matrix_mautrix_whatsapp_homeserver_domain : matrix_mautrix_whatsapp_homeserver_address }}"
  63. # Default mautrix-whatsapp configuration template which covers the generic use case.
  64. # You can customize it by controlling the various variables inside it.
  65. #
  66. # For a more advanced customization, you can extend the default (see `matrix_mautrix_whatsapp_configuration_extension_yaml`)
  67. # or completely replace this variable with your own template.
  68. matrix_mautrix_whatsapp_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  69. matrix_mautrix_whatsapp_configuration_extension_yaml: |
  70. # Your custom YAML configuration goes here.
  71. # This configuration extends the default starting configuration (`matrix_mautrix_whatsapp_configuration_yaml`).
  72. #
  73. # You can override individual variables from the default configuration, or introduce new ones.
  74. #
  75. # If you need something more special, you can take full control by
  76. # completely redefining `matrix_mautrix_whatsapp_configuration_yaml`.
  77. 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 {} }}"
  78. # Holds the final configuration (a combination of the default and its extension).
  79. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_whatsapp_configuration_yaml`.
  80. matrix_mautrix_whatsapp_configuration: "{{ matrix_mautrix_whatsapp_configuration_yaml|from_yaml|combine(matrix_mautrix_whatsapp_configuration_extension, recursive=True) }}"
  81. matrix_mautrix_whatsapp_registration_yaml: |
  82. id: whatsapp
  83. url: {{ matrix_mautrix_whatsapp_appservice_address }}
  84. as_token: "{{ matrix_mautrix_whatsapp_appservice_token }}"
  85. hs_token: "{{ matrix_mautrix_whatsapp_homeserver_token }}"
  86. # See https://github.com/mautrix/signal/issues/43
  87. sender_localpart: _bot_{{ matrix_mautrix_whatsapp_appservice_bot_username }}
  88. rate_limited: false
  89. namespaces:
  90. users:
  91. - regex: '^@whatsapp_[0-9]+:{{ matrix_mautrix_whatsapp_homeserver_domain|regex_escape }}$'
  92. exclusive: true
  93. - exclusive: true
  94. regex: '^@{{ matrix_mautrix_whatsapp_appservice_bot_username|regex_escape }}:{{ matrix_mautrix_whatsapp_homeserver_domain|regex_escape }}$'
  95. de.sorunome.msc2409.push_ephemeral: true
  96. matrix_mautrix_whatsapp_registration: "{{ matrix_mautrix_whatsapp_registration_yaml|from_yaml }}"