From ad38f611a620ad96c12dc0d83ba5b28759a07da5 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 12 Jul 2024 15:57:49 -0300 Subject: Feat: scripts: split between provision and provision-host --- scripts/provision | 41 ----------------------------------------- scripts/provision-host | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 41 deletions(-) create mode 100755 scripts/provision-host (limited to 'scripts') diff --git a/scripts/provision b/scripts/provision index 0b4418f..bdc248e 100755 --- a/scripts/provision +++ b/scripts/provision @@ -23,44 +23,3 @@ sudo apt install -y $DEPENDENCIES # Install python dependencies pip3 install --break-system-packages $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 - - ServerName localhost - ServerAlias *.onion - DocumentRoot "/srv/shared/site" - - - AuthType Basic - AuthName "Protected" - AuthUserFile /srv/shared/.htpasswd - Require valid-user - - -EOF - -# Configure virtual host for the local service -cat <<-EOF | sudo tee /etc/apache2/sites-available/local.conf > /dev/null - - ServerName protocolos.local - DocumentRoot "/srv/shared/site" - - - Options Indexes FollowSymLinks - AllowOverride All - Require all granted - - -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..d8fccb2 --- /dev/null +++ b/scripts/provision-host @@ -0,0 +1,45 @@ +#!/bin/bash +# +# Provisioner +# + +# 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 + + ServerName localhost + ServerAlias *.onion + DocumentRoot "/srv/shared/site" + + + AuthType Basic + AuthName "Protected" + AuthUserFile /srv/shared/.htpasswd + Require valid-user + + +EOF + +# Configure virtual host for the local service +cat <<-EOF | sudo tee /etc/apache2/sites-available/local.conf > /dev/null + + ServerName protocolos.local + DocumentRoot "/srv/shared/site" + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + +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 -- cgit v1.2.3