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

Collaboration (multi user) support #33

Open
xPaw opened this issue Mar 6, 2019 · 119 comments
Open

Collaboration (multi user) support #33

xPaw opened this issue Mar 6, 2019 · 119 comments
Labels
feature New user visible feature

Comments

@xPaw
Copy link

xPaw commented Mar 6, 2019

It's not documented whether multiple users can use one self hosted installation at once or not. Is this a supported use case?

@sr229
Copy link
Contributor

sr229 commented Mar 6, 2019

If I remember, this is a planned feature. But if this was a 1:1 code-oss port. VS Live Share could work on this.

@kylecarbs
Copy link
Member

Currently, we do not support multiple users collaboratively editing on the same code-server instance. We've thought of this and would love to hear what your thoughts are.

In our world, it'd be great to provide collaborative access, but never allow the collaborator to have control over the host machine in any way (for security reasons).

@sr229
Copy link
Contributor

sr229 commented Mar 6, 2019

I think we should do this the way how VS Live share does it - RBAC by limiting views to read-only and restricting terminal access.

@xPaw
Copy link
Author

xPaw commented Mar 6, 2019

I currently use https://github.com/c9/core for collaboration, where multiple users can log into the same server and work together.

code-server interests me as it uses VS Code so it heavily supported, unlike Cloud9. For my use case, permissions aren't really a problem.

@nhooyr
Copy link
Contributor

nhooyr commented Mar 6, 2019

@kylecarbs does vscode live share work?

@kylecarbs
Copy link
Member

I believe it would if the extension was open-sourced. Unfortunately, we can't provide support for it.

See: microsoft/vscode#38733 (comment)

@zanhk
Copy link

zanhk commented Mar 7, 2019

This is a must for a cloud ide, Without this feature I don't even see an advantage of using a cloud editor as there are few ways to share the workspace through the client: and in plus require less resources than the browser.
So definitely +1

@zanhk
Copy link

zanhk commented Mar 7, 2019

Maybe also with an interactive button in the status bar showing connected user and options to manage permissions.
This could be a really game changer

@PhilsLab
Copy link

PhilsLab commented Mar 7, 2019

I'd have a look at how MS Word Online handles it:
Word Online

I like the idea of having a different cursor for every person actively editing,
this could be implemented via WebSockets / WebRTC.

Also, when providing a login functionality, there should be a modern backend for this, not just local users.
A solution that would fit very many people would be to integrate SAML and/or OpenID authentication.

As I mentioned in #85, you could use Keycloak (which can handle both SAML and OpenID) as an IdP:
Keycloak: keycloak/keycloak
Keycloak NodeJS integration: keycloak/keycloak-nodejs-connect

@kylecarbs
Copy link
Member

kylecarbs commented Mar 8, 2019 via email

@baryla
Copy link

baryla commented Mar 8, 2019

This feature is a must for us. In terms of access, I would say that allowing the use of a terminal and editing any file/folder etc. would be enough.

My suggestions based on Cloud9 experience:

  • Allow for a shared terminal
  • See exactly where others are on a file (cursor, line highlight)
  • A way to see how many people are currently viewing the project
  • A way to see a person's active file (we usually talk about a particular file that may be nested in 10 folders)

The way Cloud9 tackled this is great and it is something I'd personally love to see implemented in code-server. We use it as our go-to IDE but after Amazon's take over, we're looking for alternatives and Coder/code-server would be it if it had collaboration/live share.

@baryla
Copy link

baryla commented Mar 8, 2019

@kylecarbs - sorry I accidentally commented and then deleted it haha. See my new comment.
Regarding how Cloud9 implemented this - I'm not sure about the self-hosted version as I haven't used it however, the way we use cloud one is this:

  1. We create a remote SSH workspace from our master account per project
  2. From the master account, we invite all devs to have access to the workspace (files/folders + terminal)
  3. Then you switch to your personal account and use the workspace shared by the master account.

I'm trying to think what malicious activity there could be if this is self-hosted? Surely if you have a secure server and you trust your devs, there is nothing to worry about? In our case, we only have 3 full-time devs so I guess the only time where there could be a concern for this is if we get a freelancer or something.

If you could share some of your concerns about this, I'd love to hear them! :)

@PhilsLab
Copy link

PhilsLab commented Mar 8, 2019

I think project selection should be done after login via a seperate page, locking each vs code session to one project to work on at a time.

@PhilsLab
Copy link

PhilsLab commented Mar 8, 2019

@baryla You could accidentially kill the server/container via the terminal, e.g. by installing packages that mess with the system, or killing the wrong process ID.
I already had some thoughts about that in #86.

@baryla
Copy link

baryla commented Mar 8, 2019

@PhilsLab - 100% agreed about the project selection. When it comes to accidentally killing the server - I guess there could be times when this happens but I don't think this is a massive concern. Well, it would be if you worked directly from a live server. Ideally you should only be working on a dev or staging server and then only push your code live so it's not a big deal (IMO).

@PhilsLab
Copy link

PhilsLab commented Mar 8, 2019

My concern is not one of trust, it's one of software security. For an optimal experience, i'd really like to see each terminal in it's own docker container, where you can select any docker image before running it. That would solve both security and the build/dev environment, and also is able to scale properly.
I'd use this as an instance on kubernetes to provide it to friends for example, where just trusting them not to screw up my server simply isn't enough :)

@nhooyr nhooyr added enhancement Some improvement that isn't a feature discussion and removed discussion labels Mar 8, 2019
@nadavpa
Copy link

nadavpa commented Mar 9, 2019

See how the jupyter team solved this: https://jupyter.org/hub

@babakness
Copy link

I believe codesandbox io has this feature as well and it is open source.

https://github.com/CompuIves/codesandbox-client

@sr229
Copy link
Contributor

sr229 commented Mar 13, 2019

Be reminded we can try VS Live Share, which is available in the official extensions gallery, I think we can pull from there and support that atm

@NGTmeaty
Copy link
Contributor

NGTmeaty commented Mar 13, 2019

I don't think it'll be "officially" supported because I don't believe there's a official way to obtain it. (But I do think it's a very good solution if you can get the .VSIX.)

@sr229
Copy link
Contributor

sr229 commented Mar 13, 2019

You can apparently

@baryla
Copy link

baryla commented Mar 14, 2019

@sr229 - have you tried it? does it actually work?

@PassTheMayo
Copy link

@baryla
image

@baryla
Copy link

baryla commented Mar 15, 2019

@PassTheMayo Great! haha. Thanks for letting me know that it doesn't work ;)

@paccerdk
Copy link

@toddewilliams I don't want to derail the subject of this issue, but it's not clear to me from what you shared, that its not legal - it does states that "You may install and use any number of copies of the software to use solely with Microsoft Visual Studio family of products."
But is this not a Microsoft Visual Studio family product?

@toddewilliams
Copy link
Contributor

But is this not a Microsoft Visual Studio family product?

Short answer: No, as it's not a product from Microsoft.

Longer answer: Microsofts lists those products in their Terms of Use for their website, which I referenced in my prior link. And they also have this handy page for documentation for the "Microsoft Visual Studio Product Family". You can see the members of the product family are both well-known and quite precisely restricted to Microsoft products.

@paccerdk
Copy link

It's pretty clear for me what the Visual Studio product family is, its just a little fuzzy for me when a product stops being Visual Studio Code (in this case, running in the browser), and starts being a "new" product that is no longer Visual Studio Code.
I'm going to go ahead and assume that you know. Thanks for the feedback.

@danopia
Copy link

danopia commented Feb 21, 2023

Further explanation can be found on the Code-Server FAQ:
https://coder.com/docs/code-server/latest/FAQ#why-cant-code-server-use-microsofts-extension-marketplace

And the link to codium includes more info:

Microsoft's releases of Visual Studio Code are licensed under this not-FLOSS license and contain telemetry/tracking.

@KaKi87
Copy link

KaKi87 commented Feb 21, 2023

Anyway, I tried it and it doesn't work, so we can forget it.

Still looking forward to code-server featuring collaboration.

@reyo
Copy link

reyo commented Feb 23, 2023

I currently use https://github.com/c9/core for collaboration, where multiple users can log into the same server and work together.

code-server interests me as it uses VS Code so it heavily supported, unlike Cloud9. For my use case, permissions aren't really a problem.

I'm in the exact same spot. Would really really like to see multi user support. Cloud9 is kinda dead, maybe, somewhat - underdeveloped and badly maintained under Amazon rule.

@matbgn
Copy link

matbgn commented Mar 14, 2023

This feature seemed to be getting a lot of traction and was really close to being solved by @rdbeach back in 2020:

I have released a beta version. Get it here: https://github.com/coderpair/vscode-live Looking for some people to try it and give me feedback.

My question is, is there any fundamental opposition from @toddewilliams or anyone else, or is it just a case of bad luck that this issue has been stalling for exactly 4 years? Yet @nhooyr seemed to show some interest at one point, if I followed correctly.

@cnicodeme
Copy link

I agree that it's surprising that this feature never saw the day of light!

@baryla, you mention this being a must for you (here). Can I ask what are you using nowadays that meet your needs? You mentioned Cloud9 on AWS but were looking to change. (We're on the same boat)

@toddewilliams
Copy link
Contributor

@matbgn I'm responding since I was specifically mentioned.

My question is, is there any fundamental opposition from @toddewilliams or anyone else

Not only don't I have any opposition to this, I'm not even in a position to have any opposition. I don't contribute to code-server and am not an employee of Coder.

I think all approaches to this issue are great! We (CodeTogether) developed our technology to enable cross-IDE collaboration between all the IDE's developers use (that are built on VS Code, Eclipse, or IntelliJ). As a result, it happens to work for code-server so I contributed to the documentation to make everyone aware that it was one solution to this issue.

My other posts simply point out that since code-server is not a Microsoft product, that it is prohibited from using Microsoft's Live Share as a solution due the the license under which Live Share is published.

So while I haven't looked at your project, I certainly applaud that you're trying to solve this issue as well and wish you nothing but success with it.

@code-asher
Copy link
Member

code-asher commented Mar 16, 2023

On the Coder end our scope has shrunk to maintaining what is already there and keeping Code up to date so adding collaboration is likely not something we would drive at the moment.

That said, as far as I know there is no fundamental opposition to collaboration. I do have some opposition to adding it directly to code-server though (rather than as an open-source extension, possibly extending the API if necessary) unless there is a compelling use-case that cannot be supported by extensions.

@KaKi87
Copy link

KaKi87 commented Mar 16, 2023

How could the authentication system be enhanced from an extension ?

@code-asher
Copy link
Member

I am not too familiar with VS Live Share but we could do authentication the same way they do, which I think is based on sending a link with a token in it. What sort of enhancements are you thinking about?

@KaKi87
Copy link

KaKi87 commented Mar 18, 2023

we could do authentication the same way they do, which I think is based on sending a link with a token in it

Would that allow using VCS, plugins, etc. ?

What sort of enhancements are you thinking about?

Well, as the title says : multi user.
Like operating systems, cloud platforms, VCS platforms, etc.

@danopia
Copy link

danopia commented Mar 19, 2023

What sort of enhancements are you thinking about?

Well, as the title says : multi user.

I think Multiuser is a separate goal from collaboration. Maybe we can clarify what is requested..

Various collaborative editors - including VSCode live share - still have each user running their own local editor. They are simply connected together with one-off tokens and I imagine that could be achievable via plugin here too. Every user would be expected to have an editor (Code-Server instance) already.

Meanwhile, multiuser I understand to be actually multi-tenant where one server would run multiple user's editors at the same time. If I understand that correctly then it's a more foundational task? But if you don't care about live collaboration, you could just run Code-Server multiple times and give each user their own instance. And then this hypothetical plugin could still be added to collaborate, once it exists

@KaKi87
Copy link

KaKi87 commented Mar 19, 2023

Actually, I meant both : live collaboration using multiple users, which would be like Google Workspace but for code instead of office documents.

Users have access to the same UI on which they log in and open files.
Collaboration is just multiple people opening the same file at the same time.

What's so great about code-server is that everything happens server-side, opening this possibility.
Meanwhile, creating a plugin that just provides link-based secondary UIs for guest users would not give any advantage over abovementioned alternatives.

@reyo
Copy link

reyo commented Mar 19, 2023

Good example of what people expect, I think, is like AWS Cloud9. We use it. It's like Google Docs but for code. Filesystem is shared between all users and I can see other colored cursors in my code while I edit. Even terminals are shared. Cloud9 base is opensource, or was, until AWS came ... they should be still available on Github. Why I'm looking at code-server and comment on this issue is that we'd like to break free from AWS :). They aren't that great company, but Cloud9 is still, the only software that does the thing that we all love in our company (true live single file collabration).

@code-asher
Copy link
Member

Ahhhhhhhhhhh right I was too focused on the collaboration part and forgot about the single instance part. Yeah some patching directly to code-server would be necessary. 😞

I agree that multi-tenant can be considered separately from collaboration. Perhaps multi-tenant can be patched directly into code-server (possibly with some new API for plugins to manage authentication) then the collaboration part could be implemented in a plugin.

@KaKi87
Copy link

KaKi87 commented Mar 20, 2023

Then what would happen when multiple users would open the same file simultaneously without using the plugin ?

@code-asher
Copy link
Member

We could just do nothing and let it work the same as if there were two separate code-server instances running. So whoever saved last would have the latest.

We could also make it so guest instances have no file access, then they have to use the plugin to edit forcing them to use it in collaboration mode.

@KaKi87
Copy link

KaKi87 commented Mar 20, 2023

What guest instances ?

@code-asher
Copy link
Member

The way I imagine the plugin working is you would create a token to give to people (through the API we would add) and those would be "guest" instances.

@code-asher
Copy link
Member

Or maybe the plugin would let you create users/logins and those would be guest instances or perhaps you would be able to specify whether they are guests just for collaboration or also have file access.

Basically what @rdbeach already did, just split up to minimize the patching. The more patching we have the more difficult it is to keep code-server up to date with upstream.

@morganwk
Copy link

Is there really no solution that doesn't rely on either Live Share, Duckly, or CodeTogether?

This feature as well as remaining FOSS and not tied to a paid service are both mission critical for me.

Would it be at all feasible to patch in something like Etherpad, even if it isn't fully featured, just for syncing the state of the text buffer across open file(s)? Just... something? Anything?

I realize the security implications there but I'm just spitballing in the hopes that a band-aid solution might be somewhat attainable even if a native feature is realistically many months or years down the line.

@toddewilliams
Copy link
Contributor

@morganwk Your comment makes me curious.

OSS and free are two different concerns. CodeTogether is not OSS, because we made a large investment in both terms of technology innovation, engineering, and server time and want to be able to pay our developers and cover our worldwide hosting costs. We do this by offering a very low-priced "freemium" solution. Our free version includes unlimited 1-hour sessions with up to 3 people. Most of our users find that the free version completely meets their needs. But if it doesn't, you can remove those limits completely for a few dollars per month.

So free is already available, but not as OSS because we have expenses to pay. And even if CodeTogether was OSS, someone would still have to provide a worldwide server network to run it at scale, so the expenses would remain.

Can you help me understand why OSS in this particular area (which you'll be using only to develop a solution, not deliver as part of a solution) is so "mission critical" for you? I really am simply trying to understand as you're not the only one who has this belief.

@morganwk
Copy link

In all honesty, it's largely because I'm broke. But there are a host of reasons. Pun intended.

The OSS aspect of things is less important - although I'll get to that later - but... the fact of the matter is that you are not in fact offering a free solution. And that's not your fault.

Imposing a limitation 3 collaborators for one hour at a time is reasonable for the service you're providing, being that you're offering them in such a way that they incur expenses that must be recovered and turn a profit in order to self-sustain.

Unfortunately, those limitations simply do not meet my needs.

Most of the time, I'll only be working with one other person at a time. But it isn't uncommon for me to need to open up a document with 5 or more people simultaneously. That capacity is non-negotiable.

And, in either case, I rarely do so for only one hour at a time. Even if the sessions are unlimited, having to exit and restart them at an hourly interval represents an absolutely intolerable interruption to my workflow - maybe I'm just overly sensitive to that because of ADHD, but as I'll say several times throughout, it's the principle of the matter.

That brings me to the money side of things.

I'm trying to cut down on subscription-based products and services. The harsh reality is that in a world that's being absolutely ravaged by price gouging and inflation, $5.25 billed monthly may sound inconsequential, but it adds up VERY quickly when combined with every other "reasonably priced"* piecemeal solution we've all steadily come to expect and rely upon.

*reasonably priced is in scare quotes here specifically because the price only becomes unreasonable when combined with many other subscriptions, even though it's far more than reasonable in isolation

Of course, given your particular offerings and infrastructure, not only is this a reasonable price, in isolation, but I would be highly unreasonable to expect you to provide the same services for completely free because you'd be operating at a loss. What I'm looking for - even if it isn't quite as feature complete or well-integrated, is a local solution that doesn't rely on someone else's servers.


The OSS nature of such a solution is mostly in relation to it not being something that exists for profit - because even the absolute cream of the crop of free closed-source software is subject to ruination at a moment's notice as a direct result of the whims of capital.

There's no guarantee that CodeTogether will exist forever. If anything, there's a guarantee that it won't simply because of the linear nature of time and the life cycle of private entities existing within the structure of capitalism - they either get bought up, get too big to fail (all things being relative), or they fail.

There also the exists the issue of OSS and extensibility - aside from the fact that you may change how your service works at any given moment without notice (assuming your TOS allows for that), there's also no guarantee I won't eventually face a situation where I need a functionality that is an uncommon use case and thus won't be considered for development, and I'll have no choice but to migrate.

That is highly unlikely, and it looks like your services are robust especially for the low price point, but it's the principle of the matter.


All that being said, if this truly doesn't currently exist in any form - which I find hard to believe, I feel like I simply must not have found it yet? - then... I sadly don't have the resources necessary to incentivize or kickstart its development. I can't expect anybody to do that for me, because I'd be expecting them to do it for free.

I'm just thinking out loud, here... what about something like y.js? true P2P collaboration - even with advanced functionality - without an intermediary server is clearly an extant possibility. What I want to know is why has nobody seemingly implemented such a solution within a text editor or IDE yet?

Obviously there must be a good answer to that question, but I can't think of one other than that it's simply not seen as a priority... which I find confusing but understandable - given that collaborative code is relatively new, I can understand why people haven't begun to see it as essential enough to develop a decentralized solution for... even though that disappoints me greatly. I'm just not sure where to go from that point, I suppose.


So.

Philosophizing aside, TL;DR: I desire a FOSS solution largely to save money; so that I can know it will actually be available to me in perpetuity, on premises, not at somebody else's expense; and so that can at least theoretically be adapted to my unusually picky needs and preferences if I were to either somehow learn how to do so myself or eventually afford the services of a developer. But of course if that truly, somehow, doesn't already exist... then it's not something I can reasonably ask of somebody to create.

I'd be highly disappointed and somewhat surprised if this kind of implementation doesn't already exist somewhere in some form, but if it doesn't... I guess I understand? Even though I don't quite get why I'd (in that case) be in the minority in placing it high in my list of priorities for a text editor.

@andrewsali
Copy link

JupyterLab has real time collaboration using y.js, it would be nice if code server supported something similar.

@toddewilliams
Copy link
Contributor

@morganwk Thank you very much! That was an expansive reply that really does show how conflicting some of these decisions and desires can be.

I've always wondered what the principle concerns are for people that hold the apparently conflicting opinions of "I want all the software I use to be FOSS" and "I'm a software developer and want to be paid for the software I write."

I'm at the phase of my software career where I have to make payroll for talented developers that remind me of my former self. So to pay them, and cover our other operating costs, we charge for some of our products. We believe it's an honest and direct financial model.

As to why there are no general OSS solutions: I'll postulate that it's because robust remote editing with multiple participants is extremely difficult to do in a correct and instantaneous manner. For a introduction of what's involved, this paper on Differential Synchronization is a great primer on the topic. Then you have to build on this to do any number of participants, from any distance, with edit transmit times will vary wildly from edit to edit, who use different IDEs or browsers, etc.

But again, I really do appreciate you thinking through this so completely. I found your written internal dialog quite fascinating as it's from a completely different perspective than my own.

I wish you the best in finding (or building) what you're looking for.

@stratosgear
Copy link

Apologies if I am oversimplifying things, but why would it be difficult to implement concurrent editing of a simple text document (or two, five, or twenty)? Google Docs is doing it. Sharelatex (now Overleaf) is doing it. In the case of source code editing, it might even be more simplified since no document formatting is required (no headings, no images, no tables, no wysiwyg elements). Actually the y.js library mentioned above seems to be solving all this (I was not aware of it, until 5 mins ago)

If the concurrent editing results in an invalid source file, let the compiler complain. All the remaining infrastructure work that has already been implemented (spinning servers up, having access to terminals, compiling, port forwards, fully onlne editors, etc) can remain the same. I mean, the majority of, what I would consider the actually hard work, are already implemented and they do not have to support multiuser access. Is it the simple editing of some text files that is really the roadblock here...? (Note, I already apologized for potentially oversimplifying things :) )

Basically, I am also thinking out loudly about a similar internal lack of understanding of something like @morganwk explained above...

@SichangHe
Copy link

SichangHe commented Aug 11, 2024

This would be nice to be built into code-server itself, without the need for a separate hosting service.

Reference: https://github.com/coderpair/vscode-live

@mictadlo
Copy link

Hi, I would like to be able to create two accounts one for my daughter and one for me. Would it be possible so we could work/learn on our own projects with proper isolation?

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

No branches or pull requests