Files
webmin/vnc/disable-web.patch
Barry Nelson 0a51170d3c Patch to completely disable http/https protocol on port 6080.
Only wss (web socket proxy) protocol is enabled on port 6080 and that is required.
2025-02-07 13:55:55 -05:00

71 lines
2.2 KiB
Diff

--- noVNC-1.5.0/utils/novnc_proxy 2025-02-07 11:38:00.355963553 -0500
+++ noVNC-1.5.0/utils/novnc_proxy 2025-02-07 12:22:28.702594234 -0500
@@ -109,4 +109,16 @@
esac
done
+if [ -z "$WEB" ]
+then
+ WEB="`pwd`"
+ if [ ! -e "${WEB}/vnc.html" ]
+ then
+ WEB="$HERE/.."
+ fi
+fi
+if [ "$WEB" == "NONE" ]
+then
+ unset WEB
+fi
if [ "$LISTEN" != "$PORT" ]; then
@@ -136,14 +148,4 @@
die "Could not find ${WEB}/vnc.html"
fi
-elif [ -e "$(pwd)/vnc.html" ]; then
- WEB=$(pwd)
-elif [ -e "${HERE}/../vnc.html" ]; then
- WEB=${HERE}/../
-elif [ -e "${HERE}/vnc.html" ]; then
- WEB=${HERE}
-elif [ -e "${HERE}/../share/novnc/vnc.html" ]; then
- WEB=${HERE}/../share/novnc/
-else
- die "Could not find vnc.html"
fi
@@ -204,11 +206,16 @@
# Make all file paths absolute as websockify changes working directory
-WEB=`realpath "${WEB}"`
+[ -n "${WEB}" ] && WEB="--web `realpath ${WEB}`"
[ -n "${CERT}" ] && CERT=`realpath "${CERT}"`
[ -n "${KEY}" ] && KEY=`realpath "${KEY}"`
[ -n "${RECORD}" ] && RECORD=`realpath "${RECORD}"`
-echo "Starting webserver and WebSockets proxy on${HOST:+ host ${HOST}} port ${PORT}"
-${WEBSOCKIFY} ${SYSLOG_ARG} ${SSLONLY} ${FILEONLY_ARG} --web ${WEB} ${CERT:+--cert ${CERT}} ${KEY:+--key ${KEY}} ${LISTEN} ${VNC_DEST} ${HEARTBEAT_ARG} ${IDLETIMEOUT_ARG} ${RECORD:+--record ${RECORD}} ${TIMEOUT_ARG} ${WEBAUTH_ARG} ${AUTHPLUGIN_ARG} ${AUTHSOURCE_ARG} &
+if [ -n "$WEB" ]
+then
+ echo "Starting webserver and WebSockets proxy on${HOST:+ host ${HOST}} port ${PORT}"
+else
+ echo "Starting WebSockets proxy on${HOST:+ host ${HOST}} port ${PORT}"
+fi
+${WEBSOCKIFY} ${SYSLOG_ARG} ${SSLONLY} ${FILEONLY_ARG} ${WEB} ${CERT:+--cert ${CERT}} ${KEY:+--key ${KEY}} ${LISTEN} ${VNC_DEST} ${HEARTBEAT_ARG} ${IDLETIMEOUT_ARG} ${RECORD:+--record ${RECORD}} ${TIMEOUT_ARG} ${WEBAUTH_ARG} ${AUTHPLUGIN_ARG} ${AUTHSOURCE_ARG} &
proxy_pid="$!"
sleep 1
@@ -223,9 +230,12 @@
fi
-echo -e "\n\nNavigate to this URL:\n"
-if [ "x$SSLONLY" == "x" ]; then
+if [ -n "$WEB" ]
+then
+ echo -e "\n\nNavigate to this URL:\n"
+ if [ "x$SSLONLY" == "x" ]; then
echo -e " http://${HOST}:${PORT}/vnc.html?host=${HOST}&port=${PORT}\n"
-else
+ else
echo -e " https://${HOST}:${PORT}/vnc.html?host=${HOST}&port=${PORT}\n"
+ fi
fi