-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·56 lines (46 loc) · 986 Bytes
/
run.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
set -e
if [ "$HMAC_SECRET_KEY" == "" ]; then
echo "HMAC_SECRET_KEY not set. Exiting.."
exit 1
fi
if [ "$API_KEY" == "" ]; then
echo "API_KEY not set. Exiting.."
exit 1
fi
if [ "$ADMIN_PASSWORD" == "" ]; then
echo "ADMIN_PASSWORD not set. Exiting.."
exit 1
fi
if [ "$ADMIN_SECRET" == "" ]; then
echo "ADMIN_SECRET not set. Exiting.."
exit 1
fi
if [ -z $PORT ]; then
PORT=8080
fi
cat <<EOF > config.json
{
"token_hmac_secret_key": "$HMAC_SECRET_KEY",
"api_key": "$API_KEY",
"admin": true,
"admin_password": "$ADMIN_PASSWORD",
"admin_secret": "$ADMIN_SECRET",
"web": true,
"namespaces": [
{
"name": "public",
"anonymous": true,
"publish": true,
"watch": true,
"presence": true,
"join_leave": true,
"history_size": 10,
"history_lifetime": 30,
"recover": true
}
]
}
EOF
echo "#### Starting Centrifugo..."
./centrifugo -p $PORT --admin --config=config.json