Skip to main content

Uplinks

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

Uplinks

Korišćenje

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/

Configuration

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

SvojstvoTipPotrebnoPrimerPodrškaOpisPodrazumevano
urlstringDahttps://registry.npmjs.org/potpunaUrl registry-anpmjs
castringNo~./ssl/client.crt'potpunaPut do SSL sertifikataNema ništa zadato
timeoutstringNo100mspotpunapodesite novi timeout za request30s
maxagestringNo10mpotpunathe time threshold to the cache is valid2m
fail_timeoutstringNo10mpotpunadefiniše maksimalno vreme nakon kojeg zahtev postaje neuspešan5m
max_failsnumberNo2potpunalimitira maksimalni broj neuspelih zahteva2
cachebooleanNo[true,false]>= 2.1keširanje svih tarballs iz storage-atrue
authlistNovidi ispod>= 2.5dodeljuje zaglavlje 'Authorization' više informacijaonemogućeno
zaglavlja (headers)listNoautorizacija: "Bearer SecretJWToken=="potpunalista korisničkih, prilagođenih zaglavlja za uplinkonemogućeno
strict_sslbooleanNo[true,false]> = 3.0If true, zahteva da SSL certifikat bude validan.true
agent_optionsobjectNomaxSockets: 10>= 4.0.2options for the HTTP or HTTPS Agent responsible for managing uplink connection persistence and reuse more infoNema ništa zadato

Auth property

The auth property allows you to use an auth token with an uplink. Using the default environment variable:

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

ili preko definisane environment variable:

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

token_env: FOO_TOKENza internu upotrebu koristi process.env['FOO_TOKEN']

ili je direktno definisano tokenom:

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

Napomena: token ima prioritet nad token_env

Valjalo bi znati

  • 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.
  • Preterivanje sa uplinks može usporiti lookup Vaših packages-a jer svaki put kada npm client traži zahtev, verdaccio pravi 1 pozivanje za svaki uplink.
  • Format za (timeout, maxage i fail_timeout) je usklađen sa NGINX jedinicama mere