How can I install a local plugin in etherpad? #7090
Replies: 1 comment
-
|
This is an old post, but for anyone who is still looking for an answer: you must include in the After that, if you're using Docker, you should include a build arg with your plugin name (not path), either following the instructions directly in the Dockerfile provided by Etherpad or by specifying it in docker-compose.yml (services: app: build: args: ETHERPAD_LOCAL_PLUGINS="ep_your_plugin_name"). If you're not using Docker, the Dockerfile essentially just runs #!/bin/bash
set -euo pipefail
IFS=$'\n\t'
trim() {
local var="$*"
# remove leading whitespace characters
var="${var#"${var%%[![:space:]]*}"}"
# remove trailing whitespace characters
var="${var%"${var##*[![:space:]]}"}"
printf '%s' "$var"
}
# Move to the Etherpad base directory.
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
cd "${MY_DIR}/.." || exit 1
# Source constants and useful functions
. bin/functions.sh
PNPM_OPTIONS=
if [ ! -z "${NODE_ENV-}" ]; then
if [ "$NODE_ENV" == 'production' ]; then
PNPM_OPTIONS='--prod'
fi
fi
if [ ! -z "${ETHERPAD_LOCAL_PLUGINS_ENV-}" ]; then
if [ "$ETHERPAD_LOCAL_PLUGINS_ENV" == 'production' ]; then
PNPM_OPTIONS='--prod'
elif [ "$ETHERPAD_LOCAL_PLUGINS_ENV" == 'development' ]; then
PNPM_OPTIONS='-D'
fi
fi
if [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then
readarray -d ' ' plugins <<< "${ETHERPAD_LOCAL_PLUGINS}"
for plugin in "${plugins[@]}"; do
plugin=$(trim "$plugin")
if [ -d "local_plugins/${plugin}" ]; then
echo "Installing plugin: '${plugin}'"
pnpm install -w ${PNPM_OPTIONS:-} "local_plugins/${plugin}/"
else
( echo "Error. Directory 'local_plugins/${plugin}' for local plugin " \
"'${plugin}' missing" >&2 )
exit 1
fi
done
else
echo 'No local plugings to install.'
fi |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to Etherpad and would like to write a plugin, but want to start locally. I am on a mac and would prefer not to use docker.
I cannot seem to get Etherpad to pick up my local plugin.
I have tried adding it to local_plugins and copying it to node_modules.
I am at a loss on how to begin development of a plugin. Any help would be appreciated
Beta Was this translation helpful? Give feedback.
All reactions