Update novnc/Dockerfile

This commit is contained in:
myve 2024-07-19 23:29:54 +00:00
commit 41971320aa

View file

@ -8,29 +8,29 @@ RUN apk add --no-cache \
&& <<-'01-init' cat >>/app/init.d/01-init.sh && <<-'01-init' cat >>/app/init.d/01-init.sh
# Check for client variables # Check for client variables
if ! [ ${MYVNC_VNCCLIENT_HOST} ] if ! [ ${MYVNC_VNCSSH_HOST} ]
then then
echo "Variable MYVNC_VNCCLIENT_HOST is missing." echo "Variable MYVNC_VNCSSH_HOST is missing."
echo "Exiting..." echo "Exiting..."
exit 1 exit 1
fi fi
if ! [ ${MYVNC_VNCCLIENT_PORT} ] if ! [ ${MYVNC_VNCSSH_PORT} ]
then then
echo "Variable MYVNC_VNCCLIENT_PORT is missing." echo "Variable MYVNC_VNCSSH_PORT is missing."
echo "Exiting..." echo "Exiting..."
exit 1 exit 1
fi fi
if ! [[ ${MYVNC_VNCCLIENT_PORT} =~ ^[0-9]+$ ]] if ! [[ ${MYVNC_VNCSSH_PORT} =~ ^[0-9]+$ ]]
then then
echo "Variable MYVNC_VNCCLIENT_PORT is invalid." echo "Variable MYVNC_VNCSSH_PORT is invalid."
echo "Exiting..." echo "Exiting..."
exit 1 exit 1
fi fi
# Read ssh client variables hostname and port (5900, 5901, 5902, etc) # Read ssh client variables hostname and port (5900, 5901, 5902, etc)
if ssh ${MYVNC_VNCCLIENT_HOST} exit if ssh ${MYVNC_VNCSSH_HOST} exit
then then
ssh ${MYVNC_VNCCLIENT_HOST} -L ${MYVNC_VNCLISTEN_HOST:-5900}:localhost:${MYVNC_VNCCLIENT_PORT} & ssh ${MYVNC_VNCSSH_HOST} -L ${MYVNC_VNCLISTEN_HOST:-5900}:localhost:${MYVNC_VNCSSH_PORT} &
else else
echo "Unable to establish SSH tunnel." echo "Unable to establish SSH tunnel."
echo "Exiting..." echo "Exiting..."