Permalink
Browse files

v135

+ PiHole changed to official installer:
#583
  • Loading branch information...
1 parent 12854c6 commit 28b28ce3b75cea6f4c3fd899bc053fc438b8d223 @Fourdee committed Oct 26, 2016
Showing with 30 additions and 136 deletions.
  1. +1 −0 CHANGELOG.txt
  2. +1 −1 config.txt
  3. +0 −15 dietpi/conf/dnsmasq.conf
  4. +28 −120 dietpi/dietpi-software
View
@@ -11,6 +11,7 @@ DietPi-Software | XU4 Cloudshell LCD Panel: Will automatically be enabled during
DietPi-Software | XU4: All 8 cores are now included in configuration stage. Previously we limited configurations to only use 4 CPU cores, due to heat issues with XU4. This will affect software installations such as webservers and should increase their overall performance.
DietPi-Software | Syncthing installation updated to 0.14.9.
DietPi-Software | MPD (HiFi): Updated to MPD 0.19.19 and now includes SOXR support for all SBC devices: https://github.com/Fourdee/DietPi/issues/580
+DietPi-Software | PiHole: Installation now uses the official installer: https://github.com/Fourdee/DietPi/issues/583
DietPi-Config | LCD Panel addon: Added support for Odroid 3.5 inch LCD touchscreen shield: http://www.hardkernel.com/main/products/prdt_info.php?g_code=G147435282441
DietPi-Config | Soundcard: Added support for JustBoom high-end audiophile soundcards (384khz/32bit), available from Pi Supply: https://www.pi-supply.com/brand/justboom/
DietPi-Cloudshell | Now supports 480x320 resolutions (eg: Odroid 3.5 touchscreen shield).
View
@@ -83,4 +83,4 @@ force_turbo=0
#core_freq_min=250
#sdram_freq_min=400
-#Note To Self, NEVER enable L2 cache, breaks most X based applications that were not compiled with L2 cache enabled.
+#Note To Self, NEVER enable L2 cache, breaks most X based applications that were not compiled with L2 cache enabled.
@@ -1,15 +0,0 @@
-#/etc/dnsmasq.conf
-
-addn-hosts=/etc/pihole/gravity.list
-domain-needed
-bogus-priv
-no-resolv
-server=8.8.8.8
-server=8.8.4.4
-interface=eth0
-listen-address=127.0.0.1
-cache-size=10000
-log-queries
-log-facility=/var/log/pihole.log
-local-ttl=300
-log-async
View
@@ -1370,6 +1370,7 @@ _EOF_
aSOFTWARE_WHIP_DESC[$index_current]='block adverts for any device on your network'
aSOFTWARE_CATEGORY_INDEX[$index_current]=14
aSOFTWARE_TYPE[$index_current]=0
+ aSOFTWARE_REQUIRES_GIT[$index_current]=1
aSOFTWARE_REQUIRES_WEBSERVER[$index_current]=1
aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&start=20#p174'
@@ -3376,88 +3377,42 @@ _EOF_
Banner_Installing
- # local git_version='master'
- # local git_owner='pi-hole'
- local git_version='04_09_2016'
- local git_owner='Fourdee'
-
# - Web stats
- INSTALL_URL_ADDRESS="https://github.com/$git_owner/AdminLTE/archive/$git_version.zip"
+ INSTALL_URL_ADDRESS='http://install.pi-hole.net'
/DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS"
if (( $? == 0 )); then
- #Install
-
- AGI dnsmasq bc
- service dnsmasq stop
-
- #Generate PiHole Dirs
- mkdir -p /etc/pihole
- mkdir -p /etc/.pihole #gravity always wants to read from the "temp" installation folder used by their install script.
- mkdir -p /opt/pihole
- # - reinstall: Always remove existing pihole dashboard dir
- rm -R /var/www/pihole
- mkdir -p /var/www/pihole
+ if (( $USER_INPUTS )); then
- #Grab/Setup Web interface panel
- wget "$INSTALL_URL_ADDRESS" -O package.zip
- unzip -o package.zip
- mv AdminLTE-*/* /var/www/pihole/
- rm -R AdminLTE-*
- rm package.zip
+ # - Check free available memory. Increase swapfile size to prevent gravity running out of mem.
+ if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then
- # - Grab chronometer (this script is run to parse logfiles for PiHole webpage stats)
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/advanced/Scripts/chronometer.sh -O /usr/local/bin/chronometer.sh
- chmod +x /usr/local/bin/chronometer.sh
+ if [ -f /etc/dphys-swapfile ] &&
+ (( $(cat /etc/dphys-swapfile | grep 'CONF_SWAPSIZE=' | sed 's/.*=//') < 512 )); then
- # - Blacklist/whitelist scripts
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/advanced/Scripts/blacklist.sh -O /opt/pihole/blacklist.sh
- chmod +x /opt/pihole/blacklist.sh
+ /DietPi/dietpi/func/dietpi-notify 2 "Increasing swapfile size to 512MB before running gravity.sh, please wait...\n"
+ /DietPi/dietpi/func/dietpi-set_dphys-swapfile 512
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/advanced/Scripts/whitelist.sh -O /opt/pihole/whitelist.sh
- chmod +x /opt/pihole/whitelist.sh
+ fi
- # - update dashboard
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/advanced/Scripts/updateDashboard.sh -O /opt/pihole/updateDashboard.sh
- #chmod +x /opt/pihole/updateDashboard.sh #Disabled as it wants to install Git and expects official installation method.
+ fi
- # - Default ads list
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/adlists.default -O /etc/pihole/adlists.default
- cp /etc/pihole/adlists.default /etc/.pihole/adlists.default
+ # NB: PiHole currently replaces the lighttpd.conf file entirly and restricts webserver use to PiHole only. We dont want a limited webserver dedicated to PiHole, so lets avoid it.
+ mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.bak &> /dev/null
- #Check free available memory. Increase swapfile size to prevent gravity running out of mem.
- if (( $(free -m | grep -m1 'Mem:' | awk '{print $4}') < 512 )); then
+ # - Install
+ wget "$INSTALL_URL_ADDRESS" -O install.sh
+ chmod +x install.sh
+ ./install.sh
- if [ -f /etc/dphys-swapfile ] &&
- (( $(cat /etc/dphys-swapfile | grep 'CONF_SWAPSIZE=' | sed 's/.*=//') < 512 )); then
+ mv /etc/lighttpd/lighttpd.conf.bak /etc/lighttpd/lighttpd.conf &> /dev/null
- /DietPi/dietpi/func/dietpi-notify 2 "Increasing swapfile size to 512MB before running gravity.sh, please wait...\n"
- /DietPi/dietpi/func/dietpi-set_dphys-swapfile 512
+ else
- fi
+ /DietPi/dietpi/func/dietpi-notify 1 "PiHole requires user inputs for installation. Please launch the dietpi-software program and select PiHole."
fi
- #Run and update adblocking databases (gravity)
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/gravity.sh -O /usr/local/bin/gravity.sh
- chmod 755 /usr/local/bin/gravity.sh
- /usr/local/bin/gravity.sh
- killall -w dnsmasq # gravity.sh restarts dnsmasq and creates a brief temp loss of connection. So lets kill the process and wait for it to terminate.
- ln -sf /usr/local/bin/gravity.sh /opt/pihole/gravity.sh #symlink to new location of script. We still use the old location for docs and cron
-
- #bash completion for pihole bin
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/advanced/bash-completion/pihole -O /etc/bash_completion.d/pihole
- . /etc/bash_completion.d/pihole
-
- #Pihole bin
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/pihole -O /usr/local/bin/pihole
- chmod +x /usr/local/bin/pihole
-
- #Pihole sudoers (to allow web interface access to pihole bin and add/remove white/black lists)
- mkdir -p /etc/sudoers.d
- wget https://raw.githubusercontent.com/"$git_owner"/pi-hole/"$git_version"/advanced/pihole.sudo -O /etc/sudoers.d/pihole
- chmod 0440 /etc/sudoers.d/pihole
-
else
Error_NoConnection_NoInstall
@@ -6083,7 +6038,6 @@ _EOF_
systemctl daemon-reload
-
#Copy default config
cp /DietPi/dietpi/conf/mpd.conf /etc/mpd.conf
@@ -6406,51 +6360,23 @@ _EOF_
INSTALLING_INDEX=93
if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then
- #Generate index page that replaces adverts
+ # - Create a symlink so users can use http://ip/pihole
+ ln -sf /var/www/html/admin /var/www/pihole
+
+ # - Generate index page that replaces adverts and prevents popups
cat << _EOF_ > /var/www/index.html
<html>
Blocked by Pi-hole.
<script>window.close();</script>
</html>
_EOF_
- #Generate pihole.log , set permissions to www-data
+ # - Generate pihole.log , set permissions to www-data
echo -e "" > /var/log/pihole.log
- chown www-data:www-data /var/log/pihole.log &> /dev/null
+ chown www-data:www-data /var/log/pihole.log
chmod 775 /var/log/pihole.log
- #Apply dnsmasq.conf
- cp /DietPi/dietpi/conf/dnsmasq.conf /etc/dnsmasq.conf
-
- #Add active network adapter
- local active_network_adapter=$(sed -n 3p /DietPi/dietpi/.network)
- sed -i "/interface=/c\interface=$active_network_adapter" /etc/dnsmasq.conf
-
- #Set dnsmasq service to user www-data.
- sed -i '/DNSMASQ_USER=/c\DNSMASQ_USER="www-data"' /etc/init.d/dnsmasq
-
- #Add weekly cronjob to update adlist
- cat << _EOF_ > /etc/cron.weekly/pihole_adlist_update
-#!/bin/bash
-{
- service dnsmasq stop
-
- echo -e "--------------------------------------------------------------------\n\n\$(date)\nDietPi - Running weekly adlist update" >> /var/log/pihole.log
- /usr/local/bin/gravity.sh &>> /var/log/pihole.log
- echo -e "--------------------------------------------------------------------\n" >> /var/log/pihole.log
-
- service dnsmasq start
-
- exit 0
-}
-
-_EOF_
-
- chmod +x /etc/cron.weekly/pihole_adlist_update
-
- # - Prevent warning of missing file during gravity.sh: https://github.com/Fourdee/DietPi/issues/311#issuecomment-230276175
- # NB: The contents of this file is not "currently" required for our installation.
- echo -e "#nothing here" > /etc/dnsmasq.d/01-pihole.conf
+ echo 0 &> /dev/null
fi
@@ -8360,22 +8286,7 @@ _EOF_
elif (( $1 == 93 )); then
AGP dnsmasq
- rm /etc/dnsmasq.conf
- rm /usr/local/bin/gravity.sh
- rm /usr/local/bin/chronometer.sh
- rm -R /var/www/pihole
- rm -R /etc/pihole
- rm -R /etc/.pihole
- rm -R /opt/pihole
- rm /var/log/pihole.log
- rm /etc/cron.weekly/pihole_adlist_update
- rm /etc/dnsmasq.d/01-pihole.conf
-
- rm /opt/pihole/gravity.sh
- rm /etc/bash_completion.d/pihole
- rm /usr/local/bin/pihole
- rm /etc/sudoers.d/pihole
-
+ pihole uninstall
elif (( $1 == 33 || $1 == 34 )); then
@@ -10713,9 +10624,6 @@ _EOF_
#Pi-hole.
if (( ${aSOFTWARE_INSTALL_STATE[93]} == 1 )); then
- # - Modified fork disclaimer
- whiptail --title "PiHole" --msgbox "Please note, the DietPi installation of PiHole is a modified fork. It is not endorsed or supported by PiHole.\n\nThe main changes of our version:\n - Works with Apache2, Nginx and Lighttpd\n - Smaller installation (we dont use git packages)\n - Allows for additional uses of the webserver (eg: Owncloud)\n - Updates are rolled out through DietPi-Update\n - Web dash is http://ip/pihole\n - Blocked advert pages will provide a message, instead of blank\n - May be upto 2-4weeks behind PiHole version\n\nTLDR: Contact DietPi for support if you experience issues with our modified Pihole installation" --backtitle "$WHIP_BACKTITLE" 20 70
-
# - prompt for static ip.
WHIP_TITLE=' Pi-hole - Setup Static IP Now?'
WHIP_QUESTION='A static IP address is essential for Pi-hole installations. DietPi-Config can be used to quickly setup your static IP address.\n\nIf you have already setup your static IP, please ignore this message.\n\nWould you like to setup your static IP address now?'

0 comments on commit 28b28ce

Please sign in to comment.