Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list & comment arguments enables usage with other regex lists #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nickspaargaren
Copy link

@nickspaargaren nickspaargaren commented Oct 18, 2022

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 #61

@EWouters
Copy link

EWouters commented Jan 2, 2023

Great addition!

@mmotti
Copy link
Owner

mmotti commented Jan 2, 2023

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?

@EWouters
Copy link

EWouters commented Jan 3, 2023

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.

@nickspaargaren
Copy link
Author

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!

@nickspaargaren nickspaargaren marked this pull request as ready for review February 19, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE: command line driven feeds
3 participants