jessedp / pihole5-list-tool

A tool for quickly and easily bulk adding allow and ad/block lists to a Pi-hole 5 installation
MIT License
312 stars 18 forks source link

Docker image pihole/pihole #27

Closed shinyone closed 4 years ago

shinyone commented 4 years ago

Environment

Describe the system on which this issue occurred:

pihole5-list-tool (ex: 0.4.2, pip3 show pihole5-list-tool) : π-hole 5 list tool v0.5.1

OS _(ex: Ubuntu 20.20, lsb_release -a)_ : Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster

Python (ex: 3.8.2, python --version) : Python 2.7.16

Using Docker? Y/N .....version (ex: 19.03.10, docker -v) : Docker version 19.03.12, build 48a6621

Hi,

I tried out your list tool for pihole, but had some issues, it's more user support than bugs.

  1. Firstly, it did not find my docker instance. Which for me is: pihole/pihole:latest, so in my case the command docker inspect pihole/pihole is required. I am a noob, so may have set up docker incorrectly via Portainer. If I am not the only one, it might be nice to add this as a fallback.

  2. Since I am using docker I know the location of my config (user data). I wondered if there was a way to provide the path to the gravity.db file. After running the command I saw I could edit the path. Cool!

  3. Not sure what the last step is (see trace below), i assume the gravity update, but it failed. Same docker issue? i.e. should update it, but doesn't know about it. I did the update via the UI. No big deal.

Thanks a lot for the program, just some feedback....

    ┌──────────────────────────────────────────┐
    │       π-hole 5 list tool  v0.5.1         │
    └──────────────────────────────────────────┘
    https://github.com/jessedp/pihole5-list-tool

docker not found running, continuing...
? Gravity Db to Update:  gravity.db
? Add Blocklists or Allowlists?  Blocklists

    Do not hit ENTER or Y if a step seems to hang!
    Use CTRL+C if you're sure it's hung and report it.

? Where are the block lists coming from?  Firebog | Non-crossed lists : Use when someone is usually around to allow
? Add 48 block lists to gravity.db?  Yes
0 block lists added! 48 already existed.
? Update Gravity for immediate effect?  Yes

sh: 1: pihole: not found
jessedp commented 4 years ago

Thanks for the feedback!

  1. Firstly, it did not find my docker instance. Which for me is: pihole/pihole:latest, so in my case the command docker inspect pihole/pihole is required. I am a noob, so may have set up docker incorrectly via Portainer. If I am not the only one, it might be nice to add this as a fallback.

Based off of the first Portainer+pihole article I found, my guess is that your container is named Pihole rather than pihole so docker inspect pihole fails. I used pihole since that's what the quickstart guide for the image uses.

pihole/pihole:latest or pihole/pihole is the image name used to create your container; while docker inspect pihole/pihole does return a bunch of info, it's not about your running container like we want :/

You can confirm my naming assumption by running sudo docker ps . If my assumption is correct, I suppose I could add that and a few other possibly common variations to the detection checks.

  1. Not sure what the last step is, I assume the gravity update, but it failed. Same docker issue?

Yeah, that's what it wants to do and is probably because it can't find the docker image. Ultimately it still should've reported a friendlier error saying that you need to do what you knew you needed to - update via the web UI.

shinyone commented 4 years ago

Thanks for the script and support.

Based off of the first Portainer+pihole article I found, my guess is that your container is named Pihole rather than pihole so docker inspect pihole fails. I used pihole since that's what the quickstart guide for the image uses.

In fact, it was called PiHole. Camel case. I have now renamed it (since it's just a name and isn't used anywhere) and rerun your script, no issues, everything worked correctly.

Simple fix! Thanks. (issue closed)