From 993121e517ad74548d20ef4d0de1db41930acb22 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 1 Jan 2022 03:08:00 +0000 Subject: [PATCH 1/2] feat(etherpad): add optional admin web-UI access Enables optional access to Etherpad's web-UI. This is useful for managing Etherpad plugins. Among other things, plugins makes it easy to manage/delete pads if you install the adminpads2 plugin. --- docs/configuring-playbook-etherpad.md | 17 +++++++++++++++++ roles/matrix-etherpad/defaults/main.yml | 5 +++++ .../matrix-etherpad/templates/settings.json.j2 | 8 ++++++++ 3 files changed, 30 insertions(+) diff --git a/docs/configuring-playbook-etherpad.md b/docs/configuring-playbook-etherpad.md index e5533e71..4c38bb3c 100644 --- a/docs/configuring-playbook-etherpad.md +++ b/docs/configuring-playbook-etherpad.md @@ -25,6 +25,23 @@ The Dimension administrator users can configure the default URL template. The Di If you wish to disable the Etherpad chat button, you can do it by appending `?showChat=false` to the end of the pad URL, or the template. Example: `https://dimension./etherpad/p/$roomId_$padName?showChat=false` +### Etherpad Admin access (optional) + +Etherpad comes with a admin web-UI which is disabled by default. You can enable it by setting a username and password in your configuration file (`inventory/host_vars/matrix./vars.yml`): + +```yaml +matrix_etherpad_admin_username: admin +matrix_etherpad_admin_password: some-password +``` + +The admin web-UI should then be available on: `https://dimension./etherpad/admin` + +### Managing / Deleting old pads + +If you want to manage and remove old unused pads from Etherpad, you will first need to able Admin access as described above. + +Then from the plugin manager page (`https://dimension./etherpad/admin/plugins`), install the `adminpads2` plugin. Once installed, you should have a "Manage pads" section in the Admin web-UI. + ## Known issues If your Etherpad widget fails to load, this might be due to Dimension generating a Pad name so long, the Etherpad app rejects it. diff --git a/roles/matrix-etherpad/defaults/main.yml b/roles/matrix-etherpad/defaults/main.yml index f04d8589..bcabc3dd 100644 --- a/roles/matrix-etherpad/defaults/main.yml +++ b/roles/matrix-etherpad/defaults/main.yml @@ -41,6 +41,11 @@ matrix_etherpad_database_hostname: 'matrix-postgres' matrix_etherpad_database_port: 5432 matrix_etherpad_database_name: 'matrix_etherpad' +# If a admin username and password is set, the /admin web page will be +# available. +matrix_etherpad_admin_username: '' +matrix_etherpad_admin_password: '' + matrix_etherpad_database_connection_string: 'postgres://{{ matrix_etherpad_database_username }}:{{ matrix_etherpad_database_password }}@{{ matrix_etherpad_database_hostname }}:{{ matrix_etherpad_database_port }}/{{ matrix_etherpad_database_name }}' # Variables configuring the etherpad diff --git a/roles/matrix-etherpad/templates/settings.json.j2 b/roles/matrix-etherpad/templates/settings.json.j2 index 573b445d..01127a91 100644 --- a/roles/matrix-etherpad/templates/settings.json.j2 +++ b/roles/matrix-etherpad/templates/settings.json.j2 @@ -71,6 +71,14 @@ "chatAndUsers": false, "lang": "en-gb" }, +{% if matrix_etherpad_admin_username != "" and matrix_etherpad_admin_password != "" %} + "users": { + "{{ matrix_etherpad_admin_username }}": { + "password": "{{ matrix_etherpad_admin_password }}", + "is_admin": true + } + }, +{% endif %} "padShortcutEnabled" : { "altF9": true, "altC": true, From f0d7a8e99d0210ab62aa3dd1f387fff70bacab74 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 4 Jan 2022 09:18:31 +0200 Subject: [PATCH 2/2] Use to_json --- roles/matrix-etherpad/templates/settings.json.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/matrix-etherpad/templates/settings.json.j2 b/roles/matrix-etherpad/templates/settings.json.j2 index 01127a91..0a240f3e 100644 --- a/roles/matrix-etherpad/templates/settings.json.j2 +++ b/roles/matrix-etherpad/templates/settings.json.j2 @@ -73,8 +73,8 @@ }, {% if matrix_etherpad_admin_username != "" and matrix_etherpad_admin_password != "" %} "users": { - "{{ matrix_etherpad_admin_username }}": { - "password": "{{ matrix_etherpad_admin_password }}", + {{ matrix_etherpad_admin_username|to_json }}: { + "password": {{ matrix_etherpad_admin_password|to_json }}, "is_admin": true } },