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

PADD Docker? #148

Closed
AndyVRD opened this issue Dec 28, 2020 · 10 comments
Closed

PADD Docker? #148

AndyVRD opened this issue Dec 28, 2020 · 10 comments

Comments

@AndyVRD
Copy link

AndyVRD commented Dec 28, 2020

Hi,

Is there any solution using PADD if Pihole is running in a container? I keep getting a error...

cat: /var/run/pihole-FTL.port: No such file or directory

@DL6ER
Copy link
Member

DL6ER commented Dec 29, 2020

You can create the file and put 4711 into it as the port is fix.

@dschaper Now that PADD is under the Pi-hole namespace, maybe we can just include it in the official container?

@AndyVRD
Copy link
Author

AndyVRD commented Dec 29, 2020

You can create the file and put 4711 into it as the port is fix.

@dschaper Now that PADD is under the Pi-hole namespace, maybe we can just include it in the official container?

Thanks for the reply. Changed but now get another error...

./padd.sh: line 118: ftl_port: Servname not supported for ai_socktype
./padd.sh: line 118: /dev/tcp/localhost/ftl_port: Invalid argument

GetFTLData() {

Get FTL port number

ftl_port=4711

Did we find a port for FTL?

if [[ -n "ftl_port" ]]; then
# Open connection to FTL
exec 3<>"/dev/tcp/localhost/ftl_port"

@DL6ER
Copy link
Member

DL6ER commented Dec 29, 2020

Try maybe something like

exec 3<>"/dev/tcp/localhost/4711"

you accidentally removed a $ in front of the variable name

@PromoFaux
Copy link
Member

Also if I'm not mistaken you'll need to expose port 4711 on the docker container. What does your compose file / docker run look like?

@AndyVRD
Copy link
Author

AndyVRD commented Dec 29, 2020

Sorry i'm not that good with this so any change to explain where i can find this compose file? Changed the code like DL6ER say and now i got indeed a connection refused error.

./padd.sh: connect: Connection refused
./padd.sh: line 118: /dev/tcp/localhost/4711: Connection refused

@PromoFaux
Copy link
Member

What I mean is, how did you start the docker container? I'm guessing, from context, that you ran a command like docker run...?

@AndyVRD
Copy link
Author

AndyVRD commented Dec 29, 2020

What I mean is, how did you start the docker container? I'm guessing, from context, that you ran a command like docker run...?

I used this guide and so used portainer to install it. :)

@dschaper
Copy link
Member

It won't run in a separate docker container. You have to have access to the socket in the pihole container and exposing that is not a good idea since there is no verification/validation for access.

@dschaper
Copy link
Member

Now that PADD is under the Pi-hole namespace, maybe we can just include it in the official container?

Sure, we could. I don't know how useful it would be since it needs a terminal and most of the time docker is not started with an interactive terminal. I guess you could docker exec -it and then run PADD but that's a lot of tinkering.

@itdojo
Copy link

itdojo commented Aug 20, 2024

Example using a Pi with an attached display (pimoroni hyperpixel4 in my case). OS is Raspberry Pi OS Lite, 64-bit.

  • Get your display working.
  • Edit getty@tty1.
sudo systemctl edit getty@tty1

Add:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin your_username --noclear %I $TERM
  • Then edit ~/.bashrc (or similar) and add:

Note: Assuming you don't want PADD to run when you SSH in to the Pi.

if [ "$(tty)" = "/dev/tty1" ] && [ -z "$SSH_CONNECTION" ]; then
    docker exec -it pihole /usr/local/bin/padd
fi

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

No branches or pull requests

5 participants