mirror of
https://github.com/pi-hole/pi-hole
synced 2024-11-18 06:08:21 +00:00
Merge pull request #1365 from pi-hole/adlistImprovements
Adlist improvements
This commit is contained in:
commit
a96b4d28e1
@ -1,53 +1,23 @@
|
|||||||
## Pi-hole ad-list default sources. Updated 29/10/2016 #########################
|
|
||||||
# #
|
|
||||||
# To make changes to this file: #
|
|
||||||
# 1. run `cp /etc/pihole/adlists.default /etc/pihole/adlists.list` #
|
|
||||||
# 2. run `nano /etc/pihole/adlists.list` #
|
|
||||||
# 3. Uncomment or comment any of the below lists #
|
|
||||||
# #
|
|
||||||
# Know of any other lists? Feel free to let us know about them, or add them #
|
|
||||||
# to this file! #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# The below list amalgamates several lists we used previously.
|
# The below list amalgamates several lists we used previously.
|
||||||
# See `https://github.com/StevenBlack/hosts` for details
|
# See `https://github.com/StevenBlack/hosts` for details
|
||||||
|
##StevenBlack's list
|
||||||
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
|
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
|
||||||
|
|
||||||
# Other lists we consider safe:
|
##MalwareDomains
|
||||||
https://mirror1.malwaredomains.com/files/justdomains
|
https://mirror1.malwaredomains.com/files/justdomains
|
||||||
|
|
||||||
|
##Cameleon
|
||||||
http://sysctl.org/cameleon/hosts
|
http://sysctl.org/cameleon/hosts
|
||||||
|
|
||||||
|
##Zeustracker
|
||||||
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
|
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist
|
||||||
|
|
||||||
|
##Disconnect.me Tracking
|
||||||
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
|
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
|
||||||
|
|
||||||
|
##Disconnect.me Ads
|
||||||
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
|
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
|
||||||
|
|
||||||
# hosts-file.net list. Updated frequently, but has been known to block legitimate sites.
|
##Hosts-file.net
|
||||||
https://hosts-file.net/ad_servers.txt
|
https://hosts-file.net/ad_servers.txt
|
||||||
|
|
||||||
# Mahakala list. Has been known to block legitimate domains including the entire .com range.
|
|
||||||
# Warning: Due to the sheer size of this list, the web admin console will be unresponsive.
|
|
||||||
#https://adblock.mahakala.is/
|
|
||||||
|
|
||||||
# ADZHOSTS list. Has been known to block legitimate domains
|
|
||||||
#http://pilotfiber.dl.sourceforge.net/project/adzhosts/HOSTS.txt
|
|
||||||
|
|
||||||
# Windows 10 telemetry list
|
|
||||||
#https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/win10/spy.txt
|
|
||||||
|
|
||||||
# Securemecca.com list - Also blocks "adult" sites (pornography/gambling etc)
|
|
||||||
#http://securemecca.com/Downloads/hosts.txt
|
|
||||||
|
|
||||||
# Quidsup's tracker list
|
|
||||||
#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
|
|
||||||
|
|
||||||
# Untested Lists:
|
|
||||||
#https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer-filters.txt
|
|
||||||
#https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt
|
|
||||||
#http://malwaredomains.lehigh.edu/files/domains.txt
|
|
||||||
# Following two lists should be used simultaneously: (readme https://github.com/notracking/hosts-blocklists/)
|
|
||||||
#https://raw.github.com/notracking/hosts-blocklists/master/hostnames.txt
|
|
||||||
#https://raw.github.com/notracking/hosts-blocklists/master/domains.txt
|
|
||||||
# Combination of several host files on the internet (warning some facebook domains are also blocked but you can go to facebook.com). See https://github.com/mat1th/Dns-add-block for more information.
|
|
||||||
#https://raw.githubusercontent.com/mat1th/Dns-add-block/master/hosts
|
|
||||||
|
@ -328,6 +328,25 @@ SetWebUILayout(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CustomizeAdLists() {
|
||||||
|
|
||||||
|
list="/etc/pihole/adlists.list"
|
||||||
|
|
||||||
|
if [[ "${args[2]}" == "enable" ]] ; then
|
||||||
|
sed -i "\\@${args[3]}@s/^#http/http/g" "${list}"
|
||||||
|
elif [[ "${args[2]}" == "disable" ]] ; then
|
||||||
|
sed -i "\\@${args[3]}@s/^http/#http/g" "${list}"
|
||||||
|
elif [[ "${args[2]}" == "add" ]] ; then
|
||||||
|
echo "${args[3]}" >> ${list}
|
||||||
|
elif [[ "${args[2]}" == "del" ]] ; then
|
||||||
|
var=$(echo "${args[3]}" | sed 's/\//\\\//g')
|
||||||
|
sed -i "/${var}/Id" "${list}"
|
||||||
|
else
|
||||||
|
echo "Not permitted"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
SetPrivacyMode(){
|
SetPrivacyMode(){
|
||||||
|
|
||||||
if [[ "${args[2]}" == "true" ]] ; then
|
if [[ "${args[2]}" == "true" ]] ; then
|
||||||
@ -451,6 +470,7 @@ main() {
|
|||||||
"hostrecord" ) SetHostRecord;;
|
"hostrecord" ) SetHostRecord;;
|
||||||
"-i" | "interface" ) SetListeningMode;;
|
"-i" | "interface" ) SetListeningMode;;
|
||||||
"-t" | "teleporter" ) Teleporter;;
|
"-t" | "teleporter" ) Teleporter;;
|
||||||
|
"adlist" ) CustomizeAdLists;;
|
||||||
* ) helpFunc;;
|
* ) helpFunc;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
39
gravity.sh
39
gravity.sh
@ -29,7 +29,8 @@ EOM
|
|||||||
PIHOLE_COMMAND="/usr/local/bin/pihole"
|
PIHOLE_COMMAND="/usr/local/bin/pihole"
|
||||||
|
|
||||||
adListFile=/etc/pihole/adlists.list
|
adListFile=/etc/pihole/adlists.list
|
||||||
adListDefault=/etc/pihole/adlists.default
|
adListDefault=/etc/pihole/adlists.default #being deprecated
|
||||||
|
adListRepoDefault=/etc/.pihole/adlists.default
|
||||||
whitelistScript="${PIHOLE_COMMAND} -w"
|
whitelistScript="${PIHOLE_COMMAND} -w"
|
||||||
whitelistFile=/etc/pihole/whitelist.txt
|
whitelistFile=/etc/pihole/whitelist.txt
|
||||||
blacklistFile=/etc/pihole/blacklist.txt
|
blacklistFile=/etc/pihole/blacklist.txt
|
||||||
@ -71,12 +72,24 @@ fi
|
|||||||
###########################
|
###########################
|
||||||
# collapse - begin formation of pihole
|
# collapse - begin formation of pihole
|
||||||
gravity_collapse() {
|
gravity_collapse() {
|
||||||
|
|
||||||
|
#New Logic:
|
||||||
|
# Does /etc/pihole/adlists.list exist? If so leave it alone
|
||||||
|
# If not, cp /etc/.pihole/adlists.default /etc/pihole/adlists.list
|
||||||
|
# Read from adlists.list
|
||||||
|
|
||||||
|
#The following two blocks will sort out any missing adlists in the /etc/pihole directory, and remove legacy adlists.default
|
||||||
|
if [ -f ${adListDefault} ] && [ -f ${adListFile} ]; then
|
||||||
|
rm ${adListDefault}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f ${adListFile} ]; then
|
||||||
|
cp ${adListRepoDefault} ${adListFile}
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::: Neutrino emissions detected..."
|
echo "::: Neutrino emissions detected..."
|
||||||
echo ":::"
|
echo ":::"
|
||||||
#Decide if we're using a custom ad block list, or defaults.
|
echo -n "::: Pulling source lists into range..."
|
||||||
if [ -f ${adListFile} ]; then
|
|
||||||
#custom file found, use this instead of default
|
|
||||||
echo -n "::: Custom adList file detected. Reading..."
|
|
||||||
sources=()
|
sources=()
|
||||||
while IFS= read -r line || [[ -n "$line" ]]; do
|
while IFS= read -r line || [[ -n "$line" ]]; do
|
||||||
#Do not read commented out or blank lines
|
#Do not read commented out or blank lines
|
||||||
@ -87,20 +100,6 @@ gravity_collapse() {
|
|||||||
fi
|
fi
|
||||||
done < ${adListFile}
|
done < ${adListFile}
|
||||||
echo " done!"
|
echo " done!"
|
||||||
else
|
|
||||||
#no custom file found, use defaults!
|
|
||||||
echo -n "::: No custom adlist file detected, reading from default file..."
|
|
||||||
sources=()
|
|
||||||
while IFS= read -r line || [[ -n "$line" ]]; do
|
|
||||||
#Do not read commented out or blank lines
|
|
||||||
if [[ ${line} = \#* ]] || [[ ! ${line} ]]; then
|
|
||||||
echo "" > /dev/null
|
|
||||||
else
|
|
||||||
sources+=(${line})
|
|
||||||
fi
|
|
||||||
done < ${adListDefault}
|
|
||||||
echo " done!"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# patternCheck - check to see if curl downloaded any new files.
|
# patternCheck - check to see if curl downloaded any new files.
|
||||||
@ -408,8 +407,6 @@ if [[ "${forceGrav}" == true ]]; then
|
|||||||
echo " done!"
|
echo " done!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Overwrite adlists.default from /etc/.pihole in case any changes have been made. Changes should be saved in /etc/adlists.list
|
|
||||||
cp /etc/.pihole/adlists.default /etc/pihole/adlists.default
|
|
||||||
gravity_collapse
|
gravity_collapse
|
||||||
gravity_spinup
|
gravity_spinup
|
||||||
if [[ "${skipDownload}" == false ]]; then
|
if [[ "${skipDownload}" == false ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user