coder icon indicating copy to clipboard operation
coder copied to clipboard

Feature: Sharable ports

Open mtojek opened this issue 1 year ago • 10 comments

Problem

Customers want to be able to expose arbitrary ports to other users at different levels of permissions for how those ports can be shared. 2-3 major customers are already making workarounds for this missing feature, so we should build something first class to fit this need.

RFC

https://www.notion.so/coderhq/Shareable-Ports-4140e809958c457ba99f53b3e9ae1673?pvs=4

Related

  • https://github.com/coder/coder/issues/11201
  • https://github.com/coder/coder/issues/10909
  • ~~https://github.com/coder/coder/issues/8189~~ :: This is a coder config issue
  • https://github.com/coder/coder/issues/8220
  • https://github.com/coder/coder/issues/10266
  • https://github.com/coder/coder/issues/10908

Action Items

Required

  • [x] https://github.com/coder/coder/issues/11845
  • [x] https://github.com/coder/coder/issues/11846
  • [x] https://github.com/coder/coder/issues/11847
  • [x] https://github.com/coder/coder/issues/11849
  • [x] https://github.com/coder/coder/issues/11850
  • [x] https://github.com/coder/coder/issues/11851
  • [x] https://github.com/coder/coder/issues/11853
  • [x] https://github.com/coder/coder/issues/11854
  • [x] https://github.com/coder/coder/issues/11858
  • [x] https://github.com/coder/coder/issues/12232
  • [x] https://github.com/coder/coder/issues/12454
  • [x] https://github.com/coder/coder/issues/12832
  • [ ] https://github.com/coder/coder/issues/13058
  • [ ] https://github.com/coder/coder/issues/13070

Reach

  • [ ] https://github.com/coder/coder/issues/11855
  • [ ] https://github.com/coder/coder/issues/11856
  • [ ] https://github.com/coder/coder/issues/11857
  • [x] #12651
  • [x] #12722

mtojek avatar Jan 08 '24 12:01 mtojek

adding this issue: https://github.com/coder/coder/issues/12232

ericpaulsen avatar Feb 20 '24 18:02 ericpaulsen

Minor bug: I can specify port 0 ;p

image

"Application port 1 is not permitted. Coder reserves ports less than 9 for internal use." is our error.

kylecarbs avatar Feb 20 '24 19:02 kylecarbs

It's not exactly clear to me why "Public" is greyed out here:

image

kylecarbs avatar Feb 20 '24 19:02 kylecarbs

https://github.com/coder/coder/issues/12232 will be a requirement for this to make GA.

stirby avatar Feb 27 '24 19:02 stirby

@kylecarbs the feature allows admins to restrict the maximum sharing level of ports in the template settings. If you're on our dev template the maximum sharing level is Authenticated.

We could add a tooltip if this is unclear.

stirby avatar Feb 27 '24 20:02 stirby

Yup I was thinking a tooltip will fix that nicely

f0ssel avatar Mar 04 '24 16:03 f0ssel

@kylecarbs the feature allows admins to restrict the maximum sharing level of ports in the template settings. If you're on our dev template the maximum sharing level is Authenticated.

Instead of the tooltip, we can also remove it from the dropdown if not allowed at the template level.

matifali avatar Mar 18 '24 22:03 matifali

I added two items to the checklist since we're still in experimental. I think there are some other dependencies too related to listening ports. Can you add those in so we have a good sense of what is blocking us from making this GA?

Screenshot 2024-04-23 at 9 44 16 AM

@f0ssel @stirby

bpmct avatar Apr 23 '24 14:04 bpmct

Added https://github.com/coder/coder/issues/12832 since these are intertwined from a UX perspective.

stirby avatar Apr 23 '24 21:04 stirby

@bpmct the list is complete. Added docs and GA issues.

stirby avatar Apr 24 '24 20:04 stirby

@kylecarbs the feature allows admins to restrict the maximum sharing level of ports in the template settings. If you're on our dev template the maximum sharing level is Authenticated.

We could add a tooltip if this is unclear.

@stirby What do you mean by "If you're on our dev template"?

I'm on an OSS deployment, upgraded from v2.10.2 to v2.11.0 today, and am seeing the same thing as @kylecarbs: "public" option is greyed out.

In the workspace settings, the "Public" option is pre-selected and unmodifiable, as expected.

The documentation on port forwarding says:

OSS deployments allow all workspaces to share ports at both the authenticated and public levels.

I can't seem to find a way to enable public port sharing via the port helper.

pauliuspetk avatar May 08 '24 18:05 pauliuspetk

I'd also like to suggest a simplification of the port sharing helper UI. I believe it's currently more confusing than it could be.

From the docs: annotatedports

I'd suggest merging the detected ports section into the shared ports section, by simply pre-populating the shared ports section with the detected ports, and with the sharing level set to "Owner" by default, and the protocol set to HTTP by default, as that is essentially what happens when clicking on a detected port anyway.

This solves a few UX issues:

  • it's not obvious that the detected ports are clickable;
  • if you click on a detected port, it always uses HTTP, and you have to type in the port, select HTTPS, and click on the small icon should you want to override that;
  • the "new window" icon itself is not immediately noticeable and not clear as to what it does, and there is no tooltip;
  • for the above reason, the Share button next to the first detected port can be construed as "share the port I just typed in above"

If you just automatically add the detected ports to the shared ports with "HTTP" and "Owner" settings as defaults, and perhaps with some indication/separation on which ones were autodetected, the entire "Listening Ports" section could just go away.

I'd also suggest adding "new window" icon next to the port numbers in the list, to make it more obvious that they are clickable.

Here's a rough mockup of how all this could look like, for inspiration: image

pauliuspetk avatar May 08 '24 19:05 pauliuspetk

@coder/ts @coder/pms some good feedback here ⬆️

matifali avatar May 09 '24 05:05 matifali

@matifali do you think we should open a ticket for redesigning this UI? I think having a ticket can give us time to try different alternatives and solutions based on user feedback and the opportunity to think about it more deeply.

BrunoQuaresma avatar May 09 '24 13:05 BrunoQuaresma

@matifali @BrunoQuaresma We considered a design quite similar to this is one in the past and I like the consolidation. I'd like to review the mockups before we make a decision.

stirby avatar May 09 '24 14:05 stirby

@stirby Sure, I think the first decision we have to make is if we want to spend some time working on the design before jumping into a fix/improvement. If yes, which I think we all agree, the person who creates the designs can share them with the team, including you and other PMs, to collect feedback and get approval. Wdyt?

BrunoQuaresma avatar May 09 '24 17:05 BrunoQuaresma

Sounds good, moved to new issue.

stirby avatar May 09 '24 17:05 stirby

Awesome! Looking forward to it.

@stirby could you please elaborate on https://github.com/coder/coder/issues/11486#issuecomment-2101178378 ?

The observed behavior doesn't currently match what's stated in the docs...

pauliuspetk avatar May 10 '24 00:05 pauliuspetk

Hey @pauliuspetk I can look into this behavior and get back to you, I think I understand from your description but want to investigate and see what is going on here to create this mismatch. Thanks for bringing this up.

f0ssel avatar May 13 '24 14:05 f0ssel

@stirby a question about releases. When a feature is made GA in a release, which has a bug that is later fixed in main. Is it expected to backport the fix and patch the release?

For example, coder/coder#13259 fixes the port sharing level, which was made GA in v2.11.0, but it still needs to be released as a patch.

matifali avatar May 27 '24 06:05 matifali

Ran into that bug as well.

julianpoy avatar Jun 03 '24 01:06 julianpoy