Hey there,
First time user of Pi-hole here. Got it running on my Ubiquiti CloudKey following this guide over the weekend. Thanks for the great work!
Two issues I've noticed:
- As the default HTTP port on a CloudKey is in use by UniFi, the guide included instructions to make lighttpd listen on port 81. I think index.php can be made more robust by adding the port number to the $queryAds array URL (near line 138):
$queryAds = file("http://127.0.0.1:{$_SERVER['SERVER_PORT']}/admin/scripts/pi-hole/php/queryads.php?domain=$serverName&bp", FILE_IGNORE_NEW_LINES);
- I understand that the Pi-hole admin console is supposed to be accessible at http://pi.hole & http://pi-hole/admin when running as DNS server, or http://[ip-address]/admin. When I visit http://[ip-address]/ though, I get an error like this:
[ERROR]: Unable to parse results from queryads.php: Unhandled error message (Invalid domain!)
If that URL serves no other purpose, changing the conditions (near line 60) to redirect to the admin console would make things more user-friendly:if ($serverName === "pi.hole" || $serverName === $_SERVER['SERVER_ADDR'] || $serverName === "pi.hole:".$_SERVER['SERVER_PORT'] || $serverName === $_SERVER['SERVER_ADDR'].":".$_SERVER['SERVER_PORT']) {
Pardon me for reporting this here rather than sending a PR, GitHub doesn't quite agree with me. Please also let me know if this has any unintended consequences I'm unaware of, as I am new to the code base. Thank you!