-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathentrypoint.sh
85 lines (71 loc) · 1.95 KB
/
entrypoint.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
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
#!/bin/bash
# For powershell:
# $env:NODE_OPTIONS="--openssl-legacy-provider"; npm start
API_URL="${API_URL//\"}"
DEFAULT_THEME="${DEFAULT_THEME//\"}"
SECRET="${SECRET//\"}"
LOGO_SIZE="${LOGO_SIZE//\"}"
DM_LOGO_COLOR="${DM_LOGO_COLOR//\"}"
LM_LOGO_COLOR="${LM_LOGO_COLOR//\"}"
if [[ -z "${DEFAULT_THEME}" ]]; then
DEFAULT_THEME="dracula"
fi
if [[ -z "${LOGO_SIZE}" ]]; then
LOGO_SIZE="M"
fi
if [[ -z "${DM_LOGO_COLOR}" ]]; then
DM_LOGO_COLOR="#FFFFFF"
fi
if [[ -z "${LM_LOGO_COLOR}" ]]; then
LM_LOGO_COLOR="#000000"
fi
if [[ "${DM_LOGO_COLOR}" = "original" ]]; then
DM_LOGO_COLOR=""
fi
if [[ "${LM_LOGO_COLOR}" = "original" ]]; then
LM_LOGO_COLOR=""
fi
if [[ ! -f /app/build/config.json ]]; then
touch /app/build/config.json
else
rm touch /app/build/config.json
touch touch /app/build/config.json
fi
case "$LOGO_SIZE" in
xs|XS|Xs|xS)
TAILWIND_LOGO_SIZE="w-12"
;;
s|S)
TAILWIND_LOGO_SIZE="w-16"
;;
m|M)
TAILWIND_LOGO_SIZE="w-20"
;;
l|L)
TAILWIND_LOGO_SIZE="w-24"
;;
xl|XL|Xl|xL)
TAILWIND_LOGO_SIZE="w-32"
;;
esac
echo "================== DockStat =================="
echo "API_URL : ${API_URL}"
echo "DEFAULT_THEME : ${DEFAULT_THEME}"
echo "SECRET : ${SECRET}"
echo "LOGO SIZE : ${LOGO_SIZE}"
echo "TAILWIND LOGO SIZE : ${TAILWIND_LOGO_SIZE}"
echo "DARK MODE LOGO COLOR : ${DM_LOGO_COLOR}"
echo "LIGHT MODE LOGO COLOR : ${LM_LOGO_COLOR}"
echo "================== DockStat =================="
echo "
{
\"API_URL\": \"${API_URL}\",
\"DEFAULT_THEME\": \"${DEFAULT_THEME}\",
\"SECRET\": \"${SECRET}\",
\"LOGO_SIZE\": \"${TAILWIND_LOGO_SIZE}\",
\"DARK_MODE_LOGO_COLOR\": \"$(echo "${DM_LOGO_COLOR}" | tr -d '#')\",
\"LIGHT_MODE_LOGO_COLOR\": \"$(echo "${LM_LOGO_COLOR}" | tr -d '#')\"
}
" > /app/build/config.json
export NODE_OPTIONS=--openssl-legacy-provider
exec serve -s build