codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

Multiple User support and Systemd in codesandbox WIP.

Open frog-o opened this issue 2 years ago • 0 comments

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

frog-o avatar Oct 25 '23 09:10 frog-o