-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Deploy the code server to a public IP #1928
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
Comments
There's no collaboration yet. We'll update #33 when that changes. code-server has a heartbeat file that tells you whether it's in use ( |
I found the file heartbeat in both the local device and the code-server, so which one should I believe or they are same? |
Use the one that's on the same machine code-server is running on. You might have a local one if you ran code-server locally once, maybe? The heartbeat file doesn't have any content, we just update the modified timestamp. We update it every minute so if the timestamp is more than a minute ago it means code-server is currently inactive. |
I got it. |
Sorry, I still have a little question. |
I tried out the latest Docker image but mine seems to be updating. Here's what I got:
The modification time was 22:32 then a minute later it was 22:33. Are you using a custom data directory with |
No matter how I set the parameter
At last, I want to know in which time zone is this timestamp? |
Hmm, we use a one-minute timer but it might be possible for that to be delayed depending on external factors. It might be safest to check if the heartbeat file was modified in the last five minutes or so. One thing you could test is running code-server with We don't actually specifically set the date; we just write a blank file. So it should just be using the system's timezone. You can find that out with |
I would add that until you actually connect after starting code-server the heartbeat will not be updating. On our systems we use a php-apache contained with code-server running in it (for student web development environments, so each student gets their own independent web server!) and terminate containers only after being idle for more than an hour or so (cron job external to docker container). Only the master node of our docker swarm needs to do this, looking at the users 'home' data, no matter how many nodes are in our swarm. We also have a command (some script that does idle check actually) that reports idleness of current users..
from that I can see three users are 'idle' and will have the container shutdown shortly. |
Thanks for sharing, that's a cool setup.
Ahhhh right that explains a lot. Would it be advantageous to touch that file once on startup? |
It would make no difference to code-server if you touched it or not. As part of our idle check we also check another file that gets updated when a user issues a remote control for the docker container (to start, or check what their docker environments password is). That way the idle check knows the docker was only just started (and not idle), even if it had not been logged into via web browser, (leaving heartbeat as it was from last session) |
This is pretty awesome! Would you have any interest in doing a blog post, video, or tutorial about this? |
Not at this time
…On Wed, Sep 9, 2020 at 4:24 AM Ben Potter ***@***.***> wrote:
I would add that until you actually connect after starting code-server the
heartbeat will not be updating.
While it updates once a minute or so, you should only terminate (or
whatever) code-server when it has not updated for some time.
On our systems we use a php-apache contained with code-server running in
it (for student web development environments, so each student gets their
own independent web server!) and terminate containers only after being idle
for more than an hour or so (cron job external to docker container). Only
the master node of our docker swarm needs to do this, looking at the users
'home' data, no matter how many nodes are in our swarm.
We also have a command (some script that does idle check actually) that
reports idleness of current users..
Example output from script...
Name Idle Image Node
s2836331 55 secs web-dev elf
s2845086 51 secs web-dev elf
s2875623 53:17 web-dev elf
s2884991 40:38 web-dev elf
s2894337 56:13 web-dev elf1
s2896564 27 secs web-dev elf1
s2911385 21 secs web-dev elf
from that I can see three users are 'idle' and will have the container
shutdown shortly.
This is pretty awesome! Would you have any interest in doing a blog post /
tutorial about this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1928 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJIRQCRLGWYHTF6LNRKAOTSEZZEZANCNFSM4PMUDTSA>
.
|
As of the issue of not being able to access it from the internet without having to use ssh try setting up ngrok
|
As a FYI we are currently working on a web interface, our users sign into that will then let them control their development environment (EG: start, stop, or select a different software setup). This connects to a backend system that has the docker access, to actually do the requested tasks for the user. |
Update... a summery of the new web control panel, authenticated used (in this case me) can use to select a docker environment, start it, copy the password, and jump to the code-server login screen. The next step would be to somehow do away with the need to copy the password to code server, either though a link argument, or retrieving and setting the users 'session token cookie' seeing as we have already authenticated them. The next step would be to somehow do away with the need to copy the password to code server, either though a link argument, or retrieving and setting the users 'session token cookie' seeing as we have already authenticated them. |
If I deploy the code server to a public IP, then everyone can use it.
So how do I know if someone is using it or not?
And I want to know whether code-server supports multiple collaborative coding now?
The text was updated successfully, but these errors were encountered: