codesandbox / codesandbox/codesandbox-client

Multiple User support and Systemd in codesandbox WIP.

Open
#8,149 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

🌈 Multiple User support and Systemd in Codesandbox

What is this feature? -->

If nothing else I want to keep people informed on my attempt to make this feature. I really should not be doing this it is way over my head so don't anyone get existed but it might make an interesting read. I can only hope it will be of help to someone more qualified.

My first attempt was to try to build an Image with systemd enable. For the reason why I wrote a doc here

I spent a lot of time looking for info on how all this is done. As you can see from my doc I spent a lot of time on that.
I think I was successful ( I thought I saw systemd with pid 0 but after a long time play with It, I am now , not sure) until they added the --entry = /sbin/zsh in the start command(I don't know how I would have been able to run systemd other wise). I spent a bit of time trying to override that flag in my devcontainer.json file. They have a build.buildarg setting in there but After play with it for A while I discover it does not do much. I could not put any thing by string to override What in my Dockerfile. Reading the doc a little more closely it more less told me that that what it was for. There might be hackish way to override the build file but I really don't what to do this if I going to get my changes pulled in.
I also discovered that their terminal Runs under a user called pitcher(or something like that) even though the whoamI returns root. Until I discover that I was wondering why "echo git config user.name" in my dockerfile was returning nothing. After reading there codesandbox doc I found that the terminal run as the pitcher user because it purpose is to be share among users. This makes sense but complicates things. I was able to build an image but as of now I can't git it to run systemd. To clear my head I diced to work on the next task create a home directory for all users. In order to get this list of users thought I would just look at the project directory with ls /project/home/. While this works on the preinit commands in my devcontainer.json I found out the project directory is not mounted and failed in my dockerfile after o tried to use the copy command. It looks like I going to have to figure out how mounts and volume are done sadly there no example or documentation about this that I could find that doesn't target vscode which I can't get on my tablet.

After spend over two week on working on This feature so far. I was laid off for the first two weeks. Unfortunately( or fortunately). I went back to work since, so I probably won't have much time to work on this. I also had troubles with cashing codesandbox which I think CompuIves fixed I am very grateful to him.

Please let me now what you guys think I am not putting much effort on cleaning this issue wording up because I think it is mostly unread.

How the feature should work? -->

You have examples or an idea how it can be implemented? -->

I start to work on it on my branch here right now it just a devloper container that boot systemd. It just the things in .devloper dir
more will come if interested. I planing to mount the /home/(your git user name) in the /project dir of codesandbox to your home director in the container.
My plan is to have it launch the web interface from cockpit . This Would only happen once per user per-project. It would allow you to choose what shell you want to boot into zsh, fish , bash or other set the command prompt (prompt,passwd) etc it be running as root your docker image.

Right now I work on this for my self but I thought it might be useful to you please let me know your thought. Would you prefer a different gui then cockpit if so why ? Is my base image I using ok etc? Do you guys have better ideas

I just done a quick bing search on best linux config and I came across cockpit I don't want to do a lot of looking so i going with that for now.

PLEASE ALSO NOTE I am not an offical developer but still like to here everyones thought on what they would like. I am surprised no one ask for this at least from what I could find.

Please also note I put these 2 feauter under one becuase they seem to be tied together it was brought about on my work for FNM support.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked draft branch and its .devloper directory, then inspect devcontainer.json and the Dockerfile around systemd, user setup, and project mounts. The issue proposes per-user home directories, systemd, and a Cockpit interface, but has no defined acceptance criteria; scope and a concrete definition of done would need to be agreed first.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, dockerfile, shell
Domain
devops, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.