From 9d609659808db197009f76a2919e26424de48f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BCller?= Date: Wed, 1 Nov 2023 18:47:07 +0100 Subject: [PATCH] Only write plugins to json file in Dockerfile --- Dockerfile | 14 ++------------ src/static/js/pluginfw/installer.js | 4 +++- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c45683f0c60..87e3b6f80ffb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,18 +90,8 @@ WORKDIR "${EP_DIR}" COPY --chown=etherpad:etherpad ./ ./ -# Plugins must be installed before installing Etherpad's dependencies, otherwise -# npm will try to hoist common dependencies by removing them from -# src/node_modules and installing them in the top-level node_modules. As of -# v6.14.10, npm's hoist logic appears to be buggy, because it sometimes removes -# dependencies from src/node_modules but fails to add them to the top-level -# node_modules. Even if npm correctly hoists the dependencies, the hoisting -# seems to confuse tools such as `npm outdated`, `npm update`, and some ESLint -# rules. -RUN { [ -z "${ETHERPAD_PLUGINS}" ] || \ - npm install --no-save --legacy-peer-deps ${ETHERPAD_PLUGINS}; } && \ - src/bin/installDeps.sh && \ - rm -rf ~/.npm +RUN { [ -z "${ETHERPAD_PLUGINS}" ] || /bin/bash -c 'ARR_PLUGINS=($ETHERPAD_PLUGINS) && jq -n "{plugins: \$ARGS.positional}" --args ${ARR_PLUGINS[@]} > var/installed_plugins.json'; } && \ + src/bin/installDeps.sh && # Copy the configuration file. COPY --chown=etherpad:etherpad ${SETTINGS} "${EP_DIR}"/settings.json diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index 060b1d89741c..b7e42b345547 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -65,7 +65,9 @@ exports.checkForMigration = async () => { const installedPlugins = JSON.parse(fileContent.toString()); for (const plugin of installedPlugins.plugins) { - await exports.manager.install(plugin) + if (plugin.startsWith(plugins.prefix) && plugin !== 'ep_etherpad-lite') { + await exports.manager.install(plugin) + } } };