pi-hole / docker-pi-hole

Pi-hole in a docker container
https://pi-hole.net
Other
8.4k stars 1.12k forks source link

ServerIP still required? #956

Open scara opened 2 years ago

scara commented 2 years ago

Hello Everyone, it looks like ServerIP is still required, regardless the improvement in #944, documented in https://github.com/pi-hole/docker-pi-hole/tree/3f97e6e4fc37cb7077f336cfa6a048105c0e6867#recommended-variables. These are the logs when starting the new docker image:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-resolver-resolv: applying...
[fix-attrs.d] 01-resolver-resolv: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 20-start.sh: executing...
 ::: Starting docker specific checks & setup for docker pihole/pihole

  [i] Installing configs from /etc/.pihole...
  [i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
  [✓] Installed /etc/dnsmasq.d/01-pihole.conf
  [✓] Installed /etc/dnsmasq.d/06-rfc6761.conf
Applying pihole-FTL.conf setting REPLY_ADDR4=***.***.***.***
Setting DNS servers based on PIHOLE_DNS_ variable
::: Pre existing WEBPASSWORD found
  [✓] Setting admin contact to *********@********
DNSMasq binding to default interface: eth0
Added ENV to php:
                        "PIHOLE_DOCKER_TAG" => "2021.12.1",
                        "PHP_ERROR_LOG" => "/var/log/lighttpd/error.log",
                        "ServerIP" => "0.0.0.0",
                        "CORS_HOSTS" => "",
                        "VIRTUAL_HOST" => "********.********.home",
Using IPv4
...

This is a: Bug

Details

I assume ServerIP to be no more required but logs mention it so either it is still required i.e. not deprecated or logs should be fixed.

Related Issues

How to reproduce the issue

  1. Run the latest 2021.12.1 image - it's there since 2021-11
  2. Replace ServerIP with FTLCONF_REPLY_ADDR4, in the docker-compose you're running fine on 2021.10.1

These common fixes didn't work for my issue

dschaper commented 2 years ago

I don't think I understand. Can you explain a bit more about what is broken or not working?

scara commented 2 years ago

Hi @dschaper, nothing is broken in terms of features but ServerIP is no more set as an ENV VAR by me but by the existing Dockerfile.

Being new to pi-hole code, at first glance it could be just a matter of fixing what written by logs by adding/removing relevant ENV VARs, at least adding FTLCONF_REPLY_ADDR4 too: https://github.com/pi-hole/docker-pi-hole/blob/523762e47d30571db11c0fc7e90351a029319ec9/bash_functions.sh#L220.

But... there are other places which look at ServerIP e.g. https://github.com/pi-hole/docker-pi-hole/blob/523762e47d30571db11c0fc7e90351a029319ec9/bash_functions.sh#L49. I feel that a cleanup should be required to remove the usage of ServerIP in several places, including tests:

Kind of two separate issues: this one to cleanup the logs and another one to actually deprecate ServerIP*.

HTH, Matteo

PromoFaux commented 2 years ago

Hiya, thanks for opening this issue. I made a similar note about this in a review comment for the PR that added the new FTLCONF_ variable. https://github.com/pi-hole/docker-pi-hole/pull/944#discussion_r756401249

I feel that a cleanup should be required

Absolutely agree here! I filed it under "At some point in the future, I'll have the time and energy to sit down and untangle this from the repo" - and am yet to find the time or energy for 😏

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

scara commented 2 years ago

Hi bot!

Based on https://github.com/pi-hole/docker-pi-hole/issues/956#issuecomment-1002295947 I think this could be the issue useful to track the vision of @PromoFaux .

HTH, Matteo

PromoFaux commented 2 years ago

Gosh, has it been a month already?

I've added the Help Wanted label just in case anyone else would like to dip their toes into the repo, too (and never-stale to stop the bot from marking it stale!)

pralor-bot commented 2 years ago

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pihole-freezing-randomly-apparently/53200/7

pralor-bot commented 2 years ago

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/local-dns-records-not-resolved-on-mobile-devices/53272/5

pralor-bot commented 2 years ago

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pihole-not-resolving-it-s-own-hostname/53396/4

pralor-bot commented 2 years ago

This issue has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/finding-the-source-of-a-rebind/53449/20

r2ixuz commented 2 years ago

I stumbled upon this while I tried to use only non deprecated variables/settings. I need to bind the lighttpd listen address to a virtual eth interface while using docker mode host. With setting ServerIP ENV it works.

Readme says it is deprecated so I tried to use REPLY_ADDR4 only. This sets the listen interface to 0.0.0.0 as described by OP. Furthermore I read at https://docs.pi-hole.net/ftldns/configfile/ that REPLY_ADDR4 is also deprecated. That leaves me confused.

So, what is now or in the future the correct way to bind the lighttpd to one specific address while using docker host mode?

labodj commented 2 years ago

I stumbled upon this while I tried to use only non deprecated variables/settings. I need to bind the lighttpd listen address to a virtual eth interface while using docker mode host. With setting ServerIP ENV it works.

Readme says it is deprecated so I tried to use REPLY_ADDR4 only. This sets the listen interface to 0.0.0.0 as described by OP. Furthermore I read at https://docs.pi-hole.net/ftldns/configfile/ that REPLY_ADDR4 is also deprecated. That leaves me confused.

So, what is now or in the future the correct way to bind the lighttpd to one specific address while using docker host mode?

I second this. This situation is very confusing.

docker-pi-hole readme https://github.com/pi-hole/docker-pi-hole/blob/72634fcbc25a6893c10cef4ed3e8c382a523a252/README.md?plain=1#L166

says to use FTLCONF_REPLY_ADDR4 instead of ServerIP image

Pi-hole documentation says that REPLY_ADDR4 is deprecated, LOCAL_IPV4 must be used instead image

PromoFaux commented 2 years ago

Deprecated is not the same as removed. It's still there for now, and will be read by FTL, so the documentation is not incorrect. :)

Thanks, however, for the pointer - I will look at changing the suggested variable to use instead of REPLY_ADDR4

r2ixuz commented 2 years ago

Binding lighthttpd for IPv4 works now with the new Docker image when using FTLCONF_LOCAL_IPV4.

But IPv6 is still binding to every IP:

tcp6 0 0 :::80 :::* LISTEN 13884/lighttpd

I set FTLCONF_LOCAL_IPV6 and FTLCONF_LOCAL_IPV4 via my docker-compose file. ServerIP is not set.

Edit: Typo corrected.

shaderecker commented 2 years ago

Hi guys, Is it also now somehow possible to bind two IPs with the FTLCONF_LOCAL_IPV4? Use case is accessing the website from the host IP address and also a Virtual IP address.

Edit: Ah, just leaving out the vars completely sets LOCAL_IPV4=0.0.0.0. So that's fine for my use case.

juliankrieger commented 1 year ago

I stumbled upon this issue because I had no luck setting up pi hole correctly with the given documentation, or any of the information in this issue. I was get pihole to work with my local devices, but the local DNS functionality won't work.

I'm confused on how to correctly setup my docker-compose.yml.

It seems like there is a lot of conflicting information here. Would anyone mind updating the recommended example docker compose?