10.4.0 ā€¢ Published 11 days ago

verdaccio-aws-s3-storage v10.4.0

Weekly downloads
509
License
MIT
Repository
github
Last release
11 days ago

verdaccio-aws-s3-storage

šŸ“¦ AWS S3 storage plugin for Verdaccio

verdaccio (latest) CircleCI Known Vulnerabilities codecov backers discord MIT node

Twitter followers Github backers stackshare

This plugin was forked based on verdaccio-s3-storage built in Typescript + other features added along the time. Both plugins might have vary in behaviour since then, we recommend use the AWS plugin on this repo due is under control of Verdaccio community and constantly upated.

See it in action

Basic Requirements

  • AWS Account (in case you are using the cloud)
  • Verdaccio server (4.0) (for 3.x use verdaccio-s3-storage instead)
npm install -g verdaccio

Usage

npm install verdaccio-aws-s3-storage

This will pull AWS credentials from your environment.

In your verdaccio config, configure

store:
  aws-s3-storage:
    bucket: your-s3-bucket
    keyPrefix: some-prefix # optional, has the effect of nesting all files in a subdirectory
    region: us-west-2 # optional, will use aws s3's default behavior if not specified
    endpoint: https://{service}.{region}.amazonaws.com # optional, will use aws s3's default behavior if not specified
    s3ForcePathStyle: false # optional, will use path style URLs for S3 objects
    tarballACL: private # optional, use public-read to work with CDN like Amazon CloudFront
    accessKeyId: your-access-key-id # optional, aws accessKeyId for private S3 bucket
    secretAccessKey: your-secret-access-key # optional, aws secretAccessKey for private S3 bucket
    sessionToken: your-session-token # optional, aws sessionToken for private S3 bucket
    proxy: your-proxy # optional, HTTP or HTTPS proxies if you can't connect to internet directly

The configured values can either be the actual value or the name of an environment variable that contains the value for the following options:

  • bucket
  • keyPrefix
  • region
  • endpoint
  • accessKeyId
  • secretAccessKey
  • sessionToken
  • proxy

If an environment variable is not set then it is assumed the value is the literal value given. For example, if S3_BUCKET is not set, then this will use a bucket named exactly "S3_BUCKET".

store:
  aws-s3-storage:
    bucket: S3_BUCKET
    keyPrefix: S3_KEY_PREFIX
    region: S3_REGION
    endpoint: S3_ENDPOINT
    accessKeyId: S3_ACCESS_KEY_ID
    secretAccessKey: S3_SECRET_ACCESS_KEY
    sessionToken: S3_SESSION_TOKEN
    proxy: HTTPS_PROXY

Additional properties can be defined for packages. The storage location corresponds to the folder in the S3 bucket.

packages:
  '@scope/*':
    access: all
    publish: $all
    storage: 'scoped'
  '**':
    access: $all
    publish: $all
    proxy: npmjs
    storage: 'public'

Specify ACL of Tarball Files

You can specify ACL of tarball files in S3 by the tarballACL configuration, set to 'private' by default. To enable S3 integrated CDN service (Amazon CloudFront for example), set tarballACL to 'public-read' to grant tarball files anonymous read permission.

store:
  aws-s3-storage:
    tarballACL: public-read

Developer Testing

In case of local testing, this project can be used self-efficiently. Four main ingredients are as follows:

  • config.yaml, see verdaccio documentation
  • The provided docker file allows to test the plugin, with no need for main verdaccio application
  • The provided docker-compose also provides minio in orchestration as a local substitute for S3 backend
  • Create and set content of registry.env as follows. This file does not exist on the repo and should be generated manually after cloning the project.
AWS_ACCESS_KEY_ID=foobar
AWS_SECRET_ACCESS_KEY=1234567e
AWS_DEFAULT_REGION=eu-central-1
AWS_S3_ENDPOINT=https://localhost:9000/
AWS_S3_PATH_STYLE=true

Execute the docker image for testing

You need the latest docker installed in your computer

docker-compose up

By default there is no bucket created, you might need to browse http://127.0.0.1:9000/minio/ and create the example bucket manually named rise and then restart docker-compose up.

The default values should work out of the box. If you change anything, make sure the corresponding variables are set in other parts of the ingredient as well.

10.4.0

11 days ago

10.3.3

3 months ago

10.3.2

8 months ago

10.3.1

1 year ago

10.3.0

2 years ago

11.0.0-6-next.10

2 years ago

10.2.0

2 years ago

10.2.1

2 years ago

11.0.0-6-next.9

2 years ago

10.1.3

2 years ago

11.0.0-6-next.8

3 years ago

11.0.0-6-next.7

3 years ago

10.1.2

3 years ago

11.0.0-6-next.6

3 years ago

11.0.0-6-next.5

3 years ago

10.1.0

3 years ago

10.1.1

3 years ago

10.0.0

3 years ago

9.7.2

4 years ago

9.7.1

4 years ago

9.7.0

4 years ago

9.6.1

4 years ago

9.6.0

4 years ago

9.5.0

4 years ago

10.0.0-next.1

4 years ago

10.0.0-next.0

4 years ago

9.4.0

4 years ago

9.3.2

4 years ago

9.3.1

4 years ago

9.3.0

4 years ago

9.2.0

4 years ago

9.1.0

4 years ago

9.0.0

4 years ago

8.5.3

4 years ago

8.5.2

4 years ago

8.5.1

4 years ago

8.5.0

4 years ago

8.4.2

4 years ago

8.4.1

4 years ago

8.4.0

4 years ago

8.3.0

5 years ago

8.2.0

5 years ago

8.2.0-next.0

5 years ago

8.1.2

5 years ago

8.1.1

5 years ago

8.1.0

5 years ago

8.0.1-next.1

5 years ago

8.0.0

5 years ago

8.0.0-next.4

5 years ago

8.0.0-next.2

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago