mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
change config file format + comments
This commit is contained in:
parent
c84413517f
commit
d91bef5ca0
2 changed files with 21 additions and 7 deletions
|
@ -103,15 +103,19 @@ function allow_action(package, who, action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.prototype.allow_access = function(package, user) {
|
Config.prototype.allow_access = function(package, user) {
|
||||||
return allow_action.call(this, package, user, 'access');
|
return allow_action.call(this, package, user, 'allow_access') || allow_action.call(this, package, user, 'access');
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.prototype.allow_publish = function(package, user) {
|
Config.prototype.allow_publish = function(package, user) {
|
||||||
return allow_action.call(this, package, user, 'publish');
|
return allow_action.call(this, package, user, 'allow_publish') || allow_action.call(this, package, user, 'publish');
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.prototype.allow_proxy = function(package, uplink) {
|
Config.prototype.proxy_access = function(package, uplink) {
|
||||||
return allow_action.call(this, package, uplink, 'proxy');
|
return allow_action.call(this, package, uplink, 'proxy_access') || allow_action.call(this, package, uplink, 'proxy');
|
||||||
|
}
|
||||||
|
|
||||||
|
Config.prototype.proxy_access = function(package, uplink) {
|
||||||
|
return allow_action.call(this, package, uplink, 'proxy_publish');
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.prototype.authenticate = function(user, password) {
|
Config.prototype.authenticate = function(user, password) {
|
||||||
|
|
|
@ -1,18 +1,28 @@
|
||||||
# path to a directory with all packages
|
# path to a directory with all packages
|
||||||
storage: ./storage
|
storage: ./storage
|
||||||
|
|
||||||
|
# a list of users
|
||||||
users:
|
users:
|
||||||
admin:
|
admin:
|
||||||
# crypto.createHash('sha1').update(pass).digest('hex')
|
# crypto.createHash('sha1').update(pass).digest('hex')
|
||||||
password: __PASSWORD__
|
password: __PASSWORD__
|
||||||
|
|
||||||
|
# a list of other known repositories we can talk to
|
||||||
uplinks:
|
uplinks:
|
||||||
npmjs:
|
npmjs:
|
||||||
url: https://registry.npmjs.org/
|
url: https://registry.npmjs.org/
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
'*':
|
'*':
|
||||||
publish: admin
|
# allow all users to read packages ('all' is a keyword)
|
||||||
access: all
|
# this includes non-authenticated (anonymous) users
|
||||||
proxy: npmjs
|
allow_access: all
|
||||||
|
|
||||||
|
# allow 'admin' to publish packages
|
||||||
|
allow_publish: admin
|
||||||
|
|
||||||
|
# if package is not available locally, proxy requests to 'npmjs' registry
|
||||||
|
proxy_access: npmjs
|
||||||
|
|
||||||
|
# when package is published locally, also push it to remote registry
|
||||||
|
#proxy_publish: none
|
||||||
|
|
Loading…
Reference in a new issue