diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
index 8de25c7c..1028340e 100644
--- a/.idea/codeStyleSettings.xml
+++ b/.idea/codeStyleSettings.xml
@@ -15,8 +15,11 @@
+
+
+
-
+
\ No newline at end of file
diff --git a/adlists.default b/adlists.default
index 92422db7..3c4ea8ed 100644
--- a/adlists.default
+++ b/adlists.default
@@ -37,7 +37,7 @@ https://hosts-file.net/ad_servers.txt
#http://securemecca.com/Downloads/hosts.txt
# Quidsup's tracker list
-https://raw.githubusercontent.com/quidsup/notrack/master/trackers.txt
+#https://raw.githubusercontent.com/quidsup/notrack/master/trackers.txt
# Block the BBC News website Breaking News banner
#https://raw.githubusercontent.com/BreakingTheNews/BreakingTheNews.github.io/master/hosts
diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh
index eb6ccd29..a2a5e8dc 100755
--- a/advanced/Scripts/update.sh
+++ b/advanced/Scripts/update.sh
@@ -30,7 +30,7 @@ is_repo() {
git status --short &> /dev/null
rc=$?
cd "${curdir}" &> /dev/null || return 1
- return $rc
+ return "${rc}"
}
prep_repo() {
@@ -46,26 +46,24 @@ make_repo() {
local remoteRepo="${2}"
local directory="${1}"
- (prep_repo "${directory}" && git clone -q --depth 1 "${remoteRepo}" "${directory}" > /dev/null)
+ (prep_repo "${directory}" && git clone -q --depth 1 "${remoteRepo}" "${directory}")
return
}
update_repo() {
local directory="${1}"
local curdir
- # Pull the latest commits
curdir="${PWD}"
cd "${directory}" &> /dev/null || return 1
+ # Pull the latest commits
# Stash all files not tracked for later retrieval
- git stash --all --quiet &> /dev/null
+ git stash --all --quiet
# Force a clean working directory for cloning
- git clean --force -d &> /dev/null
+ git clean --force -d
# Fetch latest changes and apply
- git pull --quiet &> /dev/null
+ git pull --quiet
cd "${curdir}" &> /dev/null || return 1
-
- return
}
getGitFiles() {
@@ -86,33 +84,59 @@ getGitFiles() {
fi
}
+GitCheckUpdateAvail() {
+ local directory="${1}"
+ curdir=$PWD;
+ cd "${directory}"
+
+ # Fetch latest changes in this repo
+ git fetch --quiet origin
+ status="$(git status -sb)"
+
+ # Change back to original directory
+ cd "${curdir}"
+
+ if [[ $status == *"behind"* ]]; then
+ # Local branch is behind remote branch -> Update
+ return 0
+ else
+ # Local branch is up-to-date or in a situation
+ # where this updater cannot be used (like on a
+ # branch that exists only locally)
+ return 1
+ fi
+}
+
main() {
local pihole_version_current
- local pihole_version_latest
local web_version_current
- local web_version_latest
- if ! is_repo "${PI_HOLE_FILES_DIR}" || ! is_repo "${ADMIN_INTERFACE_DIR}" ; then #This is unlikely
+ #This is unlikely
+ if ! is_repo "${PI_HOLE_FILES_DIR}" || ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
echo "::: Critical Error: One or more Pi-Hole repos are missing from system!"
echo "::: Please re-run install script from https://github.com/pi-hole/pi-hole"
exit 1;
fi
echo "::: Checking for updates..."
- # Checks Pi-hole version string in format vX.X.X
- pihole_version_current="$(/usr/local/bin/pihole version --pihole --current)"
- pihole_version_latest="$(/usr/local/bin/pihole version --pihole --latest)"
- web_version_current="$(/usr/local/bin/pihole version --admin --current)"
- web_version_latest="$(/usr/local/bin/pihole version --admin --latest)"
- if [[ "${pihole_version_latest}" == "-1" || "${web_version_latest}" == "-1" ]]; then
- echo "*** Unable to contact GitHub for latest version. Please try again later, contact support if this continues."
- exit 1
+ if GitCheckUpdateAvail "${PI_HOLE_FILES_DIR}" ; then
+ core_update=true
+ echo "::: Pi-hole Core: update available"
+ else
+ core_update=false
+ echo "::: Pi-hole Core: up to date"
+ fi
+
+ if GitCheckUpdateAvail "${ADMIN_INTERFACE_DIR}" ; then
+ web_update=true
+ echo "::: Web Interface: update available"
+ else
+ web_update=false
+ echo "::: Web Interface: up to date"
fi
# Logic
- # If latest versions are blank - we've probably hit Github rate limit (stop running `pihole -up so often!):
- # Update anyway
# If Core up to date AND web up to date:
# Do nothing
# If Core up to date AND web NOT up to date:
@@ -122,46 +146,40 @@ main() {
# if Core NOT up to date AND web NOT up to date:
# pull pihole repo run install --unattended
- if [[ "${pihole_version_current}" == "${pihole_version_latest}" ]] && [[ "${web_version_current}" == "${web_version_latest}" ]]; then
- echo ":::"
- echo "::: Pi-hole version is $pihole_version_current"
- echo "::: Web Admin version is $web_version_current"
+ if ! ${core_update} && ! ${web_update} ; then
echo ":::"
echo "::: Everything is up to date!"
exit 0
- elif [[ "${pihole_version_current}" == "${pihole_version_latest}" ]] && [[ "${web_version_current}" < "${web_version_latest}" ]]; then
+ elif ! ${core_update} && ${web_update} ; then
echo ":::"
echo "::: Pi-hole Web Admin files out of date"
getGitFiles "${ADMIN_INTERFACE_DIR}" "${ADMIN_INTERFACE_GIT_URL}"
- web_updated=true
-
- elif [[ "${pihole_version_current}" < "${pihole_version_latest}" ]] && [[ "${web_version_current}" == "${web_version_latest}" ]]; then
+ elif ${core_update} && ! ${web_update} ; then
+ echo ":::"
echo "::: Pi-hole core files out of date"
getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}"
/etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1
- core_updated=true
- elif [[ "${pihole_version_current}" < "${pihole_version_latest}" ]] && [[ "${web_version_current}" < "${web_version_latest}" ]]; then
+ elif ${core_update} && ${web_update} ; then
+ echo ":::"
echo "::: Updating Everything"
getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}"
/etc/.pihole/automated\ install/basic-install.sh --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1
- web_updated=true
- core_updated=true
else
echo "*** Update script has malfunctioned, fallthrough reached. Please contact support"
exit 1
fi
- if [[ "${web_updated}" == true ]]; then
+ if [[ "${web_update}" == true ]]; then
web_version_current="$(/usr/local/bin/pihole version --admin --current)"
echo ":::"
echo "::: Web Admin version is now at ${web_version_current}"
echo "::: If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'"
fi
- if [[ "${core_updated}" == true ]]; then
+ if [[ "${core_update}" == true ]]; then
pihole_version_current="$(/usr/local/bin/pihole version --pihole --current)"
echo ":::"
echo "::: Pi-hole version is now at ${pihole_version_current}"
diff --git a/advanced/Scripts/version.sh b/advanced/Scripts/version.sh
old mode 100644
new mode 100755
diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh
index b6d500cd..7fb339de 100755
--- a/advanced/Scripts/webpage.sh
+++ b/advanced/Scripts/webpage.sh
@@ -9,7 +9,9 @@
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
-args=("$@")
+readonly setupVars="/etc/pihole/setupVars.conf"
+readonly dnsmasqconfig="/etc/dnsmasq.d/01-pihole.conf"
+readonly dhcpconfig="/etc/dnsmasq.d/02-pihole-dhcp.conf"
helpFunc() {
cat << EOM
@@ -27,12 +29,34 @@ EOM
exit 0
}
+add_setting() {
+ echo "${1}=${2}" >> "${setupVars}"
+}
+
+delete_setting() {
+ sed -i "/${1}/d" "${setupVars}"
+}
+
+change_setting() {
+ delete_setting "${1}"
+ add_setting "${1}" "${2}"
+}
+
+add_dnsmasq_setting() {
+ if [[ "${2}" != "" ]]; then
+ echo "${1}=${2}" >> "${dnsmasqconfig}"
+ else
+ echo "${1}" >> "${dnsmasqconfig}"
+ fi
+}
+
+delete_dnsmasq_setting() {
+ sed -i "/${1}/d" "${dnsmasqconfig}"
+}
+
SetTemperatureUnit(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/TEMPERATUREUNIT/d' /etc/pihole/setupVars.conf
- # Save setting to file
- echo "TEMPERATUREUNIT=${unit}" >> /etc/pihole/setupVars.conf
+ change_setting "TEMPERATUREUNIT" "${unit}"
}
@@ -50,66 +74,70 @@ SetWebPassword(){
exit 1
fi
- # Remove password from file (create backup setupVars.conf.bak)
- sed -i.bak '/WEBPASSWORD/d' /etc/pihole/setupVars.conf
# Set password only if there is one to be set
if (( ${#args[2]} > 0 )) ; then
# Compute password hash twice to avoid rainbow table vulnerability
hash=$(echo -n ${args[2]} | sha256sum | sed 's/\s.*$//')
hash=$(echo -n ${hash} | sha256sum | sed 's/\s.*$//')
# Save hash to file
- echo "WEBPASSWORD=${hash}" >> /etc/pihole/setupVars.conf
+ change_setting "WEBPASSWORD" "${hash}"
echo "New password set"
else
- echo "WEBPASSWORD=" >> /etc/pihole/setupVars.conf
+ change_setting "WEBPASSWORD" ""
echo "Password removed"
fi
}
+ProcessDNSSettings() {
+ source "${setupVars}"
+
+ delete_dnsmasq_setting "server="
+ add_dnsmasq_setting "server" "${PIHOLE_DNS_1}"
+
+ if [[ "${PIHOLE_DNS_2}" != "" ]]; then
+ add_dnsmasq_setting "server" "${PIHOLE_DNS_2}"
+ fi
+
+ delete_dnsmasq_setting "domain-needed"
+
+ if [[ "${DNS_FQDN_REQUIRED}" == true ]]; then
+ add_dnsmasq_setting "domain-needed"
+ fi
+
+ delete_dnsmasq_setting "bogus-priv"
+
+ if [[ "${DNS_BOGUS_PRIV}" == true ]]; then
+ add_dnsmasq_setting "bogus-priv"
+ fi
+
+}
+
SetDNSServers(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;/DNS_FQDN_REQUIRED/d;/DNS_BOGUS_PRIV/d;' /etc/pihole/setupVars.conf
# Save setting to file
- echo "PIHOLE_DNS_1=${args[2]}" >> /etc/pihole/setupVars.conf
+ change_setting "PIHOLE_DNS_1" "${args[2]}"
+
if [[ "${args[3]}" != "none" ]]; then
- echo "PIHOLE_DNS_2=${args[3]}" >> /etc/pihole/setupVars.conf
+ change_setting "PIHOLE_DNS_2" "${args[3]}"
else
- echo "PIHOLE_DNS_2=" >> /etc/pihole/setupVars.conf
+ change_setting "PIHOLE_DNS_2" ""
fi
- # Replace within actual dnsmasq config file
- sed -i '/server=/d;' /etc/dnsmasq.d/01-pihole.conf
- echo "server=${args[2]}" >> /etc/dnsmasq.d/01-pihole.conf
- if [[ "${args[3]}" != "none" ]]; then
- echo "server=${args[3]}" >> /etc/dnsmasq.d/01-pihole.conf
- fi
-
- # Remove domain-needed entry
- sed -i '/domain-needed/d;' /etc/dnsmasq.d/01-pihole.conf
-
- # Readd it if required
if [[ "${args[4]}" == "domain-needed" ]]; then
- echo "domain-needed" >> /etc/dnsmasq.d/01-pihole.conf
- echo "DNS_FQDN_REQUIRED=true" >> /etc/pihole/setupVars.conf
+ change_setting "DNS_FQDN_REQUIRED" "true"
else
- # Leave it deleted if not wanted
- echo "DNS_FQDN_REQUIRED=false" >> /etc/pihole/setupVars.conf
+ change_setting "DNS_FQDN_REQUIRED" "false"
fi
- # Remove bogus-priv entry
- sed -i '/bogus-priv/d;' /etc/dnsmasq.d/01-pihole.conf
-
- # Readd it if required
- if [[ "${args[5]}" == "bogus-priv" ]]; then
- echo "bogus-priv" >> /etc/dnsmasq.d/01-pihole.conf
- echo "DNS_BOGUS_PRIV=true" >> /etc/pihole/setupVars.conf
+ if [[ "${args[4]}" == "bogus-priv" || "${args[5]}" == "bogus-priv" ]]; then
+ change_setting "DNS_BOGUS_PRIV" "true"
else
- # Leave it deleted if not wanted
- echo "DNS_BOGUS_PRIV=false" >> /etc/pihole/setupVars.conf
+ change_setting "DNS_BOGUS_PRIV" "false"
fi
+ ProcessDnsmasqSettings
+
# Restart dnsmasq to load new configuration
RestartDNS
@@ -117,18 +145,14 @@ SetDNSServers(){
SetExcludeDomains(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/API_EXCLUDE_DOMAINS/d;' /etc/pihole/setupVars.conf
- # Save setting to file
- echo "API_EXCLUDE_DOMAINS=${args[2]}" >> /etc/pihole/setupVars.conf
+ change_setting "API_EXCLUDE_DOMAINS" "${args[2]}"
+
}
SetExcludeClients(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/API_EXCLUDE_CLIENTS/d;' /etc/pihole/setupVars.conf
- # Save setting to file
- echo "API_EXCLUDE_CLIENTS=${args[2]}" >> /etc/pihole/setupVars.conf
+ change_setting "API_EXCLUDE_CLIENTS" "${args[2]}"
+
}
Reboot(){
@@ -149,110 +173,146 @@ RestartDNS(){
SetQueryLogOptions(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/API_QUERY_LOG_SHOW/d;' /etc/pihole/setupVars.conf
- # Save setting to file
- echo "API_QUERY_LOG_SHOW=${args[2]}" >> /etc/pihole/setupVars.conf
+ change_setting "API_QUERY_LOG_SHOW" "${args[2]}"
+
+}
+
+ProcessDHCPSettings() {
+
+ if [[ "${DHCP_ACTIVE}" == "true" ]]; then
+
+ source "${setupVars}"
+ interface=$(grep 'PIHOLE_INTERFACE=' /etc/pihole/setupVars.conf | sed "s/.*=//")
+
+ # Use eth0 as fallback interface
+ if [ -z ${interface} ]; then
+ interface="eth0"
+ fi
+
+ if [[ "${PIHOLE_DOMAIN}" == "" ]]; then
+ PIHOLE_DOMAIN="local"
+ change_setting "PIHOLE_DOMAIN" "${PIHOLE_DOMAIN}"
+ fi
+
+ if [[ "${DHCP_LEASETIME}" == "0" ]]; then
+ leasetime="infinite"
+ elif [[ "${DHCP_LEASETIME}" == "" ]]; then
+ leasetime="24h"
+ change_setting "DHCP_LEASETIME" "${leasetime}"
+ else
+ leasetime="${DHCP_LEASETIME}h"
+ fi
+
+ # Write settings to file
+ echo "###############################################################################
+# DHCP SERVER CONFIG FILE AUTOMATICALLY POPULATED BY PI-HOLE WEB INTERFACE. #
+# ANY CHANGES MADE TO THIS FILE WILL BE LOST ON CHANGE #
+###############################################################################
+dhcp-authoritative
+dhcp-range=${DHCP_START},${DHCP_END},${leasetime}
+dhcp-option=option:router,${DHCP_ROUTER}
+dhcp-leasefile=/etc/pihole/dhcp.leases
+domain=${PIHOLE_DOMAIN}
+#quiet-dhcp
+#quiet-dhcp6
+#enable-ra
+dhcp-option=option6:dns-server,[::]
+dhcp-range=::100,::1ff,constructor:${interface},ra-names,slaac,${leasetime}
+ra-param=*,0,0
+" > "${dhcpconfig}"
+
+ else
+ rm "${dhcpconfig}"
+ fi
}
EnableDHCP(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/DHCP_/d;' /etc/pihole/setupVars.conf
- echo "DHCP_ACTIVE=true" >> /etc/pihole/setupVars.conf
- echo "DHCP_START=${args[2]}" >> /etc/pihole/setupVars.conf
- echo "DHCP_END=${args[3]}" >> /etc/pihole/setupVars.conf
- echo "DHCP_ROUTER=${args[4]}" >> /etc/pihole/setupVars.conf
+ change_setting "DHCP_ACTIVE" "true"
+ change_setting "DHCP_START" "${args[2]}"
+ change_setting "DHCP_END" "${args[3]}"
+ change_setting "DHCP_ROUTER" "${args[4]}"
+ change_setting "DHCP_LEASETIME" "${args[5]}"
+ change_setting "PIHOLE_DOMAIN" "${args[6]}"
- # Remove setting from file
- sed -i '/dhcp-/d;/quiet-dhcp/d;' /etc/dnsmasq.d/01-pihole.conf
- # Save setting to file
- echo "dhcp-range=${args[2]},${args[3]},infinite" >> /etc/dnsmasq.d/01-pihole.conf
- echo "dhcp-option=option:router,${args[4]}" >> /etc/dnsmasq.d/01-pihole.conf
- # Changes the behaviour from strict RFC compliance so that DHCP requests on unknown leases from unknown hosts are not ignored. This allows new hosts to get a lease without a tedious timeout under all circumstances. It also allows dnsmasq to rebuild its lease database without each client needing to reacquire a lease, if the database is lost.
- echo "dhcp-authoritative" >> /etc/dnsmasq.d/01-pihole.conf
- # Use the specified file to store DHCP lease information
- echo "dhcp-leasefile=/etc/pihole/dhcp.leases" >> /etc/dnsmasq.d/01-pihole.conf
- # Suppress logging of the routine operation of these protocols. Errors and problems will still be logged, though.
- echo "quiet-dhcp" >> /etc/dnsmasq.d/01-pihole.conf
- echo "quiet-dhcp6" >> /etc/dnsmasq.d/01-pihole.conf
+ # Remove possible old setting from file
+ delete_dnsmasq_setting "dhcp-"
+ delete_dnsmasq_setting "quiet-dhcp"
+
+ ProcessDHCPSettings
RestartDNS
}
DisableDHCP(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/DHCP_ACTIVE/d;' /etc/pihole/setupVars.conf
- echo "DHCP_ACTIVE=false" >> /etc/pihole/setupVars.conf
+ change_setting "DHCP_ACTIVE" "false"
- # Remove setting from file
- sed -i '/dhcp-/d;/quiet-dhcp/d;' /etc/dnsmasq.d/01-pihole.conf
+ # Remove possible old setting from file
+ delete_dnsmasq_setting "dhcp-"
+ delete_dnsmasq_setting "quiet-dhcp"
+
+ ProcessDHCPSettings
RestartDNS
}
SetWebUILayout(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/WEBUIBOXEDLAYOUT/d;' /etc/pihole/setupVars.conf
- echo "WEBUIBOXEDLAYOUT=${args[2]}" >> /etc/pihole/setupVars.conf
+ change_setting "WEBUIBOXEDLAYOUT" "${args[2]}"
}
-SetDNSDomainName(){
+SetPrivacyMode(){
- # Remove setting from file (create backup setupVars.conf.bak)
- sed -i.bak '/PIHOLE_DOMAIN/d;' /etc/pihole/setupVars.conf
- # Save setting to file
- echo "PIHOLE_DOMAIN=${args[2]}" >> /etc/pihole/setupVars.conf
-
- # Replace within actual dnsmasq config file
- sed -i '/domain=/d;' /etc/dnsmasq.d/01-pihole.conf
- echo "domain=${args[2]}" >> /etc/dnsmasq.d/01-pihole.conf
-
- # Restart dnsmasq to load new configuration
- RestartDNS
+ if [[ "${args[2]}" == "true" ]] ; then
+ change_setting "API_PRIVACY_MODE" "true"
+ else
+ change_setting "API_PRIVACY_MODE" "false"
+ fi
}
ResolutionSettings() {
- typ=${args[2]}
- state=${args[3]}
+ typ="${args[2]}"
+ state="${args[3]}"
if [[ "${typ}" == "forward" ]]; then
- sed -i.bak '/API_GET_UPSTREAM_DNS_HOSTNAME/d;' /etc/pihole/setupVars.conf
- echo "API_GET_UPSTREAM_DNS_HOSTNAME=${state}" >> /etc/pihole/setupVars.conf
+ change_setting "API_GET_UPSTREAM_DNS_HOSTNAME" "${state}"
elif [[ "${typ}" == "clients" ]]; then
- sed -i.bak '/API_GET_CLIENT_HOSTNAME/d;' /etc/pihole/setupVars.conf
- echo "API_GET_CLIENT_HOSTNAME=${state}" >> /etc/pihole/setupVars.conf
+ change_setting "API_GET_CLIENT_HOSTNAME" "${state}"
fi
}
-case "${args[1]}" in
- "-p" | "password" ) SetWebPassword;;
- "-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
- "-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
- "-k" | "kelvin" ) unit="K"; SetTemperatureUnit;;
- "setdns" ) SetDNSServers;;
- "setexcludedomains" ) SetExcludeDomains;;
- "setexcludeclients" ) SetExcludeClients;;
- "reboot" ) Reboot;;
- "restartdns" ) RestartDNS;;
- "setquerylog" ) SetQueryLogOptions;;
- "enabledhcp" ) EnableDHCP;;
- "disabledhcp" ) DisableDHCP;;
- "layout" ) SetWebUILayout;;
- "-h" | "--help" ) helpFunc;;
- "domainname" ) SetDNSDomainName;;
- "resolve" ) ResolutionSettings;;
- * ) helpFunc;;
-esac
+main() {
-shift
+ args=("$@")
-if [[ $# = 0 ]]; then
- helpFunc
-fi
+ case "${args[1]}" in
+ "-p" | "password" ) SetWebPassword;;
+ "-c" | "celsius" ) unit="C"; SetTemperatureUnit;;
+ "-f" | "fahrenheit" ) unit="F"; SetTemperatureUnit;;
+ "-k" | "kelvin" ) unit="K"; SetTemperatureUnit;;
+ "setdns" ) SetDNSServers;;
+ "setexcludedomains" ) SetExcludeDomains;;
+ "setexcludeclients" ) SetExcludeClients;;
+ "reboot" ) Reboot;;
+ "restartdns" ) RestartDNS;;
+ "setquerylog" ) SetQueryLogOptions;;
+ "enabledhcp" ) EnableDHCP;;
+ "disabledhcp" ) DisableDHCP;;
+ "layout" ) SetWebUILayout;;
+ "-h" | "--help" ) helpFunc;;
+ "privacymode" ) SetPrivacyMode;;
+ "resolve" ) ResolutionSettings;;
+ * ) helpFunc;;
+ esac
+ shift
+
+ if [[ $# = 0 ]]; then
+ helpFunc
+ fi
+
+}
diff --git a/advanced/blockingpage.css b/advanced/blockingpage.css
new file mode 100644
index 00000000..7e11dbd0
--- /dev/null
+++ b/advanced/blockingpage.css
@@ -0,0 +1,136 @@
+/* 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, td { font-family: monospace; padding-left: 15px; }
+/*body, header { background: #E1E1E1; }*/
+
+body {
+ 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);
+ font: 14px, 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-size: 22px;
+ font-weight: bold;
+ width: 100%;
+ padding: 8px 0;
+ text-indent: 32px;
+ background: url("http://pi.hole/admin/img/logo.svg") left no-repeat;
+ background-size: 30px 22px;
+}
+
+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: 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: 4px 4px rgba(0,0,0,0.1);
+ 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, button, 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; }
+.buttons33 { white-space: nowrap; width: 33.333%; display: table; text-align: center; margin-left: 33.333% }
+.mini a { width: 50%; }
+a.safe { background-color: rgba(0,220,0,0.5); }
+button.safe { background-color: rgba(0,220,0,0.5); }
+a.warn { background-color: rgba(220,0,0,0.5); }
+
+.blocked a, .mini a { display: table-cell; }
+.blocked a.safe50 { width: 50%; background-color: rgba(0,220,0,0.5); }
+.blocked a.safe33 { width: 33.333%; background-color: rgba(0,220,0,0.5); }
+
+/* Types of text */
+.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; }
diff --git a/advanced/dphys-swapfile b/advanced/dphys-swapfile
deleted file mode 100644
index d8225175..00000000
--- a/advanced/dphys-swapfile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Pi-hole: A black hole for Internet advertisements
-# (c) 2015, 2016 by Jacob Salmela
-# Network-wide ad blocking via your Raspberry Pi
-# http://pi-hole.net
-# Swap file config
-#
-# Pi-hole is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-
-CONF_SWAPSIZE=500
diff --git a/advanced/index.html b/advanced/index.html
deleted file mode 100644
index 3a4abe1f..00000000
--- a/advanced/index.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/advanced/index.php b/advanced/index.php
new file mode 100644
index 00000000..1434025a
--- /dev/null
+++ b/advanced/index.php
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Website Blocked
+
+
+
+
+
+
+
+
+ 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):
+
+
+
+
+
+
+
+
+
+