mirror of https://github.com/siomiz/chrome
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
Bash
38 lines
1.0 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# VNC default no password
|
|
export X11VNC_AUTH="-nopw"
|
|
|
|
# look for VNC password file in order (first match is used)
|
|
passwd_files=(
|
|
/home/chrome/.vnc/passwd
|
|
/run/secrets/vncpasswd
|
|
)
|
|
|
|
for passwd_file in ${passwd_files[@]}; do
|
|
if [[ -f ${passwd_file} ]]; then
|
|
export X11VNC_AUTH="-rfbauth ${passwd_file}"
|
|
break
|
|
fi
|
|
done
|
|
|
|
# override above if VNC_PASSWORD env var is set (insecure!)
|
|
if [[ "$VNC_PASSWORD" != "" ]]; then
|
|
export X11VNC_AUTH="-passwd $VNC_PASSWORD"
|
|
fi
|
|
|
|
# make sure .config dir exists
|
|
mkdir -p /home/chrome/.config
|
|
chown chrome:chrome /home/chrome/.config
|
|
|
|
# set sizes for both VNC screen & Chrome window
|
|
: ${VNC_SCREEN_SIZE:='1024x768'}
|
|
IFS='x' read SCREEN_WIDTH SCREEN_HEIGHT <<< "${VNC_SCREEN_SIZE}"
|
|
export VNC_SCREEN="${SCREEN_WIDTH}x${SCREEN_HEIGHT}x24"
|
|
export CHROME_WINDOW_SIZE="${SCREEN_WIDTH},${SCREEN_HEIGHT}"
|
|
|
|
export CHROME_OPTS="${CHROME_OPTS_OVERRIDE:- --user-data-dir --no-sandbox --window-position=0,0 --force-device-scale-factor=1 --disable-dev-shm-usage}"
|
|
|
|
exec "$@"
|