From b246dba7e75a484120739a0eb239a150bdb50bbf Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 4 Dec 2016 21:30:59 +0100 Subject: [PATCH 01/17] Rename index.html to index.php --- advanced/{index.html => index.php} | 0 advanced/lighttpd.conf.debian | 2 +- advanced/lighttpd.conf.fedora | 2 +- automated install/basic-install.sh | 16 ++++++++++------ 4 files changed, 12 insertions(+), 8 deletions(-) rename advanced/{index.html => index.php} (100%) diff --git a/advanced/index.html b/advanced/index.php similarity index 100% rename from advanced/index.html rename to advanced/index.php diff --git a/advanced/lighttpd.conf.debian b/advanced/lighttpd.conf.debian index 15821bc7..01f52a85 100644 --- a/advanced/lighttpd.conf.debian +++ b/advanced/lighttpd.conf.debian @@ -21,7 +21,7 @@ server.modules = ( ) server.document-root = "/var/www/html" -server.error-handler-404 = "pihole/index.html" +server.error-handler-404 = "pihole/index.php" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" diff --git a/advanced/lighttpd.conf.fedora b/advanced/lighttpd.conf.fedora index 96e1311e..d2af5bd4 100644 --- a/advanced/lighttpd.conf.fedora +++ b/advanced/lighttpd.conf.fedora @@ -22,7 +22,7 @@ server.modules = ( ) server.document-root = "/var/www/html" -server.error-handler-404 = "pihole/index.html" +server.error-handler-404 = "pihole/index.php" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 33444873..8c7a6b1d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -21,6 +21,7 @@ set -e tmpLog=/tmp/pihole-install.log instalLogLoc=/etc/pihole/install.log setupVars=/etc/pihole/setupVars.conf +lighttpdConfig=/etc/lighttpd/lighttpd.conf webInterfaceGitUrl="https://github.com/pi-hole/AdminLTE.git" webInterfaceDir="/var/www/html/admin" @@ -709,9 +710,9 @@ installConfigs() { mkdir /etc/lighttpd chown "${USER}":root /etc/lighttpd elif [ -f "/etc/lighttpd/lighttpd.conf" ]; then - mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.orig + mv ${lighttpdConfig} ${lighttpdConfig}.orig fi - cp /etc/.pihole/advanced/${LIGHTTPD_CFG} /etc/lighttpd/lighttpd.conf + cp /etc/.pihole/advanced/${LIGHTTPD_CFG} ${lighttpdConfig} mkdir -p /var/run/lighttpd chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/run/lighttpd mkdir -p /var/cache/lighttpd/compress @@ -825,11 +826,11 @@ installPiholeWeb() { echo ":::" echo "::: Installing pihole custom index page..." if [ -d "/var/www/html/pihole" ]; then - if [ -f "/var/www/html/pihole/index.html" ]; then - echo "::: Existing index.html detected, not overwriting" + if [ -f "/var/www/html/pihole/index.php" ]; then + echo "::: Existing index.php detected, not overwriting" else - echo -n "::: index.html missing, replacing... " - cp /etc/.pihole/advanced/index.html /var/www/html/pihole/ + echo -n "::: index.php missing, replacing... " + cp /etc/.pihole/advanced/index.php /var/www/html/pihole/ echo " done!" fi @@ -955,6 +956,9 @@ accountForRefactor() { sed -i 's/piholeDNS1/PIHOLE_DNS_1/g' ${setupVars} sed -i 's/piholeDNS2/PIHOLE_DNS_2/g' ${setupVars} + # Account for change in lighttpd config file + sed -i 's:pihole/index.html:pihole/index.php:' ${lighttpdConfig} + } updatePihole() { From 6e788668f9f9d63f44585aa54d8522eafc8092c3 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 4 Dec 2016 22:17:08 +0100 Subject: [PATCH 02/17] Updated index.php --- advanced/index.php | 61 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/advanced/index.php b/advanced/index.php index 3a4abe1f..41142633 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -1,7 +1,64 @@ + - - + + + + + + Website Blocked + + + + + + +
+

Website Blocked

+
+
+
Access to the following site has been blocked:
+
+
If you have an ongoing use for this website, please ask to owner of the Pi-Hole in your network to have it whitelisted.
+
+
Generated by Pi-hole
+ + From e7241a989cc95bcf3fca527322128d2d5c07a43b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 4 Dec 2016 22:20:51 +0100 Subject: [PATCH 03/17] Include CSS file --- advanced/index.css | 212 +++++++++++++++++++++++++++++ advanced/index.php | 4 +- automated install/basic-install.sh | 8 ++ 3 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 advanced/index.css diff --git a/advanced/index.css b/advanced/index.css new file mode 100644 index 00000000..b5fae08e --- /dev/null +++ b/advanced/index.css @@ -0,0 +1,212 @@ +/* CSS Reset */ +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } +body { line-height: 1; } +ol, ul { list-style: none; } +blockquote, q { quotes: none; } +blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } +table { border-collapse: collapse; border-spacing: 0; } +html { height: 100%; overflow-x: hidden; } + +/* General Style */ +a { color: rgba(0,60,120,0.95); text-decoration: none; } /* 1E3C5A */ +a:hover { color: rgba(210,120,0,0.95); transition-duration: .2s; } /* 255, 128, 0 */ +divs a { border-bottom: 1px dashed rgba(30,60,90,0.3); } +b { font-weight: bold; } +i { font-style: italic; } + +footer, .pre, input[type='url'], input[type='text'], .alist, .transparent td { font-family: monospace; } +body, header { background: #E1E1E1; } + +body { + background-image: url('http://firebog.net/bg.png'), -webkit-linear-gradient(top, rgba(220,220,220,0.95), rgba(240,240,240,0.95)); + background-image: url('http://firebog.net/bg.png'), linear-gradient(to bottom, rgba(220,220,220,0.95), rgba(240,240,240,0.95)); + background-attachment: fixed; + color: rgba(64,64,64,0.95); + text-shadow: 0 1px rgba(0,0,0,0.04); + font: 14px Arial, sans-serif; + line-height: 1em; +} + +header { + min-width: 320px; + width: 100%; + text-shadow: 0 1px rgba(255,255,255,0.6); + display: table; + table-layout: fixed; + border: 1px solid rgba(0,0,0,0.25); + border-top-color: rgba(255,255,255,0.85); + border-style: solid none; + background-image: -webkit-linear-gradient(top, rgba(240,240,240,0.95), rgba(220,220,220,0.95)); + background-image: linear-gradient(to bottom, rgba(240,240,240,0.95), rgba(220,220,220,0.95)); + box-shadow: 0 0 1px 1px rgba(0,0,0,0.04); +} + +header h1, header div { + display: table-cell; + color: inherit; + font-weight: bold; + vertical-align: middle; + white-space: nowrap; + overflow: hidden; + box-sizing: border-box; +} + +header h1 { + font: bold 1.6em "Trebuchet MS", sans-serif; + width: 100%; + padding: 8px 0; + text-indent: 32px; + background: url("http://firebog.net/PHV.svg") left no-repeat; +} + +header h1 a, h1 a:hover { color: inherit; } +header .alt { width: 85px; font-size: 0.8em; padding-right: 4px; text-align: right; line-height: 1.25em; } +.active { color: green; } +.inactive { color: red; } + +main { + display: block; + width: 80%; + padding: 8px; + font-size: 1em; + background-color: rgba(255,255,255,0.85); + margin: 8px auto; + box-sizing: border-box; + border: 1px solid rgba(0,0,0,0.25); + box-shadow: 0 0 1px 1px rgba(0,0,0,0.04); + line-height: 1.2em; + border-radius: 8px; +} + +h2 { /* Rgba is shared with .transparent th */ + font: 1.15em sans-serif; + background-color: rgba(255,0,0,0.4); + text-shadow: none; + line-height: 1.1em; + padding-bottom: 1px; + margin-top: 8px; + margin-bottom: 4px; + background: -webkit-linear-gradient(left, rgba(0,0,0,0.25), transparent 80%) no-repeat; + background: linear-gradient(to right, rgba(0,0,0,0.25), transparent 80%) no-repeat; + background-size: 100% 1px; + background-position: 0 17px; +} + +h2:first-child { margin-top: 0; } +h2 ~ *:not(h2) { margin-left: 4px; } +li { padding: 2px 0; } +li::before { content: "\00BB\00a0"; } +li a { position: relative; top: 1px; } /* Center bullet-point arrows */ + +/* Button Style */ +.buttons a, input, .transparent th a { /* Swapped rgba is shared with input[type='url'] */ + display: inline-block; + color: rgba(32,32,32,0.9); + font-weight: bold; + text-align: center; + cursor: pointer; + text-shadow: 0 1px rgba(255,255,255,0.2); + line-height: 0.86em; + font-size: 1em; + padding: 4px 8px; + background: #FAFAFA; + background-image: -webkit-linear-gradient(top, rgba(255,255,255,0.05), rgba(0,0,0,0.05)); + background-image: linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(0,0,0,0.05)); + border: 1px solid rgba(0,0,0,0.25); + border-radius: 4px; + box-shadow: 0 1px 0 rgba(0,0,0,0.04); +} + +.buttons { white-space: nowrap; width: 100%; display: table; } +.mini a { width: 50%; } +a.safe { background-color: rgba(0,220,0,0.5); } +a.warn { background-color: rgba(220,0,0,0.5); } + +.blocked, .toggle, .sourcever, .mini, .addurl a, .editurl a { margin-top: 8px; } +.blocked a, .mini a { display: table-cell; } +.blocked a.safe { width: 100%; } + +.ministatus { text-align: center; } + +input[type='url'], input[type='text'] { /* Swapped rgba is shared with .buttons a */ + font-size: 1.15em; + padding: 2px 4px; + text-align: left; + cursor: text; + width: 100%; + box-sizing: border-box; + background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.05), rgba(255,255,255,0.05)); + background-image: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(255,255,255,0.05)); +} + +input:focus { + outline: none; + box-shadow: 0 0 0 2px rgba(0,128,240,0.4); + border-radius: 4px; +} + +/* Types of text */ +.pre { white-space: pre; overflow: auto; -webkit-overflow-scrolling: touch; } +.msg { display: block; line-height: 1.2em; font-weight: bold; font-size: 1.15em; margin: 4px 8px 8px 8px; white-space: pre-line; } +.request, .finalresults, .sourcever, .invocation, .parameters, .transparent td, .actionfilecontent, .actionslist { font-size: 0.9em; line-height: 1.2em; } /* "Pre sized" */ + +.request, .finalresults, .parameters, .actionfilecontent, .actionslist { /* Dashed outline for excessive text */ + line-height: 1.2em; + padding: 4px; + border: 1px dashed rgba(0,0,0,0.25); + border-right: 0; + background-image: -webkit-linear-gradient(left, #FFF 70%, rgba(255,255,255,0)); + background-image: linear-gradient(to right, #FFF 70%, rgba(255,255,255,0)); + border-radius: 4px 0 0 4px; +} + +.parameters, .finalresults { /* Small scrollbox for excessive text */ + max-height: 116px; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; +} + +.editactions { font-size: 0.8em; } +.actionslist { margin: 4px 0; } + +/* Matching actions in show-url-info */ +.transparent { width: 100%; margin: 0; } +.transparent th { display: block; box-sizing: border-box; text-align: left; padding: 2px 4px; border-radius: 4px; background-image: -webkit-linear-gradient(left, rgba(0,0,0,0.08), transparent 80%); background-image: linear-gradient(to right, rgba(0,0,0,0.08), transparent 80%); } /* Rgba is shared with h2 */ +.transparent td { margin: 4px; display: block; } +.transparent th a { display: none; position: relative; top: -1px; font-size: 0.75em; padding: 2px 5px 1px 3px; } /* Buttons 0.75 0.86 */ +.transparent tr:first-child a, .transparent tr:nth-last-child(2) a { display: inline-block; } /* Only show buttons for First/Last files */ + +footer { font-size: 0.8em; text-align: center; width: 87%; margin: 4px auto; } + +/* Specific Fixes */ +.alist br:first-child { display: none; } /* Final results is displayed in "pre format", so remove first BR */ +.filter a[href*="show-status"] { margin-left: 12px; } /* Margin for View/Edit on show-status */ + +/* Safari & iOS */ +@media screen and (min-color-index:0) and(-webkit-min-device-pixel-ratio:0) { @media { + ::-webkit-input-placeholder { position: relative; top: 3px; } + .transparent th a { padding: 2px 4px 1px 4px; } + a.safe { background-color: rgba(0,220,0,0.4); } + a.warn { background-color: rgba(220,0,0,0.4); } +}} + +@media only screen and (orientation:portrait) { + main { width: 100%; border-radius: 0; margin: 0; border-style: none; border-bottom-style: solid; } + header h1 { display: block; overflow: auto; -webkit-overflow-scrolling: touch; } + ::-webkit-input-placeholder { top: 2px; } +} + +@media only screen and (min-device-width : 320px) and (max-device-width : 667px) and (orientation : landscape) { + main { width: 100%; border-radius: 0; margin: 0; border-style: none; border-bottom-style: solid; } + h2 { padding-bottom: 2px; } /* Necessary for underline to show */ + main { font-size: 0.6em; } + ul li { font-size: 1.7em; } + ul li a { font-size: 0.6em; } + input[type='url'] { font-size: 1.85em; } + .buttons { font-size: 1.7em; } + .editactions { font-size: 1.3em; } + .request { font-size: 1.5em; } + .transparent th a { font-size: 1.35em; } + ::-webkit-input-placeholder { top: 2px; } +} \ No newline at end of file diff --git a/advanced/index.php b/advanced/index.php index 41142633..fe95782a 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -44,8 +44,8 @@ $piHoleVersion = exec('cd /etc/.pihole/ && git describe --tags --abbrev=0'); Website Blocked - - + + /admin/img/favicon.png' type='image/png'/> diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 8c7a6b1d..f48e78c8 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -842,6 +842,14 @@ installPiholeWeb() { echo " done!" fi + if [ -f "/var/www/html/pihole/index.css" ]; then + echo "::: Existing index.css detected, not overwriting" + else + echo -n "::: index.css missing, replacing... " + cp /etc/.pihole/advanced/index.css /var/www/html/pihole/ + echo " done!" + fi + else mkdir /var/www/html/pihole if [ -f /var/www/html/index.lighttpd.html ]; then From a866c4e388b060cdb8615afd4b57b81f0cf47665 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 5 Dec 2016 10:50:19 +0100 Subject: [PATCH 04/17] Place blockingpage.css (former index.css) unter admin/ so we can load it also from some blocked sub-directories --- advanced/{index.css => blockingpage.css} | 0 automated install/basic-install.sh | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename advanced/{index.css => blockingpage.css} (100%) diff --git a/advanced/index.css b/advanced/blockingpage.css similarity index 100% rename from advanced/index.css rename to advanced/blockingpage.css diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index f48e78c8..958b2d1d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -842,11 +842,11 @@ installPiholeWeb() { echo " done!" fi - if [ -f "/var/www/html/pihole/index.css" ]; then - echo "::: Existing index.css detected, not overwriting" + if [ -f "/var/www/html/admin/blockingpage.css" ]; then + echo "::: Existing blockingpage.css detected, not overwriting" else echo -n "::: index.css missing, replacing... " - cp /etc/.pihole/advanced/index.css /var/www/html/pihole/ + cp /etc/.pihole/advanced/blockingpage.css /var/www/html/admin echo " done!" fi From 0f90671241c0ec097be0049989fca3a2dcbd7f10 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 5 Dec 2016 10:51:41 +0100 Subject: [PATCH 05/17] Updated index.php to use CSS file unter admin/ --- advanced/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/index.php b/advanced/index.php index fe95782a..d9755dc2 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -44,7 +44,7 @@ $piHoleVersion = exec('cd /etc/.pihole/ && git describe --tags --abbrev=0'); Website Blocked - + /admin/blockingpage.css'/> /admin/img/favicon.png' type='image/png'/> From 20370d4348fee31d249bca39cc882ddb41ebebba Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 5 Dec 2016 11:26:21 +0100 Subject: [PATCH 06/17] Update CSS file --- advanced/blockingpage.css | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/advanced/blockingpage.css b/advanced/blockingpage.css index b5fae08e..f4451f28 100644 --- a/advanced/blockingpage.css +++ b/advanced/blockingpage.css @@ -15,7 +15,7 @@ divs a { border-bottom: 1px dashed rgba(30,60,90,0.3); } b { font-weight: bold; } i { font-style: italic; } -footer, .pre, input[type='url'], input[type='text'], .alist, .transparent td { font-family: monospace; } +footer, pre, input[type='url'], input[type='text'], .alist, .transparent td { font-family: monospace; } body, header { background: #E1E1E1; } body { @@ -76,7 +76,7 @@ main { border: 1px solid rgba(0,0,0,0.25); box-shadow: 0 0 1px 1px rgba(0,0,0,0.04); line-height: 1.2em; - border-radius: 8px; + border-radius: 8px; } h2 { /* Rgba is shared with .transparent th */ @@ -138,7 +138,7 @@ input[type='url'], input[type='text'] { /* Swapped rgba is shared with .buttons box-sizing: border-box; background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.05), rgba(255,255,255,0.05)); background-image: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(255,255,255,0.05)); -} +} input:focus { outline: none; @@ -184,7 +184,7 @@ footer { font-size: 0.8em; text-align: center; width: 87%; margin: 4px auto; } .filter a[href*="show-status"] { margin-left: 12px; } /* Margin for View/Edit on show-status */ /* Safari & iOS */ -@media screen and (min-color-index:0) and(-webkit-min-device-pixel-ratio:0) { @media { +@media screen and (min-color-index:0) and(-webkit-min-device-pixel-ratio:0) { @media { ::-webkit-input-placeholder { position: relative; top: 3px; } .transparent th a { padding: 2px 4px 1px 4px; } a.safe { background-color: rgba(0,220,0,0.4); } @@ -197,7 +197,7 @@ footer { font-size: 0.8em; text-align: center; width: 87%; margin: 4px auto; } ::-webkit-input-placeholder { top: 2px; } } -@media only screen and (min-device-width : 320px) and (max-device-width : 667px) and (orientation : landscape) { +@media only screen and (min-device-width : 320px) and (max-device-width : 667px) and (orientation : landscape) { main { width: 100%; border-radius: 0; margin: 0; border-style: none; border-bottom-style: solid; } h2 { padding-bottom: 2px; } /* Necessary for underline to show */ main { font-size: 0.6em; } @@ -209,4 +209,4 @@ footer { font-size: 0.8em; text-align: center; width: 87%; margin: 4px auto; } .request { font-size: 1.5em; } .transparent th a { font-size: 1.35em; } ::-webkit-input-placeholder { top: 2px; } -} \ No newline at end of file +} From fc233fcdd3d74129c02f24ca3295c583e811b0c6 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 5 Dec 2016 12:10:05 +0100 Subject: [PATCH 07/17] Fixed typo --- advanced/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/index.php b/advanced/index.php index d9755dc2..af44cd4f 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -56,7 +56,7 @@ $piHoleVersion = exec('cd /etc/.pihole/ && git describe --tags --abbrev=0');
Access to the following site has been blocked:
-
If you have an ongoing use for this website, please ask to owner of the Pi-Hole in your network to have it whitelisted.
+
If you have an ongoing use for this website, please ask the owner of the Pi-Hole in your network to have it whitelisted.
Generated by Pi-hole
From 3d6b22de6cfeac83ebf781dd5dd207b0852376df Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 5 Dec 2016 12:12:01 +0100 Subject: [PATCH 08/17] Update index.php to include more detailed output --- advanced/index.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/advanced/index.php b/advanced/index.php index af44cd4f..deb902bb 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -39,6 +39,12 @@ if (!$showPage) // Get Pi-Hole version $piHoleVersion = exec('cd /etc/.pihole/ && git describe --tags --abbrev=0'); +// Don't show the URI if it is the root directory +if($uri == "/") +{ + $uri = ""; +} + ?> @@ -57,8 +63,18 @@ $piHoleVersion = exec('cd /etc/.pihole/ && git describe --tags --abbrev=0');
Access to the following site has been blocked:
If you have an ongoing use for this website, please ask the owner of the Pi-Hole in your network to have it whitelisted.
+ + + + This page is blocked because it is explicitly contained within the following block list(s): +
Back to safety
Generated by Pi-hole
+ + + From 0d63cfd6c3ded71effe67475f56f3fc37273081e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 5 Dec 2016 12:34:30 +0100 Subject: [PATCH 09/17] Add 1x1 pixel GIF image. Can apparently be used to trick some of the please-don't-use-adblocker pages as many of them contain code like `if ($('Ad').height() == 0) { prevent access to this page; }` --- advanced/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/index.php b/advanced/index.php index deb902bb..c51fd71c 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -30,6 +30,7 @@ if (!$showPage) + Date: Mon, 5 Dec 2016 14:39:07 +0100 Subject: [PATCH 10/17] Simplified CSS, removed external contents --- advanced/blockingpage.css | 101 +++++--------------------------------- advanced/index.php | 4 +- 2 files changed, 13 insertions(+), 92 deletions(-) diff --git a/advanced/blockingpage.css b/advanced/blockingpage.css index f4451f28..bb37939d 100644 --- a/advanced/blockingpage.css +++ b/advanced/blockingpage.css @@ -16,15 +16,14 @@ b { font-weight: bold; } i { font-style: italic; } footer, pre, input[type='url'], input[type='text'], .alist, .transparent td { font-family: monospace; } -body, header { background: #E1E1E1; } +/*body, header { background: #E1E1E1; }*/ body { - background-image: url('http://firebog.net/bg.png'), -webkit-linear-gradient(top, rgba(220,220,220,0.95), rgba(240,240,240,0.95)); - background-image: url('http://firebog.net/bg.png'), linear-gradient(to bottom, rgba(220,220,220,0.95), rgba(240,240,240,0.95)); + background-image: -webkit-linear-gradient(top, rgba(240,240,240,0.95), rgba(190,190,190,0.95)); + background-image: linear-gradient(to bottom, rgba(240,240,240,0.95), rgba(190,190,190,0.95)); background-attachment: fixed; color: rgba(64,64,64,0.95); - text-shadow: 0 1px rgba(0,0,0,0.04); - font: 14px Arial, sans-serif; + font: 14px, sans-serif; line-height: 1em; } @@ -53,11 +52,13 @@ header h1, header div { } header h1 { - font: bold 1.6em "Trebuchet MS", sans-serif; + font-size: 22px; + font-weight: bold; width: 100%; padding: 8px 0; text-indent: 32px; - background: url("http://firebog.net/PHV.svg") left no-repeat; + background: url("http://pi.hole/admin/img/logo.svg") left no-repeat; + background-size: 30px 22px; } header h1 a, h1 a:hover { color: inherit; } @@ -68,13 +69,13 @@ header .alt { width: 85px; font-size: 0.8em; padding-right: 4px; text-align: rig main { display: block; width: 80%; - padding: 8px; + padding: 10px; font-size: 1em; background-color: rgba(255,255,255,0.85); margin: 8px auto; box-sizing: border-box; border: 1px solid rgba(0,0,0,0.25); - box-shadow: 0 0 1px 1px rgba(0,0,0,0.04); + box-shadow: 4px 4px rgba(0,0,0,0.1); line-height: 1.2em; border-radius: 8px; } @@ -123,90 +124,10 @@ li a { position: relative; top: 1px; } /* Center bullet-point arrows */ a.safe { background-color: rgba(0,220,0,0.5); } a.warn { background-color: rgba(220,0,0,0.5); } -.blocked, .toggle, .sourcever, .mini, .addurl a, .editurl a { margin-top: 8px; } .blocked a, .mini a { display: table-cell; } .blocked a.safe { width: 100%; } -.ministatus { text-align: center; } - -input[type='url'], input[type='text'] { /* Swapped rgba is shared with .buttons a */ - font-size: 1.15em; - padding: 2px 4px; - text-align: left; - cursor: text; - width: 100%; - box-sizing: border-box; - background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.05), rgba(255,255,255,0.05)); - background-image: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(255,255,255,0.05)); -} - -input:focus { - outline: none; - box-shadow: 0 0 0 2px rgba(0,128,240,0.4); - border-radius: 4px; -} - /* Types of text */ -.pre { white-space: pre; overflow: auto; -webkit-overflow-scrolling: touch; } -.msg { display: block; line-height: 1.2em; font-weight: bold; font-size: 1.15em; margin: 4px 8px 8px 8px; white-space: pre-line; } -.request, .finalresults, .sourcever, .invocation, .parameters, .transparent td, .actionfilecontent, .actionslist { font-size: 0.9em; line-height: 1.2em; } /* "Pre sized" */ - -.request, .finalresults, .parameters, .actionfilecontent, .actionslist { /* Dashed outline for excessive text */ - line-height: 1.2em; - padding: 4px; - border: 1px dashed rgba(0,0,0,0.25); - border-right: 0; - background-image: -webkit-linear-gradient(left, #FFF 70%, rgba(255,255,255,0)); - background-image: linear-gradient(to right, #FFF 70%, rgba(255,255,255,0)); - border-radius: 4px 0 0 4px; -} - -.parameters, .finalresults { /* Small scrollbox for excessive text */ - max-height: 116px; - overflow-y: scroll; - -webkit-overflow-scrolling: touch; -} - -.editactions { font-size: 0.8em; } -.actionslist { margin: 4px 0; } - -/* Matching actions in show-url-info */ -.transparent { width: 100%; margin: 0; } -.transparent th { display: block; box-sizing: border-box; text-align: left; padding: 2px 4px; border-radius: 4px; background-image: -webkit-linear-gradient(left, rgba(0,0,0,0.08), transparent 80%); background-image: linear-gradient(to right, rgba(0,0,0,0.08), transparent 80%); } /* Rgba is shared with h2 */ -.transparent td { margin: 4px; display: block; } -.transparent th a { display: none; position: relative; top: -1px; font-size: 0.75em; padding: 2px 5px 1px 3px; } /* Buttons 0.75 0.86 */ -.transparent tr:first-child a, .transparent tr:nth-last-child(2) a { display: inline-block; } /* Only show buttons for First/Last files */ +.msg { white-space: pre; overflow: auto; -webkit-overflow-scrolling: touch; display: block; line-height: 1.2em; font-weight: bold; font-size: 1.15em; margin: 4px 8px 8px 8px; white-space: pre-line; } footer { font-size: 0.8em; text-align: center; width: 87%; margin: 4px auto; } - -/* Specific Fixes */ -.alist br:first-child { display: none; } /* Final results is displayed in "pre format", so remove first BR */ -.filter a[href*="show-status"] { margin-left: 12px; } /* Margin for View/Edit on show-status */ - -/* Safari & iOS */ -@media screen and (min-color-index:0) and(-webkit-min-device-pixel-ratio:0) { @media { - ::-webkit-input-placeholder { position: relative; top: 3px; } - .transparent th a { padding: 2px 4px 1px 4px; } - a.safe { background-color: rgba(0,220,0,0.4); } - a.warn { background-color: rgba(220,0,0,0.4); } -}} - -@media only screen and (orientation:portrait) { - main { width: 100%; border-radius: 0; margin: 0; border-style: none; border-bottom-style: solid; } - header h1 { display: block; overflow: auto; -webkit-overflow-scrolling: touch; } - ::-webkit-input-placeholder { top: 2px; } -} - -@media only screen and (min-device-width : 320px) and (max-device-width : 667px) and (orientation : landscape) { - main { width: 100%; border-radius: 0; margin: 0; border-style: none; border-bottom-style: solid; } - h2 { padding-bottom: 2px; } /* Necessary for underline to show */ - main { font-size: 0.6em; } - ul li { font-size: 1.7em; } - ul li a { font-size: 0.6em; } - input[type='url'] { font-size: 1.85em; } - .buttons { font-size: 1.7em; } - .editactions { font-size: 1.3em; } - .request { font-size: 1.5em; } - .transparent th a { font-size: 1.35em; } - ::-webkit-input-placeholder { top: 2px; } -} diff --git a/advanced/index.php b/advanced/index.php index c51fd71c..7df55d78 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -68,8 +68,8 @@ if($uri == "/") This page is blocked because it is explicitly contained within the following block list(s): - -
Back to safety +
+
Go back
Generated by Pi-hole
From ca9321624c5187d23c3fe229d70cfb9e696e3663 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 5 Dec 2016 14:40:48 +0100 Subject: [PATCH 11/17] Added padding for ad list results --- advanced/blockingpage.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/blockingpage.css b/advanced/blockingpage.css index bb37939d..1fdb5f19 100644 --- a/advanced/blockingpage.css +++ b/advanced/blockingpage.css @@ -15,7 +15,7 @@ divs a { border-bottom: 1px dashed rgba(30,60,90,0.3); } b { font-weight: bold; } i { font-style: italic; } -footer, pre, input[type='url'], input[type='text'], .alist, .transparent td { font-family: monospace; } +footer, pre, td { font-family: monospace; padding-left: 15px; } /*body, header { background: #E1E1E1; }*/ body { From 5374f652dd5e44672593b6d83dd9b7dc7bfa95f2 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 6 Dec 2016 08:43:24 +0100 Subject: [PATCH 12/17] No need to modify lighttpd config file, since we overwrite it anyways --- automated install/basic-install.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 958b2d1d..f2e5a9d8 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -964,9 +964,6 @@ accountForRefactor() { sed -i 's/piholeDNS1/PIHOLE_DNS_1/g' ${setupVars} sed -i 's/piholeDNS2/PIHOLE_DNS_2/g' ${setupVars} - # Account for change in lighttpd config file - sed -i 's:pihole/index.html:pihole/index.php:' ${lighttpdConfig} - } updatePihole() { From 480211033d196e0d6322e69480a71c2a0535e920 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 6 Dec 2016 14:05:02 +0100 Subject: [PATCH 13/17] Detect if blocking page is loaded within frame or iframe. If so, hide everything --- advanced/index.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/advanced/index.php b/advanced/index.php index 7df55d78..b9c1f7a9 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -56,7 +56,7 @@ if($uri == "/") - +

Website Blocked

@@ -75,7 +75,25 @@ if($uri == "/") From 75deb0296178ed7dfc7c707938815b3a476b23af Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 6 Dec 2016 14:05:48 +0100 Subject: [PATCH 14/17] Don't query pihole if page is hidden anyhow --- advanced/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/advanced/index.php b/advanced/index.php index b9c1f7a9..6d48d723 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -91,8 +91,10 @@ if($uri == "/") // set white background document.body.style.backgroundImage = "none"; } - - $( "#btnSearch" ).click(); + else + { + $( "#btnSearch" ).click(); + } // } From 505c9e8979d95abb0cad1fddda500997f3379121 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 6 Dec 2016 14:08:45 +0100 Subject: [PATCH 15/17] Minor change --- advanced/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/advanced/index.php b/advanced/index.php index 6d48d723..9c7f938b 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -86,13 +86,15 @@ if($uri == "/") // Try to detect if page is loaded within iframe if(inIframe()) { - // Within iframe -> hide page + // Within iframe + // hide content of page $('#body').hide(); - // set white background + // remove background document.body.style.backgroundImage = "none"; } else { + // Query adlists $( "#btnSearch" ).click(); } // } From 3c4a9bba78d4ae078feb6b0ae5e89589c5704250 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 15 Dec 2016 10:38:24 +0100 Subject: [PATCH 16/17] Minor change --- advanced/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/index.php b/advanced/index.php index 9c7f938b..46073867 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -63,7 +63,7 @@ if($uri == "/")
Access to the following site has been blocked:
-
If you have an ongoing use for this website, please ask the owner of the Pi-Hole in your network to have it whitelisted.
+
If you have an ongoing use for this website, please ask the owner of the Pi-hole in your network to have it whitelisted.
From bc8cf1b2d8d2a4edd8500e57ef597e3c9dec3a94 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 22 Dec 2016 19:23:06 +0100 Subject: [PATCH 17/17] Fixed wrong indentation --- 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 ab2bc464..14bf10f7 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -799,7 +799,7 @@ installPiholeWeb() { mkdir /var/www/html/pihole if [ -f /var/www/html/index.lighttpd.html ]; then mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig - else + else printf "\n:::\tNo default index.lighttpd.html file found... not backing up" fi cp /etc/.pihole/advanced/index.* /var/www/html/pihole/.