-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
fix: Use guessAppRootOr to enable relative root if desired. #2100
Conversation
This is useful when serving on 0.0.0.0, such that querying from any other device with <IP>:<PORT> does not fallback to 0.0.0.0:PORT, which would fail. Tested: Manually
Cool. What's a description of the user-visible difference this makes, suitable for the manual ? On mac, with or without your fix, running hledger-web with --host 0.0.0.0 or --host localhost seems to break it for web browsers - Safari shows an empty page and Firefox refuses to browse it. (Also one has to use --port to avoid AirTunes which is using port 5000.) |
You mean serving from Mac? The user-visible change would be that if the web interface is reachable from multiple domains or IPs, they will not necessarily be redirected to the If this is not desired behavior we could maybe check if |
Ah I see - when hledger-web is accessible at multiple IPs, it will keep responding from the same IP address you visited ? That sounds good to me, I guess you have observed it fixing your issue on GNU/linux.
I don't know if this interacts with the other options, do you think there might be a problem there needing more testing ? Otherwise I'm happy to merge this. I'll call for testers on chat also.
|
Yes exactly that. Plus it would also keep the same hostname, imagine you have the host as "foo" and "192.168.1.123", then visiting http://192.168.1.123:5000 would redirect to http://192.168.1.123:5000/journal and visiting http://foo:5000 would redirect to http://foo:5000/journal.
Actually, I tested the change on Windows so far. My Linux Haskell setup is super broken at the moment... :/
The only option it could interact with is |
Tested on Linux as well now; also works. |
I think we need to clarify how this interacts with --base-url. The doc for that option says --base-url=URL : set the base url (default: http://IPADDR:PORT). Note: affects url generation but not route parsing. Can be useful if running behind a reverse web proxy that does path rewriting. Note to self: translate this to userese. |
We could just let |
I can't fully test this on mac, but I see that we print both the listening address and port and the base url and port, so it should be easy enough to troubleshoot any issues. I will shortly merge this as 6312446, thank you ! |
This is useful when serving on 0.0.0.0, such that querying from any other device with : does not fall back to 0.0.0.0:PORT, which fails. (#2099)
Tested: Manually