mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
set default expiry time to 15 minutes
This commit is contained in:
parent
7fdc6377a5
commit
c4732fe50d
@ -27,7 +27,7 @@ npm install @strapi/provider-upload-aws-s3 --save
|
||||
- `providerOptions` is passed down during the construction of the provider. (ex: `new AWS.S3(config)`). [Complete list of options](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property)
|
||||
- `providerOptions.params` is passed directly to the parameters to each method respectively.
|
||||
- `ACL` is the access control list for the object. Defaults to `public-read`.
|
||||
- `signedUrlExpires` is the number of seconds before a signed URL expires. (See [how signed URLs work](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls.html)). Defaults to 7 days and URLs are only signed when ACL is set to `private`.
|
||||
- `signedUrlExpires` is the number of seconds before a signed URL expires. (See [how signed URLs work](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls.html)). Defaults to 15 minutes and URLs are only signed when ACL is set to `private`.
|
||||
- `Bucket` is the name of the bucket to upload to.
|
||||
- `actionOptions` is passed directly to the parameters to each method respectively. You can find the complete list of [upload/ uploadStream options](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property) and [delete options](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#deleteObject-property)
|
||||
|
||||
@ -54,7 +54,7 @@ module.exports = ({ env }) => ({
|
||||
region: env('AWS_REGION'),
|
||||
params: {
|
||||
ACL: env('AWS_ACL', 'public-read'),
|
||||
signedUrlExpires: env('AWS_SIGNED_URL_EXPIRES', 60 * 60 * 24 * 7),
|
||||
signedUrlExpires: env('AWS_SIGNED_URL_EXPIRES', 15 * 60),
|
||||
Bucket: env('AWS_BUCKET'),
|
||||
},
|
||||
},
|
||||
|
@ -96,7 +96,7 @@ module.exports = {
|
||||
{
|
||||
Bucket: config.params.Bucket,
|
||||
Key: fileKey,
|
||||
Expires: getOr(60 * 60 * 24 * 7, ['params', 'signedUrlExpires'], config), // 7 days
|
||||
Expires: getOr(15 * 60, ['params', 'signedUrlExpires'], config), // 15 minutes
|
||||
},
|
||||
(err, url) => {
|
||||
if (err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user