Skip to content
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

Options for inserting default settings at deployment time that are separate from user settings #6995

Closed
DeepCowProductions opened this issue Sep 10, 2024 · 3 comments
Labels
enhancement Some improvement that isn't a feature

Comments

@DeepCowProductions
Copy link

What is your suggestion and why do you want this feature?

I was not able to find a nice solution for this so far:

Here is the scenario:
I deployed a custom coder-server installment inside JupyterLab.
For different Images and environments, I want to provide each user with different sets of extensions and default settings, that are independent of the workspace that the User are working in inside their container.
The Problem is that the users $HOME directory has to be identical for every kind of image, so a global settings.json in their $HOME is not a great solution. This would also not be easily updated with image releases, where new default settings for extensions might be required.

Technically, the best way (maybe?) would be to provide a set of default settings that originate from the deployment and are not persistent inside the user directories.
VSCode itself does not seem to provide any support for this as default settings are some kind of ephemeral and not stored in any particular location (at least I was not able to find it)

This would also be very useful for modifying the default values for pre-installed extension, such as the python extension.
In particular, this would allow an easy way of defining where the targeted python interpreter is located, which might not be where one would expect it, when a custom env is installed via conda for example.

Are there any workarounds to get this functionality today?

The best workaround so far is to create a script that creates or merges a settings.json file at the desired location every time the containers starts. But like I said, this file is also user edible and while merging json is not hard, it is unclear what to do with conflicts.

For modifying extension settings, i do something like this as a workaround:

QUERY='.contributes.configuration.properties."python.condaPath".default="/opt/conda/bin/conda"' \
jq $QUERY /usr/lib/code-server/lib/vscode/extensions/ms-python.python-*/package.json | sponge /usr/lib/code-server/lib/vscode/extensions/ms-python.python-*/package.json \

I am not sure whether this also works for internal settings, such config files are also hard to find...

Are you interested in submitting a PR for this?

Maybe, although I don't know whether such a feature could be implemented nicely given the fact that VSCode itself does not seem to support this. I am however open to other solutions.

@DeepCowProductions DeepCowProductions added the enhancement Some improvement that isn't a feature label Sep 10, 2024
@code-asher
Copy link
Member

Hmm yeah definitely an interesting idea but I think it might be out of scope for patching in code-server.

I know VS Code has setting policy stuff but I think it is Windows-only at the moment. microsoft/vscode#147756 If that worked on other machines then I think it would fulfill the criteria here.

@benz0li
Copy link
Contributor

benz0li commented Sep 11, 2024

@code-asher
Copy link
Member

Yeah, I agree. I will go ahead and close this, anyone interested in an official solution please follow the upstream issue.

@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

3 participants