Gathering detailed insights and metrics for @airteam/strapi-provider-upload-aws-s3-advanced
Gathering detailed insights and metrics for @airteam/strapi-provider-upload-aws-s3-advanced
Gathering detailed insights and metrics for @airteam/strapi-provider-upload-aws-s3-advanced
Gathering detailed insights and metrics for @airteam/strapi-provider-upload-aws-s3-advanced
A partial fork of https://github.com/strapi/strapi to extend the S3 Upload Provider to support path prefixes inside a bucket
npm install @airteam/strapi-provider-upload-aws-s3-advanced
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (98.38%)
JavaScript (1.62%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
27 Stars
78 Commits
24 Forks
3 Watchers
5 Branches
6 Contributors
Updated on Aug 29, 2024
Latest Version
4.0.8
Package Id
@airteam/strapi-provider-upload-aws-s3-advanced@4.0.8
Unpacked Size
17.66 kB
Size
6.72 kB
File Count
9
NPM Version
8.1.3
Node Version
14.17.6
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
This extends the original configurability of the provider by adding both a baseUrl
, which may be your CDN URL, which replaces the endpoint returned from AWS with a custom URL, and prefix
, which does exactly that: prefixes the object's path such that we do not strictly upload into the buckets root directory. This can be used to keep the bucket organized.
Everything else follows the regular strapi-provider-upload-aws-s3 schema.
Your configuration is passed down to the provider. (e.g: new AWS.S3(config)
). You can see the complete list of options here
See the using a provider documentation for information on installing and using a provider. And see the environment variables for setting and using environment variables in your configs.
./config/plugins.js
1module.exports = ({ env }) => ({ 2 // ... 3 upload: { 4 provider: "aws-s3-advanced", 5 providerOptions: { 6 accessKeyId: env("AWS_ACCESS_KEY_ID"), 7 secretAccessKey: env("AWS_ACCESS_SECRET"), 8 region: env("AWS_REGION"), 9 params: { 10 bucket: env("AWS_BUCKET"), 11 }, 12 baseUrl: env("CDN_BASE_URL"), // e.g. https://cdn.example.com, this is stored in strapi's database to point to the file 13 prefix: env("BUCKET_PREFIX"), // e.g. strapi-assets, note the missing slash at the start 14 }, 15 }, 16 // ... 17});
If using strapi >= 4.0.0, please use the below config:
./config/plugins.js
1module.exports = ({ env }) => ({ 2 // ... 3 upload: { 4 config: { 5 provider: "strapi-provider-upload-aws-s3-advanced", 6 providerOptions: { 7 accessKeyId: env("AWS_ACCESS_KEY_ID"), 8 secretAccessKey: env("AWS_ACCESS_SECRET"), 9 region: env("AWS_REGION"), 10 params: { 11 bucket: env("AWS_BUCKET"), 12 }, 13 baseUrl: env("CDN_BASE_URL"), // e.g. https://cdn.example.com, this is stored in strapi's database to point to the file 14 prefix: env("BUCKET_PREFIX"), // e.g. strapi-assets, note the missing slash at the start 15 }, 16 }, 17 }, 18 // ... 19});
Note: If you are migrating from a pre-4.0.0 version (i.e. v3.6.8 or earlier), the
files
relation will includeaws-s3-advanced
as the provider. Previously, the prefix "strapi-upload-provider" was assumed to always be present for upload provider plugins. This is no longer the case in >= 4.0.0, hence when uploading with the newer version of this provider, strapi will insert new files with the full provider package name, i.e.,strapi-provider-upload-aws-s3-advanced
. See Migration for details on the required manual work.
To allow the thumbnails to properly populate, add the below config to
./config/middlewares.js
1module.exports = ({ env }) => [ 2 // ... 3 { 4 name: "strapi::security", 5 config: { 6 contentSecurityPolicy: { 7 useDefaults: true, 8 directives: { 9 "connect-src": ["'self'", "https:"], 10 "img-src": ["'self'", "data:", "blob:", `${env("CDN_BASE_URL")}`], 11 "media-src": ["'self'", "data:", "blob:", `${env("CDN_BASE_URL")}`], 12 upgradeInsecureRequests: null, 13 }, 14 }, 15 }, 16 }, 17 // ... 18];
Strapi now uses the full package name as provider name, as seen in the configuration of the provider in the Example section above. This means that the relation will include different provider names when using the newer version of this provider with strapi >= 4.0.0 on data from pre-4.0.0. In particular, you will find that the pre-4.0.0 files
will have the provider aws-s3-advanved
, while the newer ones will have strapi-provider-aws-s3-advanved
. If you're not going to change the existing files in your CDN, you will not need to take any actions. The provider attribute is only used for mapping the handler for creating or deleting files to the handlers defined in this provider. Files will remain readable with the old provider and new files will be added with the new provider name. Only if you want to delete old files from the new provider, you will be required to adapt the files
table.
In strapi >= 4.0.0, only SQL databases are officially supported, so we will only provide queries for the supported backends:
1UPDATE files SET provider = 'strapi-provider-upload-aws-s3-advanced' WHERE provider = 'aws-s3-advanced';
1UPDATE `files` SET `provider` = `strapi-provider-upload-aws-s3-advanced` WHERE `provider` = `aws-s3-advanced`;
1UPDATE files SET provider = 'strapi-provider-upload-aws-s3-advanced' WHERE provider = 'aws-s3-advanced';
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/14 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More