cryptpad/docker-entrypoint.sh
Corentin ARNOULD a7e622dddc Fix bash indentation and trailing whitespaces
Some shell scripts had tabs indentation. Made it all four spaces.
Hope it's ok with spaces.

Some files had a trailing space in it. It was not useful and takes few bytes for
nothing.

I didn't delete everything.

You can find all tab indented lines with:

grep -rP '^\t' 2>/dev/null

And more trailing space with:
grep -rP ' $' 2>/dev/null
2024-07-06 10:23:49 +02:00

40 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
#
# SPDX-License-Identifier: AGPL-3.0-or-later
## Required vars
# CPAD_MAIN_DOMAIN
# CPAD_SANDBOX_DOMAIN
# CPAD_CONF
set -e
CPAD_HOME="/cryptpad"
if [ ! -f "$CPAD_CONF" ]; then
echo -e "\n\
#################################################################### \n\
Warning: No config file provided for cryptpad \n\
We will create a basic one for now but you should rerun this service \n\
by providing a file with your settings \n\
eg: docker run -v /path/to/config.js:/cryptpad/config/config.js \n\
#################################################################### \n"
cp "$CPAD_HOME"/config/config.example.js "$CPAD_CONF"
sed -i -e "s@\(httpUnsafeOrigin:\).*[^,]@\1 '$CPAD_MAIN_DOMAIN'@" \
-e "s@\(^ *\).*\(httpSafeOrigin:\).*[^,]@\1\2 '$CPAD_SANDBOX_DOMAIN'@" "$CPAD_CONF"
fi
cd $CPAD_HOME
if [ "$CPAD_INSTALL_ONLYOFFICE" == "yes" ]; then
./install-onlyoffice.sh --accept-license
fi
npm run build
exec "$@"