From 87f5cc1009f39ab136bdad06aef4be19b1fdcb89 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 12:19:39 +0100 Subject: [PATCH 01/20] Add "Help" to main navigation --- header.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/header.php b/header.php index 54b4da1e..2c02e9b5 100644 --- a/header.php +++ b/header.php @@ -256,6 +256,12 @@ Donate + +
  • + + Help + +
  • From 0680fd546bf87f2a85b80e5a2bef3a4d5e8c7159 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 12:43:35 +0100 Subject: [PATCH 02/20] Added help center skeleton --- help.php | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 help.php diff --git a/help.php b/help.php new file mode 100644 index 00000000..3df509c9 --- /dev/null +++ b/help.php @@ -0,0 +1,60 @@ + + + +
    +
    +

    Header

    +

    Top left: Status display

    +

    Top right: About

    +
    +
    +
    +
    +

    Main page

    +

    On the main page, various statistics of pi-hole are shown to the user.

    +
    +
    +
    +
    +

    Query Log

    +
    +
    +
    +
    +

    White- / Blacklist

    +
    +
    +
    +
    +

    Update lists

    +
    +
    +
    +
    +

    Disable / Enable

    +
    +
    +
    +
    +

    Donate

    +
    +
    +
    +
    +

    Help (this page)

    +
    +
    +
    +
    +

    Footer

    +
    +
    + + + From d19048f5e6b6f85bb80b50f45b67315ad215685f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 12:44:01 +0100 Subject: [PATCH 03/20] Add changing of temperature unit from the web UI --- header.php | 14 ++++++++++++++ help.php | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/header.php b/header.php index 2c02e9b5..9e54ce18 100644 --- a/header.php +++ b/header.php @@ -8,6 +8,20 @@ $refer = $_SERVER['HTTP_REFERER']; header("location:$refer"); } + + // Web based change of temperature unit + if (isset($_GET['tempunit'])) + { + if($_GET['tempunit'] == "fahrenheit") + { + exec('sudo pihole -a -f'); + } + else + { + exec('sudo pihole -a -c'); + } + } + $cmd = "echo $((`cat /sys/class/thermal/thermal_zone0/temp | cut -c1-2`))"; $output = shell_exec($cmd); $celsius = str_replace(array("\r\n","\r","\n"),"", $output); diff --git a/help.php b/help.php index 3df509c9..323bec77 100644 --- a/help.php +++ b/help.php @@ -9,6 +9,25 @@

    Header

    Top left: Status display

    +

    Shows different status messages:

    +
      +
    • Status (Active, Offline, Starting) of the Pi-hole
    • +
    • Current CPU temperature + + (switch unit to Fahrenheit) + + (switch unit to Celsius) +
    • +
    • +

    Top right: About

    From 135de872571fc149fb947cd575636a0b79de9d0e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 12:50:34 +0100 Subject: [PATCH 04/20] Completed description of the top left header subsection --- help.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/help.php b/help.php index 323bec77..720be439 100644 --- a/help.php +++ b/help.php @@ -11,7 +11,7 @@

    Top left: Status display

    Shows different status messages:

      -
    • Status (Active, Offline, Starting) of the Pi-hole
    • +
    • Status (Active (), Offline (), Starting ()) of the Pi-hole
    • Current CPU temperature
    • -
    • +
    • Load: load averages for the last minute, 5 minutes and 15 minutes, respectively. A load average of 1 reflects the full workload of a single processor on the system. We show a red icon if the current load exceeds the number of available processors on this machine (which is )
    • +
    • Memory usage: Shows the percentage of memory acutally blocked by applications. We show a red icon if the memory usage exceeds 75%

    Top right: About

    From 2fadb46d2ccddce7d8770fdbbabe340bc73beec3 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 12:54:41 +0100 Subject: [PATCH 05/20] Added top right subsection --- help.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/help.php b/help.php index 720be439..a1f046cf 100644 --- a/help.php +++ b/help.php @@ -11,8 +11,8 @@

    Top left: Status display

    Shows different status messages:

      -
    • Status (Active (), Offline (), Starting ()) of the Pi-hole
    • -
    • Current CPU temperature +
    • Status: Current status of the Pi-hole - Active (), Offline (), or Starting ()
    • +
    • Temp: Current CPU temperature @@ -30,6 +30,12 @@
    • Memory usage: Shows the percentage of memory acutally blocked by applications. We show a red icon if the memory usage exceeds 75%

    Top right: About

    +
      +
    • GitHub: Link to pi-hole repository
    • +
    • Details: Link to Jacob Salmela's blog with some more details, describing also the concept of the Pi-hole
    • +
    • Updates: Link to list of releases
    • +
    • Update notifications: If updates are available, a link will be shown here.
    • +
    From 015089d1dab1d88a41c26d46ac2133f5fbb30138 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:05:42 +0100 Subject: [PATCH 06/20] Added main page section --- help.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/help.php b/help.php index a1f046cf..02d4e4c8 100644 --- a/help.php +++ b/help.php @@ -41,7 +41,24 @@

    Main page

    -

    On the main page, various statistics of pi-hole are shown to the user.

    +

    On the main page, various statistics of pi-hole are shown to the user:

    +
      +
    • Summary: A summary of statistics showing how many out of how many total DNS queries have been blocked today, how that translates into a percentage and how many domains are on the blacklist. This graph is updated every 10 seconds. Changes are highlighted.
    • +
    • Queries over time: Diagram showing DNS queries (total and blocked) over 10 minute time intervals. More information can be acquired by hovering over the lines.
    • +
    • Query Types: Shows which types of query have been processed: +
        +
      • A: IPv4 address lookup (most commonly used to map hostnames to an IP address of the host)
      • +
      • AAAA: IPv6 address lookup (most commonly used to map hostnames to an IP address of the host)
      • +
      • PTR: most common use is for implementing reverse DNS lookups
      • +
      • SRV: Service locator (often used by XMPP, SIP, and LDAP)
      • +
      +
    • +
    • Query Types: Shows to which upstream DNS the permitted requests have been forwarded to.
    • +
    • Top Domains: Ranking of requested sites by number of DNS lookups.
    • +
    • Top Advertisers: Ranking of requested sites by number of DNS lookups.
    • +
    • Top Advertisers: Ranking of requested advertisments by number of DNS lookups.
    • +
    • Top Clients: Ranking of total DNS requests separated by clients on the local network.
    • +
    From ddef2af9d52b500a0754075323e0cbe78c9187ae Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:18:16 +0100 Subject: [PATCH 07/20] Add "Query Log" section --- help.php | 1 + 1 file changed, 1 insertion(+) diff --git a/help.php b/help.php index 02d4e4c8..78374fbd 100644 --- a/help.php +++ b/help.php @@ -64,6 +64,7 @@

    Query Log

    +

    Shows the recent queries after parsing the pi-hole log files. It is possible to search through the whole list by using the "Search" input field. If the status is reported as "OK", then the DNS request has been permitted. Otherwise ("Pi-holed") it has been blocked. By clicking on the buttons under "Action" the corresponding domains can quickly be added to the white-/blacklist. The status of this action will be reported on this page.

    From 85defe3bcd8ea25cd9d61073eafbdcbb9586080d Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:20:38 +0100 Subject: [PATCH 08/20] Add "White- / Blacklist" section --- help.php | 1 + 1 file changed, 1 insertion(+) diff --git a/help.php b/help.php index 78374fbd..8e6c48b1 100644 --- a/help.php +++ b/help.php @@ -70,6 +70,7 @@

    White- / Blacklist

    +

    Add or remove domains (or subdomains) from the white-/blacklist. If a domain is added to e.g. the whitelist, any possible entry of the same domain will be automatically removed from the blacklist and vice versa. Adding wildcars is currently not supported.

    From eedb1415490ad9a0a1537a24d582b144985f0f95 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:23:38 +0100 Subject: [PATCH 09/20] Add "Update Lists" section --- header.php | 2 +- help.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/header.php b/header.php index 9e54ce18..ee1bcc0e 100644 --- a/header.php +++ b/header.php @@ -253,7 +253,7 @@
  • - Update lists + Update Lists
  • diff --git a/help.php b/help.php index 8e6c48b1..5b092095 100644 --- a/help.php +++ b/help.php @@ -75,7 +75,8 @@
    -

    Update lists

    +

    Update Lists

    +

    Runs the command

    sudo pihole -g
    and prints the result transparently to the web UI. The gravity.sh script will update the list of ad-serving domains

    From 8bacc06c1aa176f10c6a988d0451f9eaaf17b264 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:25:13 +0100 Subject: [PATCH 10/20] Added "Disable / Enable" subsection --- help.php | 1 + 1 file changed, 1 insertion(+) diff --git a/help.php b/help.php index 5b092095..921bf47d 100644 --- a/help.php +++ b/help.php @@ -82,6 +82,7 @@

    Disable / Enable

    + Disables resp. enables Pi-Hole DNS Blocking completely. The change will be reflected by a changed status (top left)
    From d02487aa9f20121d4ee96e38c1b0a0880e76cc3b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:29:13 +0100 Subject: [PATCH 11/20] Add "Donate" section --- help.php | 1 + 1 file changed, 1 insertion(+) diff --git a/help.php b/help.php index 921bf47d..47e8ee52 100644 --- a/help.php +++ b/help.php @@ -88,6 +88,7 @@

    Donate

    + If you like Pi-Hole, please consider a small donation. Keep in mind that Pi-hole is free, but powered by your donations
    From 4a68be057219102b619fb8f2ee479e91c1d73153 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:30:03 +0100 Subject: [PATCH 12/20] Added "Help" section --- help.php | 1 + 1 file changed, 1 insertion(+) diff --git a/help.php b/help.php index 47e8ee52..76ad4e4f 100644 --- a/help.php +++ b/help.php @@ -94,6 +94,7 @@

    Help (this page)

    + Shows information about what is happening behind the scenes and what can be done with this web user interface (web UI)
    From af71be16ffb0f325b7bd38c102d258b9ce7a4649 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:30:50 +0100 Subject: [PATCH 13/20] Added "Footer" section --- help.php | 1 + 1 file changed, 1 insertion(+) diff --git a/help.php b/help.php index 76ad4e4f..380c529a 100644 --- a/help.php +++ b/help.php @@ -100,6 +100,7 @@

    Footer

    + Shows the currently installed Pi-hole and Web Interface version. If an update is available, this will be indicated here
    From 977980f49ba0ac90d24a37b7b1d1d0b118fec534 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:32:06 +0100 Subject: [PATCH 14/20] Small change to style of the new "Help center" page --- help.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/help.php b/help.php index 380c529a..afcb1605 100644 --- a/help.php +++ b/help.php @@ -1,14 +1,11 @@ - -
    +

    Help center

    Header

    -

    Top left: Status display

    +

    Top left: Status display

    Shows different status messages:

    • Status: Current status of the Pi-hole - Active (), Offline (), or Starting ()
    • @@ -29,7 +26,7 @@
    • Load: load averages for the last minute, 5 minutes and 15 minutes, respectively. A load average of 1 reflects the full workload of a single processor on the system. We show a red icon if the current load exceeds the number of available processors on this machine (which is )
    • Memory usage: Shows the percentage of memory acutally blocked by applications. We show a red icon if the memory usage exceeds 75%
    -

    Top right: About

    +

    Top right: About

    • GitHub: Link to pi-hole repository
    • Details: Link to Jacob Salmela's blog with some more details, describing also the concept of the Pi-hole
    • From bb68422262cbd031699cdfaf946afe462c356ae5 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:32:35 +0100 Subject: [PATCH 15/20] Consider that there are more possible DNS query types --- help.php | 1 + 1 file changed, 1 insertion(+) diff --git a/help.php b/help.php index afcb1605..9eefb865 100644 --- a/help.php +++ b/help.php @@ -48,6 +48,7 @@
    • AAAA: IPv6 address lookup (most commonly used to map hostnames to an IP address of the host)
    • PTR: most common use is for implementing reverse DNS lookups
    • SRV: Service locator (often used by XMPP, SIP, and LDAP)
    • +
    • and others
  • Query Types: Shows to which upstream DNS the permitted requests have been forwarded to.
  • From 16df80b017c5336bf06a3201b69c169d349078d2 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 13:45:45 +0100 Subject: [PATCH 16/20] Fixed some typos --- help.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/help.php b/help.php index 9eefb865..9d2527e3 100644 --- a/help.php +++ b/help.php @@ -24,7 +24,7 @@ } ?>
  • Load: load averages for the last minute, 5 minutes and 15 minutes, respectively. A load average of 1 reflects the full workload of a single processor on the system. We show a red icon if the current load exceeds the number of available processors on this machine (which is )
  • -
  • Memory usage: Shows the percentage of memory acutally blocked by applications. We show a red icon if the memory usage exceeds 75%
  • +
  • Memory usage: Shows the percentage of memory actually blocked by applications. We show a red icon if the memory usage exceeds 75%
  • Top right: About

      @@ -54,7 +54,7 @@
    • Query Types: Shows to which upstream DNS the permitted requests have been forwarded to.
    • Top Domains: Ranking of requested sites by number of DNS lookups.
    • Top Advertisers: Ranking of requested sites by number of DNS lookups.
    • -
    • Top Advertisers: Ranking of requested advertisments by number of DNS lookups.
    • +
    • Top Advertisers: Ranking of requested advertisements by number of DNS lookups.
    • Top Clients: Ranking of total DNS requests separated by clients on the local network.
    @@ -68,7 +68,7 @@

    White- / Blacklist

    -

    Add or remove domains (or subdomains) from the white-/blacklist. If a domain is added to e.g. the whitelist, any possible entry of the same domain will be automatically removed from the blacklist and vice versa. Adding wildcars is currently not supported.

    +

    Add or remove domains (or subdomains) from the white-/blacklist. If a domain is added to e.g. the whitelist, any possible entry of the same domain will be automatically removed from the blacklist and vice versa. Adding wildcards using the web UI is currently not supported.

    From 96f7bf59210595815130bbc4cd638d21b3e9f8a1 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 14:09:46 +0100 Subject: [PATCH 17/20] Add flushing of the pi-hole log file using the web UI --- help.php | 19 ++++++++++++++++++- js/pihole/help.js | 7 +++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 js/pihole/help.js diff --git a/help.php b/help.php index 9d2527e3..c6b934d5 100644 --- a/help.php +++ b/help.php @@ -1,6 +1,7 @@ +

    Help center

    @@ -101,8 +102,24 @@ Shows the currently installed Pi-hole and Web Interface version. If an update is available, this will be indicated here
    - +
    +
    +

    Emergency help

    + In case the web UI does not work properly anymore (i.e. timeout errors or diagrams not showing up) you can try to flush the Pi-hole config file by clicking FLUSH. Note that your statistics will be reset and you loose the statistics of the day until now. +
    +
    + + diff --git a/js/pihole/help.js b/js/pihole/help.js new file mode 100644 index 00000000..cfa05dbf --- /dev/null +++ b/js/pihole/help.js @@ -0,0 +1,7 @@ +$( "#flush" ).click(function() { + if (confirm('Are you sure you want to flush the pi-hole log file?')) { + document.location.href='help.php?flush=true'; + } else { + // Do nothing! + } +}); From 9f30aca516a6d96ab409719834e491f3c9f5f023 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 22 Nov 2016 14:13:17 +0100 Subject: [PATCH 18/20] Strings must use doublequote --- help.php | 6 +++--- js/pihole/help.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/help.php b/help.php index c6b934d5..3a4b2490 100644 --- a/help.php +++ b/help.php @@ -111,11 +111,11 @@ Date: Tue, 22 Nov 2016 14:27:00 +0100 Subject: [PATCH 19/20] Removed "Top Advertisers" being listed twice --- help.php | 1 - 1 file changed, 1 deletion(-) diff --git a/help.php b/help.php index 3a4b2490..fc6130e7 100644 --- a/help.php +++ b/help.php @@ -54,7 +54,6 @@
  • Query Types: Shows to which upstream DNS the permitted requests have been forwarded to.
  • Top Domains: Ranking of requested sites by number of DNS lookups.
  • -
  • Top Advertisers: Ranking of requested sites by number of DNS lookups.
  • Top Advertisers: Ranking of requested advertisements by number of DNS lookups.
  • Top Clients: Ranking of total DNS requests separated by clients on the local network.
  • From 5dfab7cdc2355e14c90b059499184de44ff61145 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 23 Nov 2016 11:59:18 +0100 Subject: [PATCH 20/20] Incorporate @Mcat12's comments --- help.php | 29 +++++++++++++---------------- js/pihole/help.js | 4 ++-- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/help.php b/help.php index fc6130e7..8c416647 100644 --- a/help.php +++ b/help.php @@ -29,7 +29,7 @@

    Top right: About

      -
    • GitHub: Link to pi-hole repository
    • +
    • GitHub: Link to the Pi-hole repository
    • Details: Link to Jacob Salmela's blog with some more details, describing also the concept of the Pi-hole
    • Updates: Link to list of releases
    • Update notifications: If updates are available, a link will be shown here.
    • @@ -39,14 +39,14 @@

      Main page

      -

      On the main page, various statistics of pi-hole are shown to the user:

      +

      On the main page, you can see various Pi-hole statistics:

        -
      • Summary: A summary of statistics showing how many out of how many total DNS queries have been blocked today, how that translates into a percentage and how many domains are on the blacklist. This graph is updated every 10 seconds. Changes are highlighted.
      • -
      • Queries over time: Diagram showing DNS queries (total and blocked) over 10 minute time intervals. More information can be acquired by hovering over the lines.
      • -
      • Query Types: Shows which types of query have been processed: +
      • Summary: A summary of statistics showing how many total DNS queries have been blocked today, what percentage of DNS queries have been blocked, and how many domains are in the compiled ad list. This summary is updated every 10 seconds.
      • +
      • Queries over time: Graph showing DNS queries (total and blocked) over 10 minute time intervals. More information can be acquired by hovering over the lines.
      • +
      • Query Types: Identifies the types of processed queries:
          -
        • A: IPv4 address lookup (most commonly used to map hostnames to an IP address of the host)
        • -
        • AAAA: IPv6 address lookup (most commonly used to map hostnames to an IP address of the host)
        • +
        • A: address lookup (most commonly used to map hostnames to an IPv4 address of the host)
        • +
        • AAAA: address lookup (most commonly used to map hostnames to an IPv6 address of the host)
        • PTR: most common use is for implementing reverse DNS lookups
        • SRV: Service locator (often used by XMPP, SIP, and LDAP)
        • and others
        • @@ -55,14 +55,14 @@
        • Query Types: Shows to which upstream DNS the permitted requests have been forwarded to.
        • Top Domains: Ranking of requested sites by number of DNS lookups.
        • Top Advertisers: Ranking of requested advertisements by number of DNS lookups.
        • -
        • Top Clients: Ranking of total DNS requests separated by clients on the local network.
        • +
        • Top Clients: Ranking of how many DNS requests each client has made on the local network.

      Query Log

      -

      Shows the recent queries after parsing the pi-hole log files. It is possible to search through the whole list by using the "Search" input field. If the status is reported as "OK", then the DNS request has been permitted. Otherwise ("Pi-holed") it has been blocked. By clicking on the buttons under "Action" the corresponding domains can quickly be added to the white-/blacklist. The status of this action will be reported on this page.

      +

      Shows the recent queries by parsing Pi-hole's log. It is possible to search through the whole list by using the "Search" input field. If the status is reported as "OK", then the DNS request has been permitted. Otherwise ("Pi-holed") it has been blocked. By clicking on the buttons under "Action" the corresponding domains can quickly be added to the white-/blacklist. The status of the action will be reported on this page.

      @@ -80,13 +80,13 @@

      Disable / Enable

      - Disables resp. enables Pi-Hole DNS Blocking completely. The change will be reflected by a changed status (top left) + Disables/enables Pi-Hole blocking completely. You may have to wait a few minutes for the changes to reach all of your devices. The change will be reflected by a changed status (top left)

      Donate

      - If you like Pi-Hole, please consider a small donation. Keep in mind that Pi-hole is free, but powered by your donations + Keep in mind that Pi-hole is free. If you like Pi-hole, please consider a small donation to help support its development
      @@ -104,7 +104,7 @@

      Emergency help

      - In case the web UI does not work properly anymore (i.e. timeout errors or diagrams not showing up) you can try to flush the Pi-hole config file by clicking FLUSH. Note that your statistics will be reset and you loose the statistics of the day until now. + In case the web UI does not work properly anymore (i.e. timeout errors or diagrams not showing up) you can try to flush the Pi-hole config file by clicking FLUSH. Note that your statistics will be reset and you lose the statistics up to this point.
      @@ -112,10 +112,7 @@ // Web based flushing of pi-hole log file if (isset($_GET["flush"])) { - if($_GET["flush"] == "true") - { - exec("sudo pihole -f"); - } + exec("sudo pihole -f"); } require "footer.php"; diff --git a/js/pihole/help.js b/js/pihole/help.js index 8264b88c..086759a0 100644 --- a/js/pihole/help.js +++ b/js/pihole/help.js @@ -1,6 +1,6 @@ $( "#flush" ).click(function() { - if (confirm("Are you sure you want to flush the pi-hole log file?")) { - document.location.href="help.php?flush=true"; + if (confirm("Are you sure you want to flush the Pi-hole log file?")) { + document.location.href="help.php?flush"; } else { // Do nothing! }