Matrix Docker Ansible eploy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

219 líneas
13 KiB

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