0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00
verdaccio/website/translated_docs/zh-Hans/uplinks.md
verdacciobot 81f367f4b2 New Crowdin translations (#871)
* New translations uplinks.md (Chinese Simplified)
docs(website): new translations

* New translations uplinks.md (Chinese Simplified)
docs(website): new translations

* New translations what-is-verdaccio.md (Chinese Simplified)
docs(website): new translations

* New translations config.md (Chinese Simplified)
docs(website): new translations

* New translations plugins.md (Chinese Simplified)
docs(website): new translations

* New translations config.md (Chinese Simplified)
docs(website): new translations

* New translations what-is-verdaccio.md (Chinese Simplified)
docs(website): new translations

* New translations windows.md (Chinese Simplified)
docs(website): new translations

* New translations dev-plugins.md (Chinese Simplified)
docs(website): new translations

* New translations dev-plugins.md (Chinese Simplified)
docs(website): new translations

* New translations dev-plugins.md (Chinese Simplified)
docs(website): new translations

* New translations dev-plugins.md (Chinese Simplified)
docs(website): new translations

* New translations dev-plugins.md (Chinese Simplified)
docs(website): new translations

* New translations docker.md (Chinese Simplified)
docs(website): new translations

* New translations docker.md (Chinese Simplified)
docs(website): new translations

* New translations docker.md (Chinese Simplified)
docs(website): new translations

* New translations docker.md (Chinese Simplified)
docs(website): new translations

* New translations docker.md (Chinese Simplified)
docs(website): new translations

* New translations contributing.md (Spanish)
docs(website): new translations

* New translations contributing.md (Chinese Simplified)
docs(website): new translations

* New translations contributing.md (Portuguese, Brazilian)
docs(website): new translations

* New translations config.md (Spanish)
docs(website): new translations

* New translations web.md (Portuguese, Brazilian)
docs(website): new translations

* New translations web.md (Spanish)
docs(website): new translations

* New translations config.md (Chinese Simplified)
docs(website): new translations

* New translations config.md (Portuguese, Brazilian)
docs(website): new translations

* New translations web.md (Chinese Simplified)
docs(website): new translations

* New translations install.md (Chinese Simplified)
docs(website): new translations

* New translations node-api.md (Chinese Simplified)
docs(website): new translations

* New translations contributing.md (Chinese Simplified)
docs(website): new translations

* New translations web.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations plugins.md (Spanish)
docs(website): new translations

* New translations plugins.md (Portuguese, Brazilian)
docs(website): new translations

* New translations plugins.md (Chinese Simplified)
docs(website): new translations

* New translations ansible.md (Polish)
docs(website): new translations

* New translations repositories.md (Polish)
docs(website): new translations

* New translations chef.md (Polish)
docs(website): new translations

* New translations puppet.md (Polish)
docs(website): new translations

* New translations ci.md (Polish)
docs(website): new translations

* New translations what-is-verdaccio.md (Polish)
docs(website): new translations

* New translations node-api.md (Polish)
docs(website): new translations

* New translations windows.md (Polish)
docs(website): new translations

* New translations web.md (Polish)
docs(website): new translations

* New translations use-cases.md (Polish)
docs(website): new translations

* New translations uplinks.md (Polish)
docs(website): new translations

* New translations test.md (Polish)
docs(website): new translations

* New translations ssl.md (Polish)
docs(website): new translations

* New translations server.md (Polish)
docs(website): new translations

* New translations reverse-proxy.md (Polish)
docs(website): new translations

* New translations protect-your-dependencies.md (Polish)
docs(website): new translations

* New translations auth.md (Polish)
docs(website): new translations

* New translations plugins.md (Polish)
docs(website): new translations

* New translations packages.md (Polish)
docs(website): new translations

* New translations notifications.md (Polish)
docs(website): new translations

* New translations logger.md (Polish)
docs(website): new translations

* New translations kubernetes.md (Polish)
docs(website): new translations

* New translations install.md (Polish)
docs(website): new translations

* New translations iis-server.md (Polish)
docs(website): new translations

* New translations docker.md (Polish)
docs(website): new translations

* New translations dev-plugins.md (Polish)
docs(website): new translations

* New translations contributing.md (Polish)
docs(website): new translations

* New translations config.md (Polish)
docs(website): new translations

* New translations cli.md (Polish)
docs(website): new translations

* New translations build.md (Polish)
docs(website): new translations

* New translations en.json (Polish)
docs(website): new translations
2018-08-01 22:25:11 +02:00

4.8 KiB
Raw Blame History

id title
uplinks上行链路 上行链路

上行链路 是指可以访问到外部包的外部注册服务器地址。

上行链路

用法

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/

配置

你可以定义多个上行链路,每一个都必须有唯一的名称(键值). 它们可以有多个属性:

属性 类型 必须的 范例 支持版本 描述 默认值
url string https://registry.npmjs.org/ 全部 外部注册服务器URL npmjs
ca string ~./ssl/client.crt' 全部 SSL证书文件路径 无默认值
timeout string 100ms 全部 为请求设置新的超时时间 30s
maxage string 10m 全部 请求返回信息时效,在此时间内不会发起相同的请求 2m
fail_timeout string 10m 全部 请求在连续失败超过指定次数后的最长等待重试时间 5m
max_fails number 2 全部 请求连续失败的最大次数限制 2
cache boolean [true,false] >= 2.1 缓存下载的远程tarball文件到本地 true
auth list 见下文 >= 2.5 指定“授权authorization”请求头的内容 详情见 禁用
headers list authorization: "Bearer SecretJWToken==" 全部 上行链路请求的请求头header列表 禁用
strict_ssl boolean [true,false] >= 3.0 为true时会检测SSL证书的有效性 true

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

须知

  • 自版本 v2.3.0以来, Verdaccio 不在使用Basic Authentication。verdaccio 所生成的所有令牌都基于 JWT (JSON Web Token)
  • 上行链路必须是兼容npm的注册服务器 例如: verdaccio, sinopia@1.4.0, npmjs registry, yarn registry, JFrog, Nexus and more.
  • 设置cache 为false可以帮助节省你的硬盘空间。 这将避免存储 tarballs,但是它将保留元数据在文件夹里
  • 配置过多的上行链路会导致包查询速度变慢这是因为相比较一个npm客户端每发送一次的请求verdaccio却需要向每个上行链路都发送一次这样的请求
  • 这些属性(timeout, maxage and fail_timeout) 的配置单位格式参考NGINX measurement units