From e2b87759d8237c70118e30363a0998ca03769452 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 14:27:08 +0000 Subject: [PATCH 01/39] split out web dependencies --- automated install/basic-install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index a98eb3aa..861f5c35 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -78,7 +78,8 @@ if command -v apt-get &> /dev/null; then fi # ######################################### INSTALLER_DEPS=(apt-utils debconf dhcpcd5 git whiptail) - PIHOLE_DEPS=(bc cron curl dnsmasq dnsutils ${iproute_pkg} iputils-ping lighttpd lsof netcat ${phpVer}-common ${phpVer}-cgi sudo unzip wget) + PIHOLE_DEPS=(bc cron curl dnsmasq dnsutils ${iproute_pkg} iputils-ping lsof netcat sudo unzip wget) + PIHOLE_WEB_DEPS=(lighttpd ${phpVer}-common ${phpVer}-cgi} LIGHTTPD_USER="www-data" LIGHTTPD_GROUP="www-data" LIGHTTPD_CFG="lighttpd.conf.debian" @@ -97,8 +98,8 @@ elif command -v rpm &> /dev/null; then PKG_INSTALL=(${PKG_MANAGER} install -y) PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l" INSTALLER_DEPS=(git iproute net-tools newt procps-ng) - PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq findutils lighttpd lighttpd-fastcgi nmap-ncat php php-common php-cli sudo unzip wget) - + PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq findutils nmap-ncat sudo unzip wget) + PIHOLE_WEB_DEPS=(lighttpd lighttpd-fastcgi php php-common php-cli) if ! grep -q 'Fedora' /etc/redhat-release; then INSTALLER_DEPS=("${INSTALLER_DEPS[@]}" "epel-release"); fi @@ -1144,6 +1145,7 @@ main() { { echo "!!! Unable to clone ${piholeGitUrl} into ${PI_HOLE_LOCAL_REPO}, unable to continue."; \ exit 1; \ } + #TODO: Check if web flag is set here getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \ { echo "!!! Unable to clone ${webInterfaceGitUrl} into ${webInterfaceDir}, unable to continue."; \ exit 1; \ From d9ec3d2c22240070b529e357c1b7c0a42bc75c6e Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 14:28:18 +0000 Subject: [PATCH 02/39] spelling --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 861f5c35..40292da9 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -63,7 +63,7 @@ if command -v apt-get &> /dev/null; then # grep -c will return 1 retVal on 0 matches, block this throwing the set -e with an OR TRUE PKG_COUNT="${PKG_MANAGER} -s -o Debug::NoLocking=true upgrade | grep -c ^Inst || true" # ######################################### - # fixes for dependancy differences + # fixes for dependency differences # Debian 7 doesn't have iproute2 use iproute if ${PKG_MANAGER} install --dry-run iproute2 > /dev/null 2>&1; then iproute_pkg="iproute2" From f588c6f93c8f8bc7b61ff5ebf539f2f17b56831b Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 14:38:54 +0000 Subject: [PATCH 03/39] introduce web toggle flag --- automated install/basic-install.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 40292da9..97c43b4d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -34,6 +34,8 @@ useUpdateVars=false IPV4_ADDRESS="" IPV6_ADDRESS="" QUERY_LOGGING=true +INSTALL_WEB=true + # Find the rows and columns will default to 80x24 is it can not be detected screen_size=$(stty size 2>/dev/null || echo 24 80) @@ -70,7 +72,7 @@ if command -v apt-get &> /dev/null; then else iproute_pkg="iproute" fi - # Prefer the php metapackage if it's there, fall back on the php5 pacakges + # Prefer the php metapackage if it's there, fall back on the php5 packages if ${PKG_MANAGER} install --dry-run php > /dev/null 2>&1; then phpVer="php" else @@ -543,6 +545,27 @@ setLogging() { esac } +setAdminFlag() { + local WebToggleCommand + local WebChooseOptions + local WebChoices + + WebToggleCommand=(whiptail --separate-output --radiolist "Do you wish to install the web admin interface?" ${r} ${c} 6) + WebChooseOptions=("On (Recommended)" "" on + Off "" off) + WebChoices=$("${WebToggleCommand[@]}" "${WebChooseOptions[@]}" 2>&1 >/dev/tty) || (echo "::: Cancel selected. Exiting..." && exit 1) + case ${WebChoices} in + "On (Recommended)") + echo "::: Web Interface On." + INSTALL_WEB=true + ;; + Off) + echo "::: Web Interface off." + INSTALL_WEB=false + ;; + esac +} + version_check_dnsmasq() { # Check if /etc/dnsmasq.conf is from pihole. If so replace with an original and install new in .d directory @@ -920,6 +943,7 @@ finalExports() { echo "PIHOLE_DNS_1=${PIHOLE_DNS_1}" echo "PIHOLE_DNS_2=${PIHOLE_DNS_2}" echo "QUERY_LOGGING=${QUERY_LOGGING}" + echo "INSTALL_WEB=${INSTALL_WEB}" }>> "${setupVars}" # Look for DNS server settings which would have to be reapplied @@ -1168,6 +1192,8 @@ main() { setDNS # Let the user decide if they want to block ads over IPv4 and/or IPv6 use4andor6 + # Let the user decide if they want the web interface to be installed automatically + setAdminFlag # Let the user decide if they want query logging enabled... setLogging From bd07d7f32eba63a1d18d76213bdb8f82c3bd87a6 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 15:11:39 +0000 Subject: [PATCH 04/39] Only install web dependenices if flag is true --- automated install/basic-install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 97c43b4d..bf5afe69 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1169,7 +1169,6 @@ main() { { echo "!!! Unable to clone ${piholeGitUrl} into ${PI_HOLE_LOCAL_REPO}, unable to continue."; \ exit 1; \ } - #TODO: Check if web flag is set here getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \ { echo "!!! Unable to clone ${webInterfaceGitUrl} into ${webInterfaceDir}, unable to continue."; \ exit 1; \ @@ -1199,12 +1198,18 @@ main() { # Install packages used by the Pi-hole install_dependent_packages PIHOLE_DEPS[@] + if [[ ${INSTALL_WEB} == true ]]; then + install_dependent_packages PIHOLE_WEB_DEPS[@] + fi # Install and log everything to a file installPihole | tee ${tmpLog} else # update packages used by the Pi-hole install_dependent_packages PIHOLE_DEPS[@] + if [[ ${INSTALL_WEB} == true ]]; then + install_dependent_packages PIHOLE_WEB_DEPS[@] + fi updatePihole | tee ${tmpLog} fi From dfdb9e393b91aa8dfaae4add43c2625df0741975 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 15:15:42 +0000 Subject: [PATCH 05/39] move repo clone to function --- automated install/basic-install.sh | 36 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index bf5afe69..079f11e7 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1096,6 +1096,25 @@ update_dialogs() { esac } +clone_or_update_repos() { +if [[ "${reconfigure}" == true ]]; then + echo "::: --reconfigure passed to install script. Not downloading/updating local repos" + else + # Get Git files for Core and Admin + getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} || \ + { echo "!!! Unable to clone ${piholeGitUrl} into ${PI_HOLE_LOCAL_REPO}, unable to continue."; \ + exit 1; \ + } + + if [[ ${INSTALL_WEB} == true ]]; then + getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \ + { echo "!!! Unable to clone ${webInterfaceGitUrl} into ${webInterfaceDir}, unable to continue."; \ + exit 1; \ + } + fi + fi +} + main() { ######## FIRST CHECK ######## @@ -1161,19 +1180,6 @@ main() { # Check if SELinux is Enforcing checkSelinux - if [[ "${reconfigure}" == true ]]; then - echo "::: --reconfigure passed to install script. Not downloading/updating local repos" - else - # Get Git files for Core and Admin - getGitFiles ${PI_HOLE_LOCAL_REPO} ${piholeGitUrl} || \ - { echo "!!! Unable to clone ${piholeGitUrl} into ${PI_HOLE_LOCAL_REPO}, unable to continue."; \ - exit 1; \ - } - getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl} || \ - { echo "!!! Unable to clone ${webInterfaceGitUrl} into ${webInterfaceDir}, unable to continue."; \ - exit 1; \ - } - fi if [[ ${useUpdateVars} == false ]]; then # Display welcome dialogs @@ -1195,6 +1201,8 @@ main() { setAdminFlag # Let the user decide if they want query logging enabled... setLogging + # Clone/Update the repos + clone_or_update_repos # Install packages used by the Pi-hole install_dependent_packages PIHOLE_DEPS[@] @@ -1205,6 +1213,8 @@ main() { # Install and log everything to a file installPihole | tee ${tmpLog} else + # Clone/Update the repos + clone_or_update_repos # update packages used by the Pi-hole install_dependent_packages PIHOLE_DEPS[@] if [[ ${INSTALL_WEB} == true ]]; then From f8322cc2d46fed92cc394a174c919d3ef7bc7964 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 15:25:02 +0000 Subject: [PATCH 06/39] use the web install flag. Could be optimised --- automated install/basic-install.sh | 62 +++++++++++++++++++----------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 079f11e7..52763f25 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -994,7 +994,9 @@ installPihole() { installScripts installConfigs CreateLogFile - installPiholeWeb + if [[ ${INSTALL_WEB} == true ]]; then + installPiholeWeb + fi installCron installLogrotate configureFirewall @@ -1025,7 +1027,9 @@ updatePihole() { installScripts installConfigs CreateLogFile - installPiholeWeb + if [[ ${INSTALL_WEB} == true ]]; then + installPiholeWeb + fi installCron installLogrotate finalExports #re-export setupVars.conf to account for any new vars added in new versions @@ -1188,7 +1192,9 @@ main() { mkdir -p /etc/pihole/ # Stop resolver and webserver while installing proceses stop_service dnsmasq - stop_service lighttpd + if [[ ${INSTALL_WEB} == true ]]; then + stop_service lighttpd + fi # Determine available interfaces get_available_interfaces # Find interfaces and let the user choose one @@ -1227,25 +1233,31 @@ main() { # Move the log file into /etc/pihole for storage mv ${tmpLog} ${instalLogLoc} - # Add password to web UI if there is none - pw="" - if [[ $(grep 'WEBPASSWORD' -c /etc/pihole/setupVars.conf) == 0 ]] ; then - pw=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 8) - /usr/local/bin/pihole -a -p "${pw}" - fi - - if [[ "${useUpdateVars}" == false ]]; then - displayFinalMessage "${pw}" + if [[ ${INSTALL_WEB} == true ]]; then + # Add password to web UI if there is none + pw="" + if [[ $(grep 'WEBPASSWORD' -c /etc/pihole/setupVars.conf) == 0 ]] ; then + pw=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 8) + /usr/local/bin/pihole -a -p "${pw}" + fi fi echo "::: Restarting services..." # Start services start_service dnsmasq enable_service dnsmasq - start_service lighttpd - enable_service lighttpd + + if [[ ${INSTALL_WEB} == true ]]; then + start_service lighttpd + enable_service lighttpd + fi + echo "::: done." + if [[ "${useUpdateVars}" == false ]]; then + displayFinalMessage "${pw}" + fi + echo ":::" if [[ "${useUpdateVars}" == false ]]; then echo "::: Installation Complete! Configure your devices to use the Pi-hole as their DNS server using:" @@ -1253,19 +1265,23 @@ main() { echo "::: ${IPV6_ADDRESS}" echo ":::" echo "::: If you set a new IP address, you should restart the Pi." - echo "::: View the web interface at http://pi.hole/admin or http://${IPV4_ADDRESS%/*}/admin" + if [[ ${INSTALL_WEB} == true ]]; then + echo "::: View the web interface at http://pi.hole/admin or http://${IPV4_ADDRESS%/*}/admin" + fi else echo "::: Update complete!" fi - if (( ${#pw} > 0 )) ; then - echo ":::" - echo "::: Note: As security measure a password has been installed for your web interface" - echo "::: The currently set password is" - echo "::: ${pw}" - echo ":::" - echo "::: You can always change it using" - echo "::: pihole -a -p new_password" + if [[ ${INSTALL_WEB} == true ]]; then + if (( ${#pw} > 0 )) ; then + echo ":::" + echo "::: Note: As security measure a password has been installed for your web interface" + echo "::: The currently set password is" + echo "::: ${pw}" + echo ":::" + echo "::: You can always change it using" + echo "::: pihole -a -p new_password" + fi fi echo ":::" From f0bd7fae5c6c08ea9987e25fb092d69b70f3bcaa Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 15:32:07 +0000 Subject: [PATCH 07/39] ) not } --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 52763f25..6476f0c6 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -81,7 +81,7 @@ if command -v apt-get &> /dev/null; then # ######################################### INSTALLER_DEPS=(apt-utils debconf dhcpcd5 git whiptail) PIHOLE_DEPS=(bc cron curl dnsmasq dnsutils ${iproute_pkg} iputils-ping lsof netcat sudo unzip wget) - PIHOLE_WEB_DEPS=(lighttpd ${phpVer}-common ${phpVer}-cgi} + PIHOLE_WEB_DEPS=(lighttpd ${phpVer}-common ${phpVer}-cgi) LIGHTTPD_USER="www-data" LIGHTTPD_GROUP="www-data" LIGHTTPD_CFG="lighttpd.conf.debian" From 731d15f9b574eefc6760bb6a3b1e88354705c131 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 15:43:33 +0000 Subject: [PATCH 08/39] don't display web admin info in final dialog if it's not selected --- automated install/basic-install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 6476f0c6..54020ecb 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1055,6 +1055,13 @@ checkSelinux() { } displayFinalMessage() { + + if [[ ${INSTALL_WEB} == true ]]; then + additional="View the web interface at http://pi.hole/admin or http://${IPV4_ADDRESS%/*}/admin + +Your Admin Webpage login password is ${1:-"NOT SET"}" + fi + # Final completion message to user whiptail --msgbox --backtitle "Make it so." --title "Installation Complete!" "Configure your devices to use the Pi-hole as their DNS server using: @@ -1064,9 +1071,8 @@ IPv6: ${IPV6_ADDRESS:-"Not Configured"} If you set a new IP address, you should restart the Pi. The install log is in /etc/pihole. -View the web interface at http://pi.hole/admin or http://${IPV4_ADDRESS%/*}/admin -Your Admin Webpage login password is ${1:-"NOT SET"}" ${r} ${c} +${additional}" ${r} ${c} } update_dialogs() { From 01429d59bd57ee731ae3eb5ca11343fa50659d87 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 15:45:14 +0000 Subject: [PATCH 09/39] more web checks --- automated install/basic-install.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 54020ecb..ae7e8c4d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -980,16 +980,19 @@ installLogrotate() { installPihole() { # Install base files and web interface create_pihole_user - if [ ! -d "/var/www/html" ]; then - mkdir -p /var/www/html - fi - chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/www/html - chmod 775 /var/www/html - usermod -a -G ${LIGHTTPD_GROUP} pihole - if [ -x "$(command -v lighty-enable-mod)" ]; then - lighty-enable-mod fastcgi fastcgi-php > /dev/null || true - else - printf "\n:::\tWarning: 'lighty-enable-mod' utility not found. Please ensure fastcgi is enabled if you experience issues.\n" + + if [[ ${INSTALL_WEB} == true ]]; then + if [ ! -d "/var/www/html" ]; then + mkdir -p /var/www/html + fi + chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/www/html + chmod 775 /var/www/html + usermod -a -G ${LIGHTTPD_GROUP} pihole + if [ -x "$(command -v lighty-enable-mod)" ]; then + lighty-enable-mod fastcgi fastcgi-php > /dev/null || true + else + printf "\n:::\tWarning: 'lighty-enable-mod' utility not found. Please ensure fastcgi is enabled if you experience issues.\n" + fi fi installScripts installConfigs From bc4762f270673251b2a673b363044d485fc157ad Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 16:27:02 +0000 Subject: [PATCH 10/39] no need to stop dnsmasq/lighttpt if we're going to reload them at the end anyway. --- automated install/basic-install.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index ae7e8c4d..fd135fb7 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1199,11 +1199,7 @@ main() { welcomeDialogs # Create directory for Pi-hole storage mkdir -p /etc/pihole/ - # Stop resolver and webserver while installing proceses - stop_service dnsmasq - if [[ ${INSTALL_WEB} == true ]]; then - stop_service lighttpd - fi + # Determine available interfaces get_available_interfaces # Find interfaces and let the user choose one From 5fede23cf7f344d70c669969b8ddc603c82696a6 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 18:39:15 +0000 Subject: [PATCH 11/39] trying another tactic --- automated install/basic-install.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index fd135fb7..3192c9a7 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1216,21 +1216,27 @@ main() { clone_or_update_repos # Install packages used by the Pi-hole - install_dependent_packages PIHOLE_DEPS[@] if [[ ${INSTALL_WEB} == true ]]; then - install_dependent_packages PIHOLE_WEB_DEPS[@] + DEPS=("${PIHOLE_DEPS}" "${PIHOLE_WEB_DEPS}") + else + DEPS=("${PIHOLE_DEPS}") fi + install_dependent_packages DEPS[@] + # Install and log everything to a file installPihole | tee ${tmpLog} else # Clone/Update the repos clone_or_update_repos - # update packages used by the Pi-hole - install_dependent_packages PIHOLE_DEPS[@] + + # Install packages used by the Pi-hole if [[ ${INSTALL_WEB} == true ]]; then - install_dependent_packages PIHOLE_WEB_DEPS[@] + DEPS=("${PIHOLE_DEPS}" "${PIHOLE_WEB_DEPS}") + else + DEPS=("${PIHOLE_DEPS}") fi + install_dependent_packages DEPS[@] updatePihole | tee ${tmpLog} fi From 90af12fdb8c2779b63ae06b72f0a10fa189caefd Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 18:41:37 +0000 Subject: [PATCH 12/39] Remember the [@] --- automated install/basic-install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 3192c9a7..053c09d3 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1215,11 +1215,11 @@ main() { # Clone/Update the repos clone_or_update_repos - # Install packages used by the Pi-hole + # Install packages used by the Pi-hole if [[ ${INSTALL_WEB} == true ]]; then - DEPS=("${PIHOLE_DEPS}" "${PIHOLE_WEB_DEPS}") + DEPS=("${PIHOLE_DEPS[@]}" "${PIHOLE_WEB_DEPS[@]}") else - DEPS=("${PIHOLE_DEPS}") + DEPS=("${PIHOLE_DEPS[@]}") fi install_dependent_packages DEPS[@] @@ -1232,9 +1232,9 @@ main() { # Install packages used by the Pi-hole if [[ ${INSTALL_WEB} == true ]]; then - DEPS=("${PIHOLE_DEPS}" "${PIHOLE_WEB_DEPS}") + DEPS=("${PIHOLE_DEPS[@]}" "${PIHOLE_WEB_DEPS[@]}") else - DEPS=("${PIHOLE_DEPS}") + DEPS=("${PIHOLE_DEPS[@]}") fi install_dependent_packages DEPS[@] From 35828f9cea495e486e7c7cdbfede230f27bdc1b7 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 19:05:55 +0000 Subject: [PATCH 13/39] Source setupvars earlier in update/repair process --- automated install/basic-install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 053c09d3..d7e51ffc 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1024,8 +1024,6 @@ accountForRefactor() { updatePihole() { accountForRefactor - # Source ${setupVars} for use in the rest of the functions. - source ${setupVars} # Install base files and web interface installScripts installConfigs @@ -1230,7 +1228,10 @@ main() { # Clone/Update the repos clone_or_update_repos - # Install packages used by the Pi-hole + # Source ${setupVars} for use in the rest of the functions. + source ${setupVars} + + # Install packages used by the Pi-hole if [[ ${INSTALL_WEB} == true ]]; then DEPS=("${PIHOLE_DEPS[@]}" "${PIHOLE_WEB_DEPS[@]}") else From c31b4383e6a0520fcedce65265a9b7241b8cc186 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 28 Jan 2017 21:37:21 +0000 Subject: [PATCH 14/39] add back in code to stop `dnsmasq` and `lighttpd` during install. --- automated install/basic-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index d7e51ffc..e8595065 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1198,6 +1198,10 @@ main() { # Create directory for Pi-hole storage mkdir -p /etc/pihole/ + stop_service dnsmasq + if [[ ${INSTALL_WEB} == true ]]; then + stop_service lighttpd + fi # Determine available interfaces get_available_interfaces # Find interfaces and let the user choose one From e57425df5fc84fbef31e8eb69584ce4238f90e5e Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sat, 4 Feb 2017 15:25:11 +0000 Subject: [PATCH 15/39] 0.0.0.0 instead of pi-holes IP address for redirect purposes --- automated install/basic-install.sh | 39 +++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index e8595065..7bce614e 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -663,19 +663,23 @@ installConfigs() { echo ":::" echo "::: Installing configs..." version_check_dnsmasq - if [ ! -d "/etc/lighttpd" ]; then - mkdir /etc/lighttpd - chown "${USER}":root /etc/lighttpd - elif [ -f "/etc/lighttpd/lighttpd.conf" ]; then - mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig + + #Only mess with lighttpd configs if user has chosen to install web interface + if [[ ${INSTALL_WEB} == true ]]; then + if [ ! -d "/etc/lighttpd" ]; then + mkdir /etc/lighttpd + chown "${USER}":root /etc/lighttpd + elif [ -f "/etc/lighttpd/lighttpd.conf" ]; then + mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig + fi + cp /etc/.pihole/advanced/${LIGHTTPD_CFG} /etc/lighttpd/lighttpd.conf + mkdir -p /var/run/lighttpd + chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/run/lighttpd + mkdir -p /var/cache/lighttpd/compress + chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/compress + mkdir -p /var/cache/lighttpd/uploads + chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/uploads fi - cp /etc/.pihole/advanced/${LIGHTTPD_CFG} /etc/lighttpd/lighttpd.conf - mkdir -p /var/run/lighttpd - chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/run/lighttpd - mkdir -p /var/cache/lighttpd/compress - chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/compress - mkdir -p /var/cache/lighttpd/uploads - chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/uploads } stop_service() { @@ -932,6 +936,17 @@ configureFirewall() { } finalExports() { + + if [[ ${INSTALL_WEB} == false ]]; then + #No web interface installed, and therefore no block page set IPV4/6 to 0.0.0.0 and ::/0 + if [ ${IPV4_ADDRESS} ]; then + IPV4_ADDRESS="0.0.0.0" + fi + if [ ${IPV6_ADDRESS} ]; then + IPV6_ADDRESS="::/0" + fi + fi + # Update variables in setupVars.conf file if [ -e "${setupVars}" ]; then sed -i.update.bak '/PIHOLE_INTERFACE/d;/IPV4_ADDRESS/d;/IPV6_ADDRESS/d;/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;/QUERY_LOGGING/d;' "${setupVars}" From 1428b58dde3d5be8b185139f89875eda0a00c70b Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 5 Feb 2017 19:07:04 +0000 Subject: [PATCH 16/39] source setupVars and only check admin repo if it is enabled --- advanced/Scripts/update.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index df71e9a9..a77d0bc4 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -19,6 +19,8 @@ readonly ADMIN_INTERFACE_DIR="/var/www/html/admin" readonly PI_HOLE_GIT_URL="https://github.com/pi-hole/pi-hole.git" readonly PI_HOLE_FILES_DIR="/etc/.pihole" +source /etc/pihole/setupVars.conf + is_repo() { # Use git to check if directory is currently under VCS, return the value local directory="${1}" @@ -137,8 +139,8 @@ main() { local web_version_current #This is unlikely - if ! is_repo "${PI_HOLE_FILES_DIR}" || ! is_repo "${ADMIN_INTERFACE_DIR}" ; then - echo "::: Critical Error: One or more Pi-Hole repos are missing from system!" + if ! is_repo "${PI_HOLE_FILES_DIR}" ; then + echo "::: Critical Error: Core Pi-Hole repo is missing from system!" echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole" exit 1; fi @@ -153,12 +155,20 @@ main() { echo "::: Pi-hole Core: up to date" fi - if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then - web_update=true - echo "::: Web Interface: update available" - else - web_update=false - echo "::: Web Interface: up to date" + if [[ ${INSTALL_WEB} == true ]]; then + if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then + echo "::: Critical Error: Web Admin repo is missing from system!" + echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole" + exit 1; + fi + + if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then + web_update=true + echo "::: Web Interface: update available" + else + web_update=false + echo "::: Web Interface: up to date" + fi fi # Logic From ba0abdb88d9ad67f02467c5d6d7285e1ce61077a Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 5 Feb 2017 19:12:09 +0000 Subject: [PATCH 17/39] wrap update logic in admin_installed bool check --- advanced/Scripts/update.sh | 96 ++++++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 41 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index a77d0bc4..436a5ae6 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -169,57 +169,71 @@ main() { web_update=false echo "::: Web Interface: up to date" fi - fi - # Logic - # If Core up to date AND web up to date: - # Do nothing - # If Core up to date AND web NOT up to date: - # Pull web repo - # If Core NOT up to date AND web up to date: - # pull pihole repo, run install --unattended -- reconfigure - # if Core NOT up to date AND web NOT up to date: - # pull pihole repo run install --unattended + # Logic + # If Core up to date AND web up to date: + # Do nothing + # If Core up to date AND web NOT up to date: + # Pull web repo + # If Core NOT up to date AND web up to date: + # pull pihole repo, run install --unattended -- reconfigure + # if Core NOT up to date AND web NOT up to date: + # pull pihole repo run install --unattended - if ! ${core_update} && ! ${web_update} ; then - echo ":::" - echo "::: Everything is up to date!" - exit 0 + if ! ${core_update} && ! ${web_update} ; then + echo ":::" + echo "::: Everything is up to date!" + exit 0 - elif ! ${core_update} && ${web_update} ; then - echo ":::" - echo "::: Pi-hole Web Admin files out of date" - getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}" + elif ! ${core_update} && ${web_update} ; then + echo ":::" + echo "::: Pi-hole Web Admin files out of date" + getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}" - elif ${core_update} && ! ${web_update} ; then - echo ":::" - echo "::: Pi-hole core files out of date" - getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" - /etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 + elif ${core_update} && ! ${web_update} ; then + echo ":::" + echo "::: Pi-hole core files out of date" + getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" + /etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 - elif ${core_update} && ${web_update} ; then - echo ":::" - echo "::: Updating Everything" - getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" - /etc/.pihole/automated\ install/basic-install.sh --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 + elif ${core_update} && ${web_update} ; then + echo ":::" + echo "::: Updating Everything" + getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" + /etc/.pihole/automated\ install/basic-install.sh --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 + else + echo "*** Update script has malfunctioned, fallthrough reached. Please contact support" + exit 1 + fi else - echo "*** Update script has malfunctioned, fallthrough reached. Please contact support" - exit 1 + + if ! ${core_update}; then + echo ":::" + echo "::: Everything is up to date!" + exit 0 + else + echo ":::" + echo "::: Pi-hole core files out of date" + getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" + /etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 + fi fi if [[ "${web_update}" == true ]]; then - web_version_current="$(/usr/local/bin/pihole version --admin --current)" - echo ":::" - echo "::: Web Admin version is now at ${web_version_current}" - echo "::: If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'" - fi + web_version_current="$(/usr/local/bin/pihole version --admin --current)" + echo ":::" + echo "::: Web Admin version is now at ${web_version_current}" + echo "::: If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'" + fi + + if [[ "${core_update}" == true ]]; then + pihole_version_current="$(/usr/local/bin/pihole version --pihole --current)" + echo ":::" + echo "::: Pi-hole version is now at ${pihole_version_current}" + echo "::: If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'" + fi + - if [[ "${core_update}" == true ]]; then - pihole_version_current="$(/usr/local/bin/pihole version --pihole --current)" - echo ":::" - echo "::: Pi-hole version is now at ${pihole_version_current}" - echo "::: If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'" - fi echo "" exit 0 From b764d17c64700ccd52670e2c336a83fc52ffdd73 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 5 Feb 2017 19:15:27 +0000 Subject: [PATCH 18/39] comment --- advanced/Scripts/update.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index 436a5ae6..eef0ede5 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -18,8 +18,9 @@ readonly ADMIN_INTERFACE_GIT_URL="https://github.com/pi-hole/AdminLTE.git" readonly ADMIN_INTERFACE_DIR="/var/www/html/admin" readonly PI_HOLE_GIT_URL="https://github.com/pi-hole/pi-hole.git" readonly PI_HOLE_FILES_DIR="/etc/.pihole" - -source /etc/pihole/setupVars.conf +INSTALL_WEB="" +readonly SETUP_VARS="/etc/pihole/setupVars.conf" +source ${SETUP_VARS} is_repo() { # Use git to check if directory is currently under VCS, return the value @@ -205,7 +206,8 @@ main() { echo "*** Update script has malfunctioned, fallthrough reached. Please contact support" exit 1 fi - else + + else # Web Admin not installed, so only verify if core is up to date if ! ${core_update}; then echo ":::" @@ -220,20 +222,18 @@ main() { fi if [[ "${web_update}" == true ]]; then - web_version_current="$(/usr/local/bin/pihole version --admin --current)" - echo ":::" - echo "::: Web Admin version is now at ${web_version_current}" - echo "::: If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'" - fi - - if [[ "${core_update}" == true ]]; then - pihole_version_current="$(/usr/local/bin/pihole version --pihole --current)" - echo ":::" - echo "::: Pi-hole version is now at ${pihole_version_current}" - echo "::: If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'" - fi - + web_version_current="$(/usr/local/bin/pihole version --admin --current)" + echo ":::" + echo "::: Web Admin version is now at ${web_version_current}" + echo "::: If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'" + fi + if [[ "${core_update}" == true ]]; then + pihole_version_current="$(/usr/local/bin/pihole version --pihole --current)" + echo ":::" + echo "::: Pi-hole version is now at ${pihole_version_current}" + echo "::: If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'" + fi echo "" exit 0 From 1206dda34769d221edc7914f50d5e009ee97a54d Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 5 Feb 2017 19:23:04 +0000 Subject: [PATCH 19/39] testing putting `runGravity` at a different part of the script --- automated install/basic-install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 7bce614e..9dcceab2 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1019,7 +1019,7 @@ installPihole() { installLogrotate configureFirewall finalExports - runGravity + #runGravity } accountForRefactor() { @@ -1049,7 +1049,7 @@ updatePihole() { installCron installLogrotate finalExports #re-export setupVars.conf to account for any new vars added in new versions - runGravity + #runGravity } @@ -1283,6 +1283,8 @@ main() { enable_service lighttpd fi + runGravity + echo "::: done." if [[ "${useUpdateVars}" == false ]]; then From 10a30344e5cd8959c74cb79c52fed33950907dd0 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 5 Feb 2017 19:29:56 +0000 Subject: [PATCH 20/39] No need to source setupVars, as basic-install.sh is sourced, which sources setupVars itself. Sourception. --- advanced/Scripts/update.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index eef0ede5..4e1f63a9 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -18,9 +18,6 @@ readonly ADMIN_INTERFACE_GIT_URL="https://github.com/pi-hole/AdminLTE.git" readonly ADMIN_INTERFACE_DIR="/var/www/html/admin" readonly PI_HOLE_GIT_URL="https://github.com/pi-hole/pi-hole.git" readonly PI_HOLE_FILES_DIR="/etc/.pihole" -INSTALL_WEB="" -readonly SETUP_VARS="/etc/pihole/setupVars.conf" -source ${SETUP_VARS} is_repo() { # Use git to check if directory is currently under VCS, return the value From a48317883dd6ddc06c79113471433a2cdac48b7f Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Tue, 7 Feb 2017 18:14:41 -0500 Subject: [PATCH 21/39] Fix indentation --- advanced/Scripts/update.sh | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index ecd9e86b..10847ead 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -131,24 +131,22 @@ main() { echo "::: Pi-hole Web Admin files out of date" getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}" - elif ${core_update} && ! ${web_update} ; then - echo ":::" - echo "::: Pi-hole core files out of date" - getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" - ${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 - - elif ${core_update} && ${web_update} ; then - echo ":::" - echo "::: Updating Everything" - getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" - ${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 - else - echo "*** Update script has malfunctioned, fallthrough reached. Please contact support" - exit 1 - fi + elif ${core_update} && ! ${web_update} ; then + echo ":::" + echo "::: Pi-hole core files out of date" + getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" + ${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 + elif ${core_update} && ${web_update} ; then + echo ":::" + echo "::: Updating Everything" + getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}" + ${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1 + else + echo "*** Update script has malfunctioned, fallthrough reached. Please contact support" + exit 1 + fi else # Web Admin not installed, so only verify if core is up to date - if ! ${core_update}; then echo ":::" echo "::: Everything is up to date!" From 357f5a2cfd2a4eb0a98fcbfaec80a369e43d1d90 Mon Sep 17 00:00:00 2001 From: ProtoFoo Date: Thu, 9 Feb 2017 16:46:55 +0100 Subject: [PATCH 22/39] Add manual edit warning Added text block from dns config file to warn user that manual changes to lighttpd config will be overwritten. Slight cosmetic adjustments (tabs -> spaces). --- advanced/lighttpd.conf.debian | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/advanced/lighttpd.conf.debian b/advanced/lighttpd.conf.debian index 01f52a85..53db2167 100644 --- a/advanced/lighttpd.conf.debian +++ b/advanced/lighttpd.conf.debian @@ -9,6 +9,14 @@ # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. +############################################################################### +# FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE. # +# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE # +# # +# CHANGES SHOULD BE MADE IN A SEPERATE CONFIG FILE: # +# /etc/lighttpd/external.conf # +############################################################################### + server.modules = ( "mod_access", "mod_accesslog", @@ -21,15 +29,15 @@ server.modules = ( ) server.document-root = "/var/www/html" -server.error-handler-404 = "pihole/index.php" +server.error-handler-404 = "pihole/index.php" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" server.username = "www-data" server.groupname = "www-data" server.port = 80 -accesslog.filename = "/var/log/lighttpd/access.log" -accesslog.format = "%{%s}t|%V|%r|%s|%b" +accesslog.filename = "/var/log/lighttpd/access.log" +accesslog.format = "%{%s}t|%V|%r|%s|%b" index-file.names = ( "index.php", "index.html", "index.lighttpd.html" ) From 162d9d7d57aaabd1ca5a91b4a9826f9951616169 Mon Sep 17 00:00:00 2001 From: ProtoFoo Date: Thu, 9 Feb 2017 17:00:52 +0100 Subject: [PATCH 23/39] Add manual edit warning Added text block from 01-pihole.conf to warn user that manual changes to lighttpd config will be overwritten. Slight cosmetic adjustments (tabs -> spaces). --- advanced/lighttpd.conf.fedora | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/advanced/lighttpd.conf.fedora b/advanced/lighttpd.conf.fedora index d2af5bd4..6c5b035b 100644 --- a/advanced/lighttpd.conf.fedora +++ b/advanced/lighttpd.conf.fedora @@ -9,6 +9,14 @@ # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. +############################################################################### +# FILE AUTOMATICALLY OVERWRITTEN BY PI-HOLE INSTALL/UPDATE PROCEDURE. # +# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE # +# # +# CHANGES SHOULD BE MADE IN A SEPERATE CONFIG FILE: # +# /etc/lighttpd/external.conf # +############################################################################### + server.modules = ( "mod_access", "mod_auth", @@ -22,15 +30,15 @@ server.modules = ( ) server.document-root = "/var/www/html" -server.error-handler-404 = "pihole/index.php" +server.error-handler-404 = "pihole/index.php" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" server.username = "lighttpd" server.groupname = "lighttpd" server.port = 80 -accesslog.filename = "/var/log/lighttpd/access.log" -accesslog.format = "%{%s}t|%V|%r|%s|%b" +accesslog.filename = "/var/log/lighttpd/access.log" +accesslog.format = "%{%s}t|%V|%r|%s|%b" index-file.names = ( "index.php", "index.html", "index.lighttpd.html" ) From 692292b1d48c35b6b1574f8e8a680c81b5a65d9e Mon Sep 17 00:00:00 2001 From: Ian Oliver Date: Fri, 10 Feb 2017 11:22:14 +0000 Subject: [PATCH 24/39] Spelling corrections in comments --- adlists.default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adlists.default b/adlists.default index 3c4ea8ed..0249ee54 100644 --- a/adlists.default +++ b/adlists.default @@ -23,7 +23,7 @@ https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt # hosts-file.net list. Updated frequently, but has been known to block legitimate sites. https://hosts-file.net/ad_servers.txt -# Mahakala list. Has been known to block legitimage domains including the entire .com range. +# Mahakala list. Has been known to block legitimate domains including the entire .com range. # Warning: Due to the sheer size of this list, the web admin console will be unresponsive. #http://adblock.mahakala.is/ @@ -49,5 +49,5 @@ https://hosts-file.net/ad_servers.txt # Following two lists should be used simultaneously: (readme https://github.com/notracking/hosts-blocklists/) #https://raw.github.com/notracking/hosts-blocklists/master/hostnames.txt #https://raw.github.com/notracking/hosts-blocklists/master/domains.txt -# Combination of serveral host files on the internet (warning some facebook domains are also blocked but you can go to facebook.com). See https://github.com/mat1th/Dns-add-block for more information. +# Combination of several host files on the internet (warning some facebook domains are also blocked but you can go to facebook.com). See https://github.com/mat1th/Dns-add-block for more information. #https://raw.githubusercontent.com/mat1th/Dns-add-block/master/hosts From 99fab7e52ace24302530a992bec44164e64fb280 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 10 Feb 2017 17:42:37 +0100 Subject: [PATCH 25/39] Scan whole dnsmasq.d directory for cofigurations files --- advanced/Scripts/piholeDebug.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index f763d2b8..43d78750 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -16,7 +16,7 @@ set -o pipefail VARSFILE="/etc/pihole/setupVars.conf" DEBUG_LOG="/var/log/pihole_debug.log" DNSMASQFILE="/etc/dnsmasq.conf" -DNSMASQCONFFILE="/etc/dnsmasq.d/01-pihole.conf" +DNSMASQCONFDIR="/etc/dnsmasq.d/*" LIGHTTPDFILE="/etc/lighttpd/lighttpd.conf" LIGHTTPDERRFILE="/var/log/lighttpd/error.log" GRAVITYFILE="/etc/pihole/gravity.list" @@ -132,15 +132,27 @@ version_check() { return "${error_found}" } +dir_check() { + header_write "Detecting contents of ${1}:" + for file in $1*; do + header_write "File ${file} found" + echo -n "::: Parsing..." + file_parse "${file}" + echo "done" + done + echo ":::" +} + files_check() { #Check non-zero length existence of ${1} header_write "Detecting existence of ${1}:" local search_file="${1}" if [[ -s ${search_file} ]]; then - echo "::: File exists" + echo -n "::: File exists, parsing..." file_parse "${search_file}" + echo "done" return 0 - else + else log_echo "${1} not found!" return 1 fi @@ -353,7 +365,7 @@ testResolver debugLighttpd files_check "${DNSMASQFILE}" -files_check "${DNSMASQCONFFILE}" +dir_check "${DNSMASQCONFDIR}" files_check "${WHITELISTFILE}" files_check "${BLACKLISTFILE}" files_check "${ADLISTFILE}" From 01f980d49ccdcb1296d36591a917ec5bd5fbff9e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 10 Feb 2017 17:45:20 +0100 Subject: [PATCH 26/39] Change description as we want to save the debug log for 48h instead of only 24h --- advanced/Scripts/piholeDebug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index f763d2b8..ca8c629d 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -35,7 +35,7 @@ cat << EOM ::: This process collects information from your Pi-hole, and optionally uploads ::: it to a unique and random directory on tricorder.pi-hole.net. ::: -::: NOTE: All log files auto-delete after 24 hours and ONLY the Pi-hole developers +::: NOTE: All log files auto-delete after 48 hours and ONLY the Pi-hole developers ::: can access your data via the given token. We have taken these extra steps to ::: secure your data and will work to further reduce any personal information gathered. ::: From 26cb6a19292fcfc3e4241dce9ecfb4ebc24ade96 Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Sat, 11 Feb 2017 20:46:27 -0600 Subject: [PATCH 27/39] redirect pi.hole to pi.hole/admin --- advanced/lighttpd.conf.debian | 5 +++++ advanced/lighttpd.conf.fedora | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/advanced/lighttpd.conf.debian b/advanced/lighttpd.conf.debian index 53db2167..f9c96221 100644 --- a/advanced/lighttpd.conf.debian +++ b/advanced/lighttpd.conf.debian @@ -70,5 +70,10 @@ $HTTP["url"] =~ "^(?!/admin)/.*" { setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." ) } +$HTTP["host"] =~ "pi.hole$" { + setenv.add-response-header = ( "X-Pi-hole" => "Redirecting pi.hole to /admin." ) + url.rewrite = ( "^(.*)" => "/admin$1" ) +} + # Add user chosen options held in external file include_shell "cat external.conf 2>/dev/null" diff --git a/advanced/lighttpd.conf.fedora b/advanced/lighttpd.conf.fedora index 6c5b035b..2dec05e4 100644 --- a/advanced/lighttpd.conf.fedora +++ b/advanced/lighttpd.conf.fedora @@ -87,5 +87,10 @@ $HTTP["url"] =~ "^(?!/admin)/.*" { setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." ) } +$HTTP["host"] =~ "pi.hole$" { + setenv.add-response-header = ( "X-Pi-hole" => "Redirecting pi.hole to /admin." ) + url.rewrite = ( "^(.*)" => "/admin$1" ) +} + # Add user chosen options held in external file include_shell "cat external.conf 2>/dev/null" From 6b8240d4de8df4156b59a55a43b345cfc474590f Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Tue, 14 Feb 2017 20:25:11 -0600 Subject: [PATCH 28/39] add magic mirror project link to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 429fc275..48ce7af0 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,7 @@ You can view [real-time stats](https://discourse.pi-hole.net/t/how-do-i-view-my- ## Pi-hole Projects +- [An ad blocking Magic Mirror](https://zonksec.com/blog/magic-mirror-dns-filtering/#dnssoftware) - [Pi-hole stats in your Mac's menu bar](https://getbitbar.com/plugins/Network/pi-hole.1m.py) - [Get LED alerts for each blocked ad](http://thetimmy.silvernight.org/pages/endisbutton/) - [Pi-hole on Ubuntu 14.04 on VirtualBox](http://hbalagtas.blogspot.com/2016/02/adblocking-with-pi-hole-and-ubuntu-1404.html) From c89bca6ec8acb12d8656fe61f7252df7a61101b2 Mon Sep 17 00:00:00 2001 From: Ian Oliver Date: Wed, 15 Feb 2017 21:31:42 +0000 Subject: [PATCH 29/39] Update malwaredomains.com and mahakala.is URLs to HTTPS --- adlists.default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adlists.default b/adlists.default index 3c4ea8ed..a7f2ce97 100644 --- a/adlists.default +++ b/adlists.default @@ -14,7 +14,7 @@ https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts # Other lists we consider safe: -http://mirror1.malwaredomains.com/files/justdomains +https://mirror1.malwaredomains.com/files/justdomains http://sysctl.org/cameleon/hosts https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt @@ -25,7 +25,7 @@ https://hosts-file.net/ad_servers.txt # Mahakala list. Has been known to block legitimage domains including the entire .com range. # Warning: Due to the sheer size of this list, the web admin console will be unresponsive. -#http://adblock.mahakala.is/ +#https://adblock.mahakala.is/ # ADZHOSTS list. Has been known to block legitimate domains #http://pilotfiber.dl.sourceforge.net/project/adzhosts/HOSTS.txt From cfed3d59e9d86d6c623424ad2d4fe6af70fbd011 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 16 Feb 2017 16:49:14 -0800 Subject: [PATCH 30/39] Begin fixing IP detection functions. --- advanced/Scripts/piholeDebug.sh | 36 ++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 74d2f05c..d374cfad 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -26,7 +26,7 @@ ADLISTFILE="/etc/pihole/adlists.list" PIHOLELOG="/var/log/pihole.log" WHITELISTMATCHES="/tmp/whitelistmatches.list" -IPV6_READY=false +IPV6_READY TIMEOUT=60 # Header info and introduction cat << EOM @@ -180,7 +180,7 @@ processor_check() { ipv6_check() { # Check if system is IPv6 enabled, for use in other functions - if [[ $IPv6_address ]]; then + if [[ $IPV6_ADDRESS ]]; then ls /proc/net/if_inet6 &>/dev/null && IPV6_READY=true return 0 else @@ -196,21 +196,30 @@ ip_check() { # Check if IPv6 enabled local IPv6_interface local IPv4_interface - ipv6_check && IPv6_interface=${piholeInterface:-$(ip -6 r | grep default | cut -d ' ' -f 5)} + if ipv6_check; then + IPv6_interface=${PIHOLE_INTERFACE:-$(ip -6 r | grep default | cut -d ' ' -f 5)} + echo ${PIHOLE_INTERFACE} + echo ${IPv6_interface} + fi # If declared in setupVars.conf use it, otherwise defer to default # http://stackoverflow.com/questions/2013547/assigning-default-values-to-shell-variables-with-a-single-command-in-bash - IPv4_interface=${piholeInterface:-$(ip r | grep default | cut -d ' ' -f 5)} + IPv4_interface=${PIHOLE_INTERFACE:-$(ip r | grep default | cut -d ' ' -f 5)} - if [[ IPV6_READY ]]; then - local IPv6_addr_list="$(ip a | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "inet6") print $(i+1) }')" \ - && (log_write "${IPv6_addr_list}" && echo "::: IPv6 addresses located") \ - || log_echo "No IPv6 addresses found." + if [[ "$IPV6_READY" = true ]]; then + local IPv6_addr_list="$(ip a | awk -F ' ' '{ for(i=1;i<=NF;i++) if ($i == "inet6") print $(i+1) }')" + if [[ -n ${IPv6_addr_list} ]]; then + log_write "${IPv6_addr_list}" + echo "::: IPv6 addresses located" + else + log_echo "No IPv6 addresses found." + return 0 + fi local IPv6_def_gateway=$(ip -6 r | grep default | cut -d ' ' -f 3) if [[ $? = 0 ]] && [[ -n ${IPv6_def_gateway} ]]; then echo -n "::: Pinging default IPv6 gateway: " - local IPv6_def_gateway_check="$(ping6 -q -W 3 -c 3 -n "${IPv6_def_gateway}" -I "${IPv6_interface}"| tail -n3)" \ + local IPv6_def_gateway_check="$(ping6 -q -W 3 -c 3 -n ${IPv6_def_gateway} -I ${IPv6_interface} | tail -n3)" \ && echo "Gateway Responded." \ || echo "Gateway did not respond." block_parse "${IPv6_def_gateway_check}" @@ -223,27 +232,26 @@ ip_check() { else log_echo="No IPv6 Gateway Detected" fi + fi -local IPv4_addr_list="$(ip a | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "inet") print $(i+1) }')" \ + local IPv4_addr_list="$(ip a | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "inet") print $(i+1) }')" \ && (block_parse "${IPv4_addr_list}" && echo "::: IPv4 addresses located")\ || log_echo "No IPv4 addresses found." local IPv4_def_gateway=$(ip r | grep default | cut -d ' ' -f 3) if [[ $? = 0 ]]; then echo -n "::: Pinging default IPv4 gateway: " - local IPv4_def_gateway_check="$(ping -q -w 3 -c 3 -n "${IPv4_def_gateway}" -I "${IPv4_interface}" | tail -n3)" \ + local IPv4_def_gateway_check="$(ping -q -w 3 -c 3 -n ${IPv4_def_gateway} -I ${IPv4_interface} | tail -n3)" \ && echo "Gateway responded." \ || echo "Gateway did not respond." block_parse "${IPv4_def_gateway_check}" echo -n "::: Pinging Internet via IPv4: " - local IPv4_inet_check="$(ping -q -w 5 -c 3 -n 8.8.8.8 -I "${IPv4_interface}" | tail -n3)" \ + local IPv4_inet_check="$(ping -q -w 5 -c 3 -n 8.8.8.8 -I ${IPv4_interface} | tail -n3)" \ && echo "Query responded." \ || echo "Query did not respond." block_parse "${IPv4_inet_check}" fi - - fi } port_check() { From 472708376df99cdf707c92611c92601cf98a5c56 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 16 Feb 2017 18:30:15 -0800 Subject: [PATCH 31/39] Split out IP checks. --- advanced/Scripts/piholeDebug.sh | 97 ++++++++++++++------------------- 1 file changed, 40 insertions(+), 57 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index d374cfad..97f9112a 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -26,7 +26,6 @@ ADLISTFILE="/etc/pihole/adlists.list" PIHOLELOG="/var/log/pihole.log" WHITELISTMATCHES="/tmp/whitelistmatches.list" -IPV6_READY TIMEOUT=60 # Header info and introduction cat << EOM @@ -181,77 +180,61 @@ processor_check() { ipv6_check() { # Check if system is IPv6 enabled, for use in other functions if [[ $IPV6_ADDRESS ]]; then - ls /proc/net/if_inet6 &>/dev/null && IPV6_READY=true + ls /proc/net/if_inet6 &>/dev/null return 0 else return 1 fi } - ip_check() { - header_write "IP Address Information" - # Get the current interface for Internet traffic + local protocol=${1} - # Check if IPv6 enabled - local IPv6_interface - local IPv4_interface - if ipv6_check; then - IPv6_interface=${PIHOLE_INTERFACE:-$(ip -6 r | grep default | cut -d ' ' -f 5)} - echo ${PIHOLE_INTERFACE} - echo ${IPv6_interface} - fi - # If declared in setupVars.conf use it, otherwise defer to default - # http://stackoverflow.com/questions/2013547/assigning-default-values-to-shell-variables-with-a-single-command-in-bash - IPv4_interface=${PIHOLE_INTERFACE:-$(ip r | grep default | cut -d ' ' -f 5)} + local ip_addr_list="$(ip -${protocol} addr show dev ${PIHOLE_INTERFACE} | awk -F ' ' '{ for(i=1;i<=NF;i++) if ($i ~ '/^inet/') print $(i+1) }')" + if [[ -n ${ip_addr_list} ]]; then + log_write "IPv${protocol} on ${PIHOLE_INTERFACE}" + log_write "${ip_addr_list}" + echo "::: IPv${protocol} addresses located on ${PIHOLE_INTERFACE}" + ip_ping_check ${protocol} + return $(( 0 + $? )) + else + log_echo "No IPv${protocol} found on ${PIHOLE_INTERFACE}" + return 1 + fi +} +ip_ping_check() { - if [[ "$IPV6_READY" = true ]]; then - local IPv6_addr_list="$(ip a | awk -F ' ' '{ for(i=1;i<=NF;i++) if ($i == "inet6") print $(i+1) }')" - if [[ -n ${IPv6_addr_list} ]]; then - log_write "${IPv6_addr_list}" - echo "::: IPv6 addresses located" - else - log_echo "No IPv6 addresses found." - return 0 - fi + local protocol=${1} + local cmd - local IPv6_def_gateway=$(ip -6 r | grep default | cut -d ' ' -f 3) - if [[ $? = 0 ]] && [[ -n ${IPv6_def_gateway} ]]; then - echo -n "::: Pinging default IPv6 gateway: " - local IPv6_def_gateway_check="$(ping6 -q -W 3 -c 3 -n ${IPv6_def_gateway} -I ${IPv6_interface} | tail -n3)" \ - && echo "Gateway Responded." \ - || echo "Gateway did not respond." - block_parse "${IPv6_def_gateway_check}" - - echo -n "::: Pinging Internet via IPv6: " - local IPv6_inet_check=$(ping6 -q -W 3 -c 3 -n 2001:4860:4860::8888 -I "${IPv6_interface}"| tail -n3) \ - && echo "Query responded." \ - || echo "Query did not respond." - block_parse "${IPv6_inet_check}" - else - log_echo="No IPv6 Gateway Detected" - fi + if [[ ${protocol} == "6" ]]; then + cmd="ping6" + else + cmd="ping" fi - local IPv4_addr_list="$(ip a | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "inet") print $(i+1) }')" \ - && (block_parse "${IPv4_addr_list}" && echo "::: IPv4 addresses located")\ - || log_echo "No IPv4 addresses found." + local ip_def_gateway=$(ip -${protocol} route | grep default | cut -d ' ' -f 3) + if [[ -n ${ip_def_gateway} ]]; then + echo -n "::: Pinging default IPv${protocol} gateway: " + if ! ping_gateway="$(${cmd} -q -W 3 -c 3 -n ${ip_def_gateway} -I ${PIHOLE_INTERFACE} | tail -n 3)"; then + echo "Gateway did not respond." + return 1 + else + echo "Gateway responded." + log_write "${ping_gateway}" + return 0 + fi + fi +} - local IPv4_def_gateway=$(ip r | grep default | cut -d ' ' -f 3) - if [[ $? = 0 ]]; then - echo -n "::: Pinging default IPv4 gateway: " - local IPv4_def_gateway_check="$(ping -q -w 3 -c 3 -n ${IPv4_def_gateway} -I ${IPv4_interface} | tail -n3)" \ - && echo "Gateway responded." \ - || echo "Gateway did not respond." - block_parse "${IPv4_def_gateway_check}" +ip_check_wrapper() { + header_write "IP Address Information" - echo -n "::: Pinging Internet via IPv4: " - local IPv4_inet_check="$(ping -q -w 5 -c 3 -n 8.8.8.8 -I ${IPv4_interface} | tail -n3)" \ - && echo "Query responded." \ - || echo "Query did not respond." - block_parse "${IPv4_inet_check}" + if ipv6_check; then + ip_check "6" fi + ip_check "4" } port_check() { @@ -364,7 +347,7 @@ distro_check || echo "Distro Check soft fail" # Gather processor type processor_check || echo "Processor Check soft fail" -ip_check +ip_check_wrapper daemon_check lighttpd http daemon_check dnsmasq domain From 2aa3a109a0f8eb9693754ab9a01ac859ad47f83d Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 16 Feb 2017 18:38:05 -0800 Subject: [PATCH 32/39] Ping gateways and Internet. --- advanced/Scripts/piholeDebug.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 97f9112a..2733aeaa 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -210,8 +210,10 @@ ip_ping_check() { if [[ ${protocol} == "6" ]]; then cmd="ping6" + g_addr="2001:4860:4860::8888" else cmd="ping" + g_addr="8.8.8.8" fi local ip_def_gateway=$(ip -${protocol} route | grep default | cut -d ' ' -f 3) @@ -223,9 +225,17 @@ ip_ping_check() { else echo "Gateway responded." log_write "${ping_gateway}" - return 0 + fi + echo -n "::: Pinging Internet via IPv${protocol}: " + if ! ping_inet="$(${cmd} -q -W 3 -c 3 -n ${g_addr} -I ${PIHOLE_INTERFACE} | tail -n 3)"; then + echo "Query did not respond." + return 1 + else + echo "Query responded." + log_write "${ping_inet}" fi fi + return 0 } ip_check_wrapper() { From 053b38e0bd16cdb57a69fbce15a2fffeaf14b588 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 16 Feb 2017 19:45:44 -0800 Subject: [PATCH 33/39] Set up for IP matching in detection. --- advanced/Scripts/piholeDebug.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 2733aeaa..1415d975 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -189,10 +189,13 @@ ipv6_check() { ip_check() { local protocol=${1} + local gravity=${2} local ip_addr_list="$(ip -${protocol} addr show dev ${PIHOLE_INTERFACE} | awk -F ' ' '{ for(i=1;i<=NF;i++) if ($i ~ '/^inet/') print $(i+1) }')" if [[ -n ${ip_addr_list} ]]; then log_write "IPv${protocol} on ${PIHOLE_INTERFACE}" + log_write "Gravity configured for: ${2:-NOT CONFIGURED}" + log_write "----" log_write "${ip_addr_list}" echo "::: IPv${protocol} addresses located on ${PIHOLE_INTERFACE}" ip_ping_check ${protocol} @@ -204,7 +207,6 @@ ip_check() { } ip_ping_check() { - local protocol=${1} local cmd @@ -234,19 +236,12 @@ ip_ping_check() { echo "Query responded." log_write "${ping_inet}" fi + else + log_echo " No gateway detected." fi return 0 } -ip_check_wrapper() { - header_write "IP Address Information" - - if ipv6_check; then - ip_check "6" - fi - ip_check "4" -} - port_check() { local lsof_value @@ -357,7 +352,8 @@ distro_check || echo "Distro Check soft fail" # Gather processor type processor_check || echo "Processor Check soft fail" -ip_check_wrapper +ip_check 6 ${IPV6_ADDRESS} +ip_check 4 ${IPV4_ADDRESS} daemon_check lighttpd http daemon_check dnsmasq domain From 9e5795bf5505a0f3f87ebbc640f85e5811ac7a46 Mon Sep 17 00:00:00 2001 From: Skittels Date: Sat, 18 Feb 2017 13:03:40 +0100 Subject: [PATCH 34/39] Added DNS.WATCH to default dns servers --- automated install/basic-install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 94f26be9..f29d3957 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -444,6 +444,7 @@ setDNS() { Level3 "" Norton "" Comodo "" + DNS.WATCH "" Custom "") DNSchoices=$(whiptail --separate-output --menu "Select Upstream DNS Provider. To use your own, select Custom." ${r} ${c} 6 \ "${DNSChooseOptions[@]}" 2>&1 >/dev/tty) || \ @@ -474,6 +475,11 @@ setDNS() { PIHOLE_DNS_1="8.26.56.26" PIHOLE_DNS_2="8.20.247.20" ;; + DNS.WATCH) + echo "::: Using DNS.WATCH servers." + PIHOLE_DNS_1="84.200.69.80" + PIHOLE_DNS_2="84.200.70.40" + ;; Custom) until [[ ${DNSSettingsCorrect} = True ]]; do strInvalid="Invalid" From 4e7a485e2379ee781651e083a2005b212132d2dd Mon Sep 17 00:00:00 2001 From: Skittels Date: Sat, 18 Feb 2017 13:42:13 +0100 Subject: [PATCH 35/39] Update basic-install.sh --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index f29d3957..08e2a2d1 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -444,7 +444,7 @@ setDNS() { Level3 "" Norton "" Comodo "" - DNS.WATCH "" + DNSWatch "" Custom "") DNSchoices=$(whiptail --separate-output --menu "Select Upstream DNS Provider. To use your own, select Custom." ${r} ${c} 6 \ "${DNSChooseOptions[@]}" 2>&1 >/dev/tty) || \ @@ -475,7 +475,7 @@ setDNS() { PIHOLE_DNS_1="8.26.56.26" PIHOLE_DNS_2="8.20.247.20" ;; - DNS.WATCH) + DNSWatch) echo "::: Using DNS.WATCH servers." PIHOLE_DNS_1="84.200.69.80" PIHOLE_DNS_2="84.200.70.40" From a7def771c893d81c5de66ca661a49b3ff8fcacbc Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 19 Feb 2017 20:12:32 +0000 Subject: [PATCH 36/39] Revert "redirect pi.hole to pi.hole/admin" --- advanced/lighttpd.conf.debian | 5 ----- advanced/lighttpd.conf.fedora | 5 ----- 2 files changed, 10 deletions(-) diff --git a/advanced/lighttpd.conf.debian b/advanced/lighttpd.conf.debian index f9c96221..53db2167 100644 --- a/advanced/lighttpd.conf.debian +++ b/advanced/lighttpd.conf.debian @@ -70,10 +70,5 @@ $HTTP["url"] =~ "^(?!/admin)/.*" { setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." ) } -$HTTP["host"] =~ "pi.hole$" { - setenv.add-response-header = ( "X-Pi-hole" => "Redirecting pi.hole to /admin." ) - url.rewrite = ( "^(.*)" => "/admin$1" ) -} - # Add user chosen options held in external file include_shell "cat external.conf 2>/dev/null" diff --git a/advanced/lighttpd.conf.fedora b/advanced/lighttpd.conf.fedora index 2dec05e4..6c5b035b 100644 --- a/advanced/lighttpd.conf.fedora +++ b/advanced/lighttpd.conf.fedora @@ -87,10 +87,5 @@ $HTTP["url"] =~ "^(?!/admin)/.*" { setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." ) } -$HTTP["host"] =~ "pi.hole$" { - setenv.add-response-header = ( "X-Pi-hole" => "Redirecting pi.hole to /admin." ) - url.rewrite = ( "^(.*)" => "/admin$1" ) -} - # Add user chosen options held in external file include_shell "cat external.conf 2>/dev/null" From 7da076df18c7f6ea68ddf323976e84920495e96c Mon Sep 17 00:00:00 2001 From: Massimiliano Monaro Date: Mon, 20 Feb 2017 10:04:14 +0100 Subject: [PATCH 37/39] Added my personal project Pi-hole Droid to the Projects's list Pi-hole Droid is an unofficial client that connects to your Pi-hole to show charts and statistics. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 48ce7af0..0a5f7f4c 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ You can view [real-time stats](https://discourse.pi-hole.net/t/how-do-i-view-my- - [Windows Tray Stat Application](https://github.com/goldbattle/copernicus) - [Let your blink1 device blink when Pi-hole filters ads](https://gist.github.com/elpatron68/ec0b4c582e5abf604885ac1e068d233f) - [Pi-Hole Prometheus exporter](https://github.com/nlamirault/pihole_exporter) : a [Prometheus](https://prometheus.io/) exporter for Pi-Hole +- [Pi-hole Droid - open source Android client](https://github.com/friimaind/pi-hole-droid) ## Coverage From 763b51fe22dc2320115c614e368613840976903e Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 20 Feb 2017 21:12:04 +0000 Subject: [PATCH 38/39] linux style line endings enforced --- .gitattributes | 2 +- .idea/codeStyleSettings.xml | 25 ------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 .idea/codeStyleSettings.xml diff --git a/.gitattributes b/.gitattributes index 57faaa8b..1ed54473 100644 --- a/.gitattributes +++ b/.gitattributes @@ -35,4 +35,4 @@ GitHub.Tests.Integration/Resources/* binary # Catch all for anything we forgot. Add rules if you get CRLF -> LF warnings. -* text=auto +* text eol=lf diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml deleted file mode 100644 index 1028340e..00000000 --- a/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file From 86c6e0e826e909bdb92180aff5bad011cfc15185 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 20 Feb 2017 21:36:27 +0000 Subject: [PATCH 39/39] accidentally the idea file --- .idea/codeStyleSettings.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .idea/codeStyleSettings.xml diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml new file mode 100644 index 00000000..6ad75d68 --- /dev/null +++ b/.idea/codeStyleSettings.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file