当前位置: 首页 > 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.dtcms.com/a/331135.html

相关文章:

  • 设计模式有哪些
  • 2022_ISG_CTF-rechall详解(含思考过程)
  • MixOne在macOS上安装碰到的问题
  • 上网行为安全概述
  • 【跨越 6G 安全、防御与智能协作:从APT检测到多模态通信再到AI代理语言革命】
  • 数据结构:用链表实现队列(Implementing Queue Using List)
  • python批量爬虫实战之windows主题爬取
  • 移位操作符技巧
  • 8. 函数简介
  • DeepSeek补全IBM MQ 9.4 REST API 执行命令的PPT
  • Mac chrome浏览器下载DevEco Studio 6.0.0 Beta2失败
  • 分布式锁—Redisson的公平锁
  • 线上故障定位:从报警到根因的实战指南
  • Eureka故障处理大汇总
  • 使用 Git Submodules 管理前后端分离项目
  • scikit-learn/sklearn学习|广义线性回归 Logistic regression的三种成本函数
  • Docker 核心技术:Namespace
  • Java毕业设计选题推荐 |基于SpringBoot的健身爱好线上互动与打卡社交平台系统 互动打卡小程序系统
  • 2019 GPT2原文 Language Models are Unsupervised Multitask Learners - Reading Notes
  • [激光原理与应用-274]:理论 - 波动光学 - 光是电磁波,无线电磁波可以通过天线接收和发送,为什么可见光不可以?
  • Visual Studio2019/2022离线安装完整教程(含闪退解决方法)
  • 无人机双目视觉设计要点概述!
  • SOD-YOLO:基于YOLO的无人机图像小目标检测增强方法
  • 值传递+move 优化数据传递
  • torchvision中数据集的使用与DataLoader 小土堆pytorch记录
  • Autoppt-AI驱动的演示文稿生成工具
  • 深入理解 RAG:检索增强生成技术详解
  • 通过机器学习框架实现Android手写识别输入功能
  • 【开源工具】基于硬件指纹的“一机一码”软件授权系统全实现(附完整源码)
  • MapReduce系统架构,颠覆了互联网分层架构的本质?