-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-entrypoint.sh_v1_v2
executable file
·33 lines (28 loc) · 1.22 KB
/
docker-entrypoint.sh_v1_v2
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
#!/usr/bin/dumb-init /bin/sh
# openconnect
if [[ ! -z "${OPENCONNECT_USER}" ]]; then
if [[ -z "${OPENCONNECT_PASSWORD}" ]]; then
# Ask for password
openconnect -b -u $OPENCONNECT_USER --protocol=anyconnect --authgroup $OPENCONNECT_AUTHGROUP $OPENCONNECT_URL
elif [[ ! -z "${OPENCONNECT_PASSWORD}" ]] && [[ ! -z "${OPENCONNECT_MFA_CODE}" ]]; then
# Multi factor authentication (MFA)
(echo $OPENCONNECT_PASSWORD; echo $OPENCONNECT_MFA_CODE) | openconnect -b -u $OPENCONNECT_USER --protocol=anyconnect --authgroup $OPENCONNECT_AUTHGROUP --passwd-on-stdin $OPENCONNECT_URL
elif [[ ! -z "${OPENCONNECT_PASSWORD}" ]]; then
# Standard authentication
echo $OPENCONNECT_PASSWORD | openconnect -b -u $OPENCONNECT_USER --protocol=anyconnect --authgroup $OPENCONNECT_AUTHGROUP --passwd-on-stdin $OPENCONNECT_URL
fi
fi
# install necessary packages
npm install -g typescript
cd /job_supervisor && npm install
# compile TypeScript
cd /job_supervisor && npm run build
# set SSH config
cat >> /etc/ssh_config <<EOT
Host *
StrictHostKeyChecking no
EOT
# run server
# redis-server is now a separate container (2022-04-10 Drew)
#redis-server /job_supervisor/redis.conf --daemonize yes
node /job_supervisor/production/server.js