@yimeng.ch/verdaccio-minio
v6.2.0
Published
Verdaccio 6 storage plugin for MinIO / S3 (fork of barolab/[email protected], upgraded from the v4 to the v6 plugin API, zero @verdaccio/* runtime deps)
Downloads
433
Maintainers
Readme
verdaccio-minio (v6 fork)
Verdaccio 6.x storage plugin backed by MinIO / S3-compatible object storage.
Forked from barolab/verdaccio-minio 0.2.5
(which targeted the Verdaccio 4.x plugin API and has been unmaintained since 2020-03),
ported to the Verdaccio 6 plugin API:
- No
@verdaccio/*runtime dependencies — the plugin duck-types the storage interface, so it cannot break on@verdaccio/core/@verdaccio/streamsupgrades. - Single runtime dependency:
minio(v8). - Constructor defensively accepts both
(config, { logger })(v4 style) and(config, logger)(v6 style) call signatures. - Object layout in the bucket is unchanged from the original plugin
(
db.json,tokens.json,<pkg>/package.json,<pkg>/<tarball>), so data written by the old plugin remains readable.
Install
npm install --global @yimeng.ch/verdaccio-minio
# or in a custom Docker image:
# RUN npm install --global --omit=dev @yimeng.ch/verdaccio-minioConfiguration
The plugin is scoped, so the store key is the full package name
(Verdaccio resolves scoped plugin names as-is):
store:
'@yimeng.ch/verdaccio-minio':
endPoint: minio.internal # MinIO host (no protocol)
port: 9000 # default: 443 if useSSL else 80
useSSL: false
accessKey: ${MINIO_ACCESS_KEY}
secretKey: ${MINIO_SECRET_KEY}
bucket: verdaccio # default: "verdaccio"; auto-created on startup
region: us-east-1 # default: "us-east-1" (MinIO ignores it)
# prefix: verdaccio/ # optional: store all objects under
# "<bucket>/<prefix>/" so verdaccio can share
# a bucket with other data (slashes are
# normalized; omit for root-level storage)
# retry: # optional, wraps all storage operations
# delay: 500 # ms between retries (default 500)
# retries: 10 # attempts (default 10, -1 = forever)Credentials via environment (recommended): verdaccio does not expand
${VAR} placeholders inside the store section, so this plugin resolves
accessKey / secretKey itself — a missing value or a literal "${...}"
placeholder falls back to MINIO_ACCESS_KEY / MINIO_SECRET_KEY from the
environment. Credentials never need to live in the config file.
The bucket is created automatically on startup if the credentials have permission; otherwise create it beforehand.
Note: the prebuilt Docker image installs the plugin under its scoped name and additionally links it as
verdaccio-minio, so bothstore: '@yimeng.ch/verdaccio-minio':andstore: minio:work there. If you install the plugin yourself from source or a tarball under the unscoped nameverdaccio-minio, the store key is simplyminio:.
Notes
- Sharing a bucket: set
prefix(e.g.verdaccio/) and every object is written under<bucket>/<prefix>/, leaving other data in the bucket untouched. With a prefix configured you can also drop thes3:CreateBucketpermission —initialize()only creates the bucket when it is missing, so credentials only needListBucket+ object read/write/delete on the prefix. - Token storage (
saveToken/readTokens/deleteToken) is kept intokens.jsonin the same bucket, matching the Verdaccio 6 storage-plugin contract. searchstats, secrets (getSecret/setSecret) and the package list all live in the bucket, so multiple Verdaccio replicas can share one bucket — but concurrent writes todb.jsonare last-write-wins (same semantics as the original plugin; do not run write-heavy replicas concurrently).
