Remove the appservice-kakaotalk bridge

The bridge could only be installed by self-building its source code,
and its upstream repository (on src.miscworks.net) has become
unreachable (the Internet Archive last saw it alive in May 2026),
making installation impossible. The bridge was also based on the
long-unmaintained node-kakao library and carried a warning that using
it may get KakaoTalk accounts banned.

The playbook catches leftover matrix_appservice_kakaotalk_* variables
and points users to the manual uninstallation instructions.

Related to #5068

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Slavi Pantaleev
2026-07-15 13:30:01 +03:00
parent f93616c06e
commit eb0af09bf5
22 changed files with 32 additions and 1015 deletions
@@ -1,233 +0,0 @@
# SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev
# SPDX-FileCopyrightText: 2023 Nikita Chernyi
# SPDX-FileCopyrightText: 2024 MDAD project contributors
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
# matrix-appservice-kakaotalk is a Matrix <-> Kakaotalk bridge
# Project source code URL: https://src.miscworks.net/fair/matrix-appservice-kakaotalk/
matrix_appservice_kakaotalk_enabled: true
# No images are published for neither of the container images (appservice or node), so we're self-building everything.
matrix_appservice_kakaotalk_container_image_self_build: true
# matrix_appservice_kakaotalk_container_image_self_build_repo: "https://src.miscworks.net/fair/matrix-appservice-kakaotalk.git"
#
# hnarjis' fork is used instead of upstream (fair's), because upstream is currently broken.
# The following error happens when chatting up the bot without this fix:
# [2022-07-25 09:04:53,784] [ERROR@mau.as] Exception in Matrix event handler
# Traceback (most recent call last):
# File "/usr/lib/python3.9/site-packages/mautrix/appservice/as_handler.py", line 239, in try_handle
# await handler_func(event)
# File "/usr/lib/python3.9/site-packages/mautrix/bridge/matrix.py", line 820, in int_handle_event
# await self.int_handle_invite(evt)
# File "/usr/lib/python3.9/site-packages/mautrix/bridge/matrix.py", line 441, in int_handle_invite
# inviter = await self.bridge.get_user(evt.sender)
# File "/usr/lib/python3.9/site-packages/matrix_appservice_kakaotalk/__main__.py", line 112, in get_user
# return await User.get_by_mxid(user_id, create=create)
# File "/usr/lib/python3.9/site-packages/mautrix/util/async_getter_lock.py", line 60, in wrapper
# return await fn(cls, *args, **kwargs)
# File "/usr/lib/python3.9/site-packages/matrix_appservice_kakaotalk/user.py", line 227, in get_by_mxid
# user = cls(mxid)
# TypeError: __init__() missing 2 required positional arguments: 'force_login' and 'was_connected'
matrix_appservice_kakaotalk_container_image_self_build_repo: "https://src.miscworks.net/hnarjis/matrix-appservice-kakaotalk.git"
matrix_appservice_kakaotalk_container_image_self_build_repo_version: "{{ 'master' if matrix_appservice_kakaotalk_version == 'latest' else matrix_appservice_kakaotalk_version }}"
matrix_appservice_kakaotalk_node_version: "{{ matrix_appservice_kakaotalk_version }}"
matrix_appservice_kakaotalk_node_container_image: "{{ matrix_appservice_kakaotalk_node_container_image_registry_prefix }}fair/matrix-appservice-kakaotalk-node:{{ matrix_appservice_kakaotalk_node_version }}"
matrix_appservice_kakaotalk_node_container_image_registry_prefix: "{{ 'localhost/' if matrix_appservice_kakaotalk_container_image_self_build else matrix_appservice_kakaotalk_node_container_image_registry_prefix_upstream }}"
matrix_appservice_kakaotalk_node_container_image_registry_prefix_upstream: "{{ matrix_appservice_kakaotalk_node_container_image_registry_prefix_upstream_default }}"
matrix_appservice_kakaotalk_node_container_image_registry_prefix_upstream_default: ""
matrix_appservice_kakaotalk_version: 86c038fd2ffee5e0aebf65136f085cce7e38b54e
matrix_appservice_kakaotalk_container_image: "{{ matrix_appservice_kakaotalk_container_image_registry_prefix }}fair/matrix-appservice-kakaotalk:{{ matrix_appservice_kakaotalk_version }}"
matrix_appservice_kakaotalk_container_image_registry_prefix: "{{ 'localhost/' if matrix_appservice_kakaotalk_container_image_self_build else matrix_appservice_kakaotalk_container_image_registry_prefix_upstream }}"
matrix_appservice_kakaotalk_container_image_registry_prefix_upstream: "{{ matrix_appservice_kakaotalk_container_image_registry_prefix_upstream_default }}"
matrix_appservice_kakaotalk_container_image_registry_prefix_upstream_default: ""
matrix_appservice_kakaotalk_base_path: "{{ matrix_base_data_path }}/appservice-kakaotalk"
matrix_appservice_kakaotalk_config_path: "{{ matrix_appservice_kakaotalk_base_path }}/config"
matrix_appservice_kakaotalk_data_path: "{{ matrix_appservice_kakaotalk_base_path }}/data"
matrix_appservice_kakaotalk_container_src_files_path: "{{ matrix_appservice_kakaotalk_base_path }}/docker-src"
matrix_appservice_kakaotalk_command_prefix: "!kt"
matrix_appservice_kakaotalk_homeserver_address: ""
matrix_appservice_kakaotalk_homeserver_domain: '{{ matrix_domain }}'
# Whether asynchronous uploads via MSC2246 should be enabled for media.
# Requires a homeserver that supports MSC2246 (https://github.com/matrix-org/matrix-spec-proposals/pull/2246).
matrix_appservice_kakaotalk_homeserver_async_media: false
matrix_appservice_kakaotalk_appservice_address: 'http://matrix-appservice-kakaotalk:11115'
# A list of extra arguments to pass to the appservice-kakaotalk container
matrix_appservice_kakaotalk_container_extra_arguments: []
# List of systemd services that matrix-appservice-kakaotalk.service depends on.
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 }}"
matrix_appservice_kakaotalk_systemd_required_services_list_default: |-
{{
([devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [])
+
['matrix-appservice-kakaotalk-node.service']
}}
matrix_appservice_kakaotalk_systemd_required_services_list_auto: []
matrix_appservice_kakaotalk_systemd_required_services_list_custom: []
# List of systemd services that matrix-appservice-kakaotalk.service wants
matrix_appservice_kakaotalk_systemd_wanted_services_list: []
matrix_appservice_kakaotalk_container_network: ""
matrix_appservice_kakaotalk_container_additional_networks: "{{ matrix_appservice_kakaotalk_container_additional_networks_auto + matrix_appservice_kakaotalk_container_additional_networks_custom }}"
matrix_appservice_kakaotalk_container_additional_networks_auto: []
matrix_appservice_kakaotalk_container_additional_networks_custom: []
# A list of extra arguments to pass to the appservice-kakaotalk-node container
matrix_appservice_kakaotalk_node_container_extra_arguments: []
# List of systemd services that matrix-appservice-kakaotalk-node.service depends on.
matrix_appservice_kakaotalk_node_systemd_required_services_list: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
# List of systemd services that matrix-appservice-kakaotalk-node.service wants
matrix_appservice_kakaotalk_node_systemd_wanted_services_list: []
matrix_appservice_kakaotalk_appservice_token: ''
matrix_appservice_kakaotalk_homeserver_token: ''
# Whether or not created rooms should have federation enabled.
# If false, created portal rooms will never be federated.
matrix_appservice_kakaotalk_federate_rooms: true
# Database-related configuration fields.
#
# To use SQLite:
# - change the engine (`matrix_appservice_kakaotalk_database_engine: 'sqlite'`)
# To use Postgres:
# - adjust your database credentials via the `matrix_appservice_kakaotalk_database_*` variables
matrix_appservice_kakaotalk_database_engine: 'postgres'
matrix_appservice_kakaotalk_sqlite_database_path_local: "{{ matrix_appservice_kakaotalk_data_path }}/appservice-kakaotalk.db"
matrix_appservice_kakaotalk_sqlite_database_path_in_container: "/data/appservice-kakaotalk.db"
matrix_appservice_kakaotalk_database_username: 'matrix_appservice_kakaotalk'
matrix_appservice_kakaotalk_database_password: 'some-password'
matrix_appservice_kakaotalk_database_hostname: ''
matrix_appservice_kakaotalk_database_port: 5432
matrix_appservice_kakaotalk_database_name: 'matrix_appservice_kakaotalk'
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 }}'
matrix_appservice_kakaotalk_appservice_database: "{{ {
'sqlite': ('sqlite:///' + matrix_appservice_kakaotalk_sqlite_database_path_in_container),
'postgres': matrix_appservice_kakaotalk_database_connection_string,
}[matrix_appservice_kakaotalk_database_engine] }}"
# Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
# Also see: matrix_appservice_kakaotalk_bridge_login_shared_secret_map
matrix_appservice_kakaotalk_login_shared_secret: ''
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 {} }}"
matrix_appservice_kakaotalk_bridge_relay_enabled: "{{ matrix_bridges_relay_enabled }}"
matrix_appservice_kakaotalk_bridge_permissions: |
{{
{matrix_appservice_kakaotalk_homeserver_domain: 'user'}
| combine({matrix_admin: 'admin'} if matrix_admin else {})
}}
matrix_appservice_kakaotalk_appservice_bot_username: kakaotalkbot
matrix_appservice_kakaotalk_user_prefix: 'kakaotalk_'
# End-to-bridge encryption configuration
matrix_appservice_kakaotalk_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
matrix_appservice_kakaotalk_bridge_encryption_default: "{{ matrix_bridges_encryption_default }}"
# Specifies the default log level for all bridge loggers.
matrix_appservice_kakaotalk_logging_level: WARNING
# Default configuration template which covers the generic use case.
# You can customize it by controlling the various variables inside it.
#
# For a more advanced customization, you can extend the default (see `matrix_appservice_kakaotalk_configuration_extension_yaml`)
# or completely replace this variable with your own template.
matrix_appservice_kakaotalk_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
matrix_appservice_kakaotalk_configuration_extension_yaml: |
# Your custom YAML configuration goes here.
# This configuration extends the default starting configuration (`matrix_appservice_kakaotalk_configuration_yaml`).
#
# You can override individual variables from the default configuration, or introduce new ones.
#
# If you need something more special, you can take full control by
# completely redefining `matrix_appservice_kakaotalk_configuration_yaml`.
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 {} }}"
# Holds the final configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_appservice_kakaotalk_configuration_yaml`.
matrix_appservice_kakaotalk_configuration: "{{ matrix_appservice_kakaotalk_configuration_yaml | from_yaml | combine(matrix_appservice_kakaotalk_configuration_extension, recursive=True) }}"
# Default configuration template which covers the generic use case.
# You can customize it by controlling the various variables inside it.
#
# For a more advanced customization, you can extend the default (see `matrix_appservice_kakaotalk_node_configuration_extension_yaml`)
# or completely replace this variable with your own template.
#
# The side-effect of this lookup is that Ansible would even parse the JSON for us, returning a dict.
# This is unlike what it does when looking up YAML template files (no automatic parsing there).
matrix_appservice_kakaotalk_node_configuration_default: "{{ lookup('template', 'templates/node-config.json.j2', convert_data=False) | from_json }}"
# Your custom JSON configuration for appservice-kakaotalk-node should go to `matrix_appservice_kakaotalk_node_configuration_extension_json`.
# This configuration extends the default starting configuration (`matrix_appservice_kakaotalk_node_configuration_default`).
#
# You can override individual variables from the default configuration, or introduce new ones.
#
# If you need something more special, you can take full control by
# completely redefining `matrix_appservice_kakaotalk_node_configuration_default`.
#
# Example configuration extension follows:
#
# matrix_appservice_kakaotalk_node_configuration_extension_json: |
# {
# "register_timeout": 5000
# }
matrix_appservice_kakaotalk_node_configuration_extension_json: '{}'
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 {} }}"
# Holds the final appservice-kakaotalk-node configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_appservice_kakaotalk_node_configuration_default`.
matrix_appservice_kakaotalk_node_configuration: "{{ matrix_appservice_kakaotalk_node_configuration_default | combine(matrix_appservice_kakaotalk_node_configuration_extension, recursive=True) }}"
matrix_appservice_kakaotalk_registration_yaml: |
id: appservice-kakaotalk
as_token: {{ matrix_appservice_kakaotalk_appservice_token | to_json }}
hs_token: {{ matrix_appservice_kakaotalk_homeserver_token | to_json }}
namespaces:
users:
- exclusive: true
regex: '^@{{ matrix_appservice_kakaotalk_user_prefix | regex_escape }}.*:{{ matrix_appservice_kakaotalk_homeserver_domain | regex_escape }}$'
- exclusive: true
regex: '^@{{ matrix_appservice_kakaotalk_appservice_bot_username | regex_escape }}:{{ matrix_appservice_kakaotalk_homeserver_domain | regex_escape }}$'
url: {{ matrix_appservice_kakaotalk_appservice_address | to_json }}
sender_localpart: _appservice_kakaotalk
rate_limited: false
matrix_appservice_kakaotalk_registration: "{{ matrix_appservice_kakaotalk_registration_yaml | from_yaml }}"
# matrix_appservice_kakaotalk_restart_necessary controls whether the service
# will be restarted (when true) or merely started (when false) by the
# systemd service manager role (when conditional restart is enabled).
#
# This value is automatically computed during installation based on whether
# any configuration files, the systemd service file, or the container image changed.
# The default of `false` means "no restart needed" — appropriate when the role's
# installation tasks haven't run (e.g., due to --tags skipping them).
matrix_appservice_kakaotalk_restart_necessary: false
@@ -1,24 +0,0 @@
# SPDX-FileCopyrightText: 2019 - 2023 Slavi Pantaleev
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
- tags:
- setup-all
- setup-appservice-kakaotalk
- install-all
- install-appservice-kakaotalk
block:
- when: matrix_appservice_kakaotalk_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_appservice_kakaotalk_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
- tags:
- setup-all
- setup-appservice-kakaotalk
block:
- when: not matrix_appservice_kakaotalk_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
@@ -1,136 +0,0 @@
# SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
# SPDX-FileCopyrightText: 2022 Sebastian Gumprich
# SPDX-FileCopyrightText: 2024 David Mehren
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
- name: Ensure matrix-appservice-kakaotalk image is pulled
community.docker.docker_image_pull:
name: "{{ matrix_appservice_kakaotalk_container_image }}"
pull: always
when: not matrix_appservice_kakaotalk_container_image_self_build
register: matrix_appservice_kakaotalk_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: matrix_appservice_kakaotalk_container_image_pull_result is not failed
- name: Ensure matrix-appservice-kakaotalk-node image is pulled
community.docker.docker_image_pull:
name: "{{ matrix_appservice_kakaotalk_node_container_image }}"
pull: always
when: not matrix_appservice_kakaotalk_container_image_self_build
register: matrix_appservice_kakaotalk_node_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: matrix_appservice_kakaotalk_node_container_image_pull_result is not failed
- name: Ensure matrix-appservice-kakaotalk paths exist
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
mode: '0750'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
with_items:
- {path: "{{ matrix_appservice_kakaotalk_base_path }}", when: true}
- {path: "{{ matrix_appservice_kakaotalk_config_path }}", when: true}
- {path: "{{ matrix_appservice_kakaotalk_data_path }}", when: true}
- {path: "{{ matrix_appservice_kakaotalk_container_src_files_path }}", when: "{{ matrix_appservice_kakaotalk_container_image_self_build }}"}
when: item.when | bool
- name: Ensure matrix-appservice-kakaotalk repository is present on self-build
ansible.builtin.git:
repo: "{{ matrix_appservice_kakaotalk_container_image_self_build_repo }}"
dest: "{{ matrix_appservice_kakaotalk_container_src_files_path }}"
version: "{{ matrix_appservice_kakaotalk_container_image_self_build_repo_version }}"
force: "yes"
become: true
become_user: "{{ matrix_user_name }}"
register: matrix_appservice_kakaotalk_git_pull_results
when: "matrix_appservice_kakaotalk_container_image_self_build | bool"
- name: Ensure matrix-appservice-kakaotalk-node Docker image is built
community.docker.docker_image_build:
name: "{{ matrix_appservice_kakaotalk_node_container_image }}"
dockerfile: Dockerfile
path: "{{ matrix_appservice_kakaotalk_container_src_files_path }}/node"
pull: true
rebuild: "{{ 'always' if matrix_appservice_kakaotalk_git_pull_results.changed | bool else 'never' }}"
when: "matrix_appservice_kakaotalk_container_image_self_build | bool"
register: matrix_appservice_kakaotalk_node_container_image_build_result
- name: Ensure matrix-appservice-kakaotalk Docker image is built
community.docker.docker_image_build:
name: "{{ matrix_appservice_kakaotalk_container_image }}"
dockerfile: Dockerfile
path: "{{ matrix_appservice_kakaotalk_container_src_files_path }}"
pull: true
rebuild: "{{ 'always' if matrix_appservice_kakaotalk_git_pull_results.changed | bool else 'never' }}"
when: "matrix_appservice_kakaotalk_container_image_self_build | bool"
register: matrix_appservice_kakaotalk_container_image_build_result
- name: Ensure matrix-appservice-kakaotalk-node config.json installed
ansible.builtin.copy:
content: "{{ matrix_appservice_kakaotalk_node_configuration | to_nice_json }}"
dest: "{{ matrix_appservice_kakaotalk_config_path }}/node-config.json"
mode: '0644'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_appservice_kakaotalk_node_config_result
- name: Ensure matrix-appservice-kakaotalk config.yaml installed
ansible.builtin.copy:
content: "{{ matrix_appservice_kakaotalk_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_kakaotalk_config_path }}/config.yaml"
mode: '0644'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_appservice_kakaotalk_config_result
- name: Ensure matrix-appservice-kakaotalk registration.yaml installed
ansible.builtin.copy:
content: "{{ matrix_appservice_kakaotalk_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_kakaotalk_config_path }}/registration.yaml"
mode: '0644'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_appservice_kakaotalk_registration_result
- name: Ensure matrix-appservice-kakaotalk container network is created
when: matrix_appservice_kakaotalk_container_network != 'host'
community.general.docker_network:
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
name: "{{ matrix_appservice_kakaotalk_container_network }}"
driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
- name: Ensure matrix-appservice-kakaotalk-node.service installed
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-appservice-kakaotalk-node.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk-node.service"
mode: '0644'
register: matrix_appservice_kakaotalk_node_systemd_service_result
- name: Ensure matrix-appservice-kakaotalk.service installed
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-appservice-kakaotalk.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk.service"
mode: '0644'
register: matrix_appservice_kakaotalk_systemd_service_result
- name: Determine whether matrix-appservice-kakaotalk needs a restart
ansible.builtin.set_fact:
matrix_appservice_kakaotalk_restart_necessary: >-
{{
matrix_appservice_kakaotalk_node_config_result.changed | default(false)
or matrix_appservice_kakaotalk_config_result.changed | default(false)
or matrix_appservice_kakaotalk_registration_result.changed | default(false)
or matrix_appservice_kakaotalk_node_systemd_service_result.changed | default(false)
or matrix_appservice_kakaotalk_systemd_service_result.changed | default(false)
or matrix_appservice_kakaotalk_container_image_pull_result.changed | default(false)
or matrix_appservice_kakaotalk_node_container_image_pull_result.changed | default(false)
or matrix_appservice_kakaotalk_container_image_build_result.changed | default(false)
or matrix_appservice_kakaotalk_node_container_image_build_result.changed | default(false)
}}
@@ -1,40 +0,0 @@
# SPDX-FileCopyrightText: 2022 Slavi Pantaleev
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
- name: Check existence of matrix-appservice-kakaotalk service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk.service"
register: matrix_appservice_kakaotalk_service_stat
- name: Ensure matrix-appservice-kakaotalk is stopped
ansible.builtin.service:
name: matrix-appservice-kakaotalk
state: stopped
enabled: false
daemon_reload: true
when: matrix_appservice_kakaotalk_service_stat.stat.exists | bool
- name: Check existence of matrix-appservice-kakaotalk-node service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk-node.service"
register: matrix_appservice_kakaotalk_node_service_stat
- name: Ensure matrix-appservice-kakaotalk-node is stopped
ansible.builtin.service:
name: matrix-appservice-kakaotalk-node
state: stopped
enabled: false
daemon_reload: true
when: matrix_appservice_kakaotalk_node_service_stat.stat.exists | bool
- name: Ensure matrix-appservice-kakaotalk.service files don't exist
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_items:
- "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk-node.service"
- "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk.service"
when: matrix_appservice_kakaotalk_service_stat.stat.exists | bool or matrix_appservice_kakaotalk_node_service_stat.stat.exists | bool
@@ -1,41 +0,0 @@
# SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev
# SPDX-FileCopyrightText: 2025 Suguru Hirahara
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
- name: (Deprecation) Catch and report renamed appservice-kakaotalk variables
ansible.builtin.fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
with_items:
- {'old': 'matrix_appservice_kakaotalk_node_docker_image_name_prefix', 'new': 'matrix_appservice_kakaotalk_node_container_image_registry_prefix'}
- {'old': 'matrix_appservice_kakaotalk_docker_image_name_prefix', 'new': 'matrix_appservice_kakaotalk_container_image_registry_prefix'}
- {'old': 'matrix_appservice_kakaotalk_docker_image', 'new': 'matrix_appservice_kakaotalk_container_image'}
- {'old': 'matrix_appservice_kakaotalk_docker_image_force_pull', 'new': 'matrix_appservice_kakaotalk_container_image_force_pull'}
- {'old': 'matrix_appservice_kakaotalk_docker_image_registry_prefix', 'new': 'matrix_appservice_kakaotalk_container_image_registry_prefix'}
- {'old': 'matrix_appservice_kakaotalk_docker_image_registry_prefix_upstream', 'new': 'matrix_appservice_kakaotalk_container_image_registry_prefix_upstream'}
- {'old': 'matrix_appservice_kakaotalk_docker_image_registry_prefix_upstream_default', 'new': 'matrix_appservice_kakaotalk_container_image_registry_prefix_upstream_default'}
- {'old': 'matrix_appservice_kakaotalk_docker_src_files_path', 'new': 'matrix_appservice_kakaotalk_container_src_files_path'}
- {'old': 'matrix_appservice_kakaotalk_node_docker_image', 'new': 'matrix_appservice_kakaotalk_node_container_image'}
- {'old': 'matrix_appservice_kakaotalk_node_docker_image_force_pull', 'new': 'matrix_appservice_kakaotalk_node_container_image_force_pull'}
- {'old': 'matrix_appservice_kakaotalk_node_docker_image_registry_prefix', 'new': 'matrix_appservice_kakaotalk_node_container_image_registry_prefix'}
- {'old': 'matrix_appservice_kakaotalk_node_docker_image_registry_prefix_upstream', 'new': 'matrix_appservice_kakaotalk_node_container_image_registry_prefix_upstream'}
- {'old': 'matrix_appservice_kakaotalk_node_docker_image_registry_prefix_upstream_default', 'new': 'matrix_appservice_kakaotalk_node_container_image_registry_prefix_upstream_default'}
- {'old': 'matrix_appservice_kakaotalk_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
- {'old': 'matrix_appservice_kakaotalk_node_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
- name: Fail if required appservice-kakaotalk settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
with_items:
- {'name': 'matrix_appservice_kakaotalk_appservice_token', when: true}
- {'name': 'matrix_appservice_kakaotalk_homeserver_address', when: true}
- {'name': 'matrix_appservice_kakaotalk_homeserver_token', when: true}
- {'name': 'matrix_appservice_kakaotalk_database_hostname', when: "{{ matrix_appservice_kakaotalk_database_engine == 'postgres' }}"}
- {'name': 'matrix_appservice_kakaotalk_container_network', when: true}
@@ -1,276 +0,0 @@
# Homeserver details
homeserver:
# The address that this appservice can use to connect to the homeserver.
address: {{ matrix_appservice_kakaotalk_homeserver_address | to_json }}
# The domain of the homeserver (for MXIDs, etc).
domain: {{ matrix_appservice_kakaotalk_homeserver_domain | to_json }}
# Whether or not to verify the SSL certificate of the homeserver.
# Only applies if address starts with https://
verify_ssl: true
# Whether or not the homeserver supports asmux-specific endpoints,
# such as /_matrix/client/unstable/net.maunium.asmux/dms for atomically
# updating m.direct.
asmux: false
# Number of retries for all HTTP requests if the homeserver isn't reachable.
http_retry_count: 4
# The URL to push real-time bridge status to.
# If set, the bridge will make POST requests to this URL whenever a user's MQTT connection state changes.
# The bridge will use the appservice as_token to authorize requests.
status_endpoint: null
# Endpoint for reporting per-message status.
message_send_checkpoint_endpoint: null
# Whether asynchronous uploads via MSC2246 should be enabled for media.
# Requires a media repo that supports MSC2246.
async_media: {{ matrix_appservice_kakaotalk_homeserver_async_media | to_json }}
# Application service host/registration related details
# Changing these values requires regeneration of the registration.
appservice:
# The address that the homeserver can use to connect to this appservice.
address: {{ matrix_appservice_kakaotalk_appservice_address | to_json }}
# The hostname and port where this appservice should listen.
hostname: 0.0.0.0
port: 11115
# The maximum body size of appservice API requests (from the homeserver) in mebibytes
# Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
max_body_size: 1
# The full URI to the database. SQLite and Postgres are supported.
# Format examples:
# SQLite: sqlite:///filename.db
# Postgres: postgres://username:password@hostname/dbname
database: {{ matrix_appservice_kakaotalk_appservice_database | to_json }}
# Additional arguments for asyncpg.create_pool() or sqlite3.connect()
# https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
# https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
# For sqlite, min_size is used as the connection thread pool size and max_size is ignored.
database_opts:
min_size: 5
max_size: 10
# The unique ID of this appservice.
id: appservice-kakaotalk
# Username of the appservice bot.
bot_username: {{ matrix_appservice_kakaotalk_appservice_bot_username | to_json }}
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
# to leave display name/avatar as-is.
bot_displayname: KakaoTalk bridge bot
bot_avatar:
# Whether or not to receive ephemeral events via appservice transactions.
# Requires MSC2409 support (i.e. Synapse 1.22+).
# You should disable bridge -> sync_with_custom_puppets when this is enabled.
ephemeral_events: false
# Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
as_token: {{ matrix_appservice_kakaotalk_appservice_token | to_json }}
hs_token: {{ matrix_appservice_kakaotalk_homeserver_token | to_json }}
# Prometheus telemetry config. Requires prometheus-client to be installed.
metrics:
enabled: false
listen_port: 8000
# Manhole config.
manhole:
# Whether or not opening the manhole is allowed.
enabled: false
# The path for the unix socket.
path: /var/tmp/matrix-appservice-kakaotalk.manhole
# The list of UIDs who can be added to the whitelist.
# If empty, any UIDs can be specified in the open-manhole command.
whitelist:
- 0
# Config for things that are directly sent to KakaoTalk.
kakaotalk:
device_name: "KakaoTalk Bridge"
# Bridge config
bridge:
# Localpart template of MXIDs for KakaoTalk users.
# {userid} is replaced with the user ID of the KakaoTalk user.
username_template: "{{ matrix_appservice_kakaotalk_user_prefix }}{userid}"
# Displayname template for KakaoTalk users.
# {displayname} is replaced with the display name of the KakaoTalk user.
displayname_template: "{displayname} (KT)"
# The prefix for commands. Only required in non-management rooms.
command_prefix: {{ matrix_appservice_kakaotalk_command_prefix | to_json }}
# Number of chats to sync (and create portals for) on startup/login.
# Set to 0 to disable automatic syncing, or -1 to sync as much as possible.
initial_chat_sync: 20
# Whether or not the KakaoTalk users of logged in Matrix users should be
# invited to private chats when the user sends a message from another client.
invite_own_puppet_to_pm: false
# Whether or not to use /sync to get presence, read receipts and typing notifications
# when double puppeting is enabled
sync_with_custom_puppets: true
# Whether or not to update the m.direct account data event when double puppeting is enabled.
# Note that updating the m.direct event is not atomic (except with mautrix-asmux)
# and is therefore prone to race conditions.
sync_direct_chat_list: false
# Servers to always allow double puppeting from
double_puppet_server_map: {}
# Allow using double puppeting from any server with a valid client .well-known file.
double_puppet_allow_discovery: false
# Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
#
# If set, custom puppets will be enabled automatically for local users
# instead of users having to find an access token and run `login-matrix`
# manually.
# If using this for other servers than the bridge's server,
# you must also set the URL in the double_puppet_server_map.
login_shared_secret_map: {{ matrix_appservice_kakaotalk_bridge_login_shared_secret_map | to_json }}
# Whether or not to update avatars when syncing all contacts at startup.
update_avatar_initial_sync: true
# End-to-bridge encryption support options. These require matrix-nio to be installed with pip
# and login_shared_secret to be configured in order to get a device for the bridge bot.
#
# Additionally, https://github.com/matrix-org/synapse/pull/5758 is required if using a normal
# application service.
encryption:
# Allow encryption, work in group chat rooms with e2ee enabled
allow: {{ matrix_appservice_kakaotalk_bridge_encryption_allow | to_json }}
# Default to encryption, force-enable encryption in all portals the bridge creates
# This will cause the bridge bot to be in private chats for the encryption to work properly.
default: {{ matrix_appservice_kakaotalk_bridge_encryption_default| to_json }}
# Options for automatic key sharing.
key_sharing:
# Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
# You must use a client that supports requesting keys from other users to use this feature.
allow: false
# Require the requesting device to have a valid cross-signing signature?
# This doesn't require that the bridge has verified the device, only that the user has verified it.
# Not yet implemented.
require_cross_signing: false
# Require devices to be verified by the bridge?
# Verification by the bridge is not yet implemented.
require_verification: true
# Whether or not the bridge should send a read receipt from the bridge bot when a message has
# been sent to KakaoTalk.
delivery_receipts: false
# Whether to allow inviting arbitrary mxids to portal rooms
allow_invites: false
# Whether or not created rooms should have federation enabled.
# If false, created portal rooms will never be federated.
federate_rooms: {{ matrix_appservice_kakaotalk_federate_rooms | to_json }}
# Settings for backfilling messages from KakaoTalk.
backfill:
# Whether or not the KakaoTalk users of logged in Matrix users should be
# invited to private chats when backfilling history from KakaoTalk. This is
# usually needed to prevent rate limits and to allow timestamp massaging.
invite_own_puppet: true
# Maximum number of messages to backfill initially.
# Set to 0 to disable backfilling when creating portal, or -1 to backfill as much as possible.
initial_limit: 0
# Maximum number of messages to backfill if messages were missed while
# the bridge was disconnected.
# Set to 0 to disable backfilling missed messages, or -1 to backfill as much as possible.
missed_limit: 1000
# If using double puppeting, should notifications be disabled
# while the initial backfill is in progress?
disable_notifications: false
# The number of seconds that a disconnection can last without triggering an automatic re-sync
# and missed message backfilling when reconnecting.
# Set to 0 to always re-sync, or -1 to never re-sync automatically.
resync_max_disconnected_time: 5
# Should users remain logged in after being disconnected from chatroom updates?
# This is a convenience feature, but might make the bridge look more suspicious to KakaoTalk.
remain_logged_in_on_disconnect: true
# May the bridge restore user logins with session tokens instead of requiring a password?
# This is a convenience feature, but might make the bridge look more suspicious to KakaoTalk.
# Note that password-based login will be tried first for users who have saved their password.
allow_token_relogin: true
# Should the bridge connect users to chatroom updates after a token-based login?
# This will disconnect any KakaoTalk PC/bridge sessions that were started since the last connection.
# This is a convenience feature, but might make the bridge look more suspicious to KakaoTalk.
reconnect_on_token_relogin: true
# Should the bridge do a resync for connected users on startup?
sync_on_startup: true
# Whether or not temporary disconnections should send notices to the notice room.
# If this is false, disconnections will never send messages and connections will only send
# messages if it was disconnected for more than resync_max_disconnected_time seconds.
temporary_disconnect_notices: true
# Disable bridge notices entirely
disable_bridge_notices: false
# Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
# This field will automatically be changed back to false after it,
# except if the config file is not writable.
resend_bridge_info: false
# Whether or not mute status and tags should only be bridged when the portal room is created.
tag_only_on_create: true
# If set to true, downloading media from the CDN will use a plain aiohttp client without the usual headers or
# other configuration. This may be useful if you don't want to use the default proxy for large files.
sandbox_media_download: false
# Permissions for using the bridge.
# Permitted values:
# relay - Allowed to be relayed through the bridge, no access to commands.
# user - Use the bridge with puppeting.
# admin - Use and administrate the bridge.
# Permitted keys:
# * - All Matrix users
# domain - All users on that homeserver
# mxid - Specific user
permissions: {{ matrix_appservice_kakaotalk_bridge_permissions | to_json }}
relay:
# Whether relay mode should be allowed. If allowed, `!kt set-relay` can be used to turn any
# authenticated user into a relaybot for that chat.
enabled: {{ matrix_appservice_kakaotalk_bridge_relay_enabled }}
# The formats to use when sending messages to KakaoTalk via a relay user.
#
# Available variables:
# $sender_displayname - The display name of the sender (e.g. Example User)
# $sender_username - The username (Matrix ID localpart) of the sender (e.g. alice)
# $sender_mxid - The Matrix ID of the sender (e.g. @alice:example.com)
# $message - The message content
message_formats:
m.text: '<b>$sender_displayname</b>: $message'
m.notice: '<b>$sender_displayname</b>: $message'
m.emote: '* <b>$sender_displayname</b> $message'
m.file: 'File from <b>$sender_displayname</b>: $message'
m.image: 'Image from <b>$sender_displayname</b>: $message'
m.audio: 'Audio from <b>$sender_displayname</b>: $message'
m.video: 'Video from <b>$sender_displayname</b>: $message'
m.location: '<b>$sender_displayname</b> sent a location'
rpc:
connection:
# Either unix or tcp
type: tcp
# Only for type: unix
# path: /rpc/rpc.sock
# Only for type: tcp
host: matrix-appservice-kakaotalk-node
port: 8000
# Python logging configuration.
#
# See section 16.7.2 of the Python documentation for more info:
# https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
logging:
version: 1
formatters:
colored:
(): matrix_appservice_kakaotalk.util.ColorFormatter
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
normal:
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
handlers:
console:
class: logging.StreamHandler
formatter: colored
loggers:
mau:
level: {{ matrix_appservice_kakaotalk_logging_level | to_json }}
paho:
level: {{ matrix_appservice_kakaotalk_logging_level | to_json }}
aiohttp:
level: {{ matrix_appservice_kakaotalk_logging_level | to_json }}
root:
level: {{ matrix_appservice_kakaotalk_logging_level | to_json }}
handlers: [console]
@@ -1,6 +0,0 @@
SPDX-FileCopyrightText: 2022 MDAD project contributors
SPDX-FileCopyrightText: 2022 Slavi Pantaleev
SPDX-FileCopyrightText: 2023 Nikita Chernyi
SPDX-FileCopyrightText: 2024 Suguru Hirahara
SPDX-License-Identifier: AGPL-3.0-or-later
@@ -1,13 +0,0 @@
{
"listen": {
"type": "tcp",
"host": "0.0.0.0",
"port": 8000,
"force": false
},
"register_timeout": 3000,
"logging_keys": {
"request": ["mxid"],
"response": ["status"]
}
}
@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2022 Slavi Pantaleev
SPDX-License-Identifier: AGPL-3.0-or-later
@@ -1,48 +0,0 @@
#jinja2: lstrip_blocks: True
[Unit]
Description=appservice-kakaotalk-node bridge helper
{% for service in matrix_appservice_kakaotalk_node_systemd_required_services_list %}
Requires={{ service }}
After={{ service }}
{% endfor %}
{% for service in matrix_appservice_kakaotalk_node_systemd_wanted_services_list %}
Wants={{ service }}
{% endfor %}
DefaultDependencies=no
[Service]
Type=simple
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-appservice-kakaotalk-node 2>/dev/null || true'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-appservice-kakaotalk-node 2>/dev/null || true'
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--rm \
--name=matrix-appservice-kakaotalk-node \
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--network={{ matrix_appservice_kakaotalk_container_network }} \
--mount type=bind,src={{ matrix_appservice_kakaotalk_config_path }}/node-config.json,dst=/config.json,ro \
{% for arg in matrix_appservice_kakaotalk_node_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ matrix_appservice_kakaotalk_node_container_image }} \
node src/main.js --config /config.json
{% if matrix_appservice_kakaotalk_container_network != 'host' %}
{% for network in matrix_appservice_kakaotalk_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-kakaotalk-node
{% endfor %}
{% endif %}
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-appservice-kakaotalk-node
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-appservice-kakaotalk-node 2>/dev/null || true'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-appservice-kakaotalk-node 2>/dev/null || true'
Restart=always
RestartSec=30
SyslogIdentifier=matrix-appservice-kakaotalk-node
[Install]
WantedBy=multi-user.target
@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2022 - 2025 Slavi Pantaleev
SPDX-License-Identifier: AGPL-3.0-or-later
@@ -1,49 +0,0 @@
#jinja2: lstrip_blocks: True
[Unit]
Description=appservice-kakaotalk bridge
{% for service in matrix_appservice_kakaotalk_systemd_required_services_list %}
Requires={{ service }}
After={{ service }}
{% endfor %}
{% for service in matrix_appservice_kakaotalk_systemd_wanted_services_list %}
Wants={{ service }}
{% endfor %}
DefaultDependencies=no
[Service]
Type=simple
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-appservice-kakaotalk 2>/dev/null || true'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-appservice-kakaotalk 2>/dev/null || true'
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--rm \
--name=matrix-appservice-kakaotalk \
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--network={{ matrix_appservice_kakaotalk_container_network }} \
--mount type=bind,src={{ matrix_appservice_kakaotalk_config_path }},dst=/config,ro \
--mount type=bind,src={{ matrix_appservice_kakaotalk_data_path }},dst=/data \
{% for arg in matrix_appservice_kakaotalk_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ matrix_appservice_kakaotalk_container_image }} \
python3 -m matrix_appservice_kakaotalk -c /config/config.yaml --no-update
{% if matrix_appservice_kakaotalk_container_network != 'host' %}
{% for network in matrix_appservice_kakaotalk_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-kakaotalk
{% endfor %}
{% endif %}
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-appservice-kakaotalk
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-appservice-kakaotalk 2>/dev/null || true'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-appservice-kakaotalk 2>/dev/null || true'
Restart=always
RestartSec=30
SyslogIdentifier=matrix-appservice-kakaotalk
[Install]
WantedBy=multi-user.target
@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2022 Slavi Pantaleev
SPDX-License-Identifier: AGPL-3.0-or-later
@@ -723,6 +723,18 @@
The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_bot_matrix_registration_bot_.+', wantlist=True) | join(', ') }}
when: "lookup('ansible.builtin.varnames', '^matrix_bot_matrix_registration_bot_.+', wantlist=True) | length > 0"
- name: (Deprecation) Catch and report matrix-appservice-kakaotalk variables
ansible.builtin.fail:
msg: |-
matrix-appservice-kakaotalk was completely removed from the playbook in July 2026, because its upstream repository became unreachable and the component could only be installed by self-building it.
Please remove all `matrix_appservice_kakaotalk_*` variables from your configuration file (vars.yml).
You may also wish to uninstall the component manually. See `docs/configuring-playbook-bridge-appservice-kakaotalk.md` for more information.
The following variables in your configuration need to be removed: {{ lookup('ansible.builtin.varnames', '^matrix_appservice_kakaotalk_.+', wantlist=True) | join(', ') }}
when: "lookup('ansible.builtin.varnames', '^matrix_appservice_kakaotalk_.+', wantlist=True) | length > 0"
- name: (Deprecation) Catch and report matrix-ldap-registration-proxy variables
ansible.builtin.fail:
msg: |-