eclipse / openvsx

An open-source registry for VS Code extensions
https://open-vsx.org/
Eclipse Public License 2.0
1.26k stars 142 forks source link

How to update vscode, when i build a local self openvsx server? #903

Closed tjlcast closed 7 months ago

tjlcast commented 7 months ago

Hello guys,

I have updated production.json of my vscode, like below:

"extensionsGallery": {
  "serviceUrl": "https://localhost:8080/vscode/gallery",
  "itemUrl": "https://localhost:8080/vscode/item"
},
"linkProtectionTrustedDomains": ["https://localhost:8080"]

But when I search extensions in my vscode it still throws XHR failed

image

And I have follow the issue(https://github.com/eclipse/openvsx/issues/440), to create an container(on localhost:8080) that combines the OpenVSX frontend and backend.l vscode still popup: "Error while fetching extensions. XHR failed"

So what should I do next to let my vscode use my local self openvsx?

Thanks a lot.

amvanbaren commented 7 months ago

Hi @tjlcast, I see the urls in production.json use https. Try http instead, e.g. http://localhost:8080/vscode/gallery

tjlcast commented 7 months ago

@amvanbaren Thank you for your reply.

I have changed the production.json file. (from https://localhost:8080 to be http://localhost:8080 )

VScode still show someting wrong when I search "docker" in marketplace. image

And vscode throws different error in console. image

But I can use curl to fetch response in my local service. image

My vscode version is 1.86.2 (Universal)

I’m trying to deploy an openvsx instance in our development environment (which cannot connect to the public network) so that developers can conveniently download VSCode extensions.

What should I do next?

amvanbaren commented 7 months ago

It looks like vscode doesn't allow http. This explains the error: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/connect-src. Here's a bit more about network settings: https://code.visualstudio.com/docs/setup/network

You can setup a reverse proxy (nginx, apache) with https enabled. Something like: https://hub.docker.com/r/jc21/nginx-proxy-manager or https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins