Custom Dashboard Path

Summary
Essentially, don't hardcode the paths to the admin interface (i.e. /var/www/html/admin) within the codebase, and instead resort to some sort of user variable (perhaps in setupVars.conf?)

Rationale
I wish to run multiple services on my Pi (or server, does not matter) and use nginx to reverse proxy the requested location to the correct port.
Moving the Pi-Hole web interface is, as it stands, not trivial and requires few tweaks inside the codebase, namely:

  • Moving the /var/www/html/admin directory to my intended location (this was OK for me)
  • Replacing every occurance of /var/www/html/admin with my desired path within /opt/pihole.

Especially the last point was rather time-consuming, even with decent scripting / CLI knowledge.
For reference, /opt/pihole is populated with scripts from the advanced/Scripts directory on GitHub.

Performing such modification is not trivial for average users, which definitely also run their own Pi-Hole, and may wish to add more services easily, etc. etc.. I believe this point is quite clear.

For my specific case, I also wish to run my own admin interface to manage those services, and do some other administrative tasks on, you guessed it, myhost/admin.

Notwithstanding the above, this myhost/admin URL also poses a security issue (well, that depends, but you get my point), as the first point of attack is always some sort of /admin location. Even though my Pi is well-secured behind several security measures, this still irks me.

Personally, I believe running Pi-Hole is a great entrypoint to the world of networking, and users tend to add more and more services on their homeserver. Quickly they'll learn about software like nginx, lighttpd, caddy, etc., how to properly service those via exactly that software. Implementing such a feature will make exactly this process easier.


I did my best to search for possible duplicates, but I found nothing similar enough. If this is still a duplicate, I apologise in advance.

We're working on a new webserver daemon that will be integrated in to pihole-FTL. That will allow a lot more freedom and ability to create your own modules. It's a very big change and is still in process.

Have you tried our docker image?

I do agree with your FR though, we'll see if and how we can make this more flexible.

2 Likes

Hi Dan, thank you for that quick reply! I'll try and brush over the two points you brought up.

That's great to hear! I'm looking forward to that new release. I'm assuming that new daemon allows for such customization as well? Just getting into this stuff, so please forgive my newbie ignorance...

I have not, actually. Personally, I'm more a fan of hosting it "raw" -- I feel like I'm less restricted that way, though that might not be true. Just gut feeling, if you understand what I mean :wink:
However, security wise, I do agree that using Docker adds one more layer of protection.