anudeepND / whitelist

A simple tool to add commonly white listed domains to your Pi-Hole setup.
MIT License
4.22k stars 282 forks source link

remove error prone total_changes function introduced in #158 #164

Closed mwoolweaver closed 4 years ago

mwoolweaver commented 4 years ago

also fix merge issue of #163

anudeepND commented 4 years ago

@mwoolweaver Thank you for your contribution. Merging.

anudeepND commented 4 years ago

@mwoolweaver The whitelist.py outputs the number of domains added as 188 domains and does not show the actual number.

Steps to reproduce:

  1. clone the latest version
  2. delete some of the entries in your whitelist
  3. run the script
  4. it will always show 188 domains added to the whitelist
mwoolweaver commented 4 years ago

is that because the script is pulling from github and not the database that's cloned with the script?

https://github.com/anudeepND/whitelist/blob/master/scripts/whitelist.py#L75

mwoolweaver commented 4 years ago

the way to actually test this is to add a domain that is known to be whitelisted by the script to your whitelist before you run the script (DO NOT LEAVE A COMMENT) and it will not add that domain and will show a different number.

image

mwoolweaver commented 4 years ago

Or @anudeepND you’re talking about if a user is updating the list? I will agree in that area cause of the way it verifies domains being adding is just checking for their presence in the database which would have that caveat.

mwoolweaver commented 4 years ago

I am currently investigating checking date_added in pi-hole's database for the current date.

mwoolweaver commented 4 years ago

@anudeepND please see #168 for a fix I hope