Feat: Add proxy path feature - #260
Conversation
almeidapaulopt
left a comment
There was a problem hiding this comment.
Thank you for working on this feature, @nodauf! The proxy path functionality would be very useful.\n\nI've reviewed the implementation carefully and I think it needs some important changes before it can be merged:\n\n### Current implementation:\nThe PR adds a ProxyPath field to PortConfig and appends the path to the DNS name displayed in the dashboard.\n\n### Issues:\n\n1. Path is only cosmetic — The path is appended to status.Self.DNSName in watchStatus(), which changes the displayed URL in the dashboard. However, the actual reverse proxy doesn't know about this path — requests to machine-name.ts.net/admin won't be routed to the container's /admin path.\n\n2. Hardcoded to port 443 — The code only looks at port 443 for the path:\ngo\nfor _, c := range p.config.Ports {\n if c.ProxyPort == 443 {\n path = c.ProxyPath\n }\n}\n\nThis should probably be per-port, not hardcoded.\n\n3. Path in DNS name — Appending a path to the DNS name (machine-name.ts.net/admin) is mixing URL structure with DNS. The DNS name should remain machine-name.ts.net and the path should be handled at the HTTP routing level.\n\n### Suggested approach:\n- The reverse proxy handler should strip/rewrite the path prefix when forwarding to the container\n- The path should be stored per-port in PortConfig and used in the HTTP handler, not just the status display\n- Consider implementing this as a label like tsdproxy.path=/admin rather than part of the port config string\n\nWould you be interested in revising the implementation? Happy to help discuss the approach! 😊
b720a3f to
28506e0
Compare
Hi,
This PR is related to the issue #153. I had a similar need, where the Pi-hole administration interface is located at
/admin.If you wish this feature to be implemented differently (for example, using a label like
tsdproxy.dash.path: "/login"), let me know and I can adjust the implementation accordingly.