etherpad/bin/run.sh
Stefan Müller fe106f0afc
Improve plugins docker build and fixed plugin loading when dependencies are specified (#6164)
* Install pnpm only local - not global

* Install plugins during docker build with live-plugin-manager

* Migrated installer to ts.

* Added missing workspace script.

* Fixed docker build.

* Fix Dockerfile

* Fixed installer not being yet initialized.

* Ported installer to correct install path.

* Fixed pnpm installation.

* Fixed docker build.

* Fixed plugin loading.

* Fixed plugins not being able to be loaded.

* Fix plugin installation instructions in README

* Fixed startup.

* Fixed folder not present.

* Added unlinking dependencies.

* Added deleting dependencies.

* Fixed listing plugins.

---------

Co-authored-by: SamTV12345 <40429738+samtv12345@users.noreply.github.com>
2024-03-14 16:06:32 +01:00

44 lines
1 KiB
Bash
Executable file

#!/bin/sh
# 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
ignoreRoot=0
for ARG in "$@"; do
if [ "$ARG" = "--root" ]; then
ignoreRoot=1
fi
done
# Stop the script if it's started as root
if [ "$(id -u)" -eq 0 ] && [ "$ignoreRoot" -eq 0 ]; then
cat <<EOF >&2
You shouldn't start Etherpad as root!
Please type 'Etherpad rocks my socks' (or restart with the '--root'
argument) if you still want to start it as root:
EOF
printf "> " >&2
read rocks
[ "$rocks" = "Etherpad rocks my socks" ] || fatal "Your input was incorrect"
fi
# Prepare the environment
bin/installDeps.sh "$@" || exit 1
## Create the admin ui
if [ -z "$NODE_ENV" ] || [ "$NODE_ENV" = "development" ]; then
log "Creating the admin UI..."
(cd ../admin && pnpm run build)
else
log "Cannot create the admin UI in production mode"
fi
# Move to the node folder and start
log "Starting Etherpad..."
# cd src
exec pnpm run dev "$@"