Skip to content

Step 5. Install Admin UI for Web Safety

Admin UI of Web Safety is installed after core components installation is finished. Having a separate package for Admin UI allows for faster development cycle and improved support. To install the Admin UI components navigate to ui folder and run the following scripts one by one.

Run 01_nginx.sh for Nginx web server.

#!/bin/bash

# all web packages are installed as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# we are running non interactive
export DEBIAN_FRONTEND=noninteractive 

# install nginx and kerberos client libraries
apt -y install nginx krb5-user

Run 02_webui.sh to install Admin UI of Web Safety.

#!/bin/bash

# all packages are installed as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# default arch and version
MAJOR="9.8.0"
MINOR="2BD3"
ARCH="amd64"

# download
wget https://www.diladele.com/pkg/websafety-ui/$MAJOR.$MINOR/$ARCH/release/ubuntu26/websafety-ui-$MAJOR.${MINOR}_$ARCH.deb

# install
dpkg --install websafety-ui-$MAJOR.${MINOR}_$ARCH.deb

Run 03_venv.sh to setup virtual environment where the Python code will run.

#!/bin/bash

# all packages are installed as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# install various required python packages from the system repo
apt install -y python3-dev python3-openssl python3.14-venv \
   libjpeg-dev zlib1g-dev libldap2-dev libsasl2-dev libssl-dev

# create a virtual environment in the /opt/websafety-ui folder
python3 -m venv /opt/websafety-ui/env

# install required packages into virtual environment
/opt/websafety-ui/env/bin/pip3 install -r /opt/websafety-ui/var/console/requirements.txt

# sync ui and actual files in disk (note UI does not manage network by default)
sudo -u proxy /opt/websafety-ui/env/bin/python3 /opt/websafety-ui/var/console/generate.py --core
sudo -u websafety /opt/websafety-ui/env/bin/python3 /opt/websafety-ui/var/console/generate.py --ui

# relabel folder just in case
chown -R websafety:websafety /opt/websafety-ui

Finally, run 04_integrate.sh to integrate the Nginx web server and Admin UI of Web Safety.

#!/bin/bash

# all packages are installed as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# disable the default nginx site
rm /etc/nginx/sites-enabled/default

# and enable web safety instead
ln -s /etc/nginx/sites-available/websafety /etc/nginx/sites-enabled/websafety

# finally restart all daemons
service nginx restart
service gunicorn restart

After all these scripts we finally have Web Safety, Squid and Nginx web server setup and running as appropriate on your real hardware server. Continue on to the next step for some post installation configuration.