diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-07-13 14:24:16 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-07-13 14:24:16 -0300 |
commit | 7ed2696e697225a1b9374efa55598a8d7fe84934 (patch) | |
tree | 40bae62b971b7b7787a1b28c20fe371914d786b6 /scripts | |
parent | 35af6aac5ce6905f1ed4cea591d2b89d5201c048 (diff) | |
download | slides-7ed2696e697225a1b9374efa55598a8d7fe84934.tar.gz slides-7ed2696e697225a1b9374efa55598a8d7fe84934.tar.bz2 |
Fix: scripts: split between provision and provision-host
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/provision | 46 | ||||
-rwxr-xr-x | scripts/provision-host | 62 |
2 files changed, 63 insertions, 45 deletions
diff --git a/scripts/provision b/scripts/provision index a211e40..2798ea4 100755 --- a/scripts/provision +++ b/scripts/provision @@ -7,10 +7,7 @@ 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" +DEPENDENCIES="make pandoc" # PyPI dependencies #DEPENDENCIES_PIP="" @@ -23,44 +20,3 @@ 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 diff --git a/scripts/provision-host b/scripts/provision-host new file mode 100755 index 0000000..12cbe52 --- /dev/null +++ b/scripts/provision-host @@ -0,0 +1,62 @@ +#!/bin/bash +# +# Provisioner for the hosting environment +# + +# Parameters +DIRNAME="`dirname $0`" + +# Check for sudo +if [ "`whoami`" != "root" ]; then + SUDO="sudo" +fi + +# Install Apache +$SUDO apt install -y apache2 + +# Tor +trashman install tor + +# Configure an onion service +trashman install tor-onion-service + +# Install python dependencies +#pip3 install $DEPENDENCIES_PIP + +# Configure virtual host for the Onion Service +cat <<-EOF | $SUDO tee /etc/apache2/sites-available/onion.conf > /dev/null +<VirtualHost *:80> + ServerName slides.onion + ServerAlias slides.*.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 |