From 5dfb6bfaecc19ead52cd3ffe2dc8c2454c5b23af Mon Sep 17 00:00:00 2001 From: muppeth Date: Fri, 8 Mar 2024 10:46:48 +0100 Subject: [PATCH 01/10] added npm to apt list --- defaults/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/defaults/main.yml b/defaults/main.yml index 45d8b56..3a31cab 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -54,6 +54,7 @@ etherpad_nodejs_version: '18' etherpad_apt: - curl - nodejs + - npm - git etherpad_plugins_list: From 26e8c2d3f76080e712e109be837a81827b575476 Mon Sep 17 00:00:00 2001 From: meaz Date: Tue, 16 Apr 2024 15:08:00 +0200 Subject: [PATCH 02/10] Update to 2.0.2 (#21) I created an issue upstream as there is no possibility to remove modules from cli. The main dev will do is tomorrow normally. So I keep this as WIP at the moment. Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/21 Reviewed-by: muppeth Co-authored-by: meaz Co-committed-by: meaz --- README.MD | 8 ++++++++ Vagrantfile | 2 +- defaults/main.yml | 4 ++-- tasks/configure.yml | 4 ++-- tasks/install.yml | 9 +++++++++ tasks/installdeps.yml | 14 ++++++++++---- tasks/main.yml | 13 ++++++++----- tasks/modules.yml | 14 +------------- templates/etc/systemd/system/etherpad.service.j2 | 2 +- templates/var/www/etherpad-lite/settings.json.j2 | 2 +- 10 files changed, 43 insertions(+), 29 deletions(-) create mode 100644 tasks/install.yml diff --git a/README.MD b/README.MD index 531322d..89d7da7 100644 --- a/README.MD +++ b/README.MD @@ -14,8 +14,16 @@ Then you can access etherpad from your computer on http://192.168.33.8:9001 ## Playbook The playbook includes mariadb role and deploys entire stack needed to run Etherpad-lite. Additional role is also available in the Ansible roles repos in git. +## Tags +You can use tags when you deploy: +- `config`: to deploy just config +- `modules`: to deploy modules + +⚠ Since the v.2.0.2, modules can only be installed, not removed. The devs are working on this: https://github.com/ether/etherpad-lite/issues/6272 So if you need to remove a plugin, log into the admin interface. + ## CHANGELOG +- **14.04.2024** - Bumped version to 2.0.2 and change from npm to pnpm - **26.03.2021** - Bumped version to 1.8.13 and enable ep_adminpads2 - **04.03.2021** - Bumped version to 1.8.11 and adjusted readme file - **21.11.2020** - Make it ready for public release diff --git a/Vagrantfile b/Vagrantfile index 4bc00a9..34773e4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,7 +8,7 @@ Vagrant.configure("2") do |config| #config.ssh.insert_key = false config.vm.define "etherpad" do |etherpad| - etherpad.vm.box = "generic/debian11" + etherpad.vm.box = "generic/debian12" etherpad.vm.provider :libvirt do |libvirt| libvirt.memory = 256 end diff --git a/defaults/main.yml b/defaults/main.yml index 3a31cab..db75396 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -etherpad_version: '1.9.7' +etherpad_version: '2.0.2' etherpad_skin: 'colibris' etherpad_skinVariants: 'super-light-toolbar super-light-editor light-background' etherpad_username: 'etherpad' @@ -50,7 +50,7 @@ etherpad_smtp_host: 'localhost' etherpad_smtp_port: '587' etherpad_smtp_user: 'support' etherpad_smtp_pass: 'changeme' -etherpad_nodejs_version: '18' +etherpad_nodejs_version: '21' etherpad_apt: - curl - nodejs diff --git a/tasks/configure.yml b/tasks/configure.yml index 563558a..8f7d227 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -7,7 +7,7 @@ owner: "{{ etherpad_username }}" group: "{{ etherpad_group }}" mode: 0755 - tags: configuration + tags: config - name: '[CONFIGURE] - Deploy config' template: @@ -18,4 +18,4 @@ mode: 0644 notify: restart etherpad - tags: configuration + tags: config diff --git a/tasks/install.yml b/tasks/install.yml new file mode 100644 index 0000000..3282f5f --- /dev/null +++ b/tasks/install.yml @@ -0,0 +1,9 @@ +--- + +- name: '[INSTALL] - Install with pnpm' + shell: + cmd: pnpm install + args: + chdir: "{{ etherpad_app_dir }}/app" + become: yes + become_user: "{{ etherpad_username }}" diff --git a/tasks/installdeps.yml b/tasks/installdeps.yml index 8eb6676..3264edd 100644 --- a/tasks/installdeps.yml +++ b/tasks/installdeps.yml @@ -1,18 +1,24 @@ --- -- name: '[INSTALLDEPS] - Add Nodesource apt key.' +- name: '[INSTALL] - Add Nodesource apt key.' apt_key: - url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280 - id: "68576280" + url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key state: present - name: '[INSTALLDEPS] - Add repository for nodejs' apt_repository: - repo: deb https://deb.nodesource.com/node_{{ etherpad_nodejs_version }}.x {{ ansible_distribution_release }} main + repo: deb https://deb.nodesource.com/node_{{ etherpad_nodejs_version }}.x nodistro main state: present + update_cache: yes filename: 'nodesource' - name: '[INSTALLDEPS] - Install dependencies' apt: name: "{{ etherpad_apt }}" update_cache: yes + state: latest + +- name: '[INSTALLDEPS] - Install pnpm' + npm: + name: pnpm + global: true \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 635aa20..6609e64 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,15 +11,18 @@ - name: Deploy configuration include_tasks: configure.yml - tags: configuration - -- name: Install Modules - include_tasks: modules.yml - tags: modules + tags: config - name: Use abiword include_tasks: abiword.yml when: etherpad_abiword != 'null' +- name: Install etherpad + include_tasks: install.yml + +- name: Install Modules + include_tasks: modules.yml + tags: modules + - name: Systemd include_tasks: systemd.yml diff --git a/tasks/modules.yml b/tasks/modules.yml index d987bb6..419022c 100644 --- a/tasks/modules.yml +++ b/tasks/modules.yml @@ -5,24 +5,12 @@ # then uses filter to get all plugins names in one line, without comas or quotes as needed for npm - name: '[Modules] - Install modules' shell: - cmd: "npm install --no-save --legacy-peer-deps {{ etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') | map(attribute='key') |join(',') | replace(\",\", \" \") }}" + cmd: "pnpm run install-plugins {{ etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') | map(attribute='key') |join(',') | replace(\",\", \" \") }}" args: chdir: "{{ etherpad_app_dir }}/app" become: yes become_user: "{{ etherpad_username }}" when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') |length > 0 - notify: - restart etherpad - tags: modules - -- name: '[Modules] - Uninstall modules' - shell: - cmd: "npm uninstall {{ etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'disabled') | map(attribute='key') |join(',') | replace(\",\", \" \") }}" - args: - chdir: "{{ etherpad_app_dir }}/app" - become: yes - become_user: "{{ etherpad_username }}" - when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'disabled') |length > 0 notify: restart etherpad tags: modules \ No newline at end of file diff --git a/templates/etc/systemd/system/etherpad.service.j2 b/templates/etc/systemd/system/etherpad.service.j2 index 2b10087..81452fe 100644 --- a/templates/etc/systemd/system/etherpad.service.j2 +++ b/templates/etc/systemd/system/etherpad.service.j2 @@ -8,7 +8,7 @@ User={{ etherpad_username }} Group={{ etherpad_group }} WorkingDirectory={{ etherpad_app_dir }}/app Environment=NODE_ENV=production -ExecStart={{ etherpad_app_dir }}/app/bin/run.sh +ExecStart=pnpm run prod StandardOutput=file:{{ etherpad_logfile }} Restart=always RestartSec=3 diff --git a/templates/var/www/etherpad-lite/settings.json.j2 b/templates/var/www/etherpad-lite/settings.json.j2 index 9f4e74b..5750f45 100644 --- a/templates/var/www/etherpad-lite/settings.json.j2 +++ b/templates/var/www/etherpad-lite/settings.json.j2 @@ -541,7 +541,7 @@ /* * Restrict socket.io transport methods */ - "socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"], + "socketTransportProtocols" : ["websocket", "polling"], "socketIo": { /* From 62a7145f3a331d1dc43d78bce80cd8ef5f1c1a9e Mon Sep 17 00:00:00 2001 From: meaz Date: Tue, 16 Apr 2024 22:58:44 +0200 Subject: [PATCH 03/10] build admin page (#22) Fix the issue with admin page. Also, I know we got that discussion already for cryptpad, but I removed npm package as it is already installed with nodejs even on bookworm. Otherwise I get an error as it is trying to install`npm=9.2.0` whereas with nodejs you get `npm=10.5.0` Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/22 Reviewed-by: muppeth Co-authored-by: meaz Co-committed-by: meaz --- defaults/main.yml | 3 ++- tasks/install.yml | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index db75396..2f1090e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -54,9 +54,10 @@ etherpad_nodejs_version: '21' etherpad_apt: - curl - nodejs - - npm - git +etherpad_admin_page: 'true' # set to something else if you don't want to build admin page + etherpad_plugins_list: ep_adminpads2: enabled ep_comments_page: enabled diff --git a/tasks/install.yml b/tasks/install.yml index 3282f5f..c7fb44c 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -7,3 +7,12 @@ chdir: "{{ etherpad_app_dir }}/app" become: yes become_user: "{{ etherpad_username }}" + +- name: '[INSTALL] - Build admin pages with pnpm' + shell: + cmd: pnpm run build + args: + chdir: "{{ etherpad_app_dir }}/app/admin" + become: yes + become_user: "{{ etherpad_username }}" + when: etherpad_admin_page == "true" \ No newline at end of file From bec361ed7f5cade41c7e723425de5d35f60ca1fc Mon Sep 17 00:00:00 2001 From: muppeth Date: Tue, 21 May 2024 13:36:59 +0200 Subject: [PATCH 04/10] Version update to 2.0.3 (#25) Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/25 Reviewed-by: meaz Co-authored-by: muppeth Co-committed-by: muppeth --- defaults/main.yml | 2 +- .../var/www/etherpad-lite/settings.json.j2 | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 2f1090e..76f9562 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -etherpad_version: '2.0.2' +etherpad_version: '2.0.3' etherpad_skin: 'colibris' etherpad_skinVariants: 'super-light-toolbar super-light-editor light-background' etherpad_username: 'etherpad' diff --git a/templates/var/www/etherpad-lite/settings.json.j2 b/templates/var/www/etherpad-lite/settings.json.j2 index 5750f45..c728cff 100644 --- a/templates/var/www/etherpad-lite/settings.json.j2 +++ b/templates/var/www/etherpad-lite/settings.json.j2 @@ -665,4 +665,35 @@ * Enable/Disable case-insensitive pad names. */ "lowerCasePadIds": false + + /*"sso": { + "issuer": "${SSO_ISSUER:http://localhost:9001}", + "clients": [ + { + "client_id": "${ADMIN_CLIENT:admin_client}", + "client_secret": "${ADMIN_SECRET:admin}", + "grant_types": ["authorization_code"], + "response_types": ["code"], + "redirect_uris": ["${ADMIN_REDIRECT:http://localhost:9001/admin/}"] + }, + { + "client_id": "${USER_CLIENT:user_client}", + "client_secret": "${USER_SECRET:user}", + "grant_types": ["authorization_code"], + "response_types": ["code"], + "redirect_uris": ["${USER_REDIRECT:http://localhost:9001/}"] + } + ] + } + */ + /* Set the time to live for the tokens + This is the time of seconds a user is logged into Etherpad + "ttl": { + "AccessToken": 3600, + "AuthorizationCode": 600, + "ClientCredentials": 3600, + "IdToken": 3600, + "RefreshToken": 86400 + } + */ } From 4079807c8e8546cb0d8c9ee6b4af92936ca4e51c Mon Sep 17 00:00:00 2001 From: muppeth Date: Tue, 4 Jun 2024 21:45:03 +0200 Subject: [PATCH 05/10] 2.1.0 - Version bump (#27) Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/27 Reviewed-by: meaz Co-authored-by: muppeth Co-committed-by: muppeth --- defaults/main.yml | 3 ++- templates/var/www/etherpad-lite/settings.json.j2 | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 76f9562..467bd11 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -etherpad_version: '2.0.3' +etherpad_version: '2.1.0' etherpad_skin: 'colibris' etherpad_skinVariants: 'super-light-toolbar super-light-editor light-background' etherpad_username: 'etherpad' @@ -27,6 +27,7 @@ etherpad_indentationOnNewLine: 'false' etherpad_importExportRateLimitingwindowMs: '90000' etherpad_importExportRateLimitingMax: '10' etherpad_importMaxFileSize: '52428800' # 50 MB -> 50 * 1024 * 1024 +etherpad_authmethod: 'sso' etherpad_exposeVersion: 'false' etherpad_js_maxage: '21600' etherpad_max_log_size: '1024' diff --git a/templates/var/www/etherpad-lite/settings.json.j2 b/templates/var/www/etherpad-lite/settings.json.j2 index c728cff..647ac99 100644 --- a/templates/var/www/etherpad-lite/settings.json.j2 +++ b/templates/var/www/etherpad-lite/settings.json.j2 @@ -600,6 +600,13 @@ */ "importMaxFileSize": {{ etherpad_importMaxFileSize }}, // 50 * 1024 * 1024 + /* + The authentication method used by the server. + The default value is sso + If you want to use the old authentication system, change this to apikey + */ + "authenticationMethod": "${AUTHENTICATION_METHOD:{{ etherpad_authmethod }}}", + /* * From Etherpad 1.8.5 onwards, when Etherpad is in production mode commits from individual users are rate limited * From 6dc97b3e9c204c91ac1317e9dc906514fb104fcb Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 13 Jul 2024 10:25:38 +0200 Subject: [PATCH 06/10] remove modules (#28) Add possibility to remove modules Co-authored-by: muppeth Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/28 Reviewed-by: muppeth --- README.MD | 3 +-- defaults/main.yml | 2 +- tasks/modules.yml | 12 ++++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.MD b/README.MD index 89d7da7..bd80b80 100644 --- a/README.MD +++ b/README.MD @@ -19,10 +19,9 @@ You can use tags when you deploy: - `config`: to deploy just config - `modules`: to deploy modules -⚠ Since the v.2.0.2, modules can only be installed, not removed. The devs are working on this: https://github.com/ether/etherpad-lite/issues/6272 So if you need to remove a plugin, log into the admin interface. - ## CHANGELOG +- **09.06.2024** - Add possibility to remove plugin - **14.04.2024** - Bumped version to 2.0.2 and change from npm to pnpm - **26.03.2021** - Bumped version to 1.8.13 and enable ep_adminpads2 - **04.03.2021** - Bumped version to 1.8.11 and adjusted readme file diff --git a/defaults/main.yml b/defaults/main.yml index 467bd11..1f7b761 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -59,7 +59,7 @@ etherpad_apt: etherpad_admin_page: 'true' # set to something else if you don't want to build admin page -etherpad_plugins_list: +etherpad_plugins_list: # set to "removed" if you want to remove à plugin ep_adminpads2: enabled ep_comments_page: enabled ep_desktop_notifications: enabled diff --git a/tasks/modules.yml b/tasks/modules.yml index 419022c..fc5c35b 100644 --- a/tasks/modules.yml +++ b/tasks/modules.yml @@ -11,6 +11,18 @@ become: yes become_user: "{{ etherpad_username }}" when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'enabled') |length > 0 + notify: + restart etherpad + tags: modules + +- name: '[Modules] - Remove modules' + shell: + cmd: "pnpm run plugins rm {{ etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'removed') | map(attribute='key') |join(',') | replace(\",\", \" \") }}" + args: + chdir: "{{ etherpad_app_dir }}/app" + become: yes + become_user: "{{ etherpad_username }}" + when: etherpad_plugins_list| dict2items | selectattr('value', 'eq', 'removed') |length > 0 notify: restart etherpad tags: modules \ No newline at end of file From 0fedce36a63f2d43780b5f9cd9e97bb382a5bb39 Mon Sep 17 00:00:00 2001 From: meaz Date: Mon, 15 Jul 2024 18:34:15 +0200 Subject: [PATCH 07/10] Update to 2.1.1 (#29) Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/29 Reviewed-by: muppeth --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1f7b761..337e5d3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -etherpad_version: '2.1.0' +etherpad_version: '2.1.1' etherpad_skin: 'colibris' etherpad_skinVariants: 'super-light-toolbar super-light-editor light-background' etherpad_username: 'etherpad' From 292c04cbc01b91065701f5b74348c69724d64b16 Mon Sep 17 00:00:00 2001 From: meaz Date: Wed, 17 Jul 2024 18:09:36 +0200 Subject: [PATCH 08/10] replace nodejs task by role (#23) WIP as node role PR need to be merged first Co-authored-by: muppeth Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/23 Reviewed-by: muppeth --- Playbooks/etherpad.yml | 1 + README.MD | 2 +- defaults/main.yml | 5 +++-- tasks/installdeps.yml | 12 ------------ 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Playbooks/etherpad.yml b/Playbooks/etherpad.yml index 1c1a806..ac9c99c 100644 --- a/Playbooks/etherpad.yml +++ b/Playbooks/etherpad.yml @@ -3,6 +3,7 @@ - hosts: etherpad roles: - mariadb + - node - etherpad vars_files: diff --git a/README.MD b/README.MD index bd80b80..70a95b0 100644 --- a/README.MD +++ b/README.MD @@ -12,7 +12,7 @@ Then you can access etherpad from your computer on http://192.168.33.8:9001 ## Playbook -The playbook includes mariadb role and deploys entire stack needed to run Etherpad-lite. Additional role is also available in the Ansible roles repos in git. +The playbook includes mariadb and node roles and deploys entire stack needed to run Etherpad-lite. Additional roles are also available in the Ansible roles repos in git. ## Tags You can use tags when you deploy: diff --git a/defaults/main.yml b/defaults/main.yml index 337e5d3..372d4d3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -51,12 +51,13 @@ etherpad_smtp_host: 'localhost' etherpad_smtp_port: '587' etherpad_smtp_user: 'support' etherpad_smtp_pass: 'changeme' -etherpad_nodejs_version: '21' etherpad_apt: - curl - - nodejs - git +# Nodejs +nodejs_version: '21' + etherpad_admin_page: 'true' # set to something else if you don't want to build admin page etherpad_plugins_list: # set to "removed" if you want to remove à plugin diff --git a/tasks/installdeps.yml b/tasks/installdeps.yml index 3264edd..bc6456e 100644 --- a/tasks/installdeps.yml +++ b/tasks/installdeps.yml @@ -1,17 +1,5 @@ --- -- name: '[INSTALL] - Add Nodesource apt key.' - apt_key: - url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key - state: present - -- name: '[INSTALLDEPS] - Add repository for nodejs' - apt_repository: - repo: deb https://deb.nodesource.com/node_{{ etherpad_nodejs_version }}.x nodistro main - state: present - update_cache: yes - filename: 'nodesource' - - name: '[INSTALLDEPS] - Install dependencies' apt: name: "{{ etherpad_apt }}" From eb193119e1c0012cd2594b304f5d1f1051ffad02 Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 14 Sep 2024 09:15:19 +0200 Subject: [PATCH 09/10] update to 2.2.4 (#32) Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/32 Reviewed-by: muppeth Co-authored-by: meaz Co-committed-by: meaz --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 372d4d3..f72b7aa 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -etherpad_version: '2.1.1' +etherpad_version: '2.2.4' etherpad_skin: 'colibris' etherpad_skinVariants: 'super-light-toolbar super-light-editor light-background' etherpad_username: 'etherpad' From fb9f3531306153b8a329d5788719b817639e33b9 Mon Sep 17 00:00:00 2001 From: muppeth Date: Thu, 26 Sep 2024 06:24:05 +0200 Subject: [PATCH 10/10] update to version 2.2.5 (#33) This update solves the issue with slider that has been reported here: https://git.disroot.org/Disroot/Disroot-Project/issues/953 Would be nice to get it pushed to the upcoming deployment. Reviewed-on: https://git.disroot.org/Disroot-Ansible/etherpad/pulls/33 Co-authored-by: muppeth Co-committed-by: muppeth --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index f72b7aa..9622315 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -etherpad_version: '2.2.4' +etherpad_version: '2.2.5' etherpad_skin: 'colibris' etherpad_skinVariants: 'super-light-toolbar super-light-editor light-background' etherpad_username: 'etherpad'