* New translations docker.md (Italian) docs(website): new translations * New translations docker.md (Italian) docs(website): new translations * New translations docker.md (Italian) docs(website): new translations * New translations iis-server.md (Italian) docs(website): new translations * New translations install.md (Italian) docs(website): new translations * New translations iis-server.md (Italian) docs(website): new translations * New translations docker.md (Italian) docs(website): new translations * New translations iis-server.md (Italian) docs(website): new translations * New translations web.md (Italian) docs(website): new translations * New translations reverse-proxy.md (Italian) docs(website): new translations * New translations web.md (Korean) docs(website): new translations * New translations web.md (Polish) docs(website): new translations * New translations web.md (Vietnamese) docs(website): new translations * New translations web.md (Russian) docs(website): new translations * New translations web.md (Hindi) docs(website): new translations * New translations web.md (Portuguese) docs(website): new translations * New translations web.md (Spanish) docs(website): new translations * New translations web.md (Arabic) docs(website): new translations * New translations web.md (Portuguese, Brazilian) docs(website): new translations * New translations web.md (Chinese Simplified) docs(website): new translations * New translations web.md (Japanese) docs(website): new translations * New translations web.md (French) docs(website): new translations * New translations web.md (German) docs(website): new translations * New translations plugins.md (Italian) docs(website): new translations * New translations plugins.md (Korean) docs(website): new translations * New translations plugins.md (Polish) docs(website): new translations * New translations plugins.md (Vietnamese) docs(website): new translations * New translations plugins.md (Hindi) docs(website): new translations * New translations plugins.md (Portuguese) docs(website): new translations * New translations plugins.md (Russian) docs(website): new translations * New translations plugins.md (Spanish) docs(website): new translations * New translations plugins.md (Arabic) docs(website): new translations * New translations plugins.md (Chinese Simplified) docs(website): new translations * New translations plugins.md (Portuguese, Brazilian) docs(website): new translations * New translations plugins.md (Japanese) docs(website): new translations * New translations plugins.md (French) docs(website): new translations * New translations plugins.md (German) docs(website): new translations * New translations ansible.md (French) docs(website): new translations * New translations ansible.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations cli.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations build.md (French) docs(website): new translations * New translations build.md (French) docs(website): new translations * New translations cli.md (French) docs(website): new translations * New translations cli.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations en.json (Arabic) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations en.json (Arabic) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations en.json (Arabic) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations en.json (Arabic) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations en.json (Arabic) docs(website): new translations * New translations build.md (French) docs(website): new translations * New translations cli.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations en.json (Arabic) docs(website): new translations * New translations en.json (Arabic) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations cli.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations dev-plugins.md (French) docs(website): new translations * New translations auth.md (French) docs(website): new translations * New translations cli.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations plugins.md (Italian) docs(website): new translations * New translations plugins.md (Korean) docs(website): new translations * New translations plugins.md (Polish) docs(website): new translations * New translations plugins.md (Vietnamese) docs(website): new translations * New translations plugins.md (Hindi) docs(website): new translations * New translations plugins.md (Portuguese) docs(website): new translations * New translations plugins.md (Russian) docs(website): new translations * New translations plugins.md (Spanish) docs(website): new translations * New translations plugins.md (Arabic) docs(website): new translations * New translations plugins.md (Chinese Simplified) docs(website): new translations * New translations plugins.md (Portuguese, Brazilian) docs(website): new translations * New translations plugins.md (Japanese) docs(website): new translations * New translations plugins.md (French) docs(website): new translations * New translations build.md (French) docs(website): new translations * New translations plugins.md (German) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations dev-plugins.md (French) docs(website): new translations * New translations dev-plugins.md (French) docs(website): new translations * New translations dev-plugins.md (French) docs(website): new translations * New translations dev-plugins.md (French) docs(website): new translations * New translations ansible.md (Serbian (Cyrillic)) docs(website): new translations * New translations repositories.md (Serbian (Latin)) docs(website): new translations * New translations cli.md (Serbian (Latin)) docs(website): new translations * New translations config.md (Serbian (Latin)) docs(website): new translations * New translations contributing.md (Serbian (Latin)) docs(website): new translations * New translations dev-plugins.md (Serbian (Latin)) docs(website): new translations * New translations docker.md (Serbian (Latin)) docs(website): new translations * New translations iis-server.md (Serbian (Latin)) docs(website): new translations * New translations install.md (Serbian (Latin)) docs(website): new translations * New translations kubernetes.md (Serbian (Latin)) docs(website): new translations * New translations logger.md (Serbian (Latin)) docs(website): new translations * New translations notifications.md (Serbian (Latin)) docs(website): new translations * New translations packages.md (Serbian (Latin)) docs(website): new translations * New translations plugins.md (Serbian (Latin)) docs(website): new translations * New translations protect-your-dependencies.md (Serbian (Latin)) docs(website): new translations * New translations reverse-proxy.md (Serbian (Latin)) docs(website): new translations * New translations auth.md (Serbian (Latin)) docs(website): new translations * New translations server.md (Serbian (Latin)) docs(website): new translations * New translations ssl.md (Serbian (Latin)) docs(website): new translations * New translations test.md (Serbian (Latin)) docs(website): new translations * New translations uplinks.md (Serbian (Latin)) docs(website): new translations * New translations use-cases.md (Serbian (Latin)) docs(website): new translations * New translations web.md (Serbian (Latin)) docs(website): new translations * New translations windows.md (Serbian (Latin)) docs(website): new translations * New translations node-api.md (Serbian (Latin)) docs(website): new translations * New translations what-is-verdaccio.md (Serbian (Latin)) docs(website): new translations * New translations ci.md (Serbian (Latin)) docs(website): new translations * New translations puppet.md (Serbian (Latin)) docs(website): new translations * New translations chef.md (Serbian (Latin)) docs(website): new translations * New translations logo.md (Serbian (Latin)) docs(website): new translations * New translations build.md (Serbian (Latin)) docs(website): new translations * New translations ansible.md (Serbian (Latin)) docs(website): new translations * New translations auth.md (Serbian (Cyrillic)) docs(website): new translations * New translations protect-your-dependencies.md (Serbian (Cyrillic)) docs(website): new translations * New translations build.md (Serbian (Cyrillic)) docs(website): new translations * New translations cli.md (Serbian (Cyrillic)) docs(website): new translations * New translations config.md (Serbian (Cyrillic)) docs(website): new translations * New translations contributing.md (Serbian (Cyrillic)) docs(website): new translations * New translations dev-plugins.md (Serbian (Cyrillic)) docs(website): new translations * New translations docker.md (Serbian (Cyrillic)) docs(website): new translations * New translations iis-server.md (Serbian (Cyrillic)) docs(website): new translations * New translations install.md (Serbian (Cyrillic)) docs(website): new translations * New translations kubernetes.md (Serbian (Cyrillic)) docs(website): new translations * New translations logger.md (Serbian (Cyrillic)) docs(website): new translations * New translations notifications.md (Serbian (Cyrillic)) docs(website): new translations * New translations packages.md (Serbian (Cyrillic)) docs(website): new translations * New translations plugins.md (Serbian (Cyrillic)) docs(website): new translations * New translations repositories.md (Serbian (Cyrillic)) docs(website): new translations * New translations en.json (Serbian (Cyrillic)) docs(website): new translations * New translations reverse-proxy.md (Serbian (Cyrillic)) docs(website): new translations * New translations server.md (Serbian (Cyrillic)) docs(website): new translations * New translations ssl.md (Serbian (Cyrillic)) docs(website): new translations * New translations test.md (Serbian (Cyrillic)) docs(website): new translations * New translations uplinks.md (Serbian (Cyrillic)) docs(website): new translations * New translations use-cases.md (Serbian (Cyrillic)) docs(website): new translations * New translations web.md (Serbian (Cyrillic)) docs(website): new translations * New translations windows.md (Serbian (Cyrillic)) docs(website): new translations * New translations node-api.md (Serbian (Cyrillic)) docs(website): new translations * New translations what-is-verdaccio.md (Serbian (Cyrillic)) docs(website): new translations * New translations ci.md (Serbian (Cyrillic)) docs(website): new translations * New translations puppet.md (Serbian (Cyrillic)) docs(website): new translations * New translations chef.md (Serbian (Cyrillic)) docs(website): new translations * New translations logo.md (Serbian (Cyrillic)) docs(website): new translations * New translations en.json (Serbian (Latin)) docs(website): new translations * New translations dev-plugins.md (French) docs(website): new translations * New translations dev-plugins.md (French) docs(website): new translations * New translations dev-plugins.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations iis-server.md (French) docs(website): new translations * New translations iis-server.md (French) docs(website): new translations * New translations iis-server.md (French) docs(website): new translations * New translations iis-server.md (French) docs(website): new translations * New translations iis-server.md (French) docs(website): new translations * New translations iis-server.md (French) docs(website): new translations * New translations install.md (French) docs(website): new translations * New translations install.md (French) docs(website): new translations * New translations kubernetes.md (French) docs(website): new translations * New translations logger.md (French) docs(website): new translations * New translations logger.md (French) docs(website): new translations * New translations logger.md (French) docs(website): new translations * New translations logger.md (French) docs(website): new translations * New translations notifications.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations docker.md (French) docs(website): new translations * New translations notifications.md (French) docs(website): new translations * New translations notifications.md (French) docs(website): new translations * New translations notifications.md (French) docs(website): new translations * New translations packages.md (French) docs(website): new translations * New translations packages.md (French) docs(website): new translations * New translations packages.md (French) docs(website): new translations * New translations plugins.md (French) docs(website): new translations * New translations ansible.md (Serbian (Latin)) docs(website): new translations * New translations ansible.md (Serbian (Latin)) docs(website): new translations * New translations auth.md (Serbian (Latin)) docs(website): new translations * New translations auth.md (Serbian (Latin)) docs(website): new translations * New translations auth.md (Serbian (Latin)) docs(website): new translations * New translations build.md (Serbian (Latin)) docs(website): new translations * New translations chef.md (Serbian (Latin)) docs(website): new translations * New translations cli.md (Serbian (Latin)) docs(website): new translations * New translations ci.md (Serbian (Latin)) docs(website): new translations * New translations cli.md (Serbian (Latin)) docs(website): new translations * New translations uplinks.md (Serbian (Latin)) docs(website): new translations * New translations uplinks.md (Serbian (Latin)) docs(website): new translations * New translations uplinks.md (Serbian (Latin)) docs(website): new translations * New translations uplinks.md (Serbian (Latin)) docs(website): new translations * New translations packages.md (Korean) docs(website): new translations * New translations packages.md (Portuguese) docs(website): new translations * New translations packages.md (Vietnamese) docs(website): new translations * New translations packages.md (Italian) docs(website): new translations * New translations packages.md (Russian) docs(website): new translations * New translations packages.md (Serbian (Cyrillic)) docs(website): new translations * New translations packages.md (Serbian (Latin)) docs(website): new translations * New translations packages.md (Hindi) docs(website): new translations * New translations packages.md (French) docs(website): new translations * New translations packages.md (Arabic) docs(website): new translations * New translations packages.md (Chinese Simplified) docs(website): new translations * New translations packages.md (Spanish) docs(website): new translations * New translations packages.md (Portuguese, Brazilian) docs(website): new translations * New translations packages.md (Polish) docs(website): new translations * New translations packages.md (German) docs(website): new translations * New translations packages.md (Japanese) docs(website): new translations * New translations config.md (French) docs(website): new translations * New translations contributing.md (French) docs(website): new translations * New translations cli.md (French) docs(website): new translations * New translations config.md (French) docs(website): new translations
5.8 KiB
id | title |
---|---|
pacchetti | Accesso al pacchetto |
È una serie di restrizioni che permettono o limitano l'accesso all'archiviazione locale basandosi su criteri specifici.
Le restrizioni di sicurezza dipendono dal plugin che si sta utilizzando, verdaccio
usa di default il plugin htpasswd. Se si usa un plugin differente il funzionamento potrebbe essere diverso. Il plugin predefinito non gestisce direttamente allow_access
e allow_publish
, ma utilizza un'alternativa interna nel caso in cui il plugin non sia pronto per questo.
Per ulteriori informazioni sui permessi, visita la sezione autenticazione nella wiki.
Utilizzo
packages:
# scoped packages
'@scope/*':
access: $all
publish: $all
proxy: server2
'private-*':
access: $all
publish: $all
proxy: uplink1
'**':
# allow all users (including non-authenticated users) to read and
# publish all packages
access: $all
publish: $all
proxy: uplink2
se non ne viene specificato nemmeno uno, rimane quello predefinito
packages:
'**':
access: $all
publish: $authenticated
La lista di gruppi validi a seconda dei plugin predefiniti è
'$all', '$anonymous', '@all', '@anonymous', 'all', 'undefined', 'anonymous'
Tutti gli utenti ricevono tutti questi gruppi di permessi indipendentemente dal fatto che siano anonimi o no, più i gruppi previsti dal plugin, nel caso htpasswd
respinga lo username come un gruppo. Per esempio, se si è loggati come npmUser
l'elenco dei nomi sarà.
// groups without '$' are going to be deprecated eventually
'$all', '$anonymous', '@all', '@anonymous', 'all', 'undefined', 'anonymous', 'npmUser'
Se si desidera proteggere un insieme specifico di pacchetti dentro al proprio gruppo, è necessario fare qualcosa simile a questo. Utilizziamo un Regex
che copra tutti i pacchetti con prefisso npmuser-
. Raccomandiamo di utilizzare un prefisso per i pacchetti, in modo che possa essere più semplice proteggerli.
packages:
'npmuser-*':
access: npmuser
publish: npmuser
Riavviare verdaccio
e provare ad installare npmuser-core
nella console.
$ npm install npmuser-core
npm install npmuser-core
npm ERR! code E403
npm ERR! 403 Forbidden: npmuser-core@latest
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2017-07-02T12_20_14_834Z-debug.log
È possibile modificare la condotta esistente utilizzando un plugin di autenticazione differente. verdaccio
verifica semplicemente che l'utente che ha provato ad accedere o pubblicare un pacchetto specifico appartenga al gruppo corretto.
Definire gruppi multipli
Definire gruppi di accesso multipli è abbastanza facile, è sufficiente distinguerli semplicemente con uno spazio bianco tra di essi.
'company-*':
access: admin internal
publish: admin
proxy: server1
'supersecret-*':
access: secret super-secret-area ultra-secret-area
publish: secret ultra-secret-area
proxy: server1
Bloccare l'accesso a gruppi di pacchetti
Se si desidera bloccare l'accesso/pubblicazione ad uno specifico gruppo di pacchetti, è sufficiente non definire access
e publish
.
packages:
'old-*':
'**':
access: $all
publish: $authenticated
Bloccare l'inoltro di un gruppo di pacchetti specifici
Si potrebbe voler impedire che uno o vari pacchetti vengano raggiunti dai registri remoti, ma allo stesso tempo, permettere ad altri l'accesso a differenti uplink.
Vediamo l'esempio seguente:
packages:
'jquery':
access: $all
publish: $all
'my-company-*':
access: $all
publish: $authenticated
'@my-local-scope/*':
access: $all
publish: $authenticated
'**':
access: $all
publish: $authenticated
proxy: npmjs
Descriviamo quello che si desidera con l'esempio precedente:
- Desidero ospitare la mia dipendenza
jquery
ma ho necessità di evitare il suo inoltro. - Desidero tutte le dipendenze che coincidano con
my-company-*
ma ho necessità di evitare di inoltrarle. - Desidero tutte le dipendenze che si trovino nell'ambito
my-local-scope
ma ho necessità di evitare di inoltrarle. - Desidero l'inoltro per tutte le dipendenze rimanenti.
Non dimenticare l'importanza dell'ordine dei pacchetti e di utilizzare sempre il doppio asterisco. Poiché se non lo si include, verdaccio
lo includerà per voi e questo inciderà sulla modalità con cui le dipendenze sono risolte.
Configurazione
Si possono definire pacchetti
multipli ed ognuno di essi deve avere un Regex
unico. La sintassi è basata su espressioni minimatch glob.
Proprietà | Tipo | Richiesto | Esempio | Supporto | Descrizione |
---|---|---|---|---|---|
accesso | stringa | No | $all | tutti | definisce i gruppi autorizzati ad accedere al pacchetto |
pubblicazione | stringa | No | $authenticated | tutti | definisce i gruppi autorizzati a pubblicare |
proxy | stringa | No | npmjs | tutti | limita le ricerche di un uplink specifico |
archiviazione | variabile booleana | No | [vero/falso] | tutti | TODO |
Vogliamo rimarcare che non raccomandiamo più l'utilizzo di allow_access/allow_publish e proxy_access che sono superati e saranno presto rimossi, si prega di utilizzare invece la versione breve di ognuna di queste (access/publish/proxy).