code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Collaboration (multi user) support

Open xPaw opened this issue 6 years ago • 123 comments

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

xPaw avatar Mar 06 '19 11:03 xPaw

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.

sr229 avatar Mar 06 '19 14:03 sr229

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).

kylecarbs avatar Mar 06 '19 15:03 kylecarbs

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.

sr229 avatar Mar 06 '19 15:03 sr229

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.

xPaw avatar Mar 06 '19 15:03 xPaw

@kylecarbs does vscode live share work?

nhooyr avatar Mar 06 '19 17:03 nhooyr

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

See: https://github.com/Microsoft/vscode/issues/38733#issuecomment-388213016

kylecarbs avatar Mar 06 '19 17:03 kylecarbs

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 avatar Mar 07 '19 08:03 zanhk

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

zanhk avatar Mar 07 '19 13:03 zanhk

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

PhilsLab avatar Mar 07 '19 19:03 PhilsLab

How have they implemented it? Optimally it wouldn’t allow for full-access (to prevent malicious activity). On Thu, Mar 7, 2019 at 9:52 PM Adrian Barylski [email protected] wrote:

This feature is a must for us. My suggestions based on Cloud9 experience:

  • Allow for a shared terminal

The way Cloud9 tackled this is great and it is something I'd personally love to see implemented in code-server.

The collaboration feature is super important for us. We use Cloud9 as our go-to IDE but after Amazon's take over, we're looking for alternatives.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/codercom/code-server/issues/33#issuecomment-470814225, or mute the thread https://github.com/notifications/unsubscribe-auth/AGysxLSMbqLxhV0ardGWbNZPQbEdFiYEks5vUfqDgaJpZM4bgsjG .

kylecarbs avatar Mar 08 '19 05:03 kylecarbs

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 avatar Mar 08 '19 06:03 baryla

@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! :)

baryla avatar Mar 08 '19 06:03 baryla

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 avatar Mar 08 '19 06:03 PhilsLab

@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.

PhilsLab avatar Mar 08 '19 06:03 PhilsLab

@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).

baryla avatar Mar 08 '19 06:03 baryla

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 :)

PhilsLab avatar Mar 08 '19 06:03 PhilsLab

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

nadavpa avatar Mar 09 '19 21:03 nadavpa

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

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

babakness avatar Mar 12 '19 23:03 babakness

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

sr229 avatar Mar 13 '19 00:03 sr229

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.)

NGTmeaty avatar Mar 13 '19 00:03 NGTmeaty

You can apparently

sr229 avatar Mar 13 '19 00:03 sr229

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

baryla avatar Mar 14 '19 13:03 baryla

@baryla image

PassTheMayo avatar Mar 15 '19 04:03 PassTheMayo

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

baryla avatar Mar 15 '19 12:03 baryla

The user interface may look like this:

Code-server1 Code-server2 Code-server3

zanhk avatar Mar 22 '19 13:03 zanhk

I've installed VS Live Share via the following Dockerfile commands:

RUN curl -JL https://marketplace.visualstudio.com/_apis/public/gallery/publishers/MS-vsliveshare/vsextensions/vsliveshare/0.3.1326/vspackage | bsdtar -xvf - extension
RUN mv extension /root/.code-server/extensions/ms-vsliveshare.vsliveshare-0.3.1326

But I got the following error when starting a session:

Error: command 'liveshare.joinFromActivityBar' not found

I've also added the command to install the required dependencies:

RUN wget -O ~/vsls-reqs https://aka.ms/vsls-linux-prereq-script && chmod +x ~/vsls-reqs && ~/vsls-reqs

But still got the following error:

Visual Studio Live Share was unable to download needed dependencies to finish installation. Ensure you have network connectivity and restart VS Code to retry.

stepri avatar Mar 26 '19 09:03 stepri

So I got vscode liveshare to work but there are a few caveats, you need to install normal vscode and x11 and vnc and you install the extension via vscode and you open vscode once, you symlink the extensions. It then works like supposed to via code server. I tried a few things without vnc like installing all the required packages it doesn’t seem to work. I have an ansible repo that sets up code server in this way: https://github.com/devonlineco/ansible-roles

andreimc avatar Mar 31 '19 10:03 andreimc

I came here looking for information on multiple users sharing one code-server server, not for collaboration, but for each user to work on their own projects with proper isolation... I don't want to run a code-server per user with random ports.

Is there a feature/issue for this use-case?

AnthonyMastrean avatar Jun 14 '19 15:06 AnthonyMastrean

This falls under collaboration feature as well so you already came to the right issue. However, for the isolation part - I don't think this is a possibility considering we only support use cases to run docker containers interactively @AnthonyMastrean

sr229 avatar Jun 16 '19 01:06 sr229

@sr229 All I need to do to make the Docker container into a service is add -d and a restart policy! But, I understand what you're saying. Is there anything under the Enterprise offering that might address this use-case?

AnthonyMastrean avatar Jun 16 '19 15:06 AnthonyMastrean