docker-pi-hole
docker-pi-hole copied to clipboard
lighthttp listens on all IPv6 addresses
Hello,
lighttpd seems to ignore the ServerIPv6 env variable. It's listening on all IPv6 addresses (:::80). Is there any way that it will listen only on the IPv6 address specified by the env variable ServerIPv6, like IPv4 does?
The file /etc/lighttpd/lighttpd.conf seems to be missing the $SERVER["socket"] config for ipv6.
Kind Regards, Madic
Is this still an issue in the latest tag?
Yes, but see #924 why this can also be useful :)
As a workaround to this issue, I override the docker entrypoint in the following way, so that $ServerIPv6
is honored:
/bin/bash -c 'sed -i "s/\[::\]/[$ServerIPv6]/" /usr/share/lighttpd/use-ipv6.pl ; /s6-init'
Just append the following line to your docker-compose.yml (and observe indentation!):
entrypoint: ['/bin/bash', '-c', 'sed -i "s/\[::\]/[$$ServerIPv6]/" /usr/share/lighttpd/use-ipv6.pl ; /s6-init']
Verified to work with tags 2022.01.1 and 2022.08.2. Just in case someone is in need for a quick and simple solution that does not require applying a full-blown patch.