Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@dotcom-tool-kit/upload-assets-to-s3
Advanced tools
Upload files to a configured AWS S3 bucket.
Install @dotcom-tool-kit/upload-assets-to-s3
as a devDependency
in your app:
npm install --save-dev @dotcom-tool-kit/upload-assets-to-s3
Add the plugin to your Tool Kit configuration:
plugins:
- '@dotcom-tool-kit/upload-assets-to-s3'
Key | Description | Default value |
---|---|---|
accessKeyIdEnvVar | variable name of the project's aws access key id | no default value - for backwards compatability the plugin falls back to the default value for accessKeyId |
secretAccessKeyEnvVar | variable name of the project's aws secret access key | no default value - for backwards compatability the plugin falls back to the default value for secretAccessKey |
accessKeyId | DEPRECATED variable name of the project's aws access key id | 'aws_access_hashed_assets' |
secretAccessKey | DEPRECATED variable name of the project's aws secret access key | 'aws_secret_hashed_assets' |
directory | the folder in the project whose contents will be uploaded to S3 | 'public' |
reviewBucket | the development or test S3 bucket | ['ft-next-hashed-assets-preview'] |
prodBucket | production S3 bucket/s; an array of strings. The same files will be uploaded to each | ['ft-next-hashed-assets-prod', 'ft-next-hashed-assets-prod-us'] |
destination | the destination folder for uploaded assets. Set to '' to upload assets to the top level of the bucket | 'hashed-assets/page-kit' |
extensions | file extensions to be uploaded to S3 | 'js,css,map,gz,br,png,jpg,jpeg,gif,webp,svg,ico,json' |
cacheControl | header that controls how long your files stay in a CloudFront cache before CloudFront forwards another request to your origin | 'public, max-age=31536000, stale-while-revalidate=60, stale-if-error=3600' |
Example:
'@dotcom-tool-kit/upload-assets-to-s3':
'@dotcom-tool-kit/upload-assets-to-s3':
accessKeyId: AWS_ACCESS
secretAccessKey: AWS_KEY
prodBucket: ['ft-next-service-registry-prod', 'ft-next-service-registry-prod-us']
reviewBucket: ['ft-next-service-registry-dev']
destination: ''
You can test uploads to S3 locally on your review bucket to check that you are happy with the configuration. To do this set your NODE_ENV
to branch
:
$ export NODE_ENV=branch
If the AWS key names for accessing the review bucket are different to the prod bucket then update those in the .toolkitrc.yml
.
The UploadAssetsToS3
task can run on any hook so you can configure it to run on a local hook to test deployment from the command line. For example, it could be added to your build:local
hook as follows:
plugins:
- '@dotcom-tool-kit/webpack'
- '@dotcom-tool-kit/upload-assets-to-s3'
hooks:
'build:local':
- WebpackDevelopment
- UploadAssetsToS3
Then running npm run build
will run the UploadAssetsToS3
task on your review bucket.
Name | Description | Preconfigured Hook |
---|---|---|
UploadAssetsTos3 | Uploads provided files to a given S3 bucket | release:remote |
FAQs
Upload files to a configured AWS S3 bucket.
The npm package @dotcom-tool-kit/upload-assets-to-s3 receives a total of 217 weekly downloads. As such, @dotcom-tool-kit/upload-assets-to-s3 popularity was classified as not popular.
We found that @dotcom-tool-kit/upload-assets-to-s3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.