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.
32 lines
771 B
Bash
32 lines
771 B
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
|
|
|
|
# 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}"
|
|
|
|
exec "$@"
|