当前位置: 首页 > backend >正文

openvsx搭建私有插件仓库

https://github.com/eclipse/openvsx/issues/703

  1. 构建docker镜像,openvsx-server 整合 前后端+ cli
    基于 https://github.com/eclipse/openvsx.git v0.27.0
ARG OPENVSX_VERSION# Builder image to compile the website
FROM ubuntu AS builderWORKDIR /workdir# See https://github.com/nodesource/distributions/blob/main/README.md#debinstall
RUN apt-get update \&& apt-get install --no-install-recommends -y \bash \ca-certificates \git \curl \&& apt-get clean \&& rm -rf /var/lib/apt/lists/* \&& curl -sSL https://deb.nodesource.com/setup_20.x | bash - \&& apt-get install -y nodejs \&& apt-get clean \&& corepack enable \&& corepack prepare yarn@stable --activateARG OPENVSX_VERSION
ENV VERSION=v0.27.0RUN HTTPS_PROXY=150.223.210.7:7890  git clone --branch ${VERSION} --depth 1 https://github.com/eclipse/openvsx.git /workdir
COPY ./configuration /workdir/configurationRUN /usr/bin/yarn --cwd webui \&& /usr/bin/yarn --cwd webui build \&& /usr/bin/yarn --cwd webui build:defaultFROM node:20 AS cli_builder
RUN npm config set registry https://registry.npmmirror.com
RUN npm config get registry
RUN npm install -g ovsx --registry=https://registry.npmmirror.com# Main image derived from openvsx-server
FROM ghcr.io/eclipse/openvsx-server:v0.27.0
ARG OPENVSX_VERSIONCOPY --from=builder --chown=openvsx:openvsx /workdir/webui/static/ BOOT-INF/classes/static/
COPY --from=builder --chown=openvsx:openvsx /workdir/configuration/application.yml config/COPY --from=cli_builder /usr/local/lib/node_modules/ /usr/local/lib/node_modules/
COPY --from=cli_builder /usr/local/bin/ /usr/local/bin/RUN sed -i "s/<OPENVSX_VERSION>/v0.27.0/g" config/application.yml

配置文件 application.yml

logging:pattern:level: '%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]'server:port: 8080jetty:threads:max-queue-capacity: 100spring:application:name: openvsx-serverautoconfigure:# don't send traces to Zipkin in developmentexclude: org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfigurationprofiles:include: ovsxcache:jcache:config: classpath:ehcache.xmldatasource:url: jdbc:postgresql://postgres:5432/openvsxusername: openvsxpassword: openvsxflyway:baseline-on-migrate: truebaseline-version: 0.1.0baseline-description: JobRunr tablesjpa:open-in-view: falseproperties:hibernate:dialect: org.hibernate.dialect.PostgreSQLDialecthibernate:ddl-auto: nonesession:store-type: jdbcjdbc:initialize-schema: neversecurity:oauth2:client:registration:github:client-id: noneclient-secret: nonemanagement:health:probes:enabled: trueendpoints:web:exposure:include:- health- metrics- prometheusmetrics:distribution:percentiles-histogram:http:server:requests: trueclient:requests: truespringdoc:model-and-view-allowed: trueswagger-ui:path: /swagger-uidocExpansion: listoperationsSorter: alphasupportedSubmitMethods:- getorg:jobrunr:job-scheduler:enabled: truebackground-job-server:enabled: trueworker-count: 2dashboard:enabled: falsedatabase:type: sqlmiscellaneous:allow-anonymous-data-usage: falsebucket4j:enabled: truefilters:- cache-name: bucketsurl: '/api/-/(namespace/create|publish)'http-response-headers:Access-Control-Allow-Origin: '*'Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remainingrate-limits:- cache-key: getParameter("token")bandwidths:- capacity: 15time: 1unit: seconds- cache-name: bucketsurl: '/vscode/asset/.*/.*/.*/Microsoft.VisualStudio.Services.Icons.Default'http-response-headers:Access-Control-Allow-Origin: '*'Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remainingrate-limits:- cache-key: getRemoteAddr()bandwidths:- capacity: 75time: 1unit: seconds- cache-name: bucketsurl: '/vscode/(?!asset/.*/.*/.*/Microsoft.VisualStudio.Services.Icons.Default).*|/api/(?!(.*/.*/review(/delete)?)|(-/(namespace/create|publish))).*'http-response-headers:Access-Control-Allow-Origin: '*'Access-Control-Expose-Headers: X-Rate-Limit-Retry-After-Seconds, X-Rate-Limit-Remainingrate-limits:- cache-key: getRemoteAddr()bandwidths:- capacity: 15time: 1unit: secondsovsx:databasesearch:enabled: falseelasticsearch:clear-on-start: truehost: 'elasticsearch:9200'extension-control:update-on-start: trueintegrity:key-pair: create # create, renew, delete, 'undefined'registry:version: v0.27.0storage:local:directory: /home/ovsx
构建命令
docker build -t "openvsx:v0.27.0" .
2. Docker-compose 启动
services:postgres:image: postgres:latestenvironment:- POSTGRES_USER=openvsx- POSTGRES_PASSWORD=openvsxlogging:options:max-size: 10mmax-file: "3"ports:- '5432:5432'healthcheck:test: ["CMD-SHELL", "pg_isready -U openvsx"]interval: 10stimeout: 10sretries: 6elasticsearch:image: elasticsearch:8.6.2environment:- xpack.security.enabled=false- xpack.ml.enabled=false- discovery.type=single-node- bootstrap.memory_lock=true- cluster.routing.allocation.disk.threshold_enabled=falseports:- 9200:9200- 9300:9300healthcheck:test: curl -s http://elasticsearch:9200 >/dev/null || exit 1interval: 10stimeout: 5sretries: 50start_period: 5sserver:image: openvsx:v0.27.0ports:- "8080:8080"- "3000:3000"healthcheck:test: ["CMD-SHELL", "curl http://openvsx-server:8080"]interval: 10stimeout: 10sretries: 6volumes:- ./configuration/application.yml:/home/openvsx/server/config/application.yml- ./vsix:/home/vsix- ./ovsx_storage:/home/ovsxdepends_on:elasticsearch:condition: service_healthypostgres:condition: service_healthy
  1. 初始化和发布插件
docker exec -it vsx-registry-postgres-1 bash
psql -hlocalhost -Uopenvsx -p5432 INSERT INTO user_data(id, login_name, role) VALUES(1001, 'super_user', 'admin');
INSERT INTO personal_access_token(id, active, description, value, user_data) VALUES(1002, TRUE, 'For publishing test extensions', 'super_token', 1001);select * from extensions;
select * from file_resources;wget https://open-vsx.org/api/robole/file-bunny/1.3.6/file/robole.file-bunny-1.3.6.vsixdocker exec -it vsx-registry-server-1 bash
cd /home/vsix
ovsx -p super_token -r http://server:8080/ create-namespace robole
ovsx -p super_token -r http://server:8080/ publish *.vsix 

举例

openvsx@6046657205fa:~/server$ ovsx -p super_token -r http://server:8080/ create-namespace robole
🚀  Created namespace robole
openvsx@6046657205fa:/home/vsix$ ovsx -p super_token -r http://server:8080/ publish ./*.vsix
🚀  Published robole.file-bunny v1.3.6
  1. Vscode 插件配置
    下载插件,配置本地仓库
https://marketplace.visualstudio.com/items?itemName=NikolajFogh.private-extension-marketplace
  1. Vscode remote 离线安装
wget https://update.code.visualstudio.com/commit:704ed70d4fd1c6bd6342c436f1ede30d1cf4710/server-linux-x64/stable
commit_id=704ed70d4fd1c6bd6342c436f1ede30d1cf4710
mkdir -p ~/.vscode-server/bin/${commit_id}
tar -xvzf vscode-server-linux-x64.tar.gz --strip-components 1
  1. 版本要求:
    1. 低版本vscode 非 insider 版本不支持 remote-ssh
    2. 高版本 vscode 对 linux 有要求, 比如要求glibc >2.28, libstdc++ > 3.4.25 详见 https://code.visualstudio.com/docs/remote/linux#_remote-host-container-wsl-linux-prerequisites
    3. 如下是 kylin v10 升级 libstdc++ 的思路
8. 修改yum 添加,gcc-updates 源, 从mirror 发现 tlinux 2.4 带的 libstdc++ 8.5.0 可用
9. yum update libstdc++,  并解决依赖问题,如有
10. strings /usr/lib64/libstdc++.6 |grep GLIBCXX   
http://www.xdnf.cn/news/17776.html

相关文章:

  • mysql查询中的filesort是指什么
  • 云蝠智能 VoiceAgent:重构物流售后场景的智能化引擎
  • 构建Node.js单可执行应用(SEA)的方法
  • 飞算JavaAI合并项目实战:7天完成3年遗留系统重构
  • BitDock——让你的Windows桌面变为Mac
  • 网络层协议——IP
  • 前端Vite介绍(现代化前端构建工具,由尤雨溪开发,旨在显著提升开发体验和构建效率)ES模块(ESM)、与传统Webpack对比、Rollup打包
  • 设计模式(1)
  • vue2和vue3的区别
  • httpx 设置速率控制 limit 时需要注意 timeout 包含 pool 中等待时间
  • 【2025年 Arxiv 即插即用】 特征融合新突破:空间–光谱注意力融合模块 SAFFM 强势登场!
  • Vite 为什么比 Webpack 快?原理深度分析
  • 【Linux系统】进程的生命旅程:从创建到独立的演绎
  • RTC时钟倒计时数码管同步显示实现(STC8)
  • 如何安装 scikit-learn Python 库
  • 8. 函数简介
  • 鸿蒙NEXT如何通过userAgent区分手机端和pc端
  • 全栈:SSM项目的分支结构以及对应的每个的文件的作用
  • 古中医学习笔记专题文章导航
  • Stability AI技术浅析(一)
  • 力扣top100(day03-02)--图论
  • 【Java虚拟机】JVM相关面试题
  • RabbitMQ高级特性——消息确认、持久性、发送方确认、重试
  • tlias智能学习辅助系统--Maven 高级-私服介绍与资源上传下载
  • 反射在Spring IOC容器中的应用——动态创建Bean (补充)
  • Elasticsearch RBAC 配置:打造多租户环境的安全访问控制
  • CMake语法与Bash语法的区别
  • CV 医学影像分类、分割、目标检测,之【3D肝脏分割】项目拆解
  • 图论Day2学习心得
  • YouBallin正式上线:用Web3重塑创作者经济