From 35dc4800e07135af1894ff817b8e51d2cf302932 Mon Sep 17 00:00:00 2001 From: mettacrawler Date: Sun, 5 Nov 2017 15:28:44 -0500 Subject: [PATCH 01/17] basic-install.sh - no CIDR in ifcfg-* Do not expect CIDR format IP addresses in /etc/sysconfig/network-scripts/ifcfg-* files as it is not a requirement. Expect only: IPADDR=10.10.10.10 Do not expect: IPADDR=10.10.10.10/24 --- 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 647661f8..e7c3f189 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -684,13 +684,13 @@ setStaticIPv4() { elif [[ -f "/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE}" ]];then # If it exists, IFCFG_FILE=/etc/sysconfig/network-scripts/ifcfg-${PIHOLE_INTERFACE} + IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/) # check if the desired IP is already set - if grep -q "${IPV4_ADDRESS}" "${IFCFG_FILE}"; then + if grep -q "${IPADDR}" "${IFCFG_FILE}"; then echo -e " ${INFO} Static IP already configured" # Otherwise, else # Put the IP in variables without the CIDR notation - IPADDR=$(echo "${IPV4_ADDRESS}" | cut -f1 -d/) CIDR=$(echo "${IPV4_ADDRESS}" | cut -f2 -d/) # Backup existing interface configuration: cp "${IFCFG_FILE}" "${IFCFG_FILE}".pihole.orig From c17d95bfeddface2fc74882d0f38a8197e844bfd Mon Sep 17 00:00:00 2001 From: Ryan Knapper Date: Mon, 19 Feb 2018 10:22:28 -0500 Subject: [PATCH 02/17] Proper output for debug CPU detection Inserted "log_write" to properly output CPU detection lines. Signed-off-by: Ryan Knapper (ryanknapper@gmail.com> --- advanced/Scripts/piholeDebug.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index b668af94..5918ec1b 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -465,15 +465,15 @@ processor_check() { else # Check if the architecture is currently supported for FTL case "${PROCESSOR}" in - "amd64") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" + "amd64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" ;; - "armv6l") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" + "armv6l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" ;; - "armv6") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" + "armv6") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" ;; - "armv7l") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" + "armv7l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" ;; - "aarch64") "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" + "aarch64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}" ;; # Otherwise, show the processor type *) log_write "${INFO} ${PROCESSOR}"; From e61d8e4fb84130560f28021b484a9d4350e38268 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Thu, 22 Feb 2018 14:45:31 +0000 Subject: [PATCH 03/17] adlists.default no longer used. No need to reference it. Use --force switch of gravity to force the cache refresh Signed-off-by: Adam Warner --- automated install/basic-install.sh | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index b694b527..c5eb17e4 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1378,22 +1378,8 @@ installCron() { # Gravity is a very important script as it aggregates all of the domains into a single HOSTS formatted list, # which is what Pi-hole needs to begin blocking ads runGravity() { - echo "" - echo -e " ${INFO} Preparing to run gravity.sh to refresh hosts..." - # If cached lists exist, - if ls /etc/pihole/list* 1> /dev/null 2>&1; then - echo -e " ${INFO} Cleaning up previous install (preserving whitelist/blacklist)" - # remove them - rm /etc/pihole/list.* - fi - # If the default ad lists file exists, - if [[ ! -e /etc/pihole/adlists.default ]]; then - # copy it over from the local repo - cp ${PI_HOLE_LOCAL_REPO}/adlists.default /etc/pihole/adlists.default - fi - echo -e " ${INFO} Running gravity.sh" # Run gravity in the current shell - { /opt/pihole/gravity.sh; } + { /opt/pihole/gravity.sh --force; } } # Check if the pihole user exists and create if it does not From 71d8f5f96fa8a8edf5618f58c6b1d28f77887c00 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 7 Mar 2018 22:00:14 +0000 Subject: [PATCH 04/17] remove PA YAML file Signed-off-by: Adam Warner --- .pullapprove.yml | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .pullapprove.yml diff --git a/.pullapprove.yml b/.pullapprove.yml deleted file mode 100644 index 30888234..00000000 --- a/.pullapprove.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 - -always_pending: - title_regex: '(WIP|wip)' - labels: - - wip - explanation: 'This PR is a work in progress...' - -group_defaults: - reset_on_push: - enabled: true - reject_value: -2 - approve_regex: '^(Approved|:shipit:|:\+1:|Engage|:taco:)' - reject_regex: '^(Rejected|:-1:|Borg)' - author_approval: - auto: true - - -groups: - development: - approve_by_comment: - enabled: true - conditions: - branches: - - development - required: 2 - teams: - - approvers - - master: - approve_by_comment: - enabled: true - conditions: - branches: - - master - required: 4 - teams: - - approvers From 2895b9bfb70e9fa10e0a8118ba163961b52c1ddb Mon Sep 17 00:00:00 2001 From: justinamcafee Date: Sat, 10 Mar 2018 17:33:31 -0600 Subject: [PATCH 05/17] Added support for FamilyShield from OpenDNS With a very minor code change, individuals can now implement restrictions on dangers, disturbing, or otherwise adult oriented content without the need for managed restrictions. This is a fairly non-invasive change and will benefit users who intend to use VPN for home or small business uses where access to such material may be undesirable. --- automated install/basic-install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index c87d00a6..ccdb479c 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -771,6 +771,7 @@ setDNS() { Comodo "" DNSWatch "" Quad9 "" + FamilyShield "" Custom "") # In a whiptail dialog, show the options DNSchoices=$(whiptail --separate-output --menu "Select Upstream DNS Provider. To use your own, select Custom." ${r} ${c} 7 \ @@ -817,6 +818,10 @@ setDNS() { PIHOLE_DNS_1="9.9.9.9" PIHOLE_DNS_2="149.112.112.112" ;; + FamilyShield) + echo "FamilyShield servers" + PIHOLE_DNS_1="208.67.222.123" + PIHOLE_DNS_2="208.67.220.123" Custom) # Until the DNS settings are selected, until [[ "${DNSSettingsCorrect}" = True ]]; do From 30af6e73be1ac05dd05a274aea1f583fd098bc06 Mon Sep 17 00:00:00 2001 From: justinamcafee Date: Sat, 10 Mar 2018 17:36:47 -0600 Subject: [PATCH 06/17] added ;; to line 825 Misformated case. Updated correct case --- automated install/basic-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index ccdb479c..29dc6cd1 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -822,6 +822,7 @@ setDNS() { echo "FamilyShield servers" PIHOLE_DNS_1="208.67.222.123" PIHOLE_DNS_2="208.67.220.123" + ;; Custom) # Until the DNS settings are selected, until [[ "${DNSSettingsCorrect}" = True ]]; do From bfcbd72e4b021b458be3b45ac442f4350ac1603a Mon Sep 17 00:00:00 2001 From: "Leo MG Nesfield (LMGN)" Date: Fri, 23 Mar 2018 16:17:31 +0000 Subject: [PATCH 07/17] Link to the admin panel on the splash page. --- advanced/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/index.php b/advanced/index.php index 999acebb..5aa9fbcb 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -64,7 +64,7 @@ if ($serverName === "pi.hole") { $viewPort -
Pi-hole: Your black hole for Internet advertisements +
Pi-hole: Your black hole for Internet advertisements
Did you mean to go to the admin panel? "; // Set splash/landing page based off presence of $landPage From 68c27eb2a19fcaec9895245294875796675c77f0 Mon Sep 17 00:00:00 2001 From: Jacob Salmela Date: Sun, 25 Mar 2018 21:27:40 -0500 Subject: [PATCH 08/17] add label to x-header so you know which one is being evaluated Signed-off-by: Jacob Salmela --- advanced/Scripts/piholeDebug.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index b668af94..a16457a0 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -712,20 +712,20 @@ check_x_headers() { # If the X-header found by curl matches what is should be, if [[ $block_page == "$block_page_working" ]]; then # display a success message - log_write "$TICK ${COL_GREEN}${block_page}${COL_NC}" + log_write "$TICK Block page X-Header: ${COL_GREEN}${block_page}${COL_NC}" else # Otherwise, show an error - log_write "$CROSS ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}" + log_write "$CROSS Block page X-Header: ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}" log_write "${COL_RED}${full_curl_output_block_page}${COL_NC}" fi # Same logic applies to the dashbord as above, if the X-Header matches what a working system shoud have, if [[ $dashboard == "$dashboard_working" ]]; then # then we can show a success - log_write "$TICK ${COL_GREEN}${dashboard}${COL_NC}" + log_write "$TICK Web interface X-Header: ${COL_GREEN}${dashboard}${COL_NC}" else # Othewise, it's a failure since the X-Headers either don't exist or have been modified in some way - log_write "$CROSS ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}" + log_write "$CROSS Web interface X-Header: ${COL_RED}X-Header does not match or could not be retrieved.${COL_NC}" log_write "${COL_RED}${full_curl_output_dashboard}${COL_NC}" fi } From 37e8a91d5bdfce3f6fff43f471fb265e4f68c510 Mon Sep 17 00:00:00 2001 From: Dillon Flamand Date: Sun, 25 Mar 2018 21:59:35 -0700 Subject: [PATCH 09/17] Remove dead link from CONTRIBUTING.md Removed a link to a github repo that no longer exists. Signed-off-by: D. Flamand --- CONTRIBUTING.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b7fae5d..e32b500e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,3 @@ -_This template was created based on the work of [`udemy-dl`](https://github.com/nishad/udemy-dl/blob/master/LICENSE)._ - # Contributors Guide Please read and understand the contribution guide before creating an issue or pull request. From 3390fbf238924218fb94bab07c8a8492eb4a2ab1 Mon Sep 17 00:00:00 2001 From: Perflyst Date: Tue, 27 Mar 2018 12:17:44 +0200 Subject: [PATCH 10/17] Add RaspberryPi 3B+ Signed-off-by: Perflyst --- advanced/Scripts/chronometer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/chronometer.sh b/advanced/Scripts/chronometer.sh index 13d743a8..4bc090f2 100755 --- a/advanced/Scripts/chronometer.sh +++ b/advanced/Scripts/chronometer.sh @@ -179,6 +179,7 @@ get_init_stats() { 90009[2-3]|920093) sys_model=" Zero";; # 512MB 9000c1) sys_model=" Zero W";; # 512MB a02082|a[2-3]2082) sys_model=" 3, Model B";; # 1GB + a020d3) sys_model=" 3, Model B+";; # 1GB *) sys_model="";; esac sys_type="Raspberry Pi$sys_model" From a8b493cb7dcfa6a0dfc7904c74966f65f9b802d4 Mon Sep 17 00:00:00 2001 From: Everett Southwick Date: Sun, 1 Apr 2018 17:59:08 -0500 Subject: [PATCH 11/17] Add support for public Cloudflare DNS servers. Signed-off-by: Everett Southwick --- 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 59b1c8a3..b25cf272 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -772,6 +772,7 @@ setDNS() { DNSWatch "" Quad9 "" FamilyShield "" + Cloudflare "" Custom "") # In a whiptail dialog, show the options DNSchoices=$(whiptail --separate-output --menu "Select Upstream DNS Provider. To use your own, select Custom." ${r} ${c} 7 \ @@ -823,6 +824,11 @@ setDNS() { PIHOLE_DNS_1="208.67.222.123" PIHOLE_DNS_2="208.67.220.123" ;; + Cloudflare) + echo "Cloudflare servers" + PIHOLE_DNS_1="1.1.1.1" + PIHOLE_DNS_2="1.0.0.1" + ;; Custom) # Until the DNS settings are selected, until [[ "${DNSSettingsCorrect}" = True ]]; do From 7361d5d3ea37b9baa718c7fd1d0e4577feb85bb1 Mon Sep 17 00:00:00 2001 From: Razvan Radu Date: Thu, 5 Apr 2018 11:09:07 -0600 Subject: [PATCH 12/17] Update pihole lolcahost probe for DNS status Signed-off-by: Razvan Radu --- pihole | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pihole b/pihole index 4421cb87..566a0ce4 100755 --- a/pihole +++ b/pihole @@ -476,7 +476,7 @@ statusFunc() { local addnConfigs # Determine if service is running on port 53 (Cr: https://superuser.com/a/806331) - if (echo > /dev/tcp/localhost/53) >/dev/null 2>&1; then + if (echo > /dev/tcp/127.0.0.1/53) >/dev/null 2>&1; then if [[ "${1}" != "web" ]]; then echo -e " ${TICK} DNS service is running" fi From 952f1271b4a84808e454e1bd3431a5ba52bb42e4 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Wed, 11 Apr 2018 10:13:09 -0700 Subject: [PATCH 13/17] Do not require DCO for Pi-hole Org members with GPG signed commits. Signed-off-by: Dan Schaper --- .github/dco.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/dco.yml diff --git a/.github/dco.yml b/.github/dco.yml new file mode 100644 index 00000000..0c4b142e --- /dev/null +++ b/.github/dco.yml @@ -0,0 +1,2 @@ +require: + members: false From 3b229489c2f4aca05637eef674d5e8c116dbf373 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Fri, 13 Apr 2018 09:19:31 +0200 Subject: [PATCH 14/17] Fix regex to find DBFILE= from configuration file The regex ^\s^.DBFILE\s*=\s* does not work to match "DBFILE=" I don't know what the second '^' is used for. With the change I now have the results: DBFILE=/foo/bar -> /foo/bar DBFILE=/foo/bar -> /foo/bar # DBFILE=/foo/bar -> /etc/pihole/pihole-FTL.db xDBFILE=/foo/bar -> /etc/pihole/pihole-FTL.db Signed-off-by: Ludovic Rousseau --- advanced/Scripts/piholeLogFlush.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index 5fd9832e..ffc9e0f5 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -16,7 +16,7 @@ source ${colfile} # Constructed to return nothing when # a) the setting is not present in the config file, or # b) the setting is commented out (e.g. "#DBFILE=...") -DBFILE="$(sed -n -e 's/^\s^.DBFILE\s*=\s*//p' /etc/pihole/pihole-FTL.conf)" +DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' /etc/pihole/pihole-FTL.conf)" # Test for empty string. Use standard path in this case. if [ -z "$DBFILE" ]; then DBFILE="/etc/pihole/pihole-FTL.db" From d8f85a898130453e4f4ee9f0924d33c3c450dfbc Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Fri, 13 Apr 2018 11:08:02 +0200 Subject: [PATCH 15/17] Avoid a "No such file or directory" error Check the file /etc/pihole/pihole-FTL.conf exists before trying to use it. without the patch I get, each day, in my logs: sed: can't read /etc/pihole/pihole-FTL.conf: No such file or directory I use a variable FTLconf to not repeat the file name twice. Signed-off-by: Ludovic Rousseau --- advanced/Scripts/piholeLogFlush.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index ffc9e0f5..9777b613 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -16,7 +16,8 @@ source ${colfile} # Constructed to return nothing when # a) the setting is not present in the config file, or # b) the setting is commented out (e.g. "#DBFILE=...") -DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' /etc/pihole/pihole-FTL.conf)" +FTLconf="/etc/pihole/pihole-FTL.conf" +[ -e "$FTLconf" ] && DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' $FTLconf)" # Test for empty string. Use standard path in this case. if [ -z "$DBFILE" ]; then DBFILE="/etc/pihole/pihole-FTL.db" From 9b3531f634ba59e0d71b25e2ceda1abbf291acf8 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Fri, 13 Apr 2018 11:48:34 +0200 Subject: [PATCH 16/17] Fix stylistic issue Expand variable using ${FTLconf} Signed-off-by: Ludovic Rousseau --- advanced/Scripts/piholeLogFlush.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index 9777b613..be2ca20d 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -17,7 +17,7 @@ source ${colfile} # a) the setting is not present in the config file, or # b) the setting is commented out (e.g. "#DBFILE=...") FTLconf="/etc/pihole/pihole-FTL.conf" -[ -e "$FTLconf" ] && DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' $FTLconf)" +[ -e "$FTLconf" ] && DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' ${FTLconf})" # Test for empty string. Use standard path in this case. if [ -z "$DBFILE" ]; then DBFILE="/etc/pihole/pihole-FTL.db" From 7edab27e53fbe005c542d996bb40a2a54505f5fb Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Fri, 13 Apr 2018 12:19:55 +0200 Subject: [PATCH 17/17] Stylistic change to use an explicit if/then/fi Signed-off-by: Ludovic Rousseau --- advanced/Scripts/piholeLogFlush.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index be2ca20d..44af77a6 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -17,7 +17,9 @@ source ${colfile} # a) the setting is not present in the config file, or # b) the setting is commented out (e.g. "#DBFILE=...") FTLconf="/etc/pihole/pihole-FTL.conf" -[ -e "$FTLconf" ] && DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' ${FTLconf})" +if [ -e "$FTLconf" ]; then + DBFILE="$(sed -n -e 's/^\s*DBFILE\s*=\s*//p' ${FTLconf})" +fi # Test for empty string. Use standard path in this case. if [ -z "$DBFILE" ]; then DBFILE="/etc/pihole/pihole-FTL.db"