diff --git a/conf/full.yaml b/conf/full.yaml index 7700da2ad..8173528b7 100644 --- a/conf/full.yaml +++ b/conf/full.yaml @@ -92,6 +92,11 @@ packages: # Advanced settings ##################################################################### +## Special packages publish configurations +#publish: +## This will allow the publisher to publish packages even if any uplink is down. +# allow_offline: true + # if you use nginx with custom path, use this to override links #url_prefix: https://dev.company.local/verdaccio/ diff --git a/src/lib/storage.js b/src/lib/storage.js index 5b5aa0c5b..9c1be72ca 100644 --- a/src/lib/storage.js +++ b/src/lib/storage.js @@ -83,6 +83,11 @@ class Storage { // if uplink fails with a status other than 404, we report failure if (_.isNil(err_results[i][0]) === false) { if (err_results[i][0].status !== 404) { + if (_.isNil(this.config.publish) === false && + _.isBoolean(this.config.publish.allow_offline) && + this.config.publish.allow_offline) { + return resolve(); + } return reject(Error[503]('one of the uplinks is down, refuse to publish')); } }