-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support stable URLs for endpoints #898
Comments
Workspace urls are not meant to be stable, as they depend on the cluster they are running in. You can always look up the URL by running
Would it be possible to have your proxy accepting this information on some endpoint? That way you could update the proxy whenever you start a workspace and you could even easily start fresh workspaces on your repo all the time, which is how Gitpod is intended to be used. |
Thanks @codemzy for sharing your usecase! I think this is an excellent point for adding a "URL" feature to Gitpod. 🙂 |
I use Auth0 to handle logins. Authorized login urls need to be defined in my Auth0 dashboard or via an admin api. Using the admin api just heaps extra complexity on my dev environment (and means I have to strip this code out in production) - the management of live and unused urls via the api would not be trivial either. I've learned to double check my workspace url whenever I get a service error page from Auth0 now and update my live urls in Auth0 dashboard. However I can see this issue become more critical as I use more 3rd party services with webhooks/authorized urls etc. |
I don't think this would be possible, I set up the proxy from my netlify production deploy in the Maybe I'm not using gitpod how it was intended, by I usually need my dev environment for at least a few weeks at a time while I work on adding a feature or working on a new project, so it would really handy if each workspace could have a static url that doesn't change for the lifetime of the workspace. Especially useful when you have to authorise your api keys against a URL on other services you are using during development. Please consider this! 🙏 🌟 |
Sure, we are thinking about a solution. Thank you for sharing your use cases. |
I also have the same Auth0 challenge as @devops-at-alinea - a stable endpoint would be very helpful so I don't have to update the Auth0 dashboard all the time. I think that wildcards can be specified for subdomains in the Auth0 dashboard, so it there was a way to have the project name in the subdomain it might solve the need. For example: Where myprojectidentifier is some combination of project/username (would need some thinking about). Within Auth0 I could allow the callback url According to their docs I think that would work: https://auth0.com/docs/applications/wildcards-for-subdomains. As a guess maybe the hyphen option would be easier to implement because no additional sub domain level would be required? |
I have created an example for Auth0 https://github.com/gitpod-io/auth0-express-webapp-sample |
Thanks @svenefftinge! That's what I've done - the other suggestion was to be slightly more secure by limiting to the project identifier but actually it doesn't really matter for the dev environment anyway. |
Another use case, @svenefftinge, at GitLab we want to use it to develop integrations with the Jira Cloud Platform. A changing URL means updating the URLs inside of Jira every time you restart a pod. The linking happens via an iframe. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We just announced preview version of Gitpod local companion which allows to tunnel any tcp port: https://www.gitpod.io/blog/local-app particularly it allows you access everything on localhost on proper port, similarly how you will do it in the local env, please try and give us feedback 🙏🏻 |
Another solution is to use https://ngrok.com/docs |
One key question to answer here is how that stable URL gets assigned to a workspace? What if I have two workspaces open? |
From Slack: @geropl
💯 how about .ws.gitpod.io?
indeed, this would introduce some level of connection. However, I don’t think it would be stronger than what we have right now, because it would very much be based on the IDE URL that we already rely on from the meta side.
Downside of this approach is that you need cookies available/set for the redirect to work. For API calls/curl that won’t be the case.
Could certainly be its own component, but it would still need to run in either meta or workspace. I don’t think the operational overheard of introducing something outside of those two structures is worth it right now. |
Both contradict each other, no? I thought getting rid of the
Not sure what you mean with this. What I implied above is that we want to have an "internal redirect" which is transparent to browsers - hence the strong connection. The reasons I thought this is a requirement was to support all kind of clients scenarios. But it might make sense to go through those use-cases one-by-one and make sure they are important enough to warrant that complexity. If we would have a "simple redirect" (302) the implementation is far easier indeed. |
It would just be
I reckon we should avoid to actually tunnel traffic through the "redirector". That would
If we combined the simple redirect with CNAME DNS entries, we'd also make this work for clients that don't cope with redirects. We would also open the door for weird DNS-caused failure modes (e.g. cached DNS entries pointing to the wrong workspace). |
Got it, completely d'accord.
👍
That would be nice indeed! And would nicely match the semantics as we're offering a "name service" 🙂 |
Awesome - happy to find consensus on the technical side :) We still need to answer a bunch of questions around the stable name itself:
|
Could it have the username or a unique string assigned to each user in the url? E.g. Although to be honest, for my original use case I think how things are good now. The workspace name carries over the url, e.g. the workspace name |
So far I thought about this as a way to expose a workspace, so there's always a 1-1 connection between "stable name/URL" and "workspace". Following this Everything else - especially custom names (with possible per-user namespace) - would be an addon and could be handled atop of this. |
That would work great for my needs. Even if you still include the port in the url |
We should not include workspace names, because they are ephemeral. Instead, we should use a combination of project and user.
We should surface the public URLs in the ports view.
This would not be possible with the proposal above. Do we know a use case for "user influenced" URLs? |
Seen several people asking for this on our discord server, one recent query: https://discord.com/channels/816244985187008514/952289368394043412/952601245598752808 |
I was asked to add my use case to this issue, so here it is. Part of our system is dependent on webhooks and code running on a third party service. In a traditional (not web based) dev environment we used to use a tunneling tool (like ngrok) to manage traffic from those, but with gitpod already being on the web, it would make a lot of sense to be able to provide a stable gitpod url instead. |
A bit more on how I would imagine this feature working: It would be great to be able to assign a subdomain to a project, per user. Something like One detail I would add from previous experience: if possible, it would be nice to have multiple subdomains point to the same port. Like that we can choose to use our own proxy to manage traffic based on hostnames. |
@jldec This is a feature request that won't go away - we should make we keep it on our radar, even if not working on it immediately. I filed it under "Projects Usability", but feel free to re-assign. |
Hi, Thanks 👍 |
I was able to start a quick tunnel following the Cloudflare docs. I have not tried this, but would expect that you could configure a stable subdomain per user in cloudflare DNS this way. |
@jldec I had done this inside Gitpod while trying out some minecraft server dev and it works 💪 |
Yup, this works. |
A similar related use-case from discussion with a user today (@konne) was around security, that the current URL process with the organisation and the repo exposes information (when the link is shared), and the user would like the ability to mask the URL by updating or renaming a workspace URL. However, this might be sufficiently different to warrant it's own issue, but that depends on the implementation. |
What if 💡 we introduced a For example, if I executed The command should warn and ask for confirmation in case there's already active usage from another workspace instance. But to allow this to be used programatically (e.g. in the It would also be nice that on restart, it automatically tried to register the previous existing entries. Insane? Maybe. Let me know 😅 Also have no idea how difficult this would be to implement 🤔 |
Stable URLs is a repeated request, either generated (your proposal), or even manually set. Two key issues with stable URLs remain:
|
@csweichel one question, can this not be done via DNS aliases. |
I was doing this via https://ngrok.com/. I had a number of domains e.g mysite1.eu.ngrok.io, mysite2.eu.ngrok.io etc setup in ngrok. My .gitpod.yml had this in it: tasks:
- init: >
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
&& unzip ngrok-stable-linux-amd64.zip
&& rm -f ./ngrok-stable-linux-amd64.zip
command: >
if [ -z "$NGROK_DOMAIN" ]; then echo "\n\nNGROK_DOMAIN is not set\n"; else gp await-port 4040 && gp preview $NGROK_DOMAIN; fi
&& printf "\n\nThis window can be closed\n"
#ngrok
- name: ngrok
command: >
while [ ! -f ./ngrok ]; do sleep 1; done
&& if [ -z "$NGROK_DOMAIN" ]; then echo "NGROK_DOMAIN is not set, skipping ngrok setup" && exit 0; fi
&& ./ngrok authtoken $NGROK_AUTH_TOKEN
&& gp await-port 8080
&& ./ngrok http -region=eu -hostname=$NGROK_DOMAIN 8080 This used to work very well - but now something has changed in gitpod and whenever I run ngrok the workspace just closes down. |
@csweichel I guess having HTTP only would solve most cases, and be a good 🛹. |
For OAuth2 Redirect Callback is necessary. tasks:
- name: cloudflared
command: |
sudo wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
sudo rm cloudflared-linux-amd64.deb
sudo cloudflared service install $CLOUDFLARED
exit |
are you able to get oauth2 callback working like this without installing something locally ? If so, would you let me know how you did it ? :) |
@jmls No, i couldn't find a way. |
Still no way to do this? Have too many webhooks and microservices that can't just be spun up with on the fly dynamic urls. |
First of all, I love gitpod, and I've been a paying customer. But, if there is one reason I will stop using it, it is this issue. To add my use-case to this issue:
|
is this still an issue or is there now some super option that permits a stable url ? :) |
GitPod has not prioritized, or even seems to care about, this fundamental flaw. I stopped subscribing a long time ago and moved on. |
Hey gitpod team,
I'm on the premium plan and using one of my workspaces for development work on a repo. I've proxied a url e.g.
dev.my-url.com
to the url of the exposed port when I'm running the site so I can preview the work on my domain url (because some services I use the api keys are tied to the url) and also I can remember it then etc.Anyway, this has been working fine, but today I opened the workspace and ran the site on the port, but it seems the workplace url has changed. Is this something that is expected? As in the same workspace may have a different url? I've not created a new workspace from the same repo or anything like that. I can reset up the proxy to the new url, but I would rather not have to keep doing this if it can be avoided. I expect to be working on this project for a few months.
Thanks 😄
The text was updated successfully, but these errors were encountered: