generated from coop-cloud/example
30 lines
823 B
Bash
30 lines
823 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# set ETHERPAD_API_KEY variable
|
|
if test -f "/run/secrets/etherpad_api_key"; then
|
|
pwd=`cat /run/secrets/etherpad_api_key`
|
|
if [ -z $pwd ]; then
|
|
echo >&2 "error: /run/secrets/etherpad_api_key is empty"
|
|
exit 1
|
|
fi
|
|
echo "entrypoint.bbb-pads.sh setting ETHERPAD_API_KEY"
|
|
export "ETHERPAD_API_KEY"="${pwd}"
|
|
unset "pwd"
|
|
else
|
|
echo >&2 "error: /run/secrets/etherpad_api_key does not exist"
|
|
exit 1
|
|
fi
|
|
|
|
TARGET=/bbb-pads/config/settings.json
|
|
|
|
cp /bbb-pads/config/settings.json.template $TARGET
|
|
sed -i "s/ETHERPAD_API_KEY/\"$ETHERPAD_API_KEY\"/g" $TARGET
|
|
jq '.etherpad.host = "etherpad"' $TARGET | sponge $TARGET
|
|
jq '.express.host = "0.0.0.0"' $TARGET | sponge $TARGET
|
|
jq '.redis.host = "redis"' $TARGET | sponge $TARGET
|
|
|
|
cd /bbb-pads
|
|
export NODE_ENV=production
|
|
npm start
|