-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·51 lines (41 loc) · 1.19 KB
/
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
#!/bin/bash
set -e
# Import any extra environment we might need
if [[ -f /dit4c/env.sh ]]; then
set -a
source /dit4c/env.sh
set +a
fi
if [[ "$NGROK_REGION" == "" ]]; then
echo "Must specify NGROK_REGION to use"
exit 1
fi
if [[ "$DIT4C_INSTANCE_HELPER_AUTH_HOST" == "" ]]; then
echo "Must specify DIT4C_INSTANCE_HELPER_AUTH_HOST to expose"
exit 1
fi
if [[ "$DIT4C_INSTANCE_HELPER_AUTH_PORT" == "" ]]; then
echo "Must specify DIT4C_INSTANCE_HELPER_AUTH_PORT to expose"
exit 1
fi
if [[ ! -f "$DIT4C_INSTANCE_PRIVATE_KEY" ]]; then
echo "Unable to find DIT4C_INSTANCE_PRIVATE_KEY: $DIT4C_INSTANCE_PRIVATE_KEY"
exit 1
fi
if [[ "$DIT4C_INSTANCE_JWT_ISS" == "" ]]; then
echo "Must specify DIT4C_INSTANCE_JWT_ISS for JWT auth token"
exit 1
fi
if [[ "$DIT4C_INSTANCE_JWT_KID" == "" ]]; then
echo "Must specify DIT4C_INSTANCE_JWT_KID for JWT auth token"
exit 1
fi
if [[ "$DIT4C_INSTANCE_URI_UPDATE_URL" == "" ]]; then
echo "Must specify DIT4C_INSTANCE_URI_UPDATE_URL"
exit 1
fi
ngrok http --config /etc/ngrok2.conf \
-region $NGROK_REGION \
$DIT4C_INSTANCE_HELPER_AUTH_HOST:$DIT4C_INSTANCE_HELPER_AUTH_PORT 2>&1 | \
/opt/bin/listen_for_url.sh | \
/opt/bin/notify_portal.sh