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.
 
 

215 lines
13 KiB

  1. ---
  2. # matrix-appservice-kakaotalk is a Matrix <-> Kakaotalk bridge
  3. # Project source code URL: https://src.miscworks.net/fair/matrix-appservice-kakaotalk/
  4. matrix_appservice_kakaotalk_enabled: true
  5. # No images are published for neither of the container images (appservice or node), so we're self-building everything.
  6. matrix_appservice_kakaotalk_container_image_self_build: true
  7. # matrix_appservice_kakaotalk_container_image_self_build_repo: "https://src.miscworks.net/fair/matrix-appservice-kakaotalk.git"
  8. #
  9. # hnarjis' fork is used instead of upstream (fair's), because upstream is currently broken.
  10. # The following error happens when chatting up the bot without this fix:
  11. # [2022-07-25 09:04:53,784] [ERROR@mau.as] Exception in Matrix event handler
  12. # Traceback (most recent call last):
  13. # File "/usr/lib/python3.9/site-packages/mautrix/appservice/as_handler.py", line 239, in try_handle
  14. # await handler_func(event)
  15. # File "/usr/lib/python3.9/site-packages/mautrix/bridge/matrix.py", line 820, in int_handle_event
  16. # await self.int_handle_invite(evt)
  17. # File "/usr/lib/python3.9/site-packages/mautrix/bridge/matrix.py", line 441, in int_handle_invite
  18. # inviter = await self.bridge.get_user(evt.sender)
  19. # File "/usr/lib/python3.9/site-packages/matrix_appservice_kakaotalk/__main__.py", line 112, in get_user
  20. # return await User.get_by_mxid(user_id, create=create)
  21. # File "/usr/lib/python3.9/site-packages/mautrix/util/async_getter_lock.py", line 60, in wrapper
  22. # return await fn(cls, *args, **kwargs)
  23. # File "/usr/lib/python3.9/site-packages/matrix_appservice_kakaotalk/user.py", line 227, in get_by_mxid
  24. # user = cls(mxid)
  25. # TypeError: __init__() missing 2 required positional arguments: 'force_login' and 'was_connected'
  26. matrix_appservice_kakaotalk_container_image_self_build_repo: "https://src.miscworks.net/hnarjis/matrix-appservice-kakaotalk.git"
  27. matrix_appservice_kakaotalk_container_image_self_build_repo_version: "{{ 'master' if matrix_appservice_kakaotalk_version == 'latest' else matrix_appservice_kakaotalk_version }}"
  28. matrix_appservice_kakaotalk_node_version: "{{ matrix_appservice_kakaotalk_version }}"
  29. matrix_appservice_kakaotalk_node_docker_image: "{{ matrix_appservice_kakaotalk_node_docker_image_prefix }}fair/matrix-appservice-kakaotalk-node:{{ matrix_appservice_kakaotalk_node_version }}"
  30. matrix_appservice_kakaotalk_node_docker_image_prefix: "localhost/"
  31. matrix_appservice_kakaotalk_node_docker_image_force_pull: "{{ matrix_appservice_kakaotalk_node_docker_image.endswith(':latest') }}"
  32. matrix_appservice_kakaotalk_version: 86c038fd2ffee5e0aebf65136f085cce7e38b54e
  33. matrix_appservice_kakaotalk_docker_image: "{{ matrix_appservice_kakaotalk_docker_image_name_prefix }}fair/matrix-appservice-kakaotalk:{{ matrix_appservice_kakaotalk_version }}"
  34. matrix_appservice_kakaotalk_docker_image_name_prefix: "localhost/"
  35. matrix_appservice_kakaotalk_docker_image_force_pull: "{{ matrix_appservice_kakaotalk_docker_image.endswith(':latest') }}"
  36. matrix_appservice_kakaotalk_base_path: "{{ matrix_base_data_path }}/appservice-kakaotalk"
  37. matrix_appservice_kakaotalk_config_path: "{{ matrix_appservice_kakaotalk_base_path }}/config"
  38. matrix_appservice_kakaotalk_data_path: "{{ matrix_appservice_kakaotalk_base_path }}/data"
  39. matrix_appservice_kakaotalk_docker_src_files_path: "{{ matrix_appservice_kakaotalk_base_path }}/docker-src"
  40. matrix_appservice_kakaotalk_command_prefix: "!kt"
  41. matrix_appservice_kakaotalk_homeserver_address: ""
  42. matrix_appservice_kakaotalk_homeserver_domain: '{{ matrix_domain }}'
  43. matrix_appservice_kakaotalk_appservice_address: 'http://matrix-appservice-kakaotalk:11115'
  44. # A list of extra arguments to pass to the appservice-kakaotalk container
  45. matrix_appservice_kakaotalk_container_extra_arguments: []
  46. # List of systemd services that matrix-appservice-kakaotalk.service depends on.
  47. matrix_appservice_kakaotalk_systemd_required_services_list: "{{ matrix_appservice_kakaotalk_systemd_required_services_list_default + matrix_appservice_kakaotalk_systemd_required_services_list_auto + matrix_appservice_kakaotalk_systemd_required_services_list_custom }}"
  48. matrix_appservice_kakaotalk_systemd_required_services_list_default: |-
  49. {{
  50. ([devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [])
  51. +
  52. ['matrix-appservice-kakaotalk-node.service']
  53. }}
  54. matrix_appservice_kakaotalk_systemd_required_services_list_auto: []
  55. matrix_appservice_kakaotalk_systemd_required_services_list_custom: []
  56. # List of systemd services that matrix-appservice-kakaotalk.service wants
  57. matrix_appservice_kakaotalk_systemd_wanted_services_list: []
  58. matrix_appservice_kakaotalk_container_network: ""
  59. matrix_appservice_kakaotalk_container_additional_networks: "{{ matrix_appservice_kakaotalk_container_additional_networks_auto + matrix_appservice_kakaotalk_container_additional_networks_custom }}"
  60. matrix_appservice_kakaotalk_container_additional_networks_auto: []
  61. matrix_appservice_kakaotalk_container_additional_networks_custom: []
  62. # A list of extra arguments to pass to the appservice-kakaotalk-node container
  63. matrix_appservice_kakaotalk_node_container_extra_arguments: []
  64. # List of systemd services that matrix-appservice-kakaotalk-node.service depends on.
  65. matrix_appservice_kakaotalk_node_systemd_required_services_list: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
  66. # List of systemd services that matrix-appservice-kakaotalk-node.service wants
  67. matrix_appservice_kakaotalk_node_systemd_wanted_services_list: []
  68. matrix_appservice_kakaotalk_appservice_token: ''
  69. matrix_appservice_kakaotalk_homeserver_token: ''
  70. # Whether or not created rooms should have federation enabled.
  71. # If false, created portal rooms will never be federated.
  72. matrix_appservice_kakaotalk_federate_rooms: true
  73. # Database-related configuration fields.
  74. #
  75. # To use SQLite:
  76. # - change the engine (`matrix_appservice_kakaotalk_database_engine: 'sqlite'`)
  77. # To use Postgres:
  78. # - adjust your database credentials via the `matrix_appservice_kakaotalk_database_*` variables
  79. matrix_appservice_kakaotalk_database_engine: 'postgres'
  80. matrix_appservice_kakaotalk_sqlite_database_path_local: "{{ matrix_appservice_kakaotalk_data_path }}/appservice-kakaotalk.db"
  81. matrix_appservice_kakaotalk_sqlite_database_path_in_container: "/data/appservice-kakaotalk.db"
  82. matrix_appservice_kakaotalk_database_username: 'matrix_appservice_kakaotalk'
  83. matrix_appservice_kakaotalk_database_password: 'some-password'
  84. matrix_appservice_kakaotalk_database_hostname: ''
  85. matrix_appservice_kakaotalk_database_port: 5432
  86. matrix_appservice_kakaotalk_database_name: 'matrix_appservice_kakaotalk'
  87. matrix_appservice_kakaotalk_database_connection_string: 'postgres://{{ matrix_appservice_kakaotalk_database_username }}:{{ matrix_appservice_kakaotalk_database_password }}@{{ matrix_appservice_kakaotalk_database_hostname }}:{{ matrix_appservice_kakaotalk_database_port }}/{{ matrix_appservice_kakaotalk_database_name }}'
  88. matrix_appservice_kakaotalk_appservice_database: "{{
  89. {
  90. 'sqlite': ('sqlite:///' + matrix_appservice_kakaotalk_sqlite_database_path_in_container),
  91. 'postgres': matrix_appservice_kakaotalk_database_connection_string,
  92. }[matrix_appservice_kakaotalk_database_engine]
  93. }}"
  94. # Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
  95. # Also see: matrix_appservice_kakaotalk_bridge_login_shared_secret_map
  96. matrix_appservice_kakaotalk_login_shared_secret: ''
  97. matrix_appservice_kakaotalk_bridge_login_shared_secret_map: "{{ {matrix_appservice_kakaotalk_homeserver_domain: matrix_appservice_kakaotalk_login_shared_secret} if matrix_appservice_kakaotalk_login_shared_secret else {} }}"
  98. matrix_appservice_kakaotalk_bridge_relay_enabled: "{{ matrix_bridges_relay_enabled }}"
  99. matrix_appservice_kakaotalk_bridge_permissions: |
  100. {{
  101. {matrix_appservice_kakaotalk_homeserver_domain: 'user'}
  102. | combine({matrix_admin: 'admin'} if matrix_admin else {})
  103. }}
  104. matrix_appservice_kakaotalk_appservice_bot_username: kakaotalkbot
  105. matrix_appservice_kakaotalk_user_prefix: 'kakaotalk_'
  106. # End-to-bridge encryption configuration
  107. matrix_appservice_kakaotalk_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
  108. matrix_appservice_kakaotalk_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
  109. # Specifies the default log level for all bridge loggers.
  110. matrix_appservice_kakaotalk_logging_level: WARNING
  111. # Default configuration template which covers the generic use case.
  112. # You can customize it by controlling the various variables inside it.
  113. #
  114. # For a more advanced customization, you can extend the default (see `matrix_appservice_kakaotalk_configuration_extension_yaml`)
  115. # or completely replace this variable with your own template.
  116. matrix_appservice_kakaotalk_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  117. matrix_appservice_kakaotalk_configuration_extension_yaml: |
  118. # Your custom YAML configuration goes here.
  119. # This configuration extends the default starting configuration (`matrix_appservice_kakaotalk_configuration_yaml`).
  120. #
  121. # You can override individual variables from the default configuration, or introduce new ones.
  122. #
  123. # If you need something more special, you can take full control by
  124. # completely redefining `matrix_appservice_kakaotalk_configuration_yaml`.
  125. matrix_appservice_kakaotalk_configuration_extension: "{{ matrix_appservice_kakaotalk_configuration_extension_yaml | from_yaml if matrix_appservice_kakaotalk_configuration_extension_yaml | from_yaml is mapping else {} }}"
  126. # Holds the final configuration (a combination of the default and its extension).
  127. # You most likely don't need to touch this variable. Instead, see `matrix_appservice_kakaotalk_configuration_yaml`.
  128. matrix_appservice_kakaotalk_configuration: "{{ matrix_appservice_kakaotalk_configuration_yaml | from_yaml | combine(matrix_appservice_kakaotalk_configuration_extension, recursive=True) }}"
  129. # Default configuration template which covers the generic use case.
  130. # You can customize it by controlling the various variables inside it.
  131. #
  132. # For a more advanced customization, you can extend the default (see `matrix_appservice_kakaotalk_node_configuration_extension_yaml`)
  133. # or completely replace this variable with your own template.
  134. #
  135. # The side-effect of this lookup is that Ansible would even parse the JSON for us, returning a dict.
  136. # This is unlike what it does when looking up YAML template files (no automatic parsing there).
  137. matrix_appservice_kakaotalk_node_configuration_default: "{{ lookup('template', 'templates/node-config.json.j2') }}"
  138. # Your custom JSON configuration for appservice-kakaotalk-node should go to `matrix_appservice_kakaotalk_node_configuration_extension_json`.
  139. # This configuration extends the default starting configuration (`matrix_appservice_kakaotalk_node_configuration_default`).
  140. #
  141. # You can override individual variables from the default configuration, or introduce new ones.
  142. #
  143. # If you need something more special, you can take full control by
  144. # completely redefining `matrix_appservice_kakaotalk_node_configuration_default`.
  145. #
  146. # Example configuration extension follows:
  147. #
  148. # matrix_appservice_kakaotalk_node_configuration_extension_json: |
  149. # {
  150. # "register_timeout": 5000
  151. # }
  152. matrix_appservice_kakaotalk_node_configuration_extension_json: '{}'
  153. matrix_appservice_kakaotalk_node_configuration_extension: "{{ matrix_appservice_kakaotalk_node_configuration_extension_json | from_json if matrix_appservice_kakaotalk_node_configuration_extension_json | from_json is mapping else {} }}"
  154. # Holds the final appservice-kakaotalk-node configuration (a combination of the default and its extension).
  155. # You most likely don't need to touch this variable. Instead, see `matrix_appservice_kakaotalk_node_configuration_default`.
  156. matrix_appservice_kakaotalk_node_configuration: "{{ matrix_appservice_kakaotalk_node_configuration_default | combine(matrix_appservice_kakaotalk_node_configuration_extension, recursive=True) }}"
  157. matrix_appservice_kakaotalk_registration_yaml: |
  158. id: appservice-kakaotalk
  159. as_token: {{ matrix_appservice_kakaotalk_appservice_token | to_json }}
  160. hs_token: {{ matrix_appservice_kakaotalk_homeserver_token | to_json }}
  161. namespaces:
  162. users:
  163. - exclusive: true
  164. regex: '^@{{ matrix_appservice_kakaotalk_user_prefix | regex_escape }}.*:{{ matrix_appservice_kakaotalk_homeserver_domain | regex_escape }}$'
  165. - exclusive: true
  166. regex: '^@{{ matrix_appservice_kakaotalk_appservice_bot_username | regex_escape }}:{{ matrix_appservice_kakaotalk_homeserver_domain | regex_escape }}$'
  167. url: {{ matrix_appservice_kakaotalk_appservice_address | to_json }}
  168. sender_localpart: _appservice_kakaotalk
  169. rate_limited: false
  170. matrix_appservice_kakaotalk_registration: "{{ matrix_appservice_kakaotalk_registration_yaml | from_yaml }}"