-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·48 lines (36 loc) · 846 Bytes
/
run.sh
File metadata and controls
executable file
·48 lines (36 loc) · 846 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
if [ -z "$URL" ] ; then
echo "Missing environment variable: URL."
echo ""
echo "Set to the CORS Url from which the frontend will talk with the server."
echo "Example: https://www.example.com/"
exit 1
fi
if [ -z "$LISTEN" ] ; then
LISTEN="http://0.0.0.0:8080/"
fi
if [ -z "$DB" ] ; then
DB="/db/comments.db"
fi
if [ ! -d /config ] ; then
mkdir /config
fi
DB_PATH="$(dirname $DB)"
if [ ! -d "$DB_PATH" ] ; then
mkdir -p "$DB_PATH";
fi
if [ ! -f "$DB" ] ; then
touch $DB
fi
sed -e "s~%%URL%%~$URL~" \
-e "s~%%LISTEN%%~$LISTEN~" \
-e "s~%%DB%%~$DB~" \
/opt/config/isso.conf.tpl > /config/isso.conf
export ISSO_SETTINGS="/config/isso.conf"
if [ "$#" -gt "0" ] ; then
$*
else
chown -R $UID:$GID /db /config
exec su-exec $UID:$GID gunicorn -b 0.0.0.0:8080 -w 4 --preload isso.run
#isso -c /config/isso.conf run
fi