coder / code-server

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

Use password in URL to login similar as in jupyter notebook servers #6734

Open benjaminum opened 3 months ago

benjaminum commented 3 months ago

Fixes #6733

This change allows passing the password in the URL to code-server to allow automatic login similar to the token in jupyter notebook servers.

We can use the following snippet to create the URL and launch code-server.

local password=$(openssl rand -hex 32)
echo http://$(hostname -f):8080/login?session_password=$password
PASSWORD=$password /path/to/code-server/bin/code-server --bind-addr 0.0.0.0:8080

Clicking on this link printed to the terminal by the above code will login the user to code-server without any interaction.

http://mycomputer.com:8080/login?session_password=fbf7cc58bbd90a9f172490f5c57201e03ca967efe424090c872b3218110f29fa