Collection of scripts to manage the blocklists and whitelists on my pihole instances
Find a file
2021-07-14 11:40:20 +03:00
assets Initial commit 2021-07-13 22:41:19 +03:00
comparison Initial commit 2021-07-13 22:41:19 +03:00
.gitignore Initial commit 2021-07-13 22:41:19 +03:00
block_FB.sh Initial commit 2021-07-13 22:41:19 +03:00
blocked Initial commit 2021-07-13 22:41:19 +03:00
get_blocklists.sh Initial commit 2021-07-13 22:41:19 +03:00
LICENSE Initial commit 2021-07-13 22:41:19 +03:00
Links.txt update links 2021-07-14 11:40:20 +03:00
pull.lists.sh white list accessible from gitlab 2021-07-14 11:23:26 +03:00
readme.md Initial commit 2021-07-13 22:41:19 +03:00
update.pi.sh update links 2021-07-14 11:40:20 +03:00
whitelist.txt differentiate with extension 2021-07-14 11:39:07 +03:00

Pihole Lists Manager

If you find this repo useful please consider giving it a star on gitlab.

PayPal

About the project

This repository contains scripts, blocklists and whitelists I use to manage the gravity database on my pihole instances.

The script pull.lists.sh fetches public blocklists and aggregates them with my personal blocklist. Finally the blocklists are compressed (xz) and are ready to be used.

The compressed blocklists save time & data spent in getting the blocklists over slow internet connections or while deploying to several machines. This results in files that is somewhere between 11-25% of their original size.

The script update.pi.sh is run on the pihole instances (raspberrypi, pc, docker), and it fetches the compressed blocklists and my whitelist. The script adds my whitelisted domains to pihole and updates gravity on pihole using pihole -g.

Note:

  1. This script uses sd and rg as replacement for sed and grep. These time-tested utilities although very reliable are slower compared to their new age counterparts. If you have systems where they are not available, then you can edit the relevant lines in the pull.lists.sh to use sed and grep.

  2. Currently update.pi.sh has this repo as upstream, but it can be changed to some other location, even locally if youre running pihole on the same device.

How to use:

Run the following lines to update your blocklists:

./pull.lists.sh
# ensure everything is looking good
# commit to git
git add -u ; git commit -m "Update `date +'%Y-%m-%d'`" ; git push

Screen Shot 2020-07-29 at 13.24.15

Then updating your pihole instances is as simple as running the included update.pi.sh script on your pihole from your git repo:

curl -L "https://gitlab.com/robocopAlpha/pihole_lists/-/raw/master/update.pi.sh" | bash

# To make it even easier
# just add this to your ~/.bashrc or ~/.zshrc
alias update.pi='curl -L "https://gitlab.com/robocopAlpha/pihole_lists/-/raw/master/update.pi.sh" | bash'

# Command to easily add the alias is included in the update.pi.sh

Adding as a cron job

You can add the update.pi script as a cron job to let the updates happen on a set time automatically by running (requires sudo rights):

sudo -s
curl -L "https://gitlab.com/robocopAlpha/pihole_lists/-/raw/master/update.pi.sh" >| /usr/local/bin/updatepi
chmod +x /usr/local/bin/updatepi
echo '5 18 * * *   root     PATH="$PATH:/usr/sbin:/usr/local/bin/" updatepi' >| /etc/cron.d/updatepi
exit

Whitelisting / False Positive reports

The list sources are listed in the file get_blocklists.sh, you can report issues to them directly to fix it. I can only give you “hot fixes”, which address the issue but doesnt actually fix it.