mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-23 22:27:34 -05:00
eb7a8e3528
fix #1328 and #720 Type: bug The following has been addressed in the PR: Instead of returning a 404 (Not Found) when npm, yarn, etc requests a package and the package cannot be acquired from an uplink due to a connection timeout, socket timeout, or connection reset problem, a 503 (service unavailable) is returned by Verdaccio instead. In limited testing of a few versions of npm and yarn, both of these clients correctly attempt to retry the request when a 503 is returned. Added functional tests to verify the behavior (this adds a dev dependency on nock, which provides HTTP request mocking Description: This resolves issue #1328 and #720, and ensures npm/yarn install commands don't fail immediately when there is an intermittent network timeout problem with an uplink. Instead Verdaccio will appropriately respond to the client with a 503. A 404 response (current behavior) incorrectly tells the client that the package does not exist (which may or may not be true) and to not try again.
134 lines
2.1 KiB
YAML
134 lines
2.1 KiB
YAML
storage: ./test-storage
|
|
|
|
max_users: 2
|
|
|
|
web:
|
|
enable: true
|
|
title: verdaccio-server-1
|
|
|
|
middlewares:
|
|
../fixtures/plugins/middlewares.uplink:
|
|
message: provides uplink mocking (e.g. simulates socket timeout)
|
|
|
|
auth:
|
|
auth-memory:
|
|
users:
|
|
test:
|
|
name: test
|
|
password: test
|
|
|
|
uplinks:
|
|
express:
|
|
url: http://localhost:55550/
|
|
timeout: 100ms
|
|
server2:
|
|
url: http://localhost:55552/
|
|
maxage: 0
|
|
server3:
|
|
url: http://localhost:55553/
|
|
baduplink:
|
|
url: http://localhost:55666/
|
|
|
|
logs:
|
|
- { type: stdout, format: pretty, level: trace }
|
|
|
|
packages:
|
|
'@test/*':
|
|
access: $all
|
|
publish: $all
|
|
proxy: server2
|
|
|
|
## mirror.js
|
|
'test-mirror-*':
|
|
access: $all
|
|
publish: $all
|
|
proxy: server2
|
|
|
|
## mirror.js
|
|
'testloop':
|
|
access: $all
|
|
publish: $all
|
|
proxy: server2
|
|
|
|
'testexp':
|
|
access: $anonymous
|
|
|
|
# used by tags.spec.js
|
|
'testexp_tag*':
|
|
access: $all
|
|
publish: $all
|
|
proxy: express
|
|
|
|
# used by gzip.spec.js
|
|
'testexp_gzip':
|
|
access: $all
|
|
publish: $all
|
|
proxy: express
|
|
|
|
# used by gh29.js
|
|
'testpkg-gh29':
|
|
access: $all
|
|
publish: $all
|
|
proxy: express
|
|
|
|
# used by preserve_tags_spec.js
|
|
'testpkg-preserve':
|
|
access: $all
|
|
publish: $all
|
|
proxy: express
|
|
|
|
# used by racycrash.js
|
|
'testexp-racycrash':
|
|
access: $all
|
|
publish: $all
|
|
proxy: express
|
|
|
|
# used by incomplete.js
|
|
'testexp-incomplete':
|
|
access: $all
|
|
publish: $all
|
|
proxy: express
|
|
|
|
'test-nullstorage*':
|
|
access: $all
|
|
publish: $all
|
|
proxy: server2
|
|
storage: sub_storage
|
|
|
|
'baduplink':
|
|
access: $all
|
|
publish: $all
|
|
proxy: baduplink
|
|
|
|
'test-access-only':
|
|
access: $all
|
|
publish: nobody
|
|
storage: sub_storage
|
|
|
|
'test-publish-only':
|
|
access: nobody
|
|
publish: $all
|
|
storage: sub_storage
|
|
|
|
'test-only-test':
|
|
access: test
|
|
publish: test
|
|
storage: sub_storage
|
|
|
|
'test-only-auth':
|
|
access: $authenticated
|
|
publish: $authenticated
|
|
storage: sub_storage
|
|
|
|
'test-uplink-timeout-*':
|
|
access: $all
|
|
proxy:
|
|
- server2
|
|
- server3
|
|
|
|
'*':
|
|
access: test $anonymous
|
|
publish: test $anonymous
|
|
|
|
# expose internal methods
|
|
_debug: true
|