Code-server: code server keeps asking for password after giving correct password

Created on 27 Jul 2020  路  8Comments  路  Source: cdr/code-server

  • Web Browser: Chrome
  • Local OS: Windows
  • Remote OS: Ubuntu 18.04
  • Remote Architecture: AWS Cloud9
  • code-server --version: 3.4.1

If I give incorrect password it logs that I have attmpted with incorrect password.

When I give correct password then page refreshes and shows password field again. No log for incorrect password. But doesn't go pass the password screen.

All 8 comments

Issue Resolved

just use code-server --auth none

However AWS Cloud 9 only has 1 port available for running application. Port 8080. So if you are running code-server then you cannot hot reload react app for example. So you need to shut down code-server and only run npm start. So this defeats purpose of hot reloading.

I'm not sure why the login wasn't working but for the port something you could try is code-server's proxy. More information here: https://github.com/cdr/code-server/blob/master/doc/FAQ.md#how-do-i-securely-access-web-services

You could also put a reverse proxy on 8080 and then use either sub-domains or ports to proxy to code-server and your app.

If I put it on wrong port then I shouldn't be able to see the screen to input password. It has nothing to do with port or proxy. When I put invalid password it actually logs that I put invalid password. That means port is correct. But when I add valid password then it just refreshes and continues to show password screen.

Also I was afraid that this domain is public and by using --auth none anyone who knows my IP address or domain can just come and mess with my editor. But Cloud 9 Editor creates some sort of VPC by default. So I was not able to access same domain/IP address from incognito window.

My bad, I didn't mean to imply the port or proxy was causing the password issues. I was only referring to how you have to shut down code-server and run npm start. With code-server's built-in proxy (or any proxy) you wouldn't need to do that.

I haven't been able to replicate the password issue but it sounds like the cookie isn't being set properly. If you check the domain and path of the cookie it might reveal the problem. It's possible no cookie is being set as well. code-server uses the value of the host header to set the cookie's domain, so maybe it's getting sent something that doesn't match the domain?

Good I got your attention. I wanted to ask you something.
How do you feel about arm development server?
AWS promises 40% more performance for arm server than same category x86 server. And AWS will charge 20% less price for arm server than same category x86 server. Luckily code-server does support arm64 version for linux. However I also use Jupyterlab IDE for machine learning. That doesn't support arm architecture. The arm support in general for other packages is minimal and not widely available.

I failed to run code-server directly on EC2 because apparently I need to learn Nginx for connecting to public IP. I just bought the course on Nginx and will try to figure it out. So I am running 3 different server and experiment

  1. Cloud 9 IDE with code-server
  2. x86 EC2 + code-server (no cloud 9)
  3. arm64 EC2 + code-server (no cloud 9)

I think arm is great but I don't have any experience using it as a development server.

You might want to check out Caddy, it can be easier to set up than NGINX and has more features (like automatic Let's Encrypt certificates).

I :heart: golang. I also knew about Caddy. I can't believe I didn't put 2 and 2 together. I think because I do exclusive serverless development. So I just ignore anything that is not serverless.
Thanks :pray: for confirming that I can use Caddy with code-server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lshamis picture lshamis  路  3Comments

grant picture grant  路  3Comments

pchecinski picture pchecinski  路  3Comments

sa7mon picture sa7mon  路  3Comments

Arsaev picture Arsaev  路  3Comments