Skip to content

Commit

Permalink
Only write plugins to json file in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Gared committed Nov 1, 2023
1 parent 4987443 commit 9d60965
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/static/js/pluginfw/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
};

Expand Down

0 comments on commit 9d60965

Please sign in to comment.