-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
Allow path prefix multiplexing the dashboard and API #3269
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>
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: DL6ER <dl6er@dl6er.de>
Conflicts have been resolved. |
My only comment in those |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. |
Signed-off-by: DL6ER <dl6er@dl6er.de>
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 = |
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
/api
path.Note
You will need the related FTL branch
new/web_prefix
for 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:
developmental
branch.