vscode-coder icon indicating copy to clipboard operation
vscode-coder copied to clipboard

feat: set `serverInstallPath` for the `<host>` automatically to the workspace dir

Open michaelbrewer opened this issue 1 year ago • 11 comments
trafficstars

In some cases the $HOME dir is ephemeral, so when a workspace is restarted the ~/.vscode-server folder is lost and all of the extensions have to be installed from scratch.

But adding an entry to the settings.json to persistence volume would cache the installled extensions between restarts.

"remote.SSH.serverInstallPath": {
    "<host>": "/workspace/"
}

michaelbrewer avatar Apr 25 '24 02:04 michaelbrewer

How do you think it'd be best to address this?

Maybe we make a module that automatically writes this to the settings file?

kylecarbs avatar Apr 25 '24 12:04 kylecarbs

Currently the user will have to figure out what the correct value for <host> and the also know the directory of the persistence volume for that workspace you are connecting to.

Coder workspace would know both things.

michaelbrewer avatar Apr 26 '24 17:04 michaelbrewer

We don't technically know the persistence, so I think a module that ensures settings exist with specific values would be best for this.

Would that work @michaelbrewer?

cc @matifali the module maker!

kylecarbs avatar Apr 30 '24 01:04 kylecarbs

Yes, persistence isn't easy to know, and if we expose this path as a module input and use it to set the remote.SSH.serverInstallPath, it will probably override user settings. Most users prefer VS Code Web over code-server because of the settings sync. So, overwriting settings isn't a good idea. Let's wait for more opinions.

matifali avatar Apr 30 '24 14:04 matifali

True. Right now I am documenting workarounds for users.

I might need to create symlinks from the home directory to the persistence volume used by my workspaces.

michaelbrewer avatar Apr 30 '24 15:04 michaelbrewer

A symlink of ~/.vscode-server would actually probably do the trick.

kylecarbs avatar Apr 30 '24 15:04 kylecarbs

@kylecarbs sadly vscode wipes out any symlinks :( and linux does not allow hardlinks for directories.

michaelbrewer avatar May 01 '24 17:05 michaelbrewer

@michaelbrewer we might have to make an exception for this... I agree it's a valuable option and weird for us to not support.

kylecarbs avatar May 01 '24 17:05 kylecarbs