diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2023-05-12 11:00:31 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2023-05-12 11:00:31 -0300 |
commit | 40d2e1517de60b2acb7bb5b88cf5ba445124825d (patch) | |
tree | c34ce24904637d3c712c56cd6499c0367790a459 /scripts | |
parent | 6f17223a2f18dcb3870f9e69462526387bbea266 (diff) | |
download | slides-40d2e1517de60b2acb7bb5b88cf5ba445124825d.tar.gz slides-40d2e1517de60b2acb7bb5b88cf5ba445124825d.tar.bz2 |
KVMX support
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/provision | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/scripts/provision b/scripts/provision new file mode 100755 index 0000000..a211e40 --- /dev/null +++ b/scripts/provision @@ -0,0 +1,66 @@ +#!/bin/bash +# +# Provisioner +# + +# Parameters +DIRNAME="`dirname $0`" + +# Basic dependencies +DEPENDENCIES="make pandoc tor" + +# Dependenicies for genesis-get +#DEPENDENCIES="$DEPENDENCIES tor python3-requests python3-bs4 python3-socks python3-pybtex python3-tqdm" + +# PyPI dependencies +#DEPENDENCIES_PIP="" + +# Ensure an up-to-date system +sudo apt-get update && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean + +# Install dependencies +sudo apt install -y $DEPENDENCIES + +# Install python dependencies +#pip3 install $DEPENDENCIES_PIP + +# Configure an onion service +trashman install tor-onion-service + +# Configure virtual host for the Onion Service +cat <<-EOF | sudo tee /etc/apache2/sites-available/onion.conf > /dev/null +<VirtualHost *:80> + ServerName localhost + ServerAlias *.onion + DocumentRoot "/srv/shared/" + + <Directory /srv/shared/> + AuthType Basic + AuthName "Protected" + AuthUserFile /srv/shared/.htpasswd + Require valid-user + </Directory> +</VirtualHost> +EOF + +# Configure virtual host for the local service +cat <<-EOF | sudo tee /etc/apache2/sites-available/local.conf > /dev/null +<VirtualHost *:80> + ServerName slides.local + DocumentRoot "/srv/shared/" + + <Directory /srv/shared/> + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + </Directory> +</VirtualHost> +EOF + +# Enable virtual host +sudo a2ensite onion local +sudo systemctl reload apache2 + +# Configure PATH +mkdir -p ~/.custom +echo 'export PATH=$PATH:/srv/shared/scripts' > ~/.custom/profile |