Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(vscode-web): use VS Code code CLI instead of VS Code code-server #411

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
wants to merge 16 commits into from

Conversation

Ricky-Hao
Copy link

Hi,
The current VSCode Web module directly uses code-server to start a VSCode Web instance.
However, I noticed that the current VSCode Web only stores user credentials (e.g., GitHub authentication) in in-memory storage.

After investigating the VSCode source code, I discovered that VSCode Web requires a key from the /mint-key endpoint.
In Coder's code-server, the /mint-key endpoint is implemented.
However, in the official VSCode version, the /mint-key functionality is only available in the VSCode CLI (code binary).

To enable credential persistence, we need to use code serve-web to start a VSCode Web instance instead of the current code-server serve-local.

In this PR, I updated the process to use code serve-web to start a VSCode Web instance.
Most of the features from the old code-server are supported, except for the following two:

  • OFFLINE
  • USE_CACHE

I did not remove these variables from the .tf files to maintain compatibility.

@bcpeinhardt
Copy link
Collaborator

@matifali this would be a good opportunity to use the new individual version tag structure when releasing.

@matifali
Copy link
Member

matifali commented Feb 26, 2025

Yes, if this lands, it should go as 2.0.0 for vscode-web. @bcpeinhardt can you take care of this?

@matifali matifali changed the title Use VSCode Code CLI instead of VSCode code-server to run VSCode Web feat(vscode-web): use VS Code code CLI instead of VS Code code-server Apr 16, 2025
@matifali
Copy link
Member

Hi @Ricky-Hao, Sorry for not coming to this earlier. We were sorting versions for the modules, and as this module changes stuff significantly while Aldo breaks a few existing =g use cases, We needed that to land this in.

Can you update the README.md to reflect the changes? Specifically the ones which are o more supported.

@matifali
Copy link
Member

I would also like @michaelbrewer to review as he has contributed to this module in past.

@matifali
Copy link
Member

Most of the features from the old code-server are supported, except for the following two:

  • OFFLINE
  • USE_CACHE

I did not remove these variables from the .tf files to maintain compatibility.

Hi @Ricky-Hao, why can we not support these two features with VS Code's code serve-web CLI?

@Ricky-Hao
Copy link
Author

Ricky-Hao commented Apr 22, 2025

Hi @Ricky-Hao, why can we not support these two features with VS Code's code serve-web CLI?

Hi @matifali, sorry for the delayed response.
Since I’m not using these two features in my workspace, I’m not sure what they are supposed to do.

@matifali
Copy link
Member

I think the difference here is that code serve-web also manages downloading the code-server binary, and we do not know if we can make it use an existing binary. IF we can somehow instruct it to use an already downloaded code-server binary, it should work with OFFLINE and USE_CACHED modes.

@matifali
Copy link
Member

matifali commented May 9, 2025

We are moving to https://github.com/coder/regitsry. Please move your PR there. Thanks
More context in #469

@matifali matifali closed this May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants