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

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.lryc.cn/news/620480.html

相关文章:

  • Elasticsearch RBAC 配置:打造多租户环境的安全访问控制
  • Cherryusb UAC例程对接STM32 SAI播放音乐和录音(上)=>SAI+TX+RX+DMA的配置与音频回环测试
  • 深入详解C语言数组:承上启下——从C语言数组基础到数据结构衔接
  • 抓取系统升级,是优化还是重构更合适?
  • CSS aspect-ratio 属性
  • RTC时钟倒计时数码管同步显示实现(STC8)
  • 【基于个人博客系统】---测试报告
  • 当GitHub宕机时,我们如何协作?
  • GO学习记录五——数据库表的增删改查
  • 手写MyBatis第16弹:泛型魔法应用:MyBatis如何破解List的运行时类型
  • C++ 应用场景全景解析:从系统级到AI的跨越式演进
  • 分布式系统架构设计模式:从微服务到云原生
  • 河南萌新联赛2025第(五)场:信息工程大学”(补题)
  • DataHub OPC Gateway:实现OPC UA与OPC DA无缝集成的高性能网关
  • iOS App TF上架全流程实战 高效内测分发与IPA包管理
  • Boost库中Pool 基础内存池(boost::pool<>)的详细用法解析和实战应用
  • Docker 核心技术:Namespace
  • 版本更新!FairGuard-Mac加固工具已上线!
  • 银河麒麟系统部署oceanbase社区版
  • 【入门级-C++程序设计:13、STL 模板:栈(stack)、队 列(queue)、 链 表(list)、 向 量(vector) 等容器】
  • 中介者模式和观察者模式的区别是什么
  • mysql——count(*)、count(1)和count(字段)谁更快?有什么区别?
  • 【React】hooks 中的闭包陷阱
  • 某处卖600的【独角仙】尾盘十分钟短线 尾盘短线思路 手机电脑通用无未来函数
  • coze小白-如何用coze上传本地文件?(对话流使用)
  • 《SeeClick: Harnessing GUI Grounding for Advanced Visual GUI Agents》论文精读笔记
  • 云原生俱乐部-k8s知识点归纳(1)
  • 同创永益 IStorM CNBR云原生业务韧性管理平台 v3.3.0重磅发布:告别备份烦恼,云原生数据保护再升级!
  • 【博客系统测试报告】---接口自动化测试
  • toRefs、storeToRefs实际应用