coder / code-server

VS Code in the browser
https://coder.com
MIT License
66.47k stars 5.45k forks source link

No web acces #6860

Closed Zerbaib closed 1 week ago

Zerbaib commented 1 week ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

  1. root@vscode-srv:~# curl -fOL https://github.com/coder/code-server/releases/download/v4.90.3/code-server_4.90.3_amd64.deb
  2. root@vscode-srv:~# dpkg -i code-server_4.90.3_amd64.deb
  3. root@vscode-srv:~# useradd hugoh
  4. root@vscode-srv:~# passwd hugoh
  5. root@vscode-srv:~# chsh hugoh
  6. root@vscode-srv:~# systemctl enable --now code-server@hugoh

Expected

There is no error so idk

Actual

no change idk why

Logs

* code-server@hugoh.service - code-server
     Loaded: loaded (/lib/systemd/system/code-server@.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-06-24 12:57:28 UTC; 9min ago
   Main PID: 510 (node)
      Tasks: 22 (limit: 47714)
     Memory: 86.5M
        CPU: 828ms
     CGroup: /system.slice/system-code\x2dserver.slice/code-server@hugoh.service
             |-510 /usr/lib/code-server/lib/node /usr/lib/code-server
             `-529 /usr/lib/code-server/lib/node /usr/lib/code-server/out/node/entry

Jun 24 12:57:28 vscode-srv systemd[1]: Started code-server.
Jun 24 12:57:28 vscode-srv code-server[510]: [2024-06-24T12:57:28.753Z] info  Wrote default config file to /home/hugoh/.config/code-server/config.yaml
Jun 24 12:57:29 vscode-srv code-server[510]: [2024-06-24T12:57:29.117Z] info  code-server 4.90.3 26c763485b9101fcae2ce56fc0903f0e2d48abe3
Jun 24 12:57:29 vscode-srv code-server[510]: [2024-06-24T12:57:29.118Z] info  Using user-data-dir /home/hugoh/.local/share/code-server
Jun 24 12:57:29 vscode-srv code-server[510]: [2024-06-24T12:57:29.127Z] info  Using config file /home/hugoh/.config/code-server/config.yaml
Jun 24 12:57:29 vscode-srv code-server[510]: [2024-06-24T12:57:29.127Z] info  HTTP server listening on http://127.0.0.1:8080/
Jun 24 12:57:29 vscode-srv code-server[510]: [2024-06-24T12:57:29.127Z] info    - Authentication is enabled
Jun 24 12:57:29 vscode-srv code-server[510]: [2024-06-24T12:57:29.127Z] info      - Using password from /home/hugoh/.config/code-server/config.yaml
Jun 24 12:57:29 vscode-srv code-server[510]: [2024-06-24T12:57:29.127Z] info    - Not serving HTTPS
Jun 24 12:57:29 vscode-srv code-server[510]: [2024-06-24T12:57:29.127Z] info  Session server listening on /home/hugoh/.local/share/code-server/code-server-ipc.sock

Screenshot/Video

image image image image

Does this bug reproduce in native VS Code?

I did not test native VS Code

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

Notes

No response

benz0li commented 1 week ago

HTTP server listening on http://127.0.0.1:8080/ = code-server is not exposed to the public

Never expose web services unencrypted. It also breaks some functionality of code-server.

benz0li commented 1 week ago

Put a reverse proxy in front of your code-server/'web service' that also does TLS termination.
ℹ️ For further information, see https://coder.com/docs/code-server/guide#expose-code-server

Zerbaib commented 1 week ago

my proxy encrypt the server internet -> https -> my proxy -> http -> code-server

Zerbaib commented 1 week ago

how can i add a local cert for this ?

benz0li commented 1 week ago

my proxy encrypt the server

You do not require a local cert then.

benz0li commented 1 week ago

Where is "my proxy" located? On the same server as code-server?

If not, you must expose code-server on IP 0.0.0.0.
👉 Only do this in private networks that are not accessible directly from the internet.

Zerbaib commented 1 week ago

my proxy has local addr 192.168.0.100 my code-server addr is 192.168.0.104

in local i have this image

Zerbaib commented 1 week ago

Where is "my proxy" located? On the same server as code-server?

If not, you must expose code-server on IP 0.0.0.0. 👉 Only do this in private networks that are not accessible directly from the internet.

how ?

Zerbaib commented 1 week ago

image it's here no ?

Zerbaib commented 1 week ago

OH done ! thx you

Zerbaib commented 1 week ago

image

benz0li commented 1 week ago

❗ Do not forget to change the password (auth) – immediately.

Zerbaib commented 1 week ago

okay