jacklul / pihole-updatelists

Update Pi-hole's lists from remote sources easily
MIT License
1.39k stars 81 forks source link

Script doesnt respect if entry is already present #145

Open RichardBeisser opened 6 months ago

RichardBeisser commented 6 months ago

Hello,

it seems that the script doesnt check if an entry for a certain domain is already defined. How can I enable this behaviour?

There should be a running mode which a) only add entries when no entry for a domain ist set manually b) modify and delete only entries which were created by the script.

I think the only way to mark an entry as managed by your script is to use the comment

Thanks

jacklul commented 6 months ago

https://github.com/jacklul/pihole-updatelists?tab=readme-ov-file#migrating-lists-and-domains

RichardBeisser commented 6 months ago

https://github.com/jacklul/pihole-updatelists?tab=readme-ov-file#migrating-lists-and-domains

I read this. This refer only that your script will not overwrite comment-field if entry is already exists. But it seems that the script is overwriting existing group-assigments

Example: see attached config-file + youtube.com pihole-updatelists.conf.txt youtube.com is whitelisted for group-id 3 only. comment for youtube.com = "my comment" After running the script, youtube.com has still the comment "my comment" (that is very good!), but groups has been changed from 3 to 0+1, according the config-file. There should be an option saying the script that it shall change nothing if entry already exists and is not set by the script.

another point, a feature request: there should be a ignore-option for whitelisting for certain domains a blacklisted entry can be "overwritten" by setting a whitelist-entry, because wl has a higher priority. It would be great if you can exclude certain domains / regex from whitelisting.

In words of your options: WHITELIST_IGNORE " "
REGEX_WHITELIST_IGNORE " "

Thanks a lot.

jacklul commented 6 months ago

Example: see attached config-file + youtube.com pihole-updatelists.conf.txt youtube.com is whitelisted for group-id 3 only. comment for youtube.com = "my comment" After running the script, youtube.com has still the comment "my comment" (that is very good!), but groups has been changed from 3 to 0+1, according the config-file.

I will look into this when I can

another point, a feature request: there should be a ignore-option for whitelisting for certain domains a blacklisted entry can be "overwritten" by setting a whitelist-entry, because wl has a higher priority. It would be great if you can exclude certain domains / regex from whitelisting.

In words of your options: WHITELIST_IGNORE " " REGEX_WHITELIST_IGNORE " "

I rather not add a functionality like this - you could wget the list and filter it with sed then provide local path in the config file instead.

jacklul commented 6 months ago

Check if the newest develop version fixes mentioned issue.

RichardBeisser commented 6 months ago

Check if the newest develop version fixes mentioned issue.

just tested your new script. Great Job, it now ignores an entry completely when it exists

I rather not add a functionality like this - you could wget the list and filter it with sed then provide local path in the config file instead.

the advantage if the script would do that is that you can apply it on all lists at the same time