From add9e01789a80e0ec40e3ac89799052000ea8847 Mon Sep 17 00:00:00 2001 From: saibotk Date: Mon, 23 Aug 2021 02:11:56 +0200 Subject: [PATCH] matrix: Remove now extracted webhook-appservice BREAKING change: Removes all handling of the webhook-appservice from the matrix main role, which can now be configured using the new matrix_webhooks role. --- roles/matrix/defaults/main.yml | 14 ----------- roles/matrix/handlers/main.yml | 12 ---------- roles/matrix/tasks/main.yml | 43 ---------------------------------- 3 files changed, 69 deletions(-) diff --git a/roles/matrix/defaults/main.yml b/roles/matrix/defaults/main.yml index 33a1611..7f7fba5 100644 --- a/roles/matrix/defaults/main.yml +++ b/roles/matrix/defaults/main.yml @@ -80,17 +80,3 @@ matrix_elementweb_integrations_jitsi_widget_url: "https://scalar.vector.im/api/w # Element Web public room directory server(s) matrix_elementweb_roomdir_servers: ['matrix.org'] - -# Should the appservice-webhooks be enabled? -matrix_webhooks_enabled: true -# The matrix webhooks image tag (see https://hub.docker.com/r/turt2live/matrix-appservice-webhooks/tags?page=1&ordering=last_updated) -matrix_webhooks_image_version: "latest" -# Where should the appservice be installed into? -matrix_webhooks_location: "{{ matrix_install_location}}/webhooks" -# Under which domain should the service be reachable -matrix_webhooks_domain: "webhooks.example.com" -# The Provision API key -matrix_webhooks_provisioning_key: "{{ lookup('passwordstore', matrix_webhooks_domain + '/provisioning-api create=true length=42') }}" -# Webhook user profile (seems to be unused at the moment) -matrix_webhooks_display_name: "Captain Webhook" -matrix_webhooks_avatar: "http://i.imgur.com/IDOBtEJ.png" diff --git a/roles/matrix/handlers/main.yml b/roles/matrix/handlers/main.yml index 92d8564..2d27823 100644 --- a/roles/matrix/handlers/main.yml +++ b/roles/matrix/handlers/main.yml @@ -29,15 +29,3 @@ - docker - matrix become: true - -- name: restart matrix webhooks - docker_compose: - services: - - appservice-webhooks - state: present - project_src: "{{ matrix_install_location }}" - restarted: true - tags: - - docker - - matrix - become: true diff --git a/roles/matrix/tasks/main.yml b/roles/matrix/tasks/main.yml index 54c9b68..2fcbfe3 100644 --- a/roles/matrix/tasks/main.yml +++ b/roles/matrix/tasks/main.yml @@ -29,7 +29,6 @@ - "{{ matrix_database_location }}" - "{{ matrix_data_location }}" - "{{ matrix_elementweb_location }}" - - "{{ matrix_webhooks_location }}" become: true - name: Create install directory @@ -52,7 +51,6 @@ - "{{ matrix_database_location }}" - "{{ matrix_data_location }}" - "{{ matrix_elementweb_location }}" - - "{{ matrix_webhooks_location }}" become: true - name: Deploy docker-compose.yml @@ -110,24 +108,6 @@ - matrix become: true -- name: Deploy webhooks config files - template: - src: "webhooks/{{ item }}" - dest: "{{ matrix_webhooks_location }}/{{ item }}" - setype: "container_file_t" - mode: '0640' - owner: 'root' - group: 'root' - with_items: - - "database.json" - - "config.yaml" - tags: - - docker - - matrix - - webhooks - notify: restart matrix webhooks - become: true - - name: Check if homeserver.yaml (config) exists stat: path: "{{ matrix_data_location }}/homeserver.yaml" @@ -149,29 +129,6 @@ when: - not matrix_synapse_homeserver_yaml.stat.exists -- name: Generate webhooks registration - command: 'docker-compose run appservice-webhooks node index.js -r \ - -f /data/appservice-registration-webhooks.yaml \ - -u "http://appservice-webhooks:9000" -c /data/config.yaml' - args: - chdir: "{{ matrix_install_location }}" - creates: "{{ matrix_webhooks_location }}/appservice-registration-webhooks.yaml" - become: true - when: - - matrix_webhooks_enabled - -- name: Link webhooks registration to synapse folder - copy: - src: "{{ matrix_webhooks_location }}/appservice-registration-webhooks.yaml" - dest: "{{ matrix_data_location }}/appservice-registration-webhooks.yaml" - remote_src: true - mode: '0640' - owner: '991' - group: '991' - become: true - when: - - matrix_webhooks_enabled - - name: Compose matrix docker_compose: state: present