add support for for enabling authentication

This commit is contained in:
nickcFRU 2022-08-23 16:22:54 -04:00 committed by GitHub
parent 832937292e
commit 2f1e11b54a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -32,6 +32,11 @@ usage() {
echo " --heartbeat SEC send a ping to the client every SEC seconds" echo " --heartbeat SEC send a ping to the client every SEC seconds"
echo " --timeout SEC after SEC seconds exit when not connected" echo " --timeout SEC after SEC seconds exit when not connected"
echo " --idle-timeout SEC server exits after SEC seconds if there are no" echo " --idle-timeout SEC server exits after SEC seconds if there are no"
echo " "
echo " --web-auth enable authentication"
echo " --auth-plugin CLASS authentication plugin to use"
echo " --auth-source ARG plugin configuration"
echo " "
echo " active connections" echo " active connections"
echo " " echo " "
exit 2 exit 2
@ -52,6 +57,11 @@ SYSLOG_ARG=""
HEARTBEAT_ARG="" HEARTBEAT_ARG=""
IDLETIMEOUT_ARG="" IDLETIMEOUT_ARG=""
TIMEOUT_ARG="" TIMEOUT_ARG=""
WEBAUTH_ARG=""
AUTHPLUGIN_ARG=""
AUTHSOURCE_ARG=""
die() { die() {
echo "$*" echo "$*"
@ -85,6 +95,9 @@ while [ "$*" ]; do
--heartbeat) HEARTBEAT_ARG="--heartbeat ${OPTARG}"; shift ;; --heartbeat) HEARTBEAT_ARG="--heartbeat ${OPTARG}"; shift ;;
--idle-timeout) IDLETIMEOUT_ARG="--idle-timeout ${OPTARG}"; shift ;; --idle-timeout) IDLETIMEOUT_ARG="--idle-timeout ${OPTARG}"; shift ;;
--timeout) TIMEOUT_ARG="--timeout ${OPTARG}"; shift ;; --timeout) TIMEOUT_ARG="--timeout ${OPTARG}"; shift ;;
--web-auth) WEBAUTH_ARG="--web-auth" ;;
--auth-plugin) AUTHPLUGIN_ARG="--auth-plugin ${OPTARG}"; shift ;;
--auth-source) AUTHSOURCE_ARG="--auth-source ${OPTARG}"; shift ;;
-h|--help) usage ;; -h|--help) usage ;;
-*) usage "Unknown chrooter option: ${param}" ;; -*) usage "Unknown chrooter option: ${param}" ;;
*) break ;; *) break ;;
@ -177,7 +190,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} ${SYSLOG_ARG} ${SSLONLY} --web ${WEB} ${CERT:+--cert ${CERT}} ${KEY:+--key ${KEY}} ${PORT} ${VNC_DEST} ${HEARTBEAT_ARG} ${IDLETIMEOUT_ARG} ${RECORD_ARG} ${TIMEOUT_ARG} & ${WEBSOCKIFY} ${SYSLOG_ARG} ${SSLONLY} --web ${WEB} ${CERT:+--cert ${CERT}} ${KEY:+--key ${KEY}} ${PORT} ${VNC_DEST} ${HEARTBEAT_ARG} ${IDLETIMEOUT_ARG} ${RECORD_ARG} ${TIMEOUT_ARG} ${WEBAUTH_ARG} ${AUTHPLUGIN_ARG} ${AUTHSOURCE_ARG} &
proxy_pid="$!" proxy_pid="$!"
sleep 1 sleep 1
if ! ps -p ${proxy_pid} >/dev/null; then if ! ps -p ${proxy_pid} >/dev/null; then