An open API service indexing awesome lists of open source software.

https://github.com/galaxy-s10/billd-registry

使用verdaccio搭建的npm私有仓库
https://github.com/galaxy-s10/billd-registry

npm-registry verdaccio

Last synced: 8 months ago
JSON representation

使用verdaccio搭建的npm私有仓库

Awesome Lists containing this project

README

          

## 线上地址

- [https://registry.hsslive.cn](https://registry.hsslive.cn)

## 启动

## FAQ

### nginx 配置

```nginx
# registry.hsslive.cn 80端口
server {
listen 80;
server_name registry.hsslive.cn;

# location / {
# # 把当前域名的请求,跳转到新域名上,域名变化但路径不变,permanent:返回301永久重定向,浏览器地址栏会显示跳转后的URL地址
# rewrite ^/(.*) https://registry.hsslive.cn/$1 permanent;
# }
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
# X-Forwarded-Proto不能缺少,verdaccio会读取这个请求头
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_pass http://localhost:4873/;
}
}
# registry.hsslive.cn 443端口
server {

# SSL协议访问端口号为443。此处如未添加ssl,可能会造成Nginx无法启动。
listen 443 ssl http2;
server_name registry.hsslive.cn;

# 开启gzip,关闭用off
gzip on;
# 选择压缩的文件类型,其值可以在 mime.types 文件中找到。
gzip_types text/plain text/css application/json application/javascript
# 是否在http header中添加Vary: Accept-Encoding,建议开启
gzip_vary on;
# gzip 压缩级别,1-9,数字越大压缩的越好,也越占用CPU时间,推荐6
gzip_comp_level 6;

# https://cloud.tencent.com/document/product/400/47360
ssl_certificate /usr/local/webserver/nginx/conf/cert/registry.hsslive.cn_bundle.crt;
ssl_certificate_key /usr/local/webserver/nginx/conf/cert/registry.hsslive.cn.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TlSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers SM2-WITH-SMS4SM3:ECDH:AESGCM:HIGH:MEDIUM:!RC4:!DH:!MD5:!aNULL:!eNULL;
ssl_prefer_server_ciphers on;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
# X-Forwarded-Proto不能缺少,verdaccio会读取这个请求头
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_pass http://localhost:4873/;
}
}
```

### verdaccio 配置

目录位置:`/root/.config/verdaccio/config.yaml`

```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
# scriptsBodyAfter:
# - ''
# HTML tags injected before ends
# metaScripts:
# - ''
# - ''
# - ''
# HTML tags injected first child at