diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e528bcf..c8d31aba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # 2022-07-14 +## mx-puppet-skype removal + +The playbook no longer includes the [mx-puppet-skype](https://github.com/Sorunome/mx-puppet-skype) bridge, because it has been broken and unmaintaned for a long time. Users that have `matrix_mx_puppet_skype_enabled` in their configuration files will encounter an error when running the playbook until they remove references to this bridge from their configuration. + +To completely clean up your server from `mx-puppet-skype`'s presence on it: + +- ensure your Ansible configuration (`vars.yml` file) no longer contains `matrix_mx_puppet_skype_*` references +- stop and disable the systemd service (run `systemctl disable --now matrix-mx-puppet-skype` on the server) +- delete the systemd service (run `rm /etc/systemd/system/matrix-mx-puppet-skype.service` on the server) +- delete `/matrix/mx-puppet-skype` (run `rm -rf /matrix/mx-puppet-skype` on the server) +- drop the `matrix_mx_puppet_skype` database (run `/usr/local/bin/matrix-postgres-cli` on the server, and execute the `DROP DATABASE matrix_mx_puppet_skype;` query there) + +If you still need bridging to [Skype](https://www.skype.com/), consider switching to [go-skype-bridge](https://github.com/kelaresg/go-skype-bridge) instead. See [Setting up Go Skype Bridge bridging](docs/configuring-playbook-bridge-go-skype-bridge.md). + +If you think this is a mistake and `mx-puppet-skype` works for you (or you get it to work somehow), let us know and we may reconsider this removal. + + ## signald (0.19.0+) upgrade requires data migration In [Pull Request #1921](https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/1921) we upgraded [signald](https://signald.org/) (used by the mautrix-signal bridge) from `v0.18.5` to `v0.20.0`. diff --git a/README.md b/README.md index 4347b128..251df043 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,6 @@ Using this playbook, you can get the following services configured on your serve - (optional) the [Heisenbridge](https://github.com/hifi/heisenbridge) for bridging your Matrix server to IRC bouncer-style - see [docs/configuring-playbook-bridge-heisenbridge.md](docs/configuring-playbook-bridge-heisenbridge.md) for setup documentation -- (optional) the [mx-puppet-skype](https://hub.docker.com/r/sorunome/mx-puppet-skype) for bridging your Matrix server to [Skype](https://www.skype.com) - see [docs/configuring-playbook-bridge-mx-puppet-skype.md](docs/configuring-playbook-bridge-mx-puppet-skype.md) for setup documentation - - (optional) the [go-skype-bridge](https://github.com/kelaresg/go-skype-bridge) for bridging your Matrix server to [Skype](https://www.skype.com) - see [docs/configuring-playbook-bridge-go-skype-bridge.md](docs/configuring-playbook-bridge-go-skype-bridge.md) for setup documentation - (optional) the [mx-puppet-slack](https://hub.docker.com/r/sorunome/mx-puppet-slack) for bridging your Matrix server to [Slack](https://slack.com) - see [docs/configuring-playbook-bridge-mx-puppet-slack.md](docs/configuring-playbook-bridge-mx-puppet-slack.md) for setup documentation diff --git a/docs/configuring-playbook-bridge-mx-puppet-skype.md b/docs/configuring-playbook-bridge-mx-puppet-skype.md index ff4e636e..c80b1af8 100644 --- a/docs/configuring-playbook-bridge-mx-puppet-skype.md +++ b/docs/configuring-playbook-bridge-mx-puppet-skype.md @@ -1,32 +1,5 @@ # Setting up MX Puppet Skype (optional) -**Note**: bridging to [Skype](https://www.skype.com/) can also happen via the [go-skype-bridge](configuring-playbook-bridge-go-skype-bridge.md) bridge supported by the playbook. In fact, bridging via `mx-puppet-skype` has often been reported as broken, so we recommend that you go directly for `go-skype-bridge`, instead of this. +The playbook used to be able to install and configure [mx-puppet-skype](https://github.com/Sorunome/mx-puppet-skype), but no longer includes this component, because it has been broken and unmaintaned for a long time. -The playbook can install and configure -[mx-puppet-skype](https://github.com/Sorunome/mx-puppet-skype) for you. - -See the project page to learn what it does and why it might be useful to you. - -To enable the [Skype](https://www.skype.com/) bridge just use the following -playbook configuration: - - -```yaml -matrix_mx_puppet_skype_enabled: true -``` - - -## Usage - -Once the bot is enabled you need to start a chat with `Skype Puppet Bridge` with -the handle `@_skypepuppet_bot:YOUR_DOMAIN` (where `YOUR_DOMAIN` is your base -domain, not the `matrix.` domain). - -Send `link ` to the bridge bot to link your skype account. - -Once logged in, send `list` to the bot user to list the available rooms. - -Clicking rooms in the list will result in you receiving an invitation to the -bridged room. - -Also send `help` to the bot to see the commands available. +Bridging to [Skype](https://www.skype.com/) can also happen via the [go-skype-bridge](configuring-playbook-bridge-go-skype-bridge.md) bridge supported by the playbook. diff --git a/docs/configuring-playbook.md b/docs/configuring-playbook.md index f71a23f5..c7804d39 100644 --- a/docs/configuring-playbook.md +++ b/docs/configuring-playbook.md @@ -120,7 +120,7 @@ When you're done with all the configuration you'd like to do, continue with [Ins - [Setting up matrix-hookshot](configuring-playbook-bridge-hookshot.md) - a bridge between Matrix and multiple project management services, such as [GitHub](https://github.com), [GitLab](https://about.gitlab.com) and [JIRA](https://www.atlassian.com/software/jira). (optional) -- [Setting up MX Puppet Skype bridging](configuring-playbook-bridge-mx-puppet-skype.md) (optional) - often reported as broken; see **Go Skype Bridge** (below) as an alternative +- ~~[Setting up MX Puppet Skype bridging](configuring-playbook-bridge-mx-puppet-skype.md)~~ (optional) - this component has been broken for a long time, so it has been removed from the playbook. Consider [Setting up MX Puppet Skype bridging](configuring-playbook-bridge-mx-puppet-skype.md) instead - [Setting up MX Puppet Slack bridging](configuring-playbook-bridge-mx-puppet-slack.md) (optional) diff --git a/docs/container-images.md b/docs/container-images.md index 25005d5a..a587d932 100644 --- a/docs/container-images.md +++ b/docs/container-images.md @@ -68,8 +68,6 @@ These services are not part of our default installation, but can be enabled by [ - [folivonet/matrix-sms-bridge](https://hub.docker.com/repository/docker/folivonet/matrix-sms-bridge) - the [matrix-sms-bridge](https://github.com/benkuly/matrix-sms-bridge) (optional) -- [sorunome/mx-puppet-skype](https://hub.docker.com/r/sorunome/mx-puppet-skype) - the [mx-puppet-skype](https://github.com/Sorunome/mx-puppet-skype) bridge to [Skype](https://www.skype.com) (optional) - - [sorunome/mx-puppet-slack](https://hub.docker.com/r/sorunome/mx-puppet-slack) - the [mx-puppet-slack](https://github.com/Sorunome/mx-puppet-slack) bridge to [Slack](https://slack.com) (optional) - [sorunome/mx-puppet-instagram](https://hub.docker.com/r/sorunome/mx-puppet-instagram) - the [mx-puppet-instagram](https://github.com/Sorunome/mx-puppet-instagram) bridge to [Instagram](https://www.instagram.com) (optional) diff --git a/docs/self-building.md b/docs/self-building.md index 9cb5bf2a..ab6e17d3 100644 --- a/docs/self-building.md +++ b/docs/self-building.md @@ -33,7 +33,6 @@ List of roles where self-building the Docker image is currently possible: - `matrix-bridge-mautrix-telegram` - `matrix-bridge-mautrix-signal` - `matrix-bridge-mautrix-whatsapp` -- `matrix-bridge-mx-puppet-skype` - `matrix-bridge-mx-puppet-steam` - `matrix-bot-mjolnir` - `matrix-bot-honoroit` diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 25d0a0e1..221662c5 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -729,44 +729,6 @@ matrix_hookshot_urlprefix: "http{{ 's' if matrix_nginx_proxy_https_enabled else # ###################################################################### -###################################################################### -# -# matrix-bridge-mx-puppet-skype -# -###################################################################### - -# We don't enable bridges by default. -matrix_mx_puppet_skype_enabled: false - -matrix_mx_puppet_skype_container_image_self_build: "{{ matrix_architecture != 'amd64' }}" - -matrix_mx_puppet_skype_systemd_required_services_list: | - {{ - ['docker.service'] - + - ['matrix-' + matrix_homeserver_implementation + '.service'] - + - (['matrix-postgres.service'] if matrix_postgres_enabled else []) - + - (['matrix-nginx-proxy.service'] if matrix_nginx_proxy_enabled else []) - }} - -matrix_mx_puppet_skype_appservice_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'skype.as.tok') | to_uuid }}" - -matrix_mx_puppet_skype_homeserver_token: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'skype.hs.tok') | to_uuid }}" - -matrix_mx_puppet_skype_login_shared_secret: "{{ matrix_synapse_ext_password_provider_shared_secret_auth_shared_secret if matrix_synapse_ext_password_provider_shared_secret_auth_enabled else '' }}" - -# Postgres is the default, except if not using `matrix_postgres` (internal postgres) -matrix_mx_puppet_skype_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}" -matrix_mx_puppet_skype_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'mxpup.skype.db') | to_uuid }}" - -###################################################################### -# -# /matrix-bridge-mx-puppet-skype -# -###################################################################### - ###################################################################### # @@ -1863,12 +1825,6 @@ matrix_postgres_additional_databases: | 'password': matrix_mautrix_whatsapp_database_password, }] if (matrix_mautrix_whatsapp_enabled and matrix_mautrix_whatsapp_database_engine == 'postgres' and matrix_mautrix_whatsapp_database_hostname == 'matrix-postgres') else []) + - ([{ - 'name': matrix_mx_puppet_skype_database_name, - 'username': matrix_mx_puppet_skype_database_username, - 'password': matrix_mx_puppet_skype_database_password, - }] if (matrix_mx_puppet_skype_enabled and matrix_mx_puppet_skype_database_engine == 'postgres' and matrix_mx_puppet_skype_database_hostname == 'matrix-postgres') else []) - + ([{ 'name': matrix_mx_puppet_slack_database_name, 'username': matrix_mx_puppet_slack_database_username, diff --git a/roles/matrix-base/tasks/sanity_check.yml b/roles/matrix-base/tasks/sanity_check.yml index f78510d7..98fa2738 100644 --- a/roles/matrix-base/tasks/sanity_check.yml +++ b/roles/matrix-base/tasks/sanity_check.yml @@ -79,3 +79,13 @@ when: (ansible_architecture == "x86_64" and matrix_architecture != "amd64") or (ansible_architecture == "aarch64" and matrix_architecture != "arm64") or (ansible_architecture.startswith("armv") and matrix_architecture != "arm32") + +- name: Fail if encountering usage of removed role (mx-puppet-skype) + fail: + msg: >- + Your configuration seems to include a reference to `matrix_mx_puppet_skype_enabled`. Are you trying to install the mx-puppet-skype bridge? + The playbook no longer includes a role for installing mx-puppet-skype, because the mx-puppet-bridge is unmaintained and has been reported as broken for a long time. + To get rid of this error, remove all `matrix_mx_puppet_*` references from your configuration. + To clean up your server from mx-puppet-skype's presence, see this changelog entry: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/CHANGELOG.md#mx-puppet-skype-removal. + If you still need bridging to Skype, consider switching to the go-skype bridge instead. See `docs/configuring-playbook-bridge-go-skype-bridge.md`. + when: "'matrix_mx_puppet_skype_enabled' in vars" diff --git a/roles/matrix-bridge-mx-puppet-skype/defaults/main.yml b/roles/matrix-bridge-mx-puppet-skype/defaults/main.yml deleted file mode 100644 index 905e5086..00000000 --- a/roles/matrix-bridge-mx-puppet-skype/defaults/main.yml +++ /dev/null @@ -1,112 +0,0 @@ ---- -# Mx Puppet Skype is a Matrix <-> Skype bridge -# See: https://github.com/Sorunome/mx-puppet-skype - -matrix_mx_puppet_skype_enabled: true - -matrix_mx_puppet_skype_container_image_self_build: false -matrix_mx_puppet_skype_container_image_self_build_repo: "https://github.com/Sorunome/mx-puppet-skype.git" - -matrix_mx_puppet_skype_version: latest -matrix_mx_puppet_skype_docker_image: "{{ matrix_mx_puppet_skype_docker_image_name_prefix }}sorunome/mx-puppet-skype:{{ matrix_mx_puppet_skype_version }}" -matrix_mx_puppet_skype_docker_image_name_prefix: "{{ 'localhost/' if matrix_mx_puppet_skype_container_image_self_build else matrix_container_global_registry_prefix }}" -matrix_mx_puppet_skype_docker_image_force_pull: "{{ matrix_mx_puppet_skype_docker_image.endswith(':latest') }}" - -matrix_mx_puppet_skype_base_path: "{{ matrix_base_data_path }}/mx-puppet-skype" -matrix_mx_puppet_skype_config_path: "{{ matrix_mx_puppet_skype_base_path }}/config" -matrix_mx_puppet_skype_data_path: "{{ matrix_mx_puppet_skype_base_path }}/data" -matrix_mx_puppet_skype_docker_src_files_path: "{{ matrix_mx_puppet_skype_base_path }}/docker-src" - -matrix_mx_puppet_skype_appservice_port: "8438" - -matrix_mx_puppet_skype_homeserver_address: "{{ matrix_homeserver_container_url }}" -matrix_mx_puppet_skype_appservice_address: 'http://matrix-mx-puppet-skype:{{ matrix_mx_puppet_skype_appservice_port }}' - -# "@user:server.com" to allow specific user -# "@.*:yourserver.com" to allow users on a specific homeserver -# "@.*" to allow anyone -matrix_mx_puppet_skype_provisioning_whitelist: - - "@.*:{{ matrix_domain|regex_escape }}" - -# Leave empty to disable blacklist -# "@user:server.com" disallow a specific user -# "@.*:yourserver.com" disallow users on a specific homeserver -matrix_mx_puppet_skype_provisioning_blacklist: [] - -# Same as provisioning -matrix_mx_puppet_skype_relay_whitelist: - - "@.*:{{ matrix_domain|regex_escape }}" - -# Same as provisioning -matrix_mx_puppet_skype_relay_blacklist: [] - -# A list of extra arguments to pass to the container -matrix_mx_puppet_skype_container_extra_arguments: [] - -# List of systemd services that matrix-puppet-skype.service depends on. -matrix_mx_puppet_skype_systemd_required_services_list: ['docker.service'] - -# List of systemd services that matrix-puppet-skype.service wants -matrix_mx_puppet_skype_systemd_wanted_services_list: [] - -matrix_mx_puppet_skype_appservice_token: '' -matrix_mx_puppet_skype_homeserver_token: '' - -# Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth). -matrix_mx_puppet_skype_login_shared_secret: '' - -# Database configuration, role default is `sqlite` but playbook default is `postgres` -matrix_mx_puppet_skype_database_engine: sqlite - -matrix_mx_puppet_skype_sqlite_database_path_local: "{{ matrix_mx_puppet_skype_data_path }}/database.db" -matrix_mx_puppet_skype_sqlite_database_path_in_container: "/data/database.db" - -matrix_mx_puppet_skype_database_username: matrix_mx_puppet_skype -matrix_mx_puppet_skype_database_password: ~ -matrix_mx_puppet_skype_database_hostname: 'matrix-postgres' -matrix_mx_puppet_skype_database_port: 5432 -matrix_mx_puppet_skype_database_name: matrix_mx_puppet_skype - -matrix_mx_puppet_skype_database_connection_string: 'postgresql://{{ matrix_mx_puppet_skype_database_username }}:{{ matrix_mx_puppet_skype_database_password }}@{{ matrix_mx_puppet_skype_database_hostname }}:{{ matrix_mx_puppet_skype_database_port }}/{{ matrix_mx_puppet_skype_database_name }}?sslmode=disable' - -# 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_mx_puppet_skype_configuration_extension_yaml`) -# or completely replace this variable with your own template. -matrix_mx_puppet_skype_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" - -matrix_mx_puppet_skype_configuration_extension_yaml: | - # Your custom YAML configuration goes here. - # This configuration extends the default starting configuration (`matrix_mx_puppet_skype_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_mx_puppet_skype_configuration_yaml`. - -matrix_mx_puppet_skype_configuration_extension: "{{ matrix_mx_puppet_skype_configuration_extension_yaml|from_yaml if matrix_mx_puppet_skype_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_mx_puppet_skype_configuration_yaml`. -matrix_mx_puppet_skype_configuration: "{{ matrix_mx_puppet_skype_configuration_yaml|from_yaml|combine(matrix_mx_puppet_skype_configuration_extension, recursive=True) }}" - -matrix_mx_puppet_skype_registration_yaml: | - as_token: "{{ matrix_mx_puppet_skype_appservice_token }}" - hs_token: "{{ matrix_mx_puppet_skype_homeserver_token }}" - id: skype-puppet - namespaces: - users: - - exclusive: true - regex: '@_skypepuppet_.*:{{ matrix_domain|regex_escape }}' - rooms: [] - aliases: - - exclusive: true - regex: '#_skypepuppet_.*:{{ matrix_domain|regex_escape }}' - protocols: [] - rate_limited: false - sender_localpart: _skypepuppet_bot - url: {{ matrix_mx_puppet_skype_appservice_address }} - de.sorunome.msc2409.push_ephemeral: true - -matrix_mx_puppet_skype_registration: "{{ matrix_mx_puppet_skype_registration_yaml|from_yaml }}" diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/init.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/init.yml deleted file mode 100644 index 699ad6f6..00000000 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/init.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070 -# and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407 -- name: Fail if trying to self-build on Ansible < 2.8 - fail: - msg: "To self-build the Element image, you should use Ansible 2.8 or higher. See docs/ansible.md" - when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_mx_puppet_skype_container_image_self_build and matrix_mx_puppet_skype_enabled" - -- set_fact: - matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mx-puppet-skype.service'] }}" - when: matrix_mx_puppet_skype_enabled|bool - -# If the matrix-synapse role is not used, these variables may not exist. -- set_fact: - matrix_synapse_container_extra_arguments: > - {{ - matrix_synapse_container_extra_arguments|default([]) - + - ["--mount type=bind,src={{ matrix_mx_puppet_skype_config_path }}/registration.yaml,dst=/matrix-mx-puppet-skype-registration.yaml,ro"] - }} - - matrix_synapse_app_service_config_files: > - {{ - matrix_synapse_app_service_config_files|default([]) - + - ["/matrix-mx-puppet-skype-registration.yaml"] - }} - when: matrix_mx_puppet_skype_enabled|bool diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/main.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/main.yml deleted file mode 100644 index 0793e994..00000000 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/main.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- - -- import_tasks: "{{ role_path }}/tasks/init.yml" - tags: - - always - -- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - when: "run_setup|bool and matrix_mx_puppet_skype_enabled|bool" - tags: - - setup-all - - setup-mx-puppet-skype - -- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - when: "run_setup|bool and matrix_mx_puppet_skype_enabled|bool" - tags: - - setup-all - - setup-mx-puppet-skype - -- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - when: "run_setup|bool and not matrix_mx_puppet_skype_enabled|bool" - tags: - - setup-all - - setup-mx-puppet-skype diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/setup_install.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/setup_install.yml deleted file mode 100644 index 96ae82e6..00000000 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/setup_install.yml +++ /dev/null @@ -1,135 +0,0 @@ ---- - -# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. -# We don't want to fail in such cases. -- name: Fail if matrix-synapse role already executed - fail: - msg: >- - The matrix-bridge-mx-puppet-skype role needs to execute before the matrix-synapse role. - when: "matrix_synapse_role_executed|default(False)" - -- name: Ensure MX Puppet Skype paths exist - file: - path: "{{ item.path }}" - state: directory - mode: 0750 - owner: "{{ matrix_user_username }}" - group: "{{ matrix_user_groupname }}" - with_items: - - {path: "{{ matrix_mx_puppet_skype_base_path }}", when: true} - - {path: "{{ matrix_mx_puppet_skype_config_path }}", when: true} - - {path: "{{ matrix_mx_puppet_skype_data_path }}", when: true} - - {path: "{{ matrix_mx_puppet_skype_docker_src_files_path }}", when: "{{ matrix_mx_puppet_skype_container_image_self_build }}"} - when: matrix_mx_puppet_skype_enabled|bool and item.when|bool - -- name: Check if an old database file already exists - stat: - path: "{{ matrix_mx_puppet_skype_base_path }}/database.db" - register: matrix_mx_puppet_skype_stat_database - -- name: (Data relocation) Ensure matrix-mx-puppet-skype.service is stopped - service: - name: matrix-mx-puppet-skype - state: stopped - enabled: false - daemon_reload: true - failed_when: false - when: "matrix_mx_puppet_skype_stat_database.stat.exists" - -- name: (Data relocation) Move mx-puppet-skype database file to ./data directory - command: "mv {{ matrix_mx_puppet_skype_base_path }}/database.db {{ matrix_mx_puppet_skype_data_path }}/database.db" - when: "matrix_mx_puppet_skype_stat_database.stat.exists" - -- set_fact: - matrix_mx_puppet_skype_requires_restart: false - -- block: - - name: Check if an SQLite database already exists - stat: - path: "{{ matrix_mx_puppet_skype_sqlite_database_path_local }}" - register: matrix_mx_puppet_skype_sqlite_database_path_local_stat_result - - - block: - - set_fact: - matrix_postgres_db_migration_request: - src: "{{ matrix_mx_puppet_skype_sqlite_database_path_local }}" - dst: "{{ matrix_mx_puppet_skype_database_connection_string }}" - caller: "{{ role_path|basename }}" - engine_variable_name: 'matrix_mx_puppet_skype_database_engine' - engine_old: 'sqlite' - systemd_services_to_stop: ['matrix-mx-puppet-skype.service'] - - - import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml" - - - set_fact: - matrix_mx_puppet_skype_requires_restart: true - when: "matrix_mx_puppet_skype_sqlite_database_path_local_stat_result.stat.exists|bool" - when: "matrix_mx_puppet_skype_database_engine == 'postgres'" - -- name: Ensure MX Puppet Skype image is pulled - docker_image: - name: "{{ matrix_mx_puppet_skype_docker_image }}" - source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" - force_source: "{{ matrix_mx_puppet_skype_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mx_puppet_skype_docker_image_force_pull }}" - when: matrix_mx_puppet_skype_enabled|bool and not matrix_mx_puppet_skype_container_image_self_build - register: result - retries: "{{ matrix_container_retries_count }}" - delay: "{{ matrix_container_retries_delay }}" - until: result is not failed - -- name: Ensure MX Puppet Skype repository is present on self build - git: - repo: "{{ matrix_mx_puppet_skype_container_image_self_build_repo }}" - dest: "{{ matrix_mx_puppet_skype_docker_src_files_path }}" - force: "yes" - become: true - become_user: "{{ matrix_user_username }}" - register: matrix_mx_puppet_skype_git_pull_results - when: "matrix_mx_puppet_skype_enabled|bool and matrix_mx_puppet_skype_container_image_self_build|bool" - -- name: Ensure MX Puppet Skype Docker image is built - docker_image: - name: "{{ matrix_mx_puppet_skype_docker_image }}" - source: build - force_source: "{{ matrix_mx_puppet_skype_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" - force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mx_puppet_skype_git_pull_results.changed }}" - build: - dockerfile: Dockerfile - path: "{{ matrix_mx_puppet_skype_docker_src_files_path }}" - pull: true - when: "matrix_mx_puppet_skype_enabled|bool and matrix_mx_puppet_skype_container_image_self_build|bool" - -- name: Ensure mx-puppet-skype config.yaml installed - copy: - content: "{{ matrix_mx_puppet_skype_configuration|to_nice_yaml(indent=2, width=999999) }}" - dest: "{{ matrix_mx_puppet_skype_config_path }}/config.yaml" - mode: 0644 - owner: "{{ matrix_user_username }}" - group: "{{ matrix_user_groupname }}" - -- name: Ensure mx-puppet-skype skype-registration.yaml installed - copy: - content: "{{ matrix_mx_puppet_skype_registration|to_nice_yaml(indent=2, width=999999) }}" - dest: "{{ matrix_mx_puppet_skype_config_path }}/registration.yaml" - mode: 0644 - owner: "{{ matrix_user_username }}" - group: "{{ matrix_user_groupname }}" - -- name: Ensure matrix-mx-puppet-skype.service installed - template: - src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-skype.service.j2" - dest: "/etc/systemd/system/matrix-mx-puppet-skype.service" - mode: 0644 - register: matrix_mx_puppet_skype_systemd_service_result - -- name: Ensure systemd reloaded after matrix-mx-puppet-skype.service installation - service: - daemon_reload: true - when: "matrix_mx_puppet_skype_systemd_service_result.changed" - -- name: Ensure matrix-mx-puppet-skype.service restarted, if necessary - service: - name: "matrix-mx-puppet-skype.service" - state: restarted - when: "matrix_mx_puppet_skype_requires_restart|bool" diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/setup_uninstall.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/setup_uninstall.yml deleted file mode 100644 index 838c3be5..00000000 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/setup_uninstall.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: Check existence of matrix-mx-puppet-skype service - stat: - path: "/etc/systemd/system/matrix-mx-puppet-skype.service" - register: matrix_mx_puppet_skype_service_stat - -- name: Ensure matrix-mx-puppet-skype is stopped - service: - name: matrix-mx-puppet-skype - state: stopped - enabled: false - daemon_reload: true - when: "matrix_mx_puppet_skype_service_stat.stat.exists" - -- name: Ensure matrix-mx-puppet-skype.service doesn't exist - file: - path: "/etc/systemd/system/matrix-mx-puppet-skype.service" - state: absent - when: "matrix_mx_puppet_skype_service_stat.stat.exists" - -- name: Ensure systemd reloaded after matrix-mx-puppet-skype.service removal - service: - daemon_reload: true - when: "matrix_mx_puppet_skype_service_stat.stat.exists" diff --git a/roles/matrix-bridge-mx-puppet-skype/tasks/validate_config.yml b/roles/matrix-bridge-mx-puppet-skype/tasks/validate_config.yml deleted file mode 100644 index 7ed433b1..00000000 --- a/roles/matrix-bridge-mx-puppet-skype/tasks/validate_config.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Fail if required settings not defined - fail: - msg: >- - You need to define a required configuration setting (`{{ item }}`). - when: "vars[item] == ''" - with_items: - - "matrix_mx_puppet_skype_appservice_token" - - "matrix_mx_puppet_skype_homeserver_token" diff --git a/roles/matrix-bridge-mx-puppet-skype/templates/config.yaml.j2 b/roles/matrix-bridge-mx-puppet-skype/templates/config.yaml.j2 deleted file mode 100644 index 647f8fc7..00000000 --- a/roles/matrix-bridge-mx-puppet-skype/templates/config.yaml.j2 +++ /dev/null @@ -1,118 +0,0 @@ -#jinja2: lstrip_blocks: "True" -bridge: - # Address for the bridge to bind to; if running as a Docker container, you - # probably want 0.0.0.0 here - bindAddress: 0.0.0.0 - # Port to host the bridge on which your homeserver will connect to - port: {{ matrix_mx_puppet_skype_appservice_port }} - # Name of your homeserver - domain: {{ matrix_domain }} - # URL where the bridge can connect to your homeserver - homeserverUrl: {{ matrix_mx_puppet_skype_homeserver_address }} - # Optionally specify a different media URL used for the media store - mediaURL: https://{{ matrix_server_fqn_matrix }} - # This enabled automatic double-puppeting: - # A map for shared secrets of the homeserver URL to the shared secret - # See https://github.com/devture/matrix-synapse-shared-secret-auth - #loginSharedSecretMap: - # yourserver.com: supersecretsharedsecret - {% if matrix_mx_puppet_skype_login_shared_secret != '' %} - loginSharedSecretMap: - {{ matrix_domain }}: {{ matrix_mx_puppet_skype_login_shared_secret }} - {% endif %} - # optionally override the display name of the bridge bot - #displayname: Protocol Bot - # optionally set the avatar of the bridge bot - #avatarUrl: mxc://yourserver.com/somefile - -logging: - # Log level of console output - # Allowed values starting with most verbose: - # silly, debug, verbose, info, warn, error - console: warn - # Optionally, you can apply filters to the console logging - #console: - # level: info - # enabled: - # - Store - # disabled: - # - PresenceHandler - - # Date and time formatting - lineDateFormat: MMM-D HH:mm:ss.SSS - # Logging files - # Log files are rotated daily by default - files: [] - -database: -{% if matrix_mx_puppet_skype_database_engine == 'postgres' %} - # Use Postgres as a database backend - # If set, will be used instead of SQLite3 - # Connection string to connect to the Postgres instance - # with username "user", password "pass", host "localhost" and database name "dbname". - # Modify each value as necessary - connString: {{ matrix_mx_puppet_skype_database_connection_string|to_json }} -{% else %} - # Use SQLite3 as a database backend - # The name of the database file - filename: {{ matrix_mx_puppet_skype_sqlite_database_path_in_container|to_json }} -{% endif %} - -provisioning: - # Regex of Matrix IDs allowed to use the puppet bridge - whitelist: {{ matrix_mx_puppet_skype_provisioning_whitelist|to_json }} - # Allow a specific user - #- "@user:server\\.com" - # Allow users on a specific homeserver - #- "@.*:yourserver\\.com" - # Allow anyone - #- ".*" - - # Regex of Matrix IDs forbidden from using the puppet bridge - #blacklist: - # Disallow a specific user - #- "@user:server\\.com" - # Disallow users on a specific homeserver - #- "@.*:yourserver\\.com" - blacklist: {{ matrix_mx_puppet_skype_provisioning_blacklist|to_json }} - -presence: - # Bridge online/offline status - enabled: true - # How often to send status to the homeserver in milliseconds - interval: 5000 - # if the im.vector.user_status state setting should be diabled - #disableStatusState: false - # A blacklist of remote user IDs for the im.vector.user_status state setting - #statusStateBlacklist: - # - baduser - -relay: - # Regex of Matrix IDs to allow to use the relay mode - # Same format as in provisioning - #whitelist: - #- "@.*:yourserver\\.com" - whitelist: {{ matrix_mx_puppet_skype_relay_whitelist|to_json }} - - #blacklist: - #- "@user:yourserver\\.com" - blacklist: {{ matrix_mx_puppet_skype_relay_blacklist|to_json }} - -# Map certain homeserver URLs to the C-S API endpoint -# Useful for double-puppeting if .well-known is unavailable for some reason -#homeserverUrlMap: -# yourserver.com: http://localhost:1234 - -namePatterns: - # Override the protocols set default name patterns - # Which variables are available depends on protocol implementation - user: :name - room: :name - -limits: - # Up to how many users should be auto-joined on room creation? -1 to disable - # Defaults to 200 - maxAutojoinUsers: 200 - # How long the delay between two autojoin users should be, in millisectonds. - # Defaults to 5000 - roomUserAutojoinDelay: 5000 diff --git a/roles/matrix-bridge-mx-puppet-skype/templates/systemd/matrix-mx-puppet-skype.service.j2 b/roles/matrix-bridge-mx-puppet-skype/templates/systemd/matrix-mx-puppet-skype.service.j2 deleted file mode 100644 index ec06485a..00000000 --- a/roles/matrix-bridge-mx-puppet-skype/templates/systemd/matrix-mx-puppet-skype.service.j2 +++ /dev/null @@ -1,43 +0,0 @@ -#jinja2: lstrip_blocks: "True" -[Unit] -Description=Matrix Mx Puppet Skype bridge -{% for service in matrix_mx_puppet_skype_systemd_required_services_list %} -Requires={{ service }} -After={{ service }} -{% endfor %} -{% for service in matrix_mx_puppet_skype_systemd_wanted_services_list %} -Wants={{ service }} -{% endfor %} -DefaultDependencies=no - -[Service] -Type=simple -Environment="HOME={{ matrix_systemd_unit_home_path }}" -ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mx-puppet-skype 2>/dev/null || true' -ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mx-puppet-skype 2>/dev/null || true' - -# Intentional delay, so that the homeserver (we likely depend on) can manage to start. -ExecStartPre={{ matrix_host_command_sleep }} 5 - -ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mx-puppet-skype \ - --log-driver=none \ - --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ - --cap-drop=ALL \ - --network={{ matrix_docker_network }} \ - -e CONFIG_PATH=/config/config.yaml \ - -e REGISTRATION_PATH=/config/registration.yaml \ - -v {{ matrix_mx_puppet_skype_config_path }}:/config:z \ - -v {{ matrix_mx_puppet_skype_data_path }}:/data:z \ - {% for arg in matrix_mx_puppet_skype_container_extra_arguments %} - {{ arg }} \ - {% endfor %} - {{ matrix_mx_puppet_skype_docker_image }} - -ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mx-puppet-skype 2>/dev/null || true' -ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mx-puppet-skype 2>/dev/null || true' -Restart=always -RestartSec=30 -SyslogIdentifier=matrix-mx-puppet-skype - -[Install] -WantedBy=multi-user.target diff --git a/setup.yml b/setup.yml index c99da4d1..64e0d90d 100755 --- a/setup.yml +++ b/setup.yml @@ -30,7 +30,6 @@ - matrix-bridge-mx-puppet-discord - matrix-bridge-mx-puppet-groupme - matrix-bridge-mx-puppet-steam - - matrix-bridge-mx-puppet-skype - matrix-bridge-mx-puppet-slack - matrix-bridge-mx-puppet-twitter - matrix-bridge-mx-puppet-instagram