-
Notifications
You must be signed in to change notification settings - Fork 2
/
entrypoint.sh
40 lines (32 loc) · 1.13 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
#!/bin/sh
#
# Perform wayback
# check dependency
command -v wayback > /dev/null || { echo "wayback is not installed in this system" 1>&2; exit 1; }
printenv WAYBACK_ARGS > /dev/null || { echo "environment variable WAYBACK_ARGS is not found in this system" 1>&2; exit 1; }
homedir=/wayback
if [ -n "${WAYBACK_CONFIGURATIONS}" ]; then
printenv WAYBACK_CONFIGURATIONS > "${homedir}/wayback.conf"
WAYBACK_ARGS="$WAYBACK_ARGS -c wayback.conf"
fi
if [ -n "${WAYBACK_ONION_LOCAL_PORT}" ]; then
export PORT=$WAYBACK_ONION_LOCAL_PORT
fi
if [ -z "${CHROMEDP_NO_SANDBOX}" ]; then
export CHROMEDP_NO_SANDBOX=true
fi
if [ -z "${CHROMEDP_DISABLE_GPU}" ]; then
export CHROMEDP_DISABLE_GPU=true
fi
if [ -z "${CHROMEDP_NO_HEADLESS}" ]; then
export CHROMEDP_NO_HEADLESS=false
fi
if [ -z "${CHROMEDP_USER_AGENT}" ]; then
export CHROMEDP_USER_AGENT="Mozilla/5.0 (en-us) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13"
fi
if [ -n "${WIREPROXY_CONF}" ]; then
printenv WIREPROXY_CONF > "${homedir}/wireproxy.conf"
fi
# execute wayback command
# more args see: https://github.com/wabarc/wayback#usage
wayback $WAYBACK_ARGS