Verdaccio

Verdaccio

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

›Uses Cases

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
  • 保护包
  • 亚马逊Web服务
Translate

链接远程Registry

Verdaccio将会代理,并在默认情况下链接公共registry。

uplinks:
  npmjs:
    url: https://registry.npmjs.org/

你可以关联多个registries,下述文档将会用一些有帮助的配置指引你。

使用关联范围

使用多个registries的唯一可行的方式,就是使用.npmrc。其功能如下:

// .npmrc
registry=https://registry.npmjs.org
@mycompany:registry=http://localhost:4873

This approach is valid, but comes with several disadvantages:

  • It only works with scopes
  • Scope must match, no Regular Expressions are allowed
  • One scope cannot fetch from multiple registries
  • Tokens/passwords must be defined within .npmrc and checked in into the repo.

See a full example here.

Linking a Registry

Linking a registry is fairly simple. First, define a new section in the uplinks section. Note, the order here is irrelevant.

  uplinks:
    private:
      url: https://private.registry.net/npm

    ... [truncated] ...

  'webpack':
    access: $all
    publish: $authenticated
    proxy: private

Add a proxy section to define the selected registry you want to proxy.

Linking Multiple Registries

  uplinks:
    server1:
      url: https://server1.registry.net/npm
    server2:
      url: https://server2.registry.net/npm

    ... [truncated] ...

  'webpack':
    access: $all
    publish: $authenticated
    proxy: server1 server2

Verdaccio supports multiple registries on the proxy field. The request will be resolved with the first in the list; if that fails, it will try with the next in the list and so on.

Offline Registry

Having a full Offline Registry is completely possible. If you don't want any connectivity with external remotes you can do the following.

<br />auth:
  htpasswd:
    file: ./htpasswd
uplinks:
packages:
  '@my-company/*':
    access: $all
    publish: none
  '@*/*':
    access: $all
    publish: $authenticated
  '**':
    access: $all
    publish: $authenticated

Remove all proxy fields within each section of packages. The registry will become full offline.

← GitHub ActionsArticles →
  • 使用关联范围
  • Linking a Registry
  • Linking Multiple Registries
  • Offline Registry
Verdaccio
Docs
Getting StartedDockerConfigurationLogos
Community
User ShowcaseStack OverflowProject ChatFollow Verdaccio on Twitter
More
BlogGitHubStar