verdaccio
- verdaccio/verdaccio
- MIT, TS, JS
- NPM 私有仓库
- 插件
- 默认端口 4873
- 参考
- Endpoint
- Tarball
:pkg/-/:name-:ver.tgz
- Web
/-/web/detail/:pkg
/-/web/detail/:pkg/v/:version
- Tarball
# VERDACCIO_PUBLIC_URL=https://npm.wener.me
docker run --rm -it \
-e VERDACCIO_PORT=8080 \
-v $PWD/storage:/verdaccio/storage \
-v $PWD/conf:/verdaccio/conf \
-v $PWD/plugins:/verdaccio/plugins \
--name verdaccio verdaccio/verdaccio
config.yaml
- 内置分组 anonymous
- $authenticated
docker
- /verdaccio/storage/htpasswd
- /verdaccio/conf/config.yaml
- 如果出现地址异常,可尝试设置 env VERDACCIO_PORT
htpasswd -bc htpasswd admin admin
auth:
htpasswd:
file: ./htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
minio
- barolab/verdaccio
FROM verdaccio/verdaccio:5
USER root
ENV NODE_ENV=production
RUN yarn global add verdaccio-minio && \
ln -s /usr/local/share/.config/yarn/global/node_modules/verdaccio-minio /verdaccio/plugins/verdaccio-minio && \
chown -R 10001 /usr/local/share/.config/yarn/global/node_modules/verdaccio-minio && \
chown -R 10001 /verdaccio/plugins
USER verdaccio
/verdaccio/conf/config.yaml
# This points to the plugin folder above
plugins: /verdaccio/plugins
# This is mandatory, otherwise verdaccio won't boot
storage: /verdaccio/storage/data
store:
minio:
port: 9000
endPoint: minio.minio.svc.cluster.local
accessKey: this-is-not-so-secret
secretKey: this-is-not-so-secret
useSSL: false
region: eu-west-1
bucket: 'npm'
retries: 3
delay: 50
ERR_SOCKET_TIMEOUT
- 走代理拉取,可能慢
# 修改 timeout
echo timeout=60000 >> .npmrc
npm config ls -l | grep fetch
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
fetch-timeout = 300000
Cannot publish over existing version
- https://github.com/verdaccio/verdaccio/issues/1402
- 目前只能 unpublish
npm publish --force --access restricted