pihole-regex
pihole-regex copied to clipboard
Add list & comment arguments enables usage with other regex lists
What
This pull request adds the following sub commands to the install script.
- --list [string] (regex.list of choice)
- --comment [string] (Comment of choice)
If you choose none of these sub commands: The default is used.
Usage
curl -sSl https://raw.githubusercontent.com/nickspaargaren/pihole-regex/args/install.py | sudo python3 /dev/stdin --list https://raw.githubusercontent.com/nickspaargaren/no-google/master/regex.list --comment github.com/nickspaargaren/no-google
How to test
Requirements
- Docker
Setup new Pi-Hole test installation
- Pull the Pi-hole docker image by running
docker pull pihole/pihole:2024.02.0
- Start the Pi-hole docker container by running
docker run --name pihole -d -p 8080:80 -e WEBPASSWORD=admin pihole/pihole:2024.02.0
- Navigate to http://localhost:8080/admin/
- Login in with password
admin
and check "Remind me for 7 days" - Install Python inside the docker container by running
docker exec pihole sh -c "sudo apt update && apt install python3 -y"
Import domains in Pi-Hole
- Navigate to http://localhost:8080/admin/groups-domains.php and make sure there are no rules
- Import a custom list by running
docker exec pihole sh -c "curl -sSl https://raw.githubusercontent.com/nickspaargaren/pihole-regex/args/install.py | sudo python3 /dev/stdin --list https://raw.githubusercontent.com/nickspaargaren/no-google/master/regex.list --comment github.com/nickspaargaren/no-google"
- Refresh or navigate to http://localhost:8080/admin/groups-domains.php and make sure the domains are imported correctly
Closes https://github.com/mmotti/pihole-regex/issues/61
Great addition!
Hi! Apologies for the delay in response; I haven't had Pi-hole installed for some time.
Unfortunately the diff for this particular change isn't too helpful for me to be able to look through this quickly and I'd have to familiarise myself once again with the code.
Are you able to confirm that this has been tested and works as expected?
I was merely trying to apply multiple lists and noticed that when you apply a list all previous entries will be deleted/disabled. Adding command line arguments to select which allow/block lists one wants to apply would be a great addition.
Hi @mmotti! My apologies for leaving this PR open for so long. I've added a "How to test" section so you can verify the changes using a new Pi-hole installation with Docker. Let me know if you need anything!