Docker 部署 verdaccio 搭建 npm 私服
一、镜像获取
# 获取 verdaccio 镜像
docker pull verdaccio/verdaccio
二、修改配置文件
cd /wwwroot/opt/docker/verdaccio/conf
vim config.yaml
config.yaml 配置文件如下,可以根据自己的需要进行修改
#
# This is the default configuration file. It allows all users to do anything,
# please read carefully the documentation and best practices to
# improve security.
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/5.x/conf
#
# Read about the best practices
# https://verdaccio.org/docs/best# path to a directory with all packages
storage: ./storage
# path to a directory with plugins to include
plugins: ./plugins# https://verdaccio.org/docs/webui
web:title: Verdaccio# comment out to disable gravatar support# gravatar: false# by default packages are ordercer ascendant (asc|desc)# sort_packages: asc# convert your UI to the dark side# darkMode: true# html_cache: true# by default all features are displayed# login: true# showInfo: true# showSettings: true# In combination with darkMode you can force specific theme# showThemeSwitch: true# showFooter: true# showSearch: true# showRaw: true# showDownloadTarball: true# HTML tags injected after manifest <scripts/># scriptsBodyAfter:# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'# HTML tags injected before ends </head># metaScripts:# - '<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>'# - '<script type="text/javascript" src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js"></script>'# - '<meta name="robots" content="noindex" />'# HTML tags injected first child at <body/># bodyBefore:# - '<div id="myId">html before webpack scripts</div>'# Public path for template manifest scripts (only manifest)# publicPath: http://somedomain.org/# https://verdaccio.org/docs/configuration#authentication
auth:htpasswd:file: ./htpasswd# Maximum amount of users allowed to register, defaults to "+inf".# You can set this to -1 to disable registration.# max_users: 1000# https://verdaccio.org/docs/configuration#uplinks
# a list of other known repositories we can talk to
uplinks:taobao: url: https://registry.npm.taobao.org/npmjs:url: https://registry.npmjs.org/yarnkg: url: https://registry.yarnpkg.com/tencent:url: https://mirrors.cloud.tencent.com/npm/cnpm:url: https://r.cnpmjs.org/npmMirror:url: https://skimdb.npmjs.com/registry/
# Learn how to protect your packages
# https://verdaccio.org/docs/protect-your-dependencies/
# https://verdaccio.org/docs/configuration#packages
packages:'@*/*':# scoped packagesaccess: $allpublish: $authenticatedunpublish: $authenticatedproxy: taobao'**':# allow all users (including non-authenticated users) to read and# publish all packages## you can specify usernames/groupnames (depending on your auth plugin)# and three keywords: "$all", "$anonymous", "$authenticated"access: $all# allow all known users to publish/publish packages# (anyone can register by default, remember?)publish: $authenticatedunpublish: $authenticated# if package is not available locally, proxy requests to 'npmjs' registryproxy: taobao# To improve your security configuration and avoid dependency confusion
# consider removing the proxy property for private packages
# https://verdaccio.org/docs/best#remove-proxy-to-increase-security-at-private-packages# https://verdaccio.org/docs/configuration#server
# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections.
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
server:keepAliveTimeout: 60# https://verdaccio.org/docs/configuration#offline-publish
# publish:
# allow_offline: false# https://verdaccio.org/docs/configuration#url-prefix
# url_prefix: /verdaccio/
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
# url_prefix: '/my_prefix'
# // url -> https://somedomain.org/my_prefix/
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
# url_prefix: '/'
# // url -> https://somedomain.org/
# VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix';
# url_prefix: '/second_prefix'
# // url -> https://somedomain.org/second_prefix/'# https://verdaccio.org/docs/configuration#security
# security:
# api:
# legacy: true
# jwt:
# sign:
# expiresIn: 29d
# verify:
# someProp: [value]
# web:
# sign:
# expiresIn: 1h # 1 hour by default
# verify:
# someProp: [value]# https://verdaccio.org/docs/configuration#user-rate-limit
# userRateLimit:
# windowMs: 50000
# max: 1000# https://verdaccio.org/docs/configuration#max-body-size
max_body_size: 50mb# https://verdaccio.org/docs/configuration#listen-port
listen:- '0.0.0.0:4873' # listen on all addresses (INADDR_ANY)
# - https://example.org:4873 # if you want to use https
# - "[::1]:4873" # ipv6
# - unix:/tmp/verdaccio.sock # unix socket# The HTTPS configuration is useful if you do not consider use a HTTP Proxy
# https://verdaccio.org/docs/configuration#https
# https:
# key: ./path/verdaccio-key.pem
# cert: ./path/verdaccio-cert.pem
# ca: ./path/verdaccio-csr.pem# https://verdaccio.org/docs/configuration#proxy
# http_proxy: http://something.local/
# https_proxy: https://something.local/# https://verdaccio.org/docs/configuration#notifications
notify:method: POSTheaders: [{ "Content-Type": "application/json;charset=utf-8" }]# 发送消息的webhookendpoint: xxxcontent: '{ "msgtype": "text","at": { "isAtAll": true }, "text": {"content":"组件发版通知: {{ name }}{{#each versions}} v{{version}}{{/each}}"}}'middlewares:audit:enabled: true# https://verdaccio.org/docs/logger
# log settings
logs: { type: stdout, format: pretty, level: http }
#experiments:
# # support for npm token command
# token: false
# # disable writing body size to logs, read more on ticket 1912
# bytesin_off: false
# # enable tarball URL redirect for hosting tarball with a different server, the tarball_url_redirect can be a template string
# tarball_url_redirect: 'http://175.42.30.161:46803/verdaccio/${packageName}/${filename}'
# tarball_url_redirect: 'http://175.42.30.161:46803/${packageName}/${filename}'
# # the tarball_url_redirect can be a function, takes packageName and filename and returns the url, when working with a js configuration file
# tarball_url_redirect(packageName, filename) {
# const signedUrl = // generate a signed url
# return signedUrl;
# }# translate your registry, api i18n not available yet
i18n:
# list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.mdweb: zh-CN
auth:
htpasswd:
file: ./htpasswd # 是 npm 私服的用户密码文件max_body_size: 50mb # 是推上私服的包的最大大小
listen:
- '0.0.0.0:4873' # 是监听的ip和端口,4873 就是后面访问的端口notify:
method: POST
headers: [{ "Content-Type": "application/json;charset=utf-8" }]
# 推包后发送消息的 webhook 地址,如没有则不用配置
endpoint: xxx
三、创建容器并运行
docker run -d --name verdaccio \n
-p 4873:4873 \n
-v /wwwroot/opt/docker/verdaccio:/verdaccio \n
--privileged=true verdaccio/verdaccio
四、测试运行
此时,verdaccio已经启动,http://ip:4873/ 已经可以访问
五、使用内网穿透 的 web界面坑
在搭建公司私有库时,使用的内网ip,但是为了在外面方便访问,运营将内网ip穿透得到一个外网可以访问的ip。但是不能使用内网ip和外网ip同时访问web页面。查看verdaccio的页面请求发现会将当天第一次请求的域名缓存起来。假设当天先访问内网环境域名,则外网环境web页面将无法访问,因为请求被写死成内网地址,如果先访问外网地址,则内网地址跳转到无包页面。
庆幸的是,这并不影响包的安装
相关文章:

Docker 部署 verdaccio 搭建 npm 私服
一、镜像获取 # 获取 verdaccio 镜像 docker pull verdaccio/verdaccio 二、修改配置文件 cd /wwwroot/opt/docker/verdaccio/conf vim config.yaml config.yaml 配置文件如下,可以根据自己的需要进行修改 # # This is the default configuration file. It all…...

49-拓展(1)
49-拓展(1) 扩展概述 扩展可以为在当前 package 可见的类型(除函数、元组、接口)添加新功能。 当不能破坏被扩展类型的封装性,但希望添加额外的功能时,可以使用扩展。 可以添加的功能包括: …...

国产编辑器EverEdit - 在文件中查找和替换
1 在文件中查找和替换 1.1 应用场景 某些场景,用户需要在所有工程文件中进行查找和替换关键词,比如:查找工程中哪些文件使用了某个常量。 1.2 使用方法 选择主菜单查找 -> 在文件中查找和替换,或使用快捷键Ctrl Shift F&a…...

安全行业大模型SecLLM技术白皮书
在ChatGPT 呈现全球现象级热度时,通用大语言模型(Large Language Model, LLM)技术成为了推动创新和变革的关键驱动力。但由于安全行业的特殊性和复杂性,LLM 并不能满足其应用需求。安全行业大模型(Security Large Language Model,…...

基础入门-HTTP数据包红蓝队研判自定义构造请求方法请求头修改状态码判断
知识点: 1、请求头&返回包-方法&头修改&状态码等 2、数据包分析-红队攻击工具&蓝队流量研判 3、数据包构造-Reqable自定义添加修改请求 一、演示案例-请求头&返回包-方法&头修改&状态码等 数据包 客户端请求Request 请求方法 …...

2025年日祭
本文将同步发表于洛谷(暂无法访问)、CSDN 与 Github 个人博客(暂未发布) 本蒟自2025.2.8开始半停课。 任务计划(站外题与专题) 数了一下,通过人数比较高的题,也就是我准备补的题&a…...

git命令行删除远程分支、删除远程提交日志
目录 1、从本地通过命令行删除远程git分支2、删除已 commit 并 push 的记录 1、从本地通过命令行删除远程git分支 git push origin --delete feature/feature_xxx 删除远程分支 feature/feature_xxx 2、删除已 commit 并 push 的记录 git reset --hard 7b5d01xxxxxxxxxx 恢复到…...

centOS8安装MySQL8设置开机自动启动失败
提供一个终极解决方案虽然systemctl 更符合管理预期但是不能用 使用一下命令 修改配置文件、修改mysql.service全是问题 systemctl start mysqld systemctl enable mysqld systemctl daemon-reload完全不生效各种报错 提示配置文件内容有问题 Main process exited, codeexite…...

对接DeepSeek
其实,整个对接过程很简单,就四步,获取key,找到接口文档,接口测试,代码对接。 获取 KEY https://platform.deepseek.com/transactions 直接付款就是了(现在官网暂停充值2025年2月7日࿰…...

SpringSecurity高级用法
SpringSecurity的高级用法,包括自定义loginUrl携带参数,自定义认证校验逻辑,自定义权限校验逻辑。 示例项目 https://github.com/qihaiyan/springcamp/tree/master/spring-advanced-security 一、概述 在项目实际开发过程中,Spr…...

NLP_[2]-认识文本预处理
文章目录 1 认识文本预处理1 文本预处理及其作用2. 文本预处理中包含的主要环节2.1 文本处理的基本方法2.2 文本张量表示方法2.3 文本语料的数据分析2.4 文本特征处理2.5数据增强方法2.6 重要说明 2 文本处理的基本方法1. 什么是分词2 什么是命名实体识别3 什么是词性标注 1 认…...

字符设备驱动开发
驱动就是获取外设、传感器数据和控制外设。数据会提交给应用程序。 Linux 驱动编译既要编写一个驱动,还要编写一个简单的测试应用程序。 而单片机下驱动和应用都是放在一个文件里,也就是杂在一块。而 Linux 则是分开了。 一、字符设备驱动开发流程 Lin…...

c语言:取绝对值
假设我们有一个 long 类型的变量 l,我们希望恢复其绝对值。以下是两种方法的对比: 方法1:使用条件语句 这个很好理解,负数时取负运算 ,用于数值的符号反转。 long abs_value(long l) {if (l < 0) {return -l;} e…...

DeepSeek从入门到精通教程PDF清华大学出版
DeepSeek爆火以来,各种应用方式层出不穷,对于很多人来说,还是特别模糊,有种雾里看花水中望月的感觉。 最近,清华大学新闻与传播学院新媒体研究中心,推出了一篇DeepSeek的使用教程,从最基础的是…...

HTML之CSS定位、浮动、盒子模型
HTML之CSS定位、浮动、盒子模型 定位 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>Document<…...

LQB(1)-python-各种基础排序
前言 除了内置的快速排序sort(),python也可以实现冒泡排序、选择排序、插入排序、快速排序、归并排序和桶排序。 一、冒泡排序 (Bubble Sort) 基础代码 def bubble_sort(arr):n len(arr)for i in range(n):swapped False # 优化:若本轮无交换则提前…...

解锁国内主流前端与后端框架
前端框架大揭秘 在当今的 Web 开发领域,前端框架的地位愈发举足轻重。随着用户对 Web 应用交互性和体验性要求的不断攀升,前端开发不再仅仅是简单的页面布局与样式设计,更需要构建复杂且高效的用户界面。前端框架就像是一位得力助手…...

使用OBS推流,srs服务器播放
说明: ffmpeg可以推流,但是是命令行方式不太友好,还可以使用主流的OBS开源推流软件,可从官网Open Broadcaster Software | OBS 下载最新版本,目前很多网络主播都是用它做直播。该软件支持本地视频文件以及摄像头推流。…...

【鸿蒙HarmonyOS Next实战开发】多媒体视频播放-ijkplayer
简介 ijkplayer是OpenHarmony和HarmonyOS环境下可用的一款基于FFmpeg的视频播放器。 演示 下载安装 ohpm install ohos/ijkplayer使用说明 import { IjkMediaPlayer } from "ohos/ijkplayer";import type { OnPreparedListener } from "ohos/ijkplayer";i…...

GRU 和 LSTM 公式推导与矩阵变换过程图解
GRU 和 LSTM 公式推导与矩阵变换过程图解 GRULSTM 本文的前置篇链接: 单向/双向,单层/多层RNN输入输出维度问题一次性解决 GRU GRU(Gate Recurrent Unit)是循环神经网络(RNN)的一种,可以解决RNN中不能长期…...

现在中国三大运营商各自使用的哪些band频段
现在中国三大运营商4G和5G频段分配情况: 中国移动 4G频段: TD-LTE: Band 39:1880-1920MHz,实际使用1885-1915MHz。 Band 40:2300-2400MHz,实际使用2320-2370MHz。 Band 41:2515-26…...

使用Jenkins实现鸿蒙HAR应用的自动化构建打包
使用Jenkins实现鸿蒙HAR应用的自动化构建打包 在软件开发领域,自动化构建是提高开发效率和确保代码质量的重要手段。特别是在鸿蒙(OpenHarmony)应用开发中,自动化构建更是不可或缺。本文将详细介绍如何使用Jenkins命令行工具实现…...

AI时代,职场人如何开启学习之旅
为什么要学习 AI 在当今数字化时代,AI 正以前所未有的速度改变着我们的工作和生活方式。从智能客服到自动化生产,从数据分析到个性化推荐,AI 已经广泛渗透到各个行业和领域。学习 AI,对于工作人员来说,不仅是提升工作…...

MIT6.824 Lecture 2-RPC and Threads Lecture 3-GFS
Lecture 2-RPC and Threads Go语言在多线程、同步,还有很好用的RPC包 《Effective Go》 线程是实现并发的重要工具 在分布式系统里关注多线程的原因: I/O concurrencyParallelismConvenience Thread challenges 用锁解决race问题 Coordination channel…...

MySQL第五次作业
根据图片内容完成作业 1.建表 (1)建立两个表:goods(商品表)、orders(订单表) mysql> create table goods( -> gid char(8) primary key, -> name varchar(10), -> price decimal(8,2), -> num int); mysql> create t…...

【PDF提取内容】如何批量提取PDF里面的文字内容,把内容到处表格或者批量给PDF文件改名,基于C++的实现方案和步骤
以下分别介绍基于 C 批量提取 PDF 里文字内容并导出到表格,以及批量给 PDF 文件改名的实现方案、步骤和应用场景。 批量提取 PDF 文字内容并导出到表格 应用场景 文档数据整理:在处理大量学术论文、报告等 PDF 文档时,需要提取其中的关键信…...

智慧机房解决方案(文末联系,领取整套资料,可做论文)
智慧机房解决方案-软件部分 一、方案概述 本智慧机房解决方案旨在通过硬件设备与软件系统的深度整合,实现机房的智能化管理与服务,提升机房管理人员的工作效率,优化机房运营效率,确保机房设备的安全稳定运行。软件部分包括机房管…...

【C编程问题集中营】使用数组指针时容易踩得坑
【C编程问题集中营】使用数组指针时容易踩得坑 文章目录 【C编程问题集中营】使用数组指针时容易踩得坑一、获取数组首地址二、应用场景举例2.1 正常场景2.2 异常场景 三、总结 一、获取数组首地址 一维数组的首地址即数组第一个元素的指针,常用的获取一维数组首地…...

【Redis】Linux、Windows、Docker 环境下部署 Redis
一、Linux环境部署Redis 1、卸载 # 查看 Redis 是否还在运行 [appuserlocalhost redis]$ ps -ef|grep redis appuser 135694 125912 0 14:24 pts/1 00:00:00 ./bin/redis-server *:6379 appuser 135731 125912 0 14:24 pts/1 00:00:00 grep --colorauto redis# 停止…...

反函数定义及其推导
文章目录 定义存在条件举例说明总结 反函数是数学中一种特殊的函数,用于“逆转”另一个函数的映射关系。 定义 设有一个函数 f : X → Y f: X \to Y f:X→Y。如果存在一个函数 g : Y → X g: Y \to X g:Y→X,使得对于所有 x ∈ X x \in X x∈X 和 y…...