Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage adlists #252

Merged
merged 23 commits into from
Apr 6, 2017
Merged

Manage adlists #252

merged 23 commits into from
Apr 6, 2017

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Dec 15, 2016

Changes proposed in this pull request:

  • Enable/disable all lists from /etc/pihole/adlists.default from the Settings page
  • Add new ad lists to user-defined file that will be preserved on updates

screenshot at 2016-12-16 15-35-36

This section is loaded in collapsed form since it needs quite some space of the Settings page...

@pi-hole/dashboard

@AzureMarker
Copy link
Contributor

Could we add a text field on the bottom for custom lists? Then they can add them there. Also, how will we handle if the lists are changed in the repo and their adlists.list is out of date, but has their changes?

@DL6ER
Copy link
Member Author

DL6ER commented Dec 15, 2016

Sure, I can add a field where a user can add lists. I'd store them in an extra file, so the original adlists.list can always be updated, i.e. overwritten, by us when this it is necessary.

@AzureMarker
Copy link
Contributor

I think it's more of a deeper problem. Since adlists.list is copied from adlists.default, it isn't updated with the normal update. I like the idea of adding extra lists in a separate file. Then we can change up a bit how we handle list updates. Perhaps only have one adlists.list file, which users can modify. On an update, we check the user's list against the updated list and add in the lists that are in the updated version but the the user's version? Then that raises the question of what to do if a list changes from active to commented out or flat deleted in an update. Do we comment out the user's list, delete the list from the file, etc? Or leave it up to the user?

@DL6ER
Copy link
Member Author

DL6ER commented Dec 16, 2016

Currently I do the following: Edit adlists.default directly such that it will get stashed and changed how we want it during an update. The extra.list would be separate. I'd propose to comment out everything in this file on update. That would lead to the situation that an user always has the configuration we think is the best after an update - however, his custom lists are not deleted, but only disabled for the moment. He can simply go to the Settings page and customize as he likes.

This might be some level of inconvenience connected to each update, but we can be sure that all users have a working situation (that we can control) after each update. Re-enabling the extra lists is done in seconds.

Conflicts:
	php/savesettings.php
@DL6ER DL6ER added this to the next release milestone Dec 16, 2016
@DL6ER
Copy link
Member Author

DL6ER commented Dec 16, 2016

Updated screenshot in PR description

@DL6ER DL6ER changed the title Enable/disable all lists from /etc/pihole/adlists.default from the Settings page Manage adlists [Settings] Dec 16, 2016
@DL6ER DL6ER changed the title Manage adlists [Settings] [WIP] Manage adlists [Settings] Dec 16, 2016
@DL6ER
Copy link
Member Author

DL6ER commented Dec 16, 2016

@Mcat12 I'd propose to go with adlists.list + new adlists.user. Not sure what to do with an possibly already existing adlists.list, because I'd like to overwrite on every Pi-hole update like:

cp /etc/.pihole/adlists.default /etc/pihole/adlists.lists

to enforce an up-to-date list.

See also here

@DL6ER DL6ER modified the milestones: v2.1, next release Dec 16, 2016
@AzureMarker
Copy link
Contributor

Gravity actually already overrides the default list on every run. ;) https://github.com/pi-hole/pi-hole/blob/master/gravity.sh#L335

@AzureMarker
Copy link
Contributor

That sounds like it should work well. Just will have to try and re-enable/disable the lists that are in the default list based on the user's prior settings, if possible.

@DL6ER DL6ER changed the title [WIP] Manage adlists [Settings] Manage adlists [Settings] Dec 27, 2016
@DL6ER DL6ER changed the title Manage adlists [Settings] Manage adlists Dec 27, 2016
@AzureMarker
Copy link
Contributor

Does this require any Core changes?

{
while (($line = fgets($handle)) !== false)
{
if(substr($line, 0, 2) === "#h")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this check for #http instead? There might be a comment that starts like #here's some list...

function readAdlists(&$list, $listname)
{
// Reset list
$list = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why take in a list and just rewrite it? Could this return a list instead?
$adlistsuser = readAdlists("user");

@DL6ER
Copy link
Member Author

DL6ER commented Dec 28, 2016

@Mcat12 These are the core changes:
Allow enabling/disabling of adlists via webUI pi-hole/pi-hole#988

@PromoFaux PromoFaux modified the milestones: v2.4, v2.3 Jan 1, 2017
@DL6ER DL6ER changed the title Manage adlists [WIP] Manage adlists Jan 2, 2017
@DL6ER
Copy link
Member Author

DL6ER commented Jan 2, 2017

WIP since we might change the format of the adlist to CSV

@DL6ER DL6ER mentioned this pull request Jan 16, 2017
10 tasks
@AzureMarker AzureMarker modified the milestones: v2.5, v2.4 Jan 27, 2017
@DL6ER DL6ER removed this from the v2.5 milestone Mar 5, 2017
@technicalpyro
Copy link

i oticed this thread a few days ago and am wondering if the formatting of my personal adlist could be useful in it

###A word of warning (i.e: Please DO NOT just install all these lists at once):
###Installing all of these lists will result in the Query Log tool of Pi-hole to return an ajax datatables error, when it loads
###If this doesn't deter you, consider skipping a couple of lists known for false positives (e.g: hosts.eladkarako.com)
###If you have hardware with 1GB of RAM or more, you may increase PHP's memory: memory_limit = 180M within /etc/php5/fpm/php.ini OR /etc/php5/cgi/php.ini (FPM if it exists, otherwise CGI, and then sudo service php5-fpm restart OR sudo service php5-cgi restart)
###Raising PHP's memory beyond this suggestion may result in your hardware becoming unresponsive (freezing), as multiple 'children' with this limit are spawned via /etc/php5/fpm/pool.d/www.conf

##Suspicious Lists:

#Bill Stearn
http://v.firebog.net/hosts/BillStearns.txt
#CAMELEON
http://sysctl.org/cameleon/hosts
#DSHEILD Suspicious
https://www.dshield.org/feeds/suspiciousdomains_Low.txt
#Elad Karako
https://raw.githubusercontent.com/eladkarako/hosts.eladkarako.com/master/_raw__hosts.txt
#Joe Wein
http://www.joewein.net/dl/bl/dom-bl-base.txt
#Mahakala
https://adblock.mahakala.is
#hpHosts Spam
https://hosts-file.net/grm.txt
#Andy Short
http://hostsfile.mine.nu/hosts0.txt
#Piwik Referrer Spam
https://raw.githubusercontent.com/piwik/referrer-spam-blacklist/master/spammers.txt
#ReddestDream
https://raw.githubusercontent.com/ReddestDream/reddestdream.github.io/master/Projects/MinimalHosts/etc/MinimalHostsBlocker/minimalhosts
#Steven Blacks KAD
https://raw.githubusercontent.com/StevenBlack/hosts/master/data/KADhosts/hosts
#Steven Blacks Spammers
https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.Spam/hosts
#SecureMecca
http://securemecca.com/Downloads/hosts.txt
#Someone Who Cares
http://someonewhocares.org/hosts/zero/hosts
#Spam404
https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt
#Vokins yhosts
https://raw.githubusercontent.com/vokins/yhosts/master/hosts
#Winhelp2002 MVPS
http://winhelp2002.mvps.org/hosts.txt

##Advertising Lists:

#AdAway
https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt
#Disconnect Ads
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
#hpHosts Ads/Trackers
https://hosts-file.net/ad_servers.txt
#Easylist
http://v.firebog.net/hosts/Easylist.txt
#Steven Blacks Spotify Ads
https://raw.githubusercontent.com/StevenBlack/hosts/master/data/SpotifyAds/hosts
#Steven Blacks Unchecky Ads
https://raw.githubusercontent.com/StevenBlack/hosts/master/data/UncheckyAds/hosts

##Tracking & Telemetry Lists:

#Airelle Trackers
http://v.firebog.net/hosts/Airelle-trc.txt
#Easyprivacy
http://v.firebog.net/hosts/Easyprivacy.txt
#Quidsup Trackers
https://raw.githubusercontent.com/quidsup/notrack/master/trackers.txt
#Steven Blacks Trackers
https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.2o7Net/hosts
#Steven Blacks Microsoft Telemetry
https://raw.githubusercontent.com/StevenBlack/hosts/master/data/tyzbit/hosts

##Malicious Lists:

#Airelle High Risk
http://v.firebog.net/hosts/Airelle-hrsk.txt
#Disconnect Malvertising
https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt
#DNS-BH Malware
http://mirror1.malwaredomains.com/files/justdomains
#hpHosts Exploit
https://hosts-file.net/exp.txt
#hpHosts Malware
https://hosts-file.net/emd.txt
#hpHosts Phishing
https://hosts-file.net/psh.txt
#'Immortal' Malware Domains
https://mirror.cedia.org.ec/malwaredomains/immortal_domains.txt
#Malware Domain List
: https://www.malwaredomainlist.com/hostslist/hosts.txt
#Mandiant APT1 Report
https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a1308f2f12394abd86d0927a4a0/bad_lists/Mandiant_APT1_Report_Appendix_D.txt
#Openphish
https://openphish.com/feed.txt
#Quidsup Malicious
https://raw.githubusercontent.com/quidsup/notrack/master/malicious-sites.txt
#Ransomware Tracker
https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt
#Steven Blacks Risky Hosts
https://raw.githubusercontent.com/StevenBlack/hosts/master/data/add.Risk/hosts
#Shalla Malicious
http://v.firebog.net/hosts/Shalla-mal.txt
#Zeus Tracker
https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist

@AzureMarker
Copy link
Contributor

image

@AzureMarker
Copy link
Contributor

AzureMarker commented Apr 1, 2017

image

@DL6ER
Copy link
Member Author

DL6ER commented Apr 1, 2017

Why should the user want to delete them when he can disable them?

@technicalpyro
Copy link

is there a way to label the lists using a more descriptive title if is is present in the adlists.list file ?

@PromoFaux
Copy link
Member

@DL6ER some people might just want to have a clean slate, and not use any of the defaults. Why have them all in the list disabled if they're never going to use them?

@technicalpyro possibly, for now I think it's nice just to get the functionality out there and work on the polish separately!

@PromoFaux PromoFaux changed the title [WIP] Manage adlists Manage adlists Apr 4, 2017
@AzureMarker AzureMarker merged commit acc8334 into devel Apr 6, 2017
@AzureMarker AzureMarker deleted the customizeadlists branch April 6, 2017 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants