Allow path prefix multiplexing the dashboard and API#3269
Merged
DL6ER merged 5 commits intodevelopmentfrom Mar 22, 2025
Merged
Conversation
…#2319 for further details Signed-off-by: DL6ER <dl6er@dl6er.de>
…ead of calling pihole.webhome() multiple times Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: DL6ER <dl6er@dl6er.de>
Contributor
|
Conflicts have been resolved. |
Contributor
|
My only comment in those |
Closed
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Contributor
|
Conflicts have been resolved. |
Signed-off-by: DL6ER <dl6er@dl6er.de>
Member
|
This is what I'm testing with, and access looks good. Compose file, running Pi-hole outside of the docker stack on the host: root@pht:/etc/pihole# cat traefik-pihole-issue-docker.yml
services:
traefik:
image: "traefik:v3.3.3"
container_name: "traefik"
command:
- "--accessLog=true"
- "--tracing=true"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.file.directory=/etc/traefik/"
- "--entryPoints.web.address=:80"
- "--entryPoints.dnstcp.address=:53"
- "--entryPoints.dnsudp.address=:53/udp"
ports:
- "53:53"
- "53:53/udp"
- "80:80"
- "8080:8080"
restart: unless-stopped
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./etc-traefik:/etc/traefik:ro"
whoami:
image: "traefik/whoami"
container_name: "simple-service"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=PathPrefix(`/whoami`)"
- "traefik.http.routers.whoami.entrypoints=web"
- "traefik.http.routers.whoami.middlewares=stripwhoami"
- "traefik.http.middlewares.stripwhoami.stripprefix.prefixes=/whoami/"Dynamic configuration, file provider, for the host installed Pi-hole. root@pht:/etc/pihole/etc-traefik# cat dynamic.yaml
http:
routers:
pihole:
entryPoints:
- web
rule: "PathPrefix(`/pihole`)"
middlewares:
- piholehttp
service: piholehttp
middlewares:
piholehttp:
stripPrefix:
prefixes:
- "/pihole"
services:
piholehttp:
loadBalancer:
servers:
- url: "http://192.168.1.190:8081"pihole.toml # Prefix where the web interface is served
# This is useful when you are using a reverse proxy serving the web interface, e.g.,
# at http://<ip>/pihole/admin/ instead of http://<ip>/admin/. In this example, the
# prefix would be "/pihole". Note that the prefix has to be stripped away by the
# reverse proxy, e.g., for traefik:
# - traefik.http.routers.pihole.rule=PathPrefix('/pihole)
# - traefik.http.middlewares.piholehttp.stripprefix.prefixes=/pihole
# The prefix should start with a slash. If you don't use a prefix, leave this field
# empty. Setting this field to an incorrect value may result in the web interface not
# being accessible.
Don't use this setting if you are not using a reverse proxy!
Possible values are:
valid URL prefix or empty
prefix = "/pihole" ### CHANGED, default = |
dschaper
approved these changes
Mar 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What does this implement/fix?
See pi-hole/FTL#2319 for further details. This PR mostly consists of search-and-replace to remove hard-coded absolute paths for the login page as well as adding the ability to send API requests to anywhere else than the fixes
/apipath.Note
You will need the related FTL branch
new/web_prefixfor this to work as expected.Related issue or feature (if applicable): Fixes pi-hole/FTL#2298
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase)Checklist:
developmentalbranch.