Merge pull request #603 from WardF/master
Added option for --ssl-only noVNC session to launch.sh
This commit is contained in:
commit
9dfbf44028
|
@ -9,7 +9,7 @@ usage() {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
echo "Usage: ${NAME} [--listen PORT] [--vnc VNC_HOST:PORT] [--cert CERT]"
|
echo "Usage: ${NAME} [--listen PORT] [--vnc VNC_HOST:PORT] [--cert CERT] [--ssl-only]"
|
||||||
echo
|
echo
|
||||||
echo "Starts the WebSockets proxy and a mini-webserver and "
|
echo "Starts the WebSockets proxy and a mini-webserver and "
|
||||||
echo "provides a cut-and-paste URL to go to."
|
echo "provides a cut-and-paste URL to go to."
|
||||||
|
@ -22,6 +22,8 @@ usage() {
|
||||||
echo " Default: self.pem"
|
echo " Default: self.pem"
|
||||||
echo " --web WEB Path to web files (e.g. vnc.html)"
|
echo " --web WEB Path to web files (e.g. vnc.html)"
|
||||||
echo " Default: ./"
|
echo " Default: ./"
|
||||||
|
echo " --ssl-only Disable non-https connections."
|
||||||
|
echo " "
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +35,7 @@ VNC_DEST="localhost:5900"
|
||||||
CERT=""
|
CERT=""
|
||||||
WEB=""
|
WEB=""
|
||||||
proxy_pid=""
|
proxy_pid=""
|
||||||
|
SSLONLY=""
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
|
@ -59,6 +62,7 @@ while [ "$*" ]; do
|
||||||
--vnc) VNC_DEST="${OPTARG}"; shift ;;
|
--vnc) VNC_DEST="${OPTARG}"; shift ;;
|
||||||
--cert) CERT="${OPTARG}"; shift ;;
|
--cert) CERT="${OPTARG}"; shift ;;
|
||||||
--web) WEB="${OPTARG}"; shift ;;
|
--web) WEB="${OPTARG}"; shift ;;
|
||||||
|
--ssl-only) SSLONLY="--ssl-only" ;;
|
||||||
-h|--help) usage ;;
|
-h|--help) usage ;;
|
||||||
-*) usage "Unknown chrooter option: ${param}" ;;
|
-*) usage "Unknown chrooter option: ${param}" ;;
|
||||||
*) break ;;
|
*) break ;;
|
||||||
|
@ -138,7 +142,7 @@ fi
|
||||||
|
|
||||||
echo "Starting webserver and WebSockets proxy on port ${PORT}"
|
echo "Starting webserver and WebSockets proxy on port ${PORT}"
|
||||||
#${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
|
#${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
|
||||||
${WEBSOCKIFY} --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
|
${WEBSOCKIFY} ${SSLONLY} --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
|
||||||
proxy_pid="$!"
|
proxy_pid="$!"
|
||||||
sleep 1
|
sleep 1
|
||||||
if ! ps -p ${proxy_pid} >/dev/null; then
|
if ! ps -p ${proxy_pid} >/dev/null; then
|
||||||
|
@ -148,7 +152,12 @@ if ! ps -p ${proxy_pid} >/dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n\nNavigate to this URL:\n"
|
echo -e "\n\nNavigate to this URL:\n"
|
||||||
echo -e " http://$(hostname):${PORT}/vnc.html?host=$(hostname)&port=${PORT}\n"
|
if [ "x$SSLONLY" == "x" ]; then
|
||||||
|
echo -e " http://$(hostname):${PORT}/vnc.html?host=$(hostname)&port=${PORT}\n"
|
||||||
|
else
|
||||||
|
echo -e " https://$(hostname):${PORT}/vnc.html?host=$(hostname)&port=${PORT}\n"
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "Press Ctrl-C to exit\n\n"
|
echo -e "Press Ctrl-C to exit\n\n"
|
||||||
|
|
||||||
wait ${proxy_pid}
|
wait ${proxy_pid}
|
||||||
|
|
Loading…
Reference in New Issue