gitpod-io / openvscode-server

Run upstream VS Code on a remote machine with access through a modern web browser from any device, anywhere.
https://www.gitpod.io/
MIT License
4.84k stars 423 forks source link

[feature] Provide a way to set the initial User settings that a new session will recieve #535

Open spkane opened 8 months ago

spkane commented 8 months ago

Currently, there does not appear to be any way to set default User settings without modifying the source code and building openvscode-server from that.

When setting up a remote system, there are plenty of occasions where being able to tweak some of the default settings for extensions, etc, is highly desirable, but since these defaults are not loaded from an on-disk JSON file and are only stored in the browser, there does not appear to be any reasonable way to deal with settings that have an application scope.

I don't have strong feelings about how this is achieved. A command argument pointing to a default User settings JSON file to load, having the system automatically load .openvscode-server/data/User/settings.json, or some combination of the above all seem like possibilities.

electricmonk commented 7 months ago

Same for Machine settings would be great. My use case is using OpenVSCode Server to run an E2E test for a VSCode extension using Playwright, and I would like to turn off Workspace Trust.

derzufall commented 4 months ago

There is an Extension that does this: https://github.com/spkane/vscode-training-tweaks

You can install it by extending the Container Image like this:

RUN ${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server --install-extension /home/workspace/training-tweaks-0.0.1.vsix

Then put your custom settings into the correct locations:

COPY ./custom-settings-extension.js /home/workspace/.openvscode-server/extensions/spkane.training-tweaks-0.0.1/out/extension.js
COPY ./custom-remote-settings.json /home/workspace/.openvscode-server/data/Machine/settings.json