From 5bc76da07b18c74df53cffb1a4c3573caef2cd8a Mon Sep 17 00:00:00 2001 From: v3d Date: Thu, 5 May 2022 18:37:53 +0200 Subject: [PATCH] Fixing hotspot mode --- etc/apache2/sites-available/000-default.conf | 31 ++++++++++++++++++++ usr/local/bin/hotspot | 4 +-- usr/local/bin/onion | 2 +- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 etc/apache2/sites-available/000-default.conf diff --git a/etc/apache2/sites-available/000-default.conf b/etc/apache2/sites-available/000-default.conf new file mode 100644 index 0000000..231e6bc --- /dev/null +++ b/etc/apache2/sites-available/000-default.conf @@ -0,0 +1,31 @@ + + # The ServerName directive sets the request scheme, hostname and port that + # the server uses to identify itself. This is used when creating + # redirection URLs. In the context of virtual hosts, the ServerName + # specifies what hostname must appear in the request's Host: header to + # match this virtual host. For the default virtual host (this file) this + # value is not decisive as it is used as a last resort host regardless. + # However, you must set it for any further virtual host explicitly. + #ServerName www.example.com + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html/pivilion/gen + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/usr/local/bin/hotspot b/usr/local/bin/hotspot index 31babc1..6c9c0d9 100755 --- a/usr/local/bin/hotspot +++ b/usr/local/bin/hotspot @@ -9,9 +9,9 @@ fi echo "Configuring components..." sudo cp -f /home/pi/pivilion/config/hostapd.hotspot /etc/hostapd/hostapd.conf sudo cp -f /home/pi/pivilion/config/dnsmasq.hotspot /etc/dnsmasq.conf -sudo cp -rf /home/pi/pivilion/config/html /var/www/ +sudo cp -rf /home/pi/pivilion/config/html /var/www/html/gen sudo chown -R www-data:www-data /var/www/html -sudo chown root:www-data /var/www/html/.htaccess +sudo chown root:www-data /var/www/htmlgen//.htaccess sudo cp -f /home/pi/pivilion/config/rc.hotspot /etc/rc.local sudo cp -f /home/pi/pivilion/config/override.hotspot /etc/apache2/conf-available/override.conf sudo a2enconf override diff --git a/usr/local/bin/onion b/usr/local/bin/onion index 4a94afc..9c104ea 100755 --- a/usr/local/bin/onion +++ b/usr/local/bin/onion @@ -8,7 +8,7 @@ sudo update-rc.d dnsmasq disable sudo bash -c 'cat /home/pi/pivilion/config/rc.local.onion > /etc/rc.local' sudo mv /etc/wpa_supplicant/wpa_supplicant.bak /etc/wpa_supplicant/wpa_supplicant.conf - +sudo rm /var/www/html/pivilion/gen/.htaccess echo "The next time you reboot, your Pi will start in onion mode"! echo "Your onion domain is `cat /home/pi/pivilion/torname`" sudo bash -c 'echo "onion" > /home/pi/pivilion/mode'