From 46de2f30a986f47b32f3ab344a4017d001861c18 Mon Sep 17 00:00:00 2001 From: phil Date: Sun, 20 Apr 2025 11:40:35 +0200 Subject: [PATCH] feat: Optionally disable the pluginmanager --- .ansible/.lock | 0 README.md | 1 + defaults/main.yml | 1 + files/99-onlyoffice | 3 +++ tasks/install.yml | 15 +++++++++++++++ 5 files changed, 20 insertions(+) create mode 100644 .ansible/.lock create mode 100644 files/99-onlyoffice diff --git a/.ansible/.lock b/.ansible/.lock new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 5685047..fdebd6a 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,4 @@ You need to enable the *contrib* apt repository. | `onlyoffice_db_name` | string | onlyoffice | | `onlyoffice_jwt_secret` | string | *not set* | | `onlyoffice_ds_port` | int | 80 | +| `onlyoffice_disable_pluginmanager` | bool | false | diff --git a/defaults/main.yml b/defaults/main.yml index e85b420..302029b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,6 +3,7 @@ onlyoffice_db_host: localhost onlyoffice_db_user: onlyoffice onlyoffice_db_name: onlyoffice onlyoffice_ds_port: 80 +onlyoffice_disable_pluginmanager: false database_host: "{{ onlyoffice_db_host }}" diff --git a/files/99-onlyoffice b/files/99-onlyoffice new file mode 100644 index 0000000..3bdabf6 --- /dev/null +++ b/files/99-onlyoffice @@ -0,0 +1,3 @@ +### Disables the pluginmanager by removing the directory + +DPkg::Post-Invoke { "if dpkg -l | grep -q 'onlyoffice-documentserver'; then rm -rf /var/www/onlyoffice/documentserver/sdkjs-plugins/marketplace; systemctl restart ds-docservice.service fi"; }; diff --git a/tasks/install.yml b/tasks/install.yml index 33e3570..d2f4dde 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -56,3 +56,18 @@ path: /etc/rabbitmq/rabbitmq-env.conf line: "NODE_IP_ADDRESS={{ rabbitmq_listen_address }}" notify: Restart RabbitMQ + +- name: "Install | Remove Pluginmanager" + when: onlyoffice_disable_pluginmanager + block: + - name: Remove Pluginmanager directory + ansible.builtin.file: + path: /var/www/onlyoffice/documentserver/sdkjs-plugins/marketplace + state: absent + notify: Restart documentserver + - name: Copy apt post hool script + ansible.builtin.copy: + src: 99-onyloffice + dest: /etc/apt/apt.conf.d/99-onyloffice + mode: "0644" + \ No newline at end of file