Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Updated deps #21

Merged
merged 2 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependencies/CustomPiOS
Submodule CustomPiOS updated 37 files
+4 −3 README.rst
+3 −0 src/Dockerfile
+3 −0 src/Dockerfile.arm32v7
+34 −15 src/common.sh
+24 −6 src/custompios
+1 −1 src/dist_generators/dist_example/src/modules/example/start_chroot_script
+0 −1 src/dist_generators/dist_example/src/variants/jessielite/config
+10 −1 src/modules/admin-toolkit/config
+4 −4 src/modules/admin-toolkit/filesystem/home/pi/scripts/ufw_config
+22 −2 src/modules/admin-toolkit/start_chroot_script
+2 −0 ...dules/auto-mount-removable/filesystem/root/etc/systemd/system/systemd-udevd.service.d/override-private.conf
+15 −0 src/modules/auto-mount-removable/start_chroot_script
+24 −1 src/modules/base/config
+10 −2 src/modules/base/end_chroot_script
+112 −0 src/modules/base/filesystem/ubuntu/usr/lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant
+28 −5 src/modules/base/start_chroot_script
+5 −0 src/modules/docker/config
+1 −0 src/modules/docker/filesystem/boot/docker-compose/README
+15 −0 src/modules/docker/filesystem/root/etc/systemd/system/docker-compose.service
+17 −0 src/modules/docker/filesystem/root/usr/bin/start_docker_compose
+10 −0 src/modules/docker/filesystem/root/usr/bin/stop_docker_compose
+47 −2 src/modules/docker/start_chroot_script
+1 −1 src/modules/gui/filesystem/home/pi/scripts/enable_gpu
+56 −0 src/modules/gui/filesystem/home/pi/scripts/rotate.sh
+1 −1 src/modules/kernel/config
+2 −2 src/modules/kernel/end_chroot_script
+3 −2 src/modules/kernel/start_chroot_script
+24 −1 src/modules/network/start_chroot_script
+2 −2 src/nightly_build_scripts/custompios_nightly_build
+2 −2 src/qemu_boot.sh
+67 −0 src/qemu_boot64.sh
+28 −5 src/release
+1 −0 src/variants/armbian/config
+3 −3 src/variants/armbian/filesystem/root/etc/network/interfaces
+19 −5 src/variants/armbian/pre_chroot_script
+5 −1 src/variants/bananapi-m1/pre_chroot_script
+5 −1 src/variants/example/post_chroot_script
2 changes: 1 addition & 1 deletion dependencies/OctoPi
2 changes: 1 addition & 1 deletion src/modules/cncjs/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pushd /home/pi

# make links to the logos
pushd landingPage/static
ln -s /usr/local/lib/node_modules/cncjs/dist/cnc/web/images/logo-badge-256x256.png logo_cncjs.png
ln -s /usr/local/lib/node_modules/cncjs/dist/cncjs/app/images/logo-badge-256x256.png logo_cncjs.png
ln -s /home/pi/oprint/lib/python2.7/site-packages/octoprint/static/img/logo.png logo_octoprint.png
ln -s /var/www/html/app/img/raspAP-logo.png logo_raspap.png
popd
Expand Down
95 changes: 1 addition & 94 deletions src/modules/raspap/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -14,102 +14,9 @@ source /common.sh
### Script ####

echo "--- RaspAP Install"

echo "--- RaspAP apt Install"
apt-get update
apt-get install -y git lighttpd php7.1-cgi hostapd dnsmasq vnstat
#cleanup
apt-get clean
apt-get autoremove -y

echo "--- RaspAP lighttpd Install"
lighttpd-enable-mod fastcgi-php

echo "--- RaspAP html Install"
rm -rf /var/www/html
git clone https://github.com/billz/raspap-webgui /var/www/html
mv /var/www/html/app/icons/* /var/www/html
chown -R www-data:www-data /var/www/html
mkdir /etc/raspap
mv /var/www/html/raspap.php /etc/raspap/
chown -R www-data:www-data /etc/raspap

echo "--- RaspAP sudoers Install"
cat <<'EOT' >> /etc/sudoers
# For security reasons, the www-data user which lighttpd runs under is not allowed to start or stop
# daemons, or run commands like ifdown and ifup, all of which we want our page to do. So what I have
# done is added the www-data user to the sudoers file, but with restrictions on what commands the
# user can run

www-data ALL=(ALL) NOPASSWD:/sbin/ifdown
www-data ALL=(ALL) NOPASSWD:/sbin/ifup
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wpa_supplicant/wpa_supplicant.conf
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wpa_supplicant/wpa_supplicant-wlan[0-9].conf
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/wifidata /etc/wpa_supplicant/wpa_supplicant.conf
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/wifidata /etc/wpa_supplicant/wpa_supplicant-wlan[0-9].conf
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli -i wlan[0-9] scan_results
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli -i wlan[0-9] scan
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli -i wlan[0-9] reconfigure
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli -i wlan[0-9] select_network
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf
www-data ALL=(ALL) NOPASSWD:/bin/systemctl start hostapd.service
www-data ALL=(ALL) NOPASSWD:/bin/systemctl stop hostapd.service
www-data ALL=(ALL) NOPASSWD:/bin/systemctl start dnsmasq.service
www-data ALL=(ALL) NOPASSWD:/bin/systemctl stop dnsmasq.service
www-data ALL=(ALL) NOPASSWD:/bin/systemctl start openvpn-client@client
www-data ALL=(ALL) NOPASSWD:/bin/systemctl stop openvpn-client@client
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/openvpn.ovpn /etc/openvpn/client/client.conf
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/authdata /etc/openvpn/client/#.conf
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dnsmasqdata /etc/dnsmasq.conf
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dhcpddata /etc/dhcpcd.conf
www-data ALL=(ALL) NOPASSWD:/sbin/shutdown -h now
www-data ALL=(ALL) NOPASSWD:/sbin/reboot
www-data ALL=(ALL) NOPASSWD:/sbin/ip link set wlan[0-9] down
www-data ALL=(ALL) NOPASSWD:/sbin/ip link set wlan[0-9] up
www-data ALL=(ALL) NOPASSWD:/sbin/ip -s a f label wlan[0-9]
www-data ALL=(ALL) NOPASSWD:/bin/cp /etc/raspap/networking/dhcpcd.conf /etc/dhcpcd.conf
www-data ALL=(ALL) NOPASSWD:/etc/raspap/hostapd/enablelog.sh
www-data ALL=(ALL) NOPASSWD:/etc/raspap/hostapd/disablelog.sh
www-data ALL=(ALL) NOPASSWD:/etc/raspap/hostapd/servicestart.sh
www-data ALL=(ALL) NOPASSWD:/etc/raspap/lighttpd/configport.sh
www-data ALL=(ALL) NOPASSWD:/etc/raspap/openvpn/configauth.sh
EOT

echo "--- RaspAP Hostapd Install"
mkdir /etc/raspap/hostapd
mv /var/www/html/installers/*log.sh /etc/raspap/hostapd
mv /var/www/html/installers/service*.sh /etc/raspap/hostapd
chown -c root:www-data /etc/raspap/hostapd/*.sh
chmod 750 /etc/raspap/hostapd/*.sh

echo "--- RaspAP Configuration"
mv /var/www/html/config/default_hostapd /etc/default/hostapd
mv /var/www/html/config/hostapd.conf /etc/hostapd/hostapd.conf
mv /var/www/html/config/dnsmasq.conf /etc/dnsmasq.conf
mv /var/www/html/config/dhcpcd.conf /etc/dhcpcd.conf
mv /var/www/html/config/config.php /var/www/html/includes/
curl -sL https://install.raspap.com | bash -s -- --yes

sed -i 's@\(server.port\s*=\s*\)80@\17080@' /etc/lighttpd/lighttpd.conf
sed -i "s@raspi-webgui@$RASPAP_HOTSPOT_NAME@" /etc/hostapd/hostapd.conf

echo "--- RaspAP PHP Optimization"
sed -i -E 's/^session\.cookie_httponly\s*=\s*(0|([O|o]ff)|([F|f]alse)|([N|n]o))\s*$/session.cookie_httponly = 1/' /etc/php/7.1/cgi/php.ini
sed -i -E 's/^;?opcache\.enable\s*=\s*(0|([O|o]ff)|([F|f]alse)|([N|n]o))\s*$/opcache.enable = 1/' /etc/php/7.1/cgi/php.ini
phpenmod opcache

echo "--- RaspAP rc.local Configuration"
sed -i 's@exit 0@@' /etc/rc.local
cat <<'EOT' >> /etc/rc.local
echo 1 > /proc/sys/net/ipv4/ip_forward #RASPAP
iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP
iptables -t nat -A POSTROUTING -s 192.168.50.0/24 ! -d 192.168.50.0/24 -j MASQUERADE #RASPAP
EOT
echo 'exit 0' >> /etc/rc.local

echo "--- RaspAP hostapd services"
systemctl unmask hostapd.service
systemctl enable hostapd.service

mv /var/www/html/installers/raspap.service /lib/systemd/system
systemctl enable raspap.service