Skip to content

Commit

Permalink
Fix #78 Add new setting to allow publish when uplinks are offline
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpicado committed Jul 22, 2017
1 parent e84ff19 commit 890922a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions conf/full.yaml
Expand Up @@ -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/

Expand Down
3 changes: 3 additions & 0 deletions src/lib/storage.js
Expand Up @@ -83,6 +83,9 @@ 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 && this.config.publish.allow_offline) {
return resolve();
}
return reject(Error[503]('one of the uplinks is down, refuse to publish'));
}
}
Expand Down

0 comments on commit 890922a

Please sign in to comment.