#!/bin/bash -f ###################################################################### # Artemis Nebula VNC script, (C) 2015-2020 Nosey Nick Waterman, # https://noseynick.org/artemis/nebula/ # All wrong righted, all rights reserved. Licensed under thev GNU # Affero General Public License v3.0 https://www.gnu.org/licenses/agpl.txt # with Commons Clause https://commonsclause.com/ v1.0 ###################################################################### banner VNC setup # shellcheck disable=SC1090 # no need to parse this file when shellchecking: . ~/bin/conf.sh [[ "$VNCPASS" ]] || export VNCPASS=sig93air [[ "$DISPLAY" ]] || export DISPLAY=:20 cd || exit 9 timeout 2 x11vnc -r stop && sleep 2 mkdir -p .vnc x11vnc -storepasswd "$VNCPASS" ~/.vnc/passwd # echo "$VNCPASS" | tightvncpasswd -f > .vnc/passwd x11vnc -localhost -forever -shared -usepw & # x11vnc -forever -shared -usepw & # x11vnc -forever -shared -usepw -httpdir /usr/share/novnc/ & # x11vnc -forever -shared -usepw -http_oneport -httpdir /usr/share/novnc/ & # x11vnc -forever -shared -usepw -httpdir ~/noVNC-master/ & # http://127.0.0.1:5800/vnc_auto.html?port=5900&password=sig93air NVVER=master # master broken. Lock to this ver for now: # NVVER=80b078c469465f1ec45a5251a40eee51f13c5a1d # good # NVVER=01d4514deed5e61d849c6f720b6f165a88f2e106 # bad nebula "https://github.com/novnc/noVNC/archive/$NVVER.zip#/noVNC.zip" 'unzip -o' for X in core vendor app vnc.html vnc_lite.html; do rm -f ~/www/$X ln -vfs ../noVNC-$NVVER/$X ~/www/$X done # fix for 2019-07 NoVNC / WebSockify compatibility bug: sed -i~ -E '/options.wsProtocols/ s/\[\]/["binary","base64"]/' ~/www/core/rfb.js # fix for 2019-12-12 NoVNC password bug - https://github.com/novnc/noVNC/issues/1343 # sed -i~ -E '/credentials:/ s/\{/!password ? {} : {/' ~/www/vnc_lite.html # ... or apt install novnc and websockify --web /usr/share/novnc/ 8787 127.1:5900 if [[ "$TESTCHAN" ]] && [[ "$IP" ]] && [[ "$VNCPASS" ]]; then date "+%F %T $IP: REMOTE: http://$IP/vnc_lite.html?password=$VNCPASS" \ | TEST=1 discord.sh --send fi