github anudeepND/whitelist v2.0.0
Whitelist 2.0

latest release: v2.0.1
4 years ago

Whitelist 2.0 - A major update

It's been a long time since this project got an update. I've been inactive on GitHub for some time but I will address the issues and PR as soon as possible.

whitelist.py

The project is rewritten in Python and has many features that are requested by the Pi-hole users. Pi-hole 5.0 introduced databases. New version of Pi-hole migrated list storage from individual files in /etc/pihole to a new gravity database in the same directory called gravity.db.

This allows control over enabling and disabling items in the lists, and even the ability to add comments to remind you why you black/whitelisted something!

The script will check for the Pi-hole path, read/write permission before proceeding further and checks whether the Pi-hole uses database or not i.e; it checks the Pi-hole version. The script is backward compatible. Now all the domain has a comment section that provides some useful info about it.

The comment field has a unique string - qjz9zk to uniquely identify the domains added by this script so the user can remove the domains without affecting other whitelisted sites.

uninstall.py

As mentioned earlier, the unique string (qjz9zk) will come in handy while removing the domains from the database. It uses LIKE operator of the sqlite to match the wildcard string present in the comment section.

SELECT * FROM domainlist WHERE type = 0 AND comment LIKE '%qjz9zk%'
This statement will remove the domain only if it is present in the exact whitelist section and having the string qjz9zk.

Domains in the regex list will not be removed by this script.

The older version of the Pi-hole uses a simple text file to store the entries. In this case the script will match the domains present in your Pi-hole to the domains present in the GitHub repo and removes them accordingly.

Don't miss a new whitelist release

NewReleases is sending notifications on new releases.