[vscode-server-web] Enable storing user state/settings in remote instead of in IndexedDB #210775
Labels
feature-request
Request for new features or functionality
*out-of-scope
Posted issue is not in scope of VS Code
Milestone
tl;dr: I need a default
User/settings.json
on the remote, as not all clients connecting to the code-server have nonvolatile storage for that file.Settings Sync is not an option due to many limitations, and by the time I could enable Settings Sync, it's already too late, the remote code-server state gets completely destroyed by the connecting client.
Actually, an entire global remote profile or so would be better, so I could close my session on one device, then continue where I left off on the other. This is actually what I really need, but it feels like that's not possible (yet?), considering my limited experience with code-server.
I'm running a (VS)Code-server-web on my main computer, so I can use VSCode on devices where installing VSCode is not possible (Windows thin client, Android thin client, non-Linux device with web browser. etc.), or from some other device if I'm bed-bound due to health reasons.
My very big problem, is that if I join from a device (always only one session is open!), then it will have default config. And the default config is bad. It auto-updates important extensions, so I have to disable extension auto-update, then crawl out of bed, close code-server, overwrite the extension with the version-locked version, then restart code-server, and crawl back into bed, and then I can keep manually restoring the
User/settings.json
file from a template, as not all devices have writable nonvolatile storage.This is bad, especially because not all of my devices have writable nonvolatile storage, so this will happen over and over again. Sometimes almost every hour, if I happen to use a device with a read-only storage, and it happens to crash the browser frequently due to running out of RAM for example.
Since I plan to use code-server in "single user mode", and I've read that code-server is intended to be used by a single user, why not make a remote setting, so that all of the user state is actually stored on the remote, and only use
User/settings.json
to store local overrides instead (if any, for example font size or font change, to accomodate for different screen size across the devices, for example)?I've tried to be clever, and copypasted the template
settings.json
toMachine/settings.json
, but then some settings get grayed out, and they show a message on hover:That's kind of infuriating, as exactly the settings I'd want to configure globally (like
window.menuBarVisibility
andextensions.autoUpdate
for example) are locked toUser/settings.json
for some reason.How do I make these settings global to all clients?
How do I switch between two clients while keeping global state (settings, open files, etc.) ?
It doesn't seem like this is possible at the moment. I've looked through docs, and many issues in this repo, and I found nothing. Is this even supported in code-server?
VSCode type: vscode-server-web
Version: 1.89.0-insider
Commit: 063d715
Date: 2024-04-19T05:03:56.125Z (12 hrs ago)
Tried older 32bit version as well:
Version: 1.84.0-insider
Commit: 0c36b92
Date: 2023-10-16T05:47:07.428Z
Operating System running code-server: Windows 10 (tried both 32bit and 64bit)
Extensions: any/none (happens with completely empty
.vscode-server-insiders
folder as well)I am the sole user of this code-server, always, with only up to 1 instance connected. I'm hosting it locally, on a partially isolated network. No VPN or tunnel or Tunnel, I'm using direct connection from browser.
Commandline:
code-server-insiders serve-local --host 0.0.0.0 --without-connection-token --accept-server-license-terms
Edit: I'm using code-server-web, so I'm always just opening a browser. Fixed some wording mistakes.
Edit 2: I've did some digging, and it seems like this is not implemented yet, but feels like it should be easy-ish to implement, considering how modular and abstracted the code is.
I found this line of code [permalink to code][permalink to struct element], where I could possibly overwrite the default profile.However, it sems like it's not being passed in in the Javascript object [permalink], and there is no implementation to actually pass that in.
That doesn't quite matter anymore, as I found what I was looking for.
It seems like that the userdata path is hardcoded to use IndexedDB [permalink], which is not great, as I need remote permanent storage.
Some lines up [permalink] the remote storage is initialized, which is really asking to be used by being there.
Sure enough, it gets mapped to an URI schema [permalink], which could be potentially used to map the userdata URI scheme to the remote URI scheme, kind of like how the standalone Electron client does it [permalink], except with the remote URI scheme instead of the file URI scheme.
I am extremely "uncomfortable" with TypeScript though, so I can't make a PR out of this myself.
Edit 3: crossed out not-so-relevant parts, and updated the title to be more focused and less generic
The text was updated successfully, but these errors were encountered: