Verdaccio

Verdaccio

  • Docs
  • Blog
  • Twitter
  • Help
  • GitHub
  • Team
  • 支持我们
  • Languages icon中文
    • English
    • Español
    • Français
    • Russian
    • Yoruba
    • 帮助翻译

›Features

Introduction

  • Verdaccio是什么?
  • 安装
  • 命令行工具
  • Using a private registry
  • 谁在使用 Verdaccio?
  • Security Policy
  • Logotype
  • Uses Cases

    • End to End testing
    • Caching strategies
    • GitHub Actions
    • 链接远程Registry

    Talks & Articles

    • Articles
    • Talks

Features

  • 配置文件
  • 上行链路
  • 包的访问
  • Authentication
  • 通知
  • 记录器
  • Web 用户界面

Server

  • 服务器配置
  • 逆向代理服务器设置
  • 设置SSL 证书
  • 作为 Windows 服务安装
  • IIS server上进行安装

Development

  • 插件
  • 插件开发
  • Dev Guides

    • Plugin Generator
    • Authentication Plugin(认证插件)
    • Middleware Plugin(Middleware 插件)
    • Storage Plugin(存储插件)
  • Node API

DevOps

  • Docker
  • Kubernetes
  • 持续集成
  • Cloud

    • 亚马逊Web服务

    Tools

    • Ansible
    • Puppet
    • Chef Cookbook

Guides

  • Best Practices
  • 保护包
  • Amazon Web Services
Translate

上行链路

An uplink is a link with an external registry that provides access to external packages.

上行链路

用法

uplinks:
  npmjs:
   url: https://registry.npmjs.org/
  server2:
    url: http://mirror.local.net/
    timeout: 100ms
  server3:
    url: http://mirror2.local.net:9000/
  baduplink:
    url: http://localhost:55666/

配置

You can define mutiple uplinks and each of them must have an unique name (key). They can have the following properties:

属性类型必须的范例支持版本描述默认值
urlstring是https://registry.npmjs.org/全部外部注册服务器URLnpmjs
castring否~./ssl/client.crt'全部SSL证书文件路径无默认值
timeoutstring否100ms全部为请求设置新的超时时间30s
maxagestring否10m全部the time threshold to the cache is valid2m
fail_timeoutstring否10m全部请求在连续失败超过指定次数后的最长等待重试时间5m
max_failsnumber否2全部请求连续失败的最大次数限制2
cacheboolean否[true,false]>= 2.1缓存下载的远程tarball文件到本地true
authlist否见下文>= 2.5指定“授权authorization”请求头的内容 详情见禁用
headerslist否authorization: "Bearer SecretJWToken=="全部上行链路请求的请求头header列表禁用
strict_sslboolean否[true,false]>= 3.0为true时,会检测SSL证书的有效性true
agent_optionsobject否maxSockets: 10>= 4.0.2options for the HTTP or HTTPS Agent responsible for managing uplink connection persistence and reuse more info无默认值

Auth属性

auth 属性内容是向上行链路发起请求时提供的授权令牌。例如使用默认环境变量:

uplinks:
  private:
    url: https://private-registry.domain.com/registry
    auth:
      type: bearer
      token_env: true # defaults to `process.env['NPM_TOKEN']`

或者使用一个指定的环境变量

uplinks:
  private:
    url: https://private-registry.domain.com/registry
    auth:
      type: bearer
      token_env: FOO_TOKEN

token_env: FOO_TOKEN内部将使用 process.env['FOO_TOKEN']

或者直接指定令牌:

uplinks:
  private:
    url: https://private-registry.domain.com/registry
    auth:
      type: bearer
      token: "token"

注意: token的优先级高于token_env

须知

  • Uplinks must be registries compatible with the npm endpoints. Eg: verdaccio, sinopia@1.4.0, npmjs registry, yarn registry, JFrog, Nexus and more.
  • Setting cache to false will help to save space in your hard drive. This will avoid store tarballs but it will keep metadata in folders.
  • Exceed with multiple uplinks might slow down the lookup of your packages due for each request a npm client does, verdaccio does 1 call for each uplink.
  • The (timeout, maxage and fail_timeout) format follow the NGINX measurement units
← 配置文件包的访问 →
Verdaccio
Docs
Getting StartedDockerConfigurationLogos
Community
User ShowcaseStack OverflowProject ChatFollow Verdaccio on Twitter
More
BlogGitHubStar