Skip to content

How do you get a website to auto deploy the code server? #467

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

Closed
crazytaj opened this issue Apr 9, 2019 · 22 comments
Closed

How do you get a website to auto deploy the code server? #467

crazytaj opened this issue Apr 9, 2019 · 22 comments
Labels
waiting-for-info Waiting for more information from submitter

Comments

@crazytaj
Copy link

crazytaj commented Apr 9, 2019

I was wondering if there was some way to basically do what you guys did on coder.com. I want to be able to use the same password every time, and start it from a website. I do not really know how to do this, but I have root access to a Ubuntu 16.04 VPS so any help would be really cool.

@sr229
Copy link
Contributor

sr229 commented Apr 9, 2019

Hey @crazytaj, you can self host! We provided examples written in docs/, you just need to expose it to the internet.

We provide two ways to host your instance: Docker or manual install.

@navin-moorthy
Copy link

@crazytaj You can write a Unit File in Systemd service for the code server to start and restart even after a VPS restart.

Part 1

[Unit]
Description=Code Server AutoStart
After=http://network.target 

[Service]
Type=simple
User=$USER
WorkingDirectory=/path/to/start/your/working/directory/inside/vscode
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Restart=on-failure

ExecStart=/path/to/codeserver/binary --allow-http --password=xxxxxxx

[Install]
WantedBy=http://multi-user.target 

Then run the below commands

sudo systemctl daemon-reload
sudo systemctl start code-server.service
sudo systemctl enable code-server.service

This will start your code-server at the port 8443 and test this by directly going to your IP:8443 in the browser and the password you mentioned above will be the same untill you edit your Unit File.

Learn more about systemctl


Part 2

Do the Prerequisites Part and Step 4 in the below link to proxy your port 8443 to your own domain using nginx.

Digital Ocean Tutorial

@crazytaj
Copy link
Author

crazytaj commented Apr 9, 2019

I tried starting the code server, but I got a JSON error. It says unexpected end of file in some bootstrap directory. I can paste it in here if you want.

@haoteng10
Copy link

@crazytaj Just ignore the JSON error.

@crazytaj
Copy link
Author

I cant because it causes the page to not load and fail

@navin-moorthy
Copy link

@crazytaj Did you try the docker file.?

@crazytaj
Copy link
Author

I dont have docker installed, it is a vps with 1 gb of ram

@MichaelDesantis
Copy link
Contributor

I think if you use the docker file and increase the RAM to 2gb things should work just fine.

@crazytaj
Copy link
Author

I dont have enough for a 2gb vps, thats all I have. But I dont think that is the issue. The error it gives when I try to connect is about an unexpected end to a JSON file and was left hanging. If you need me to I can record me trying to install it.

@sr229
Copy link
Contributor

sr229 commented Apr 11, 2019

the JSON error is minor, and we’re figuring out how to run code-server in Raspberry Pi Zero

@crazytaj
Copy link
Author

Alright. Is there a way to get it to run successfully, or is it just a wait until it is fixed kind of deal?

@sr229
Copy link
Contributor

sr229 commented Apr 11, 2019

Feel free to check it out at #140 for progress.

@coadler
Copy link
Contributor

coadler commented Apr 11, 2019

You could always add swap. Works well for me on a 600mb VM

@crazytaj
Copy link
Author

what is swap?

@crazytaj
Copy link
Author

never mind, it is just 'RAM' on the HD. Do you think more ram is needed for it to run? I thought I had successfully run it before but after I setup my web server, it isn't running. I tried doing it on a clean install of Ubuntu 16.04 but it didn't work either.

@crazytaj
Copy link
Author

crazytaj commented Apr 12, 2019

here is a video of the problem if it helps:
https://www.youtube.com/watch?v=3jMiHl0Pqjc
ignore the background sounds. I was in class

@crytos
Copy link

crytos commented Apr 14, 2019

Are you running the server behind nginx as a reverse proxy?

@crazytaj
Copy link
Author

no, my server is running apache. I just moved into that folder for the editing part.

@code-asher
Copy link
Member

@crazytaj Have you had a chance to try out v2? It might solve the problem. It's also possible Apache needs to be configured according to this: https://github.com/cdr/code-server/blob/master/doc/quickstart.md#apache-reverse-proxy

@code-asher code-asher added the waiting-for-info Waiting for more information from submitter label Oct 29, 2019
@crazytaj
Copy link
Author

I haven't gotten a chance to check out v2 yet. Kinda got demoralized after my failed attempt at customizing the server. Might pick it up again.

@sr229
Copy link
Contributor

sr229 commented Nov 18, 2019

Requesting further information. Failure to reply means it was fixed in your end and I'll close this automatically after 3 days.

@nhooyr
Copy link
Contributor

nhooyr commented Jan 29, 2020

If this is still a problem, please feel free to reopen.

@nhooyr nhooyr closed this as completed Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-info Waiting for more information from submitter
Projects
None yet
Development

No branches or pull requests

9 participants