Compare commits

..

No commits in common. "f9d0816b468dc04a563d695bc13628302d2529ea" and "b18157ae7d90fb71dc41947b9da1ea3c36ed8b12" have entirely different histories.

10 changed files with 32 additions and 129 deletions

View File

@ -1,19 +0,0 @@
interface=br0
listen-address=10.1.1.1
no-hosts
dhcp-range=10.1.1.2,10.1.1.254,72h
dhcp-option=option:router,10.1.1.1
dhcp-authoritative
address=/#/10.1.1.1
address=/clients1.google.com/1.2.3.4
address=/clients3.google.com/1.2.3.4
address=/connectivitycheck.android.com/1.2.3.4
address=/connectivitycheck.gstatic.com/1.2.3.4
address=/connect.rom.miui.com/generate_204/1.2.3.4
address=/www.apple.com/library/test/success.html/1.2.3.4
server=/0.debian.pool.ntp.org/#
server=/1.debian.pool.ntp.org/#
server=/2.debian.pool.ntp.org/#
server=/3.debian.pool.ntp.org/#
server=/deb.debian.org/debian/#
#server=/formatc.hr/#

View File

@ -1,9 +0,0 @@
interface=wlan0
channel=6
hw_mode=g
ssid=pivilion
bridge=br0
auth_algs=1
wmm_enabled=0

View File

@ -1,4 +0,0 @@
RewriteEngine on
RewriteCond %{REQUEST_URI} !(\/index\.php)$
RewriteCond %{REQUEST_URI} !(\/pi-logo_128\.png)$
RewriteRule ^(.*)$ http://10.1.1.1/index.php [L,R=301]

View File

@ -1,31 +0,0 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to Pivilion</title>
<style type="text/css">
html {
background-image: url("pi-logo_128.png");
padding: 10px;
}
body {
font-family: monospace;
font-size: 14px;
color: white;
background-color: black;
padding:10px;
display: table;
}
a {
font-weight: bold;
text-decoration: underline;
color: white;
}
</style>
</head>
<body>
<h1>Welcome to Pivilion!</h1>
<p>Access your Rpi using SFTP or consult the manual to get your content here. </p>
<p>For more info visit <a href="http://pivilion.net">pivilion.net</a>
</body>
</html>

View File

@ -1,5 +0,0 @@
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>

View File

@ -1,20 +0,0 @@
#!/bin/bash
service apache2 start
sleep 1
ifconfig wlan0 down
ifconfig wlan0 up
sleep 1
hostapd -B /etc/hostapd/hostapd.conf
sleep 2
ifconfig br0 up
ifconfig br0 10.1.1.1 netmask 255.255.255.0
sysctl net.ipv4.ip_forward=1
iptables --flush
iptables -t nat --flush
iptables -t nat -A PREROUTING -i br0 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.1:53
iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.1.1:80
iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.1.1:80
iptables -t nat -A POSTROUTING -j MASQUERADE
service dnsmasq start
exit 0

View File

@ -1,20 +1,24 @@
#!/bin/bash #!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
service apache2 start # Print the IP address
sleep 1 _IP=$(hostname -I) || true
ifconfig wlan0 down if [ "$_IP" ]; then
ifconfig wlan0 up printf "My IP address is %s\n" "$_IP"
sleep 1 fi
hostapd -B /etc/hostapd/hostapd.conf # Display onion domain in MOTD
sleep 2 cat /var/lib/tor/hidden_service/hostname > /home/pi/torname
ifconfig br0 up hostapd -d /etc/hostapd/hostapd.conf
ifconfig br0 10.1.1.1 netmask 255.255.255.0
sysctl net.ipv4.ip_forward=1
iptables --flush
iptables -t nat --flush
iptables -t nat -A PREROUTING -i br0 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.1:53
iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.1.1:80
iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.1.1:80
iptables -t nat -A POSTROUTING -j MASQUERADE
service dnsmasq start
exit 0 exit 0

View File

@ -1,26 +1,13 @@
#!/bin/sh -e #!/bin/bash
echo "Checking for required packages and installing if missing" cat /home/pi/pivilion/config/dhcpcd.deny.wlan0 > /etc/dhcpcd.conf
if [ $(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
sudo apt update
sudo apt -y install hostapd dnsmasq apache2 php
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 chown -R www-data:www-data /var/www/html
sudo chown root:www-data /var/www/html/.htaccess
sudo cp -f rc.hotspot /etc/rc.local
sudo cp -f override.hotspot /etc/apache2/conf-available/override.conf
sudo a2enconf override
sudo a2enmod rewrite
echo "Backing up wireless network configuration..." sudo bash -c 'cat /home/pi/pivilion/config/interfaces.hotspot > /etc/network/interfaces'
sudo mv /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.bak
echo "Captive portal enabled. Reboot to execute." sudo update-rc.d dnsmasq enable
sudo bash -c 'cat /home/pi/pivilion/config/rc.local.hotspot > /etc/rc.local'
echo "Your Rpi will reboot in hotspot mode"!
sudo bash -c 'echo "hotspot" > /home/pi/pivilion/mode' sudo bash -c 'echo "hotspot" > /home/pi/pivilion/mode'
exit 0

View File

@ -25,7 +25,7 @@
</head> </head>
<body> <body>
<h1>Welcome to Pivilion!</h1> <h1>Welcome to Pivilion!</h1>
<p>Access your Rpi using SFTP or consult the manual to get your content here. </p> <p>Go make a gallery at yourRpilocalIP:81 or upload your own HTML to /var/www/html/pivilion/gen or change the server directory in /etc/lighttpd/lighttpd.conf.</p>
<p>For more info visit <a href="http://pivilion.net">pivilion.net</a> <p>For more info visit <a href="http://pivilion.net">pivilion.net</a>
<p>The gallery generation script will overwrite this file.</p> <p>The gallery generation script will overwrite this file.</p>
</body> </body>