From a44a201f0088a48a4240f380dded8c815ed4411e Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Mon, 14 Mar 2016 22:51:16 -0500 Subject: [PATCH 1/4] rewrite js files to a valid stub --- advanced/lighttpd.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/advanced/lighttpd.conf b/advanced/lighttpd.conf index 5a662ffa..124371a9 100644 --- a/advanced/lighttpd.conf +++ b/advanced/lighttpd.conf @@ -53,4 +53,6 @@ $HTTP["url"] =~ "^/admin/" { $HTTP["url"] =~ "^(?!/admin)/.*" { # Create a response header for debugging using curl -I setenv.add-response-header = ( "X-Pi-hole" => "A black hole for Internet advertisements." ) + # rewrite only js requests + url.rewrite = ("(.*).js" => "pihole/index.js") } From d3971b26e4e278a227f861697c2063acd6bfe9a8 Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Mon, 14 Mar 2016 22:52:02 -0500 Subject: [PATCH 2/4] add a valid js stub --- advanced/index.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 advanced/index.js diff --git a/advanced/index.js b/advanced/index.js new file mode 100644 index 00000000..6e81b42f --- /dev/null +++ b/advanced/index.js @@ -0,0 +1 @@ +var x = "X-Pi-hole: A black hole for Internet advertisements." From 404ea0ce6daaf61b1e6739d2ae3647d85390b24d Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Mon, 14 Mar 2016 22:54:45 -0500 Subject: [PATCH 3/4] copy both the html and js stubs during install --- 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 b3e6202f..35c885e8 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -619,7 +619,7 @@ installPiholeWeb() { else $SUDO mkdir /var/www/html/pihole $SUDO mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig - $SUDO cp /etc/.pihole/advanced/index.html /var/www/html/pihole/index.html + $SUDO cp /etc/.pihole/advanced/index.* /var/www/html/pihole/. $SUDO echo " done!" fi } From b79db363368310cc47fcea4b4abd2426ce898c5d Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Mon, 14 Mar 2016 22:59:38 -0500 Subject: [PATCH 4/4] no need for the X- header prefix in the string --- advanced/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/index.js b/advanced/index.js index 6e81b42f..c9da5aff 100644 --- a/advanced/index.js +++ b/advanced/index.js @@ -1 +1 @@ -var x = "X-Pi-hole: A black hole for Internet advertisements." +var x = "Pi-hole: A black hole for Internet advertisements."