Skip to content

Commit 26fcb1b

Browse files
authored
Merge pull request pi-hole#1429 from pi-hole/development
Release v3.0.1
2 parents 1dcc187 + e9c4e81 commit 26fcb1b

File tree

5 files changed

+46
-19
lines changed

5 files changed

+46
-19
lines changed

advanced/01-pihole.conf

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ addn-hosts=/etc/pihole/local.list
2525

2626
domain-needed
2727

28+
localise-queries
29+
2830
bogus-priv
2931

3032
no-resolv

advanced/Scripts/piholeDebug.sh

+13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ PIHOLELOG="/var/log/pihole.log"
2727
PIHOLEGITDIR="/etc/.pihole/"
2828
ADMINGITDIR="/var/www/html/admin/"
2929
WHITELISTMATCHES="/tmp/whitelistmatches.list"
30+
readonly FTLLOG="/var/log/pihole-FTL.log"
3031

3132
TIMEOUT=60
3233
# Header info and introduction
@@ -523,6 +524,18 @@ header_write "Analyzing pihole.log"
523524
&& log_write "${PIHOLELOG} is ${pihole_size}." \
524525
|| log_echo "Warning: No pihole.log file found!"
525526

527+
header_write "Analyzing pihole-FTL.log"
528+
529+
FTL_length=$(grep -c ^ "${FTLLOG}") \
530+
&& log_write "${FTLLOG} is ${FTL_length} lines long." \
531+
|| log_echo "Warning: No pihole-FTL.log file found!"
532+
533+
FTL_size=$(du -h "${FTLLOG}" | awk '{ print $1 }') \
534+
&& log_write "${FTLLOG} is ${FTL_size}." \
535+
|| log_echo "Warning: No pihole-FTL.log file found!"
536+
537+
tail -n50 "${FTLLOG}" >&3
538+
526539
trap finalWork EXIT
527540

528541
### Method calls for additional logging ###

advanced/Scripts/webpage.sh

+24-13
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ SetTemperatureUnit(){
6767

6868
}
6969

70+
HashPassword(){
71+
# Compute password hash twice to avoid rainbow table vulnerability
72+
return=$(echo -n ${1} | sha256sum | sed 's/\s.*$//')
73+
return=$(echo -n ${return} | sha256sum | sed 's/\s.*$//')
74+
echo ${return}
75+
}
76+
7077
SetWebPassword(){
7178

7279
if [ "${SUDO_USER}" == "www-data" ]; then
@@ -81,21 +88,25 @@ SetWebPassword(){
8188
exit 1
8289
fi
8390

84-
read -s -p "Enter New Password (Blank for no password): " PASSWORD
85-
echo ""
86-
87-
if [ "${PASSWORD}" == "" ]; then
88-
change_setting "WEBPASSWORD" ""
89-
echo "Password Removed"
90-
exit 0
91-
fi
91+
if (( ${#args[2]} > 0 )) ; then
92+
readonly PASSWORD="${args[2]}"
93+
readonly CONFIRM="${PASSWORD}"
94+
else
95+
read -s -p "Enter New Password (Blank for no password): " PASSWORD
96+
echo ""
97+
98+
if [ "${PASSWORD}" == "" ]; then
99+
change_setting "WEBPASSWORD" ""
100+
echo "Password Removed"
101+
exit 0
102+
fi
103+
104+
read -s -p "Confirm Password: " CONFIRM
105+
echo ""
106+
fi
92107

93-
read -s -p "Confirm Password: " CONFIRM
94-
echo ""
95108
if [ "${PASSWORD}" == "${CONFIRM}" ] ; then
96-
# Compute password hash twice to avoid rainbow table vulnerability
97-
hash=$(echo -n ${PASSWORD} | sha256sum | sed 's/\s.*$//')
98-
hash=$(echo -n ${hash} | sha256sum | sed 's/\s.*$//')
109+
hash=$(HashPassword ${PASSWORD})
99110
# Save hash to file
100111
change_setting "WEBPASSWORD" "${hash}"
101112
echo "New password set"

automated install/basic-install.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ if command -v apt-get &> /dev/null; then
105105
phpVer="php5"
106106
fi
107107
# #########################################
108-
INSTALLER_DEPS=(apt-utils debconf dhcpcd5 git ${iproute_pkg} whiptail)
108+
INSTALLER_DEPS=(apt-utils dialog debconf dhcpcd5 git ${iproute_pkg} whiptail)
109109
PIHOLE_DEPS=(bc cron curl dnsmasq dnsutils iputils-ping lsof netcat sudo unzip wget)
110110
PIHOLE_WEB_DEPS=(lighttpd ${phpVer}-common ${phpVer}-cgi)
111111
LIGHTTPD_USER="www-data"
@@ -136,7 +136,7 @@ elif command -v rpm &> /dev/null; then
136136
UPDATE_PKG_CACHE=":"
137137
PKG_INSTALL=(${PKG_MANAGER} install -y)
138138
PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l"
139-
INSTALLER_DEPS=(git iproute net-tools newt procps-ng)
139+
INSTALLER_DEPS=(dialog git iproute net-tools newt procps-ng)
140140
PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq findutils nmap-ncat sudo unzip wget)
141141
PIHOLE_WEB_DEPS=(lighttpd lighttpd-fastcgi php php-common php-cli)
142142
if ! grep -q 'Fedora' /etc/redhat-release; then
@@ -1413,7 +1413,8 @@ main() {
14131413
pw=""
14141414
if [[ $(grep 'WEBPASSWORD' -c /etc/pihole/setupVars.conf) == 0 ]] ; then
14151415
pw=$(tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 8)
1416-
/usr/local/bin/pihole -a -p "${pw}"
1416+
. /opt/pihole/webpage.sh
1417+
echo "WEBPASSWORD=$(HashPassword ${pw})" >> ${setupVars}
14171418
fi
14181419
fi
14191420

gravity.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ gravity_transport() {
167167

168168
# Process result
169169
gravity_patternCheck "${patternBuffer}" ${success} "${err}"
170-
170+
171171
# Delete temp file if it hasn't been moved
172172
if [[ -f "${patternBuffer}" ]]; then
173173
rm "${patternBuffer}"
@@ -187,7 +187,7 @@ gravity_spinup() {
187187
saveLocation=${piholeDir}/list.${i}.${domain}.${justDomainsExtension}
188188
activeDomains[$i]=${saveLocation}
189189

190-
agent="Mozilla/10.0"
190+
agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36"
191191

192192
# Use a case statement to download lists that need special cURL commands
193193
# to complete properly and reset the user agent when required
@@ -196,7 +196,7 @@ gravity_spinup() {
196196
agent='Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'
197197
cmd_ext="-e http://forum.xda-developers.com/"
198198
;;
199-
199+
200200
"adaway.org")
201201
agent='Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'
202202
;;

0 commit comments

Comments
 (0)