diff --git a/README.md b/README.md
index 6e225856b4..12769874c3 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
Pi-hole Admin Dashboard
============
+[](https://www.codacy.com/app/Pi-hole/AdminLTE?utm_source=github.com&utm_medium=referral&utm_content=pi-hole/AdminLTE&utm_campaign=badger)
[](https://gitter.im/pi-hole/AdminLTE?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3J2L3Z4DHW9UY "Donate")
@@ -8,8 +9,7 @@ Using **[AdminLTE](https://almsaeedstudio.com)**, this project will create a Web
From this interface, you will be able to see stats on how well your Pi-hole is performing. You will also be able to update the lists used to block ads.
-
-
+
## API
A read-only API can be accessed at `/admin/api.php`. With either no parameters or `api.php?summary` it returns the following JSON:
@@ -22,6 +22,9 @@ A read-only API can be accessed at `/admin/api.php`. With either no parameters o
}
```
-There are many more parameters, such as `summaryRaw`, `overTimeData`, `topItems`, `recentItems`, `getQueryTypes`, `getForwardDestinations`, `getQuerySources`, and finally `getAllQueries`.
+There are many more parameters, such as `summaryRaw`, `overTimeData10mins`, ` topClients` or `getQuerySources`, `getQueryTypes`, `getForwardDestinations`, and `getAllQueries`.
+Together with a token it is also possible to enable and disable (also with a set timeout) blocking via the API.
-`getAllQueries` can optionally be set with one of these values to return JSON hash ordered as value implies: `orderByClientDomainTime`, `orderByClientTimeDomain`, `orderByTimeClientDomain`, `orderByTimeDomainClient`, `orderByDomainClientTime` or `orderByDomainTimeClient`.
+
Query Types: Shows to which upstream DNS the permitted requests have been forwarded to.
+
Forward Destinations: 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 how many DNS requests each client has made on the local network.
@@ -70,25 +70,33 @@
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 wildcards using the web UI 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.
+
Wildcard blacklisting is supported (entering something.de will block this domain including all subdomains like a.bb.c.999.something.de). Note that wildcard whitelisting is not supported.
+
You can white-/blacklist multiple entries at a time if you separate the domains by spaces.
-
Update Lists
-
Will download any updates from the third-party ad-serving domain lists that we source. By default, this command runs once a week via cron.
+
Disable / Enable
+ 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)
-
Query adlists
- This function is useful to find out what list a domain appears on. Since we don't control what the third-parties put on the block lists, you may find that a domain you normally visit stops working. If this is the case, you could run this command to scan for strings in the list of blocked domains and it will return the list the domain is found on. This proved useful a while back when the Mahakala list was adding apple.com and microsoft.com to their block list.
+
Tools → Update Lists
+
Will download any updates from the third-party ad-serving domain lists that we source. By default, this command runs once a week via cron (Sunday at 01:59).
-
Disable / Enable
- 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)
+
Tools → Query adlists
+ This function is useful to find out what list a domain appears on. Since we don't control what the third-parties put on the block lists, you may find that a domain you normally visit stops working. If this is the case, you could run this command to scan for strings in the list of blocked domains and it will return the list the domain is found on. This proved useful a while back when the Mahakala list was adding apple.com and microsoft.com to their block list.
+
+
+
+
+
Tools → Tail pihole.log
+ Live tailing of the raw Pi-hole log.
@@ -96,13 +104,13 @@
Settings
Change settings for the Pi-Hole
Networking
- Displays information about the interfaces of the Pi-Hole. No changes possible
+ Displays information about the interfaces of the Pi-Hole. No changes possible.
Pi-Hole DHCP Server
- Using this setting you can enable/disable the DHCP server of the Pi-Hole. Note that you should disable any other DHCP server on your network to avoid IP addresses being used more than once. You have to give the range of IPs that DHCP will serve and the IP of the local router (gateway). If the DHCP server is active, the current leases are shown on the settings page.
+ Using this setting you can enable/disable the DHCP server of the Pi-Hole. Note that you should disable any other DHCP server on your network to avoid IP addresses being used more than once. You have to give the range of IPs that DHCP will serve and the IP of the local router (gateway). If the DHCP server is active, the current leases are shown on the settings page. IPv4 DHCP will always be activated, IPv6 (stateless + statefull) can be enabled.
Upstream DNS Servers
- Customize used upstream DNS servers + advanced settings
+ Customize used upstream DNS servers + advanced settings for DNS servers. Note that any number of DNS servers may be enabled at a time.
Query Logging
- Enabled/disable query logging on your Pi-hole
+ Enabled/disable query logging on your Pi-hole + provide option to flush the log
API
Change settings which apply to the API as well as the web UI
Note that Top Clients have to be given as IP addresses
diff --git a/list.php b/list.php
index dc8097c16c..3f720e78af 100644
--- a/list.php
+++ b/list.php
@@ -29,10 +29,18 @@ function getFullName() {
+
+
+
+
+
+ }
+
+
Note that whitelisting domains which are blocked using the wildcard method won't work.
@@ -45,11 +53,18 @@ function getFullName() {
- Failure! Something went wrong.
+ Failure! Something went wrong.
+
+
Exact blocking
+
+
+
Wildcard blocking
+
+
- Failure! Something went wrong.
+ Failure! Something went wrong.
diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js
index ce64015515..6dd4ce65e6 100644
--- a/scripts/pi-hole/js/footer.js
+++ b/scripts/pi-hole/js/footer.js
@@ -10,9 +10,9 @@ $("body").on("click", function(event) {
function piholeChanged(action)
{
- const status = $("#status");
- const ena = $("#pihole-enable");
- const dis = $("#pihole-disable");
+ var status = $("#status");
+ var ena = $("#pihole-enable");
+ var dis = $("#pihole-disable");
switch(action) {
case "enabled":
@@ -33,7 +33,7 @@ function piholeChanged(action)
function piholeChange(action, duration)
{
- const token = encodeURIComponent($("#token").html());
+ var token = encodeURIComponent($("#token").html());
var btnStatus;
switch(action) {
@@ -62,25 +62,25 @@ function piholeChange(action, duration)
}
// Handle Enable/Disable
-$("#pihole-enable").on("click", (e) => {
+$("#pihole-enable").on("click", function(e){
e.preventDefault();
piholeChange("enable","");
});
-$("#pihole-disable-permanently").on("click", (e) => {
+$("#pihole-disable-permanently").on("click", function(e){
e.preventDefault();
piholeChange("disable","0");
});
-$("#pihole-disable-10s").on("click", (e) => {
+$("#pihole-disable-10s").on("click", function(e){
e.preventDefault();
piholeChange("disable","10");
setTimeout(function(){piholeChanged("enabled");},10000);
});
-$("#pihole-disable-30s").on("click", (e) => {
+$("#pihole-disable-30s").on("click", function(e){
e.preventDefault();
piholeChange("disable","30");
setTimeout(function(){piholeChanged("enabled");},30000);
});
-$("#pihole-disable-5m").on("click", (e) => {
+$("#pihole-disable-5m").on("click", function(e){
e.preventDefault();
piholeChange("disable","300");
setTimeout(function(){piholeChanged("enabled");},300000);
@@ -204,3 +204,27 @@ $(document).keypress(function(e) {
$("#loginform").submit();
}
});
+
+function testCookies()
+{
+ if (navigator.cookieEnabled)
+ {
+ return true;
+ }
+
+ // set and read cookie
+ document.cookie = "cookietest=1";
+ var ret = document.cookie.indexOf("cookietest=") !== -1;
+
+ // delete cookie
+ document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
+
+ return ret;
+}
+
+$(function() {
+ if(!testCookies() && $("#cookieInfo").length)
+ {
+ $("#cookieInfo").show();
+ }
+});
diff --git a/scripts/pi-hole/js/gravity.js b/scripts/pi-hole/js/gravity.js
index a208cae127..02c91e3c7d 100644
--- a/scripts/pi-hole/js/gravity.js
+++ b/scripts/pi-hole/js/gravity.js
@@ -2,6 +2,13 @@ function eventsource() {
var alInfo = $("#alInfo");
var alSuccess = $("#alSuccess");
var ta = $("#output");
+
+ // IE does not support EventSource - exit early
+ if (typeof EventSource !== "function") {
+ ta.show();
+ ta.html("Updating lists of ad-serving domains is not supported with this browser!");
+ return;
+ }
var source = new EventSource("scripts/pi-hole/php/gravity.sh.php");
ta.html("");
@@ -27,7 +34,7 @@ function eventsource() {
}, false);
}
-$("#gravityBtn").on("click", () => {
+$("#gravityBtn").on("click", function(){
$("#gravityBtn").attr("disabled", true);
eventsource();
});
diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js
index 5030af14bb..89b1d2ba06 100644
--- a/scripts/pi-hole/js/index.js
+++ b/scripts/pi-hole/js/index.js
@@ -132,7 +132,7 @@ function escapeHtml(text) {
function updateTopClientsChart() {
$.getJSON("api.php?summaryRaw&getQuerySources", function(data) {
var clienttable = $("#client-frequency").find("tbody:last");
- var domain, percentage, domainname;
+ var domain, percentage, domainname, domainip;
for (domain in data.top_sources) {
if ({}.hasOwnProperty.call(data.top_sources, domain)){
@@ -140,14 +140,17 @@ function updateTopClientsChart() {
domain = escapeHtml(domain);
if(domain.indexOf("|") > -1)
{
- domainname = domain.substr(0, domain.indexOf("|"));
+ var idx = domain.indexOf("|");
+ domainname = domain.substr(0, idx);
+ domainip = domain.substr(idx+1, domain.length-idx);
}
else
{
domainname = domain;
+ domainip = domain;
}
- var url = ""+domainname+"";
+ var url = ""+domainname+"";
percentage = data.top_sources[domain] / data.dns_queries_today * 100;
clienttable.append("