-
Notifications
You must be signed in to change notification settings - Fork 14
/
exec
executable file
·85 lines (83 loc) · 3.81 KB
/
exec
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/dumb-init /bin/sh
# Special exec script to handle user cases that needs auth or
# stuff I can think of.
# check for $CODER_ENABLE_AUTH.
if [ -z "$CODER_ENABLE_AUTH" ]; then
if [ -z "$CODER_ENABLE_TLS" ]; then
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects;
elif [ -n "$CODER_ENABLE_TLS" ]; then
case "$CODER_ENABLE_TLS" in
true)
echo "WARNING: Make sure you mounted your Certificates in /home/coder/certs!"
echo "your cert should be named 'coder.crt' and 'coder.key', else the script won't recognize it."
/usr/bin/code-server --bind-addr 0.0.0.0:9000 --cert=/home/coder/certs/coder.crt --cert-key=/home/coder/certs/coder.key /home/coder/projects
;;
false)
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects
;;
*)
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects
;;
esac
fi
elif [ -n "$CODER_ENABLE_AUTH" ]; then
case "$CODER_ENABLE_AUTH" in
true)
if [ -z "$CODER_ENABLE_TLS" ]; then
PASSWORD="$CODER_PASSWORD" /usr/bin/code-server --auth password --bind-addr 0.0.0.0:9000 /home/coder/projects;
elif [ -n "$CODER_ENABLE_TLS" ]; then
case "$CODER_ENABLE_TLS" in
true)
echo "WARNING: Make sure you mounted your Certificates in /home/coder/certs!"
echo "your cert should be named 'coder.crt' and 'coder.key', else the script won't recognize it."
PASSWORD="$CODER_PASSWORD" /usr/bin/code-server --auth password --bind-addr 0.0.0.0:9000 --cert=/home/coder/certs/coder.crt --cert-key=/home/coder/certs/coder.key /home/coder/projects
;;
false)
PASSWORD="$CODER_PASSWORD" /usr/bin/code-server --auth password --bind-addr 0.0.0.0:9000 /home/coder/projects
;;
*)
PASSWORD="$CODER_PASSWORD" /usr/bin/code-server --auth password --bind-addr 0.0.0.0:9000 /home/coder/projects
;;
esac
fi
;;
false)
if [ -z "$CODER_ENABLE_TLS" ]; then
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects;
elif [ -n "$CODER_ENABLE_TLS" ]; then
case "$CODER_ENABLE_TLS" in
true)
echo "WARNING: Make sure you mounted your Certificates in /home/coder/certs!"
echo "your cert should be named 'coder.crt' and 'coder.key', else the script won't recognize it."
/usr/bin/code-server --bind-addr 0.0.0.0:9000 --cert=/home/coder/certs/coder.crt --cert-key=/home/coder/certs/coder.key /home/coder/projects
;;
false)
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects
;;
*)
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects
;;
esac
fi
;;
*)
if [ -z "$CODER_ENABLE_TLS" ]; then
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects;
elif [ -n "$CODER_ENABLE_TLS" ]; then
case "$CODER_ENABLE_TLS" in
true)
echo "WARNING: Make sure you mounted your Certificates in /home/coder/certs!"
echo "your cert should be named 'coder.crt' and 'coder.key', else the script won't recognize it."
/usr/bin/code-server --bind-addr 0.0.0.0:9000 --cert=/home/coder/certs/coder.crt --cert-key=/home/coder/certs/coder.key /home/coder/projects
;;
false)
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects
;;
*)
/usr/bin/code-server --bind-addr 0.0.0.0:9000 /home/coder/projects
;;
esac
fi
;;
esac
fi