cryptpad/container-start.sh

24 lines
804 B
Bash
Raw Normal View History

2017-04-09 17:36:33 +08:00
#!/bin/sh
2016-12-30 05:02:03 +08:00
# Creating customize folder
mkdir -p customize
2017-04-09 17:36:33 +08:00
[ -z "$(ls -A customize)" ] && echo "Creating customize folder" \
2016-12-30 05:02:03 +08:00
&& cp -R customize.dist/* customize/ \
2017-04-25 22:04:17 +08:00
&& cp config.example.js customize/config.js
2016-12-30 05:02:03 +08:00
2017-04-25 22:04:17 +08:00
# Linking config.js
2017-04-09 17:36:33 +08:00
[ ! -h config.js ] && echo "Linking config.js" && ln -s customize/config.js config.js
2016-12-30 05:02:03 +08:00
2017-04-25 22:04:17 +08:00
# Configure
2017-04-09 17:36:33 +08:00
[ -n "$USE_SSL" ] && echo "Using secure websockets: $USE_SSL" \
2016-12-30 05:02:03 +08:00
&& sed -i "s/useSecureWebsockets: .*/useSecureWebsockets: ${USE_SSL},/g" customize/config.js
2017-04-09 17:36:33 +08:00
[ -n "$STORAGE" ] && echo "Using storage adapter: $STORAGE" \
2016-12-30 05:02:03 +08:00
&& sed -i "s/storage: .*/storage: ${STORAGE},/g" customize/config.js
2017-04-09 17:36:33 +08:00
[ -n "$LOG_TO_STDOUT" ] && echo "Logging to stdout: $LOG_TO_STDOUT" \
2016-12-30 05:02:03 +08:00
&& sed -i "s/logToStdout: .*/logToStdout: ${LOG_TO_STDOUT},/g" customize/config.js
2017-04-09 04:08:38 +08:00
exec node ./server.js