-
Notifications
You must be signed in to change notification settings - Fork 881
feat: show listening ports in port forward popup #4389
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
not merge blocking: If a workspace had a PostgreSQL server always running in the background, would it always display here despite there being no web interface? Wondering if there might be a reason a template might want to hide ports/processes in the dropdown OR a check if something is a web app. |
Also, I assume this omits ports from the |
Yes, all TCP ports
We should do this in a follow up.
No it doesn't but we probably could. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge fan of mentioning the service here. However, I find it quite odd that my workspace's code-server shows up here as node
:
Screen.Recording.2022-10-06.at.5.43.11.PM.mov
I don't think we should expose this to users until we deduplicate ports from coder_app
. If we want to keep this PR frontend-only, perhaps we can conditionally show the component based on CODER_EXPERIMENTAL
and fix via a later PR?
The other things I can think of aren't blocking but worth creating issues for:
- non-web-based ports (e.g. postgres) probably shouldn't show up here. if we don't want to add health checks, perhaps we add an option to disable ports via the template?
- We have some v1 users using self-signed https schemas which are rewritten. How would this be handled?
This is mentioned in the PR description. It's because code-server runs inside of node and right now we only log the name of the process executable. I think if we filter out apps then this doesn't become that big of a problem.
I will add some code server-side to filter out ports that already have apps. It should be very easy.
Sounds good to me for a follow-up. We could also have a list of ports that we filter out hardcoded, including common database ports and other common TCP protocols like SSH, FTP that have distinct port numbers. I'll do that in this PR to mitigate the issue for now.
Users can make an app instead. We only support HTTP via explicit port app URLs. |
@bpmct I have added backend code to filter out any ports in use by apps from the response, as well as common non-HTTP ports (like SSH, FTP, postgres etc.) as well as tests that this filtering works. You can see the list of filtered ports in |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend looks good
Adds a list of listening ports to the port forward popup in the UI. Uses the endpoint added in #4260
There is intentionally no loading spinner while loading the list of ports as I think it's not necessary (and on unsupported platforms this endpoint will always return an empty list, so you'd be showing a loading spinner that never does anything).
The process name is just the name of the binary. Unfortunately for node.js or python apps this will most likely be
node
orpython3
, but there's not much we can do about that without massively complicating the code.This is only supported on
linux_*
andwindows_amd64
. Darwin is entirely unsupported at the moment but we can look into adding it in the future.