forked from tutumcloud/ngrok-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·36 lines (28 loc) · 874 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
#!/bin/bash
set -e
if [ "${CA_CERT}" == "**None**" ]; then
echo "Please specify CA_CERT"
exit 1
fi
echo -e "${CA_CERT}" > /ngrok/assets/client/tls/ngrokroot.crt
if [ ! -f /ngrok/bin/ngrokd ]; then
echo "=> Compiling ngrok binary files"
cd /ngrok; make release-server release-client
echo "=> Successfully built the binaries"
fi
if [ "${TLS_KEY}" == "**None**" ]; then
echo "Please specify TLS_KEY"
exit 1
fi
if [ "${TLS_CERT}" == "**None**" ]; then
echo "Please specify TLS_CERT"
exit 1
fi
if [ "${DOMAIN}" == "**None**" ]; then
echo "Please specify DOMAIN"
exit 1
fi
echo -e "${TLS_KEY}" > /server.key
echo -e "${TLS_CERT}" > /server.crt
echo "=> Running ngrok server"
/ngrok/bin/ngrokd -tlsKey=/server.key -tlsCrt=/server.crt -domain="${DOMAIN}" -httpAddr=${HTTP_ADDR} -httpsAddr=${HTTPS_ADDR} -tunnelAddr=${TUNNEL_ADDR}