make entrypoint script working with Debian, remove outdated parts
This commit is contained in:
parent
032b094b75
commit
0cb2f42b33
1 changed files with 10 additions and 19 deletions
29
docker-entrypoint.sh
Normal file → Executable file
29
docker-entrypoint.sh
Normal file → Executable file
|
@ -1,4 +1,4 @@
|
|||
#/bin/sh
|
||||
#/bin/bash
|
||||
|
||||
## Required vars
|
||||
# CPAD_MAIN_DOMAIN
|
||||
|
@ -10,32 +10,23 @@ set -e
|
|||
|
||||
CPAD_HOME="/cryptpad"
|
||||
|
||||
# If cryptad conf isn't provided
|
||||
if [ ! -f "$CPAD_CONF" ]; then
|
||||
echo -e "\n\
|
||||
############################################### \n\
|
||||
Warning: No config file provided for CryptPad \n\
|
||||
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"
|
||||
#################################################################### \n"
|
||||
|
||||
cp $CPAD_HOME/config/config.example.js $CPAD_CONF
|
||||
cp "$CPAD_HOME"/config/config.example.js "$CPAD_CONF"
|
||||
|
||||
# Set domains
|
||||
sed -i -e "s@\(httpUnsafeOrigin:\).*[^,]@\1 'https://$CPAD_MAIN_DOMAIN'@" \
|
||||
-e "s@\(^ *\).*\(httpSafeOrigin:\).*[^,]@\1\2 'https://$CPAD_SANDBOX_DOMAIN'@" $CPAD_CONF
|
||||
|
||||
# Set admin email
|
||||
if [ -z "$CPAD_ADMIN_EMAIL" ]; then
|
||||
echo "Error: Missing admin email (Did you read the config?)"
|
||||
exit 1
|
||||
else
|
||||
sed -i "s@\(adminEmail:\).*[^,]@\1 '$CPAD_ADMIN_EMAIL'@" $CPAD_CONF
|
||||
fi
|
||||
fi
|
||||
sed -i -e "s@\(httpUnsafeOrigin:\).*[^,]@\1 'https://$CPAD_MAIN_DOMAIN'@" \
|
||||
-e "s@\(^ *\).*\(httpSafeOrigin:\).*[^,]@\1\2 'https://$CPAD_SANDBOX_DOMAIN'@" $CPAD_CONF
|
||||
fi
|
||||
|
||||
cd $CPAD_HOME
|
||||
npm run build
|
||||
|
||||
exec "$@"
|
||||
|
||||
|
|
Loading…
Reference in a new issue