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

LibreELEC + docker-pi-hole #199

Closed
Anuskuss opened this issue Dec 14, 2017 · 8 comments
Closed

LibreELEC + docker-pi-hole #199

Anuskuss opened this issue Dec 14, 2017 · 8 comments

Comments

@Anuskuss
Copy link

I'm fairly new to docker and pi-hole and didn't even know that this project had a github repo, so I can finally share my problems I've encounterd in the hope to receive some support.

Current Configuration

Config

docker run -d \
	--name pihole \
	-p 53:53/tcp \
	-p 53:53/udp \
	-p 80:80 \
	-v /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input:/sys/class/thermal/thermal_zone0/temp \
	-v /etc/localtime:/etc/localtime \
	-v /storage/pihole/:/etc/pihole \
	-v /storage/pihole/dnsmasq.d/:/etc/dnsmasq.d \
	-v /storage/html/:/var/www/html/html/ \
	-h $(cat /etc/hostname) \
	-e ServerIP=$(ip route get 8.8.8.8 | awk '{ print $NF; exit }') \
#	-e ServerIPv6=$(ip -6 route get 2001:4860:4860::8888 | awk '{ print $7; exit }') \
	-e WEBPASSWORD=123456 \
	--restart=always \
	diginc/pi-hole:latest

Problems

  • Hostname
    I think the hostname should automatically be the hostname of my machine, but your project always creates a random one. Shouldn't this be the default behaviour?
    Solved it with -h $(cat /etc/hostname)
  • Timezone
    When creating the project with -e TZ=Europe/Berlin the clock would always be one hour too early.
    Solved it with -v /etc/localtime:/etc/localtime
  • Temperature
    Could actually be a device-specific problem but /sys/class/thermal/thermal_zone0/temp outputs -263200 (absolute zero).
    Solved it with -v /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input:/sys/class/thermal/thermal_zone0/temp

IPv6

This actually makes no sense to me. The default IPv6 function print $10 doesn't output anything, the thing I'm looking for is print $7.
Here is the output of ip -6 route get 2001:4860:4860::8888

2001:4860:4860::8888 via fe80::925c:44ff:fexx:xx7a
dev eth0
src 2a02:xxxx:xxx:b500:f64d:30ff:fexx:xxd0
metric 1024

But if I do that it fails here
https://github.com/diginc/docker-pi-hole/blob/00a87646895daee3800ad5652ef13ce41478f0f9/bash_functions.sh#L37-L41

Now when I don't specify an IPv6 address at all, it obviously doesn't block IPv6. But if I instead pass the link-local adress with print $3 it somehow (?) works.

Cheers

@diginc
Copy link
Collaborator

diginc commented Dec 14, 2017 via email

@Anuskuss
Copy link
Author

That doesn't work, apparently my IPv6 address is not valid.

@diginc
Copy link
Collaborator

diginc commented Jan 5, 2018

Resolved? Feel free to re-open or add any new info that may help others.

@diginc diginc closed this as completed Jan 5, 2018
@01010101001
Copy link

01010101001 commented Mar 12, 2018

I confirm that IPv6 does not work out of the box and for some reason Anuskuss's solution is correct - you need the "via" field of that route get command (for me it was $5 however).

@diginc
Copy link
Collaborator

diginc commented Mar 12, 2018

Are you also running LibreELEC or another OS? I'm pretty sure this is just a difference in ip route command output that varies between OSs. Please lookup your IP address manually and pass it into the container environment variables.

The example docker run in the readme is exactly that - as it says: This is just an example and might need changing.

@01010101001
Copy link

01010101001 commented Mar 12, 2018

I am running a freshly installed debian stretch server image. here's how the ip command output looks like:

# ip -6 route get 2001:4860:4860::8888
2001:4860:4860::8888 from :: via fe80::a:b:c:d dev enp0s25 proto ra src $myip metric 100  mtu 1492 pref medium

selecting $5 with awk got IPv6 blocking working for me (I would have expected $11 (src) to be needed but that generates the "does not appear to be a valid address" error)

@diginc
Copy link
Collaborator

diginc commented Mar 12, 2018

This should work better

echo '2001:4860:4860::8888 from :: via fe80::a:b:c:d dev enp0s25 proto ra src $myip metric 100  mtu 1492 pref medium' | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}'
$myip

@diginc diginc reopened this Mar 12, 2018
@nxadm
Copy link
Contributor

nxadm commented Apr 21, 2018

Hostname
I think the hostname should automatically be the hostname of my machine, but your project always creates a random one. Shouldn't this be the default behaviour?
Solved it with -h $(cat /etc/hostname)

No, Docker's default hostname are random because most of the time you don't care about them. The -h is there in case it matters (e.g. when sending to a syslog server configured that way). In the case of pihole, it does not matter.

diginc added a commit that referenced this issue Apr 21, 2018
Forgot to add the lookup fix from #199 (comment)
@diginc diginc mentioned this issue Apr 21, 2018
2 tasks
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