forked from dariusk/rss-to-activitypub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·36 lines (24 loc) · 809 Bytes
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
cd /app
cp config.json.template config.json
if [[ ! -z ${DOMAIN+x} ]]; then
sed -i "s/\"DOMAIN\": \"\"/\"DOMAIN\": \"${DOMAIN}\"/g" config.json
else
echo 'Env var $DOMAIN is not set. Set it before starting the container'
exit 1
fi
if [[ ! -z ${PORT_HTTP+x} ]]; then
sed -i "s/\"PORT_HTTP\": \"3000\"/\"PORT_HTTP\": \"${PORT_HTTP}\"/g" config.json
fi
if [[ ! -z ${PORT_HTTPS+x} ]]; then
sed -i "s/\"PORT_HTTPS\": \"8443\"/\"PORT_HTTPS\": \"${PORT_HTTPS}\"/g" config.json
fi
if [[ ! -z ${PRIVKEY_PATH+x} ]]; then
sed -i "s@\"PRIVKEY_PATH\": \"\"@\"PRIVKEY_PATH\": \"${PRIVKEY_PATH}\"@g" config.json
fi
if [[ ! -z ${CERT_PATH+x} ]]; then
sed -i "s@\"CERT_PATH\": \"\"@\"CERT_PATH\": \"${CERT_PATH}\"@g" config.json
fi
echo "Configuration file :"
cat config.json
node index.js