Skip to content

macgeneral/uVSCEM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uVSCEM: unofficial VSCode Extension Manager


PyPI - Version PyPI - Python Version PyPI - Implementation PyPI - License

This little program is designed to address some limitations in air-gapped and proxy environments that currently occur due to partially missing proxy support in Visual Studio Code.
It allows for the installation of extensions in DevContainers, even when a proxy is involved, by downloading and installing them manually via Python's requests library.

It's currently a work in progress, and complete offline installation is still missing (integrating it is a minor step), but it should be good enough to be used as "postAttachCommand" in devcontainer.json for environments where a proxy is involved and where automatic extension installation currently fails due to various errors.

It's a workaround for the following upstream issues in Visual Studio Code:

Getting started

You can use this projects devcontainer.json as a template or modify your Dockerfile accordingly:

RUN pip install uvscem

(preferably after creating a virtual environment and a non-root user)

In your devcontainer.json

{
  "postAttachCommand": "uvscem --config-file /path/to/devcontainer.json"
}

uVSCEM will then install (and update) all extensions listed in devcontainer.json each time Visual Studio Code or the DevContainer is (re)started or rebuild.

Note
Ensure that your Dockerfile (or container) contains Python 3.8 or later and pip, poetry, or pipx to install this package. Also, confirm that your PATH variable includes the (virtual) environment where the package was installed into (or use poetry run uvscem after installing it with poetry).

If you have a proxy (e.g. Cntlm) listening on localhost it's best to add a line in your /etc/hosts or C:\Windows\system32\drivers\etc\hosts file (if you have the required admin permissions to do so):

127.0.0.1	localproxy

and configure VSCode to use that domain in (User) settings.json.

{
  "http.proxy": "http://localproxy:3128"
}

In your docker-compose.yml you could then specify the following (this is already included in the devcontainer example in this repository):

extra_hosts:
    - "host.docker.internal:host-gateway"
    - "localproxy:host-gateway"

This way, some extensions within the DevContainer still got internet connectivity (if they are proxy aware). GitHub's CoPilot for example tries to use 127.0.0.1 from the host's user proxy configuration ("http.proxy":) otherwise and unfortunately there's no possibility to configure that separately for the DevContainer.

A big thank you to the following people

About

unofficial VSCode Extension Manager

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages