Skip to content
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

Binding HOST_IP to Request Header "Host" #31

Open
EminUZUN opened this issue Jun 29, 2022 · 2 comments
Open

Binding HOST_IP to Request Header "Host" #31

EminUZUN opened this issue Jun 29, 2022 · 2 comments

Comments

@EminUZUN
Copy link

HOST_IP is binded to what I define. So it is making working with it harder for me.
I'm working in VM normally. I use like dolt.mshome.net or 172.....
But my vm has also 192.... address.
If I want to share with my friends, I'm setting port forwarding. And opening the machine to them (over VPN or public).
I can reach to application from all ip's. But redirections and generated repo names are binded to HOST_IP definition. I need to change ip/host everytime when I click to something. it always redirects to dolt.mshome.net

Is it possible for you to rescue us from HOST_IP definition?

@reltuk
Copy link

reltuk commented Jun 29, 2022

Hopefully we can help here :). Let me describe the current state of things. Maybe we can come up with a solution or at least a feature request.

  1. DoltLab needs to generate absolute URLs that are going to resolve to the doltlab instance for its clients. It cannot/does not rely on relative URLs, because these URLs leave the context of the browser – URLs for dolt remote add, for example, but also in the push/pull/clone implementation of a dolt client talking to doltlab as a remote. In the current implementation, there are also some cross-origin requests that use different ports on the same IP/domain name, but in theory those could be routed through a reverse proxy.

  2. As currently implemented, there is no support for split-network clients in doltlab itself. That is, doltlab expects to always be referred to by a single canonical hostname or IP address. It generates all of its external URLs based on that. The value of that canonical hostname or IP address is configured with HOST_IP.

  3. When doltlab runs in docker-compose, AFAIK, the docker daemon it binds and forwards 0.0.0.0:PORT for the ports that are forwarded. So every IP address on the host will be forwarding traffic to doltlab on the listened ports.

Is there any way you can run doltlab and make it externally accessible under a single endpoint? Sometimes this can be accomplished with split-horizon DNS for example; an external DNS name for dolt.mshome.net pointing at the external IP address which is forwarding the traffic and an internal DNS name (or, in the simplest case, an /etc/hosts entry...) for dolt.mshome.net pointing at the internal IP address. In that case, configuring HOST_IP=dolt.mshome.net should work as expected.

If this were to work for the same doltlab instance behind multiple names, it would need to be a feature request. It sounds like the feature request would be something like:

Allow me to run doltlab accessible from two or more different hostnames or IP addresses. A user arriving through a given hostname/IP address will continue addressing doltlab in that name in all contexts.

Does that sound right?

Thanks for the issue :).

@EminUZUN
Copy link
Author

The feature request exactly would be like you expressed.

Allow me to run doltlab accessible from two or more different hostnames or IP addresses. A user arriving through a given hostname/IP address will continue addressing doltlab in that name in all contexts.

E.g. Azure devops implents it exactly like this.

Implementing reverse proxy and only exposing 80/443 to outside traffic also would be a great feature and a necessity.

If we norrow it to my case: It's making my experimentation in a local pc, with no static ip and no real dns name much harder. As I want my friends also experiment with it from my instance.

Thank you for your detailed explanation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants