#!/bin/bash -f ###################################################################### # Artemis Nebula Web UI 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 Web UI install sudo dpkg --add-architecture i386 # ++++++++++++++++++++ Check if we still need this? mkdir -vp ~/logs ~/www [[ -f ~/logs/apt.log ]] || sudo DEBIAN_FRONTEND=noninteractive apt-get -yq update | tee ~/logs/apt.log # speeds up the apt-get install... echo no-triggers | sudo tee /etc/dpkg/dpkg.cfg.d/NN # install websockify - for VNC, but also (ab)using it as a webserver: sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install websockify # ... and works for this one, but can break others, so: sudo rm -rvf /etc/dpkg/dpkg.cfg.d/NN # download our homepage nebula web.html nebula https://noseynick.net/favicon.ico ln -vs ~/bin/web.html ~/www/index.html ln -vs ~/bin/favicon.ico ~/www/ ln -vs ~/logs/nebula.log ~/www/ # run the webserver on port 8080 ... websockify --web ~/www/ --daemon --log-file ~/logs/www.log 8080 127.1:5900 # ... but make it available on port 80 from the outside world sudo iptables -C PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-ports 8080 || \ sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-ports 8080