-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Closed
Copy link
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: core:uploadSource is core/upload packageSource is core/upload packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationWaiting for free time to reproduce the issue, or more information
Description
Bug report
Required System information
- Node.js version: 16
- NPM version: 8.3.1
- Strapi version: 4.10.5
- Database: Postgres
- Operating system: linux (node alpine docker)
- Is your project Javascript or Typescript: Typescript
Describe the bug
The AWS S3 provider plugin appears to use expired pre-signed URLs.
Also the readme is unclear about what the default expiry value is. Within the readme it says variously:
- "Defaults to 15 minutes"
- "The default value is 7 days"
Steps to reproduce the behavior
- set up the AWS S3 provider plugin with
ACL: 'private'and without explicitly settingsignedUrlExpires - upload an image to the media library
- insert that image into a rich text block and save it (the image should render correctly in the preview at this point)
- wait 20 minutes
- reload the rich text block
- the inserted image is broken because the presigned url has expired
Expected behavior
On reloading the saved text block, you should still see the inserted image.
Screenshots

A text block with a broken image

The response returned by AWS showing that the url expired after 15 minutes (900 seconds).
Code snippets
plugins.ts
export default ({ env }) => ({
upload: {
config: {
provider: env.bool('IS_LOCAL') ? 'local' : 'aws-s3',
providerOptions: {
region: env('AWS_REGION', 'eu-west-2'),
sslEnabled: true,
params: {
Bucket: env('CMS_S3_BUCKET', 'iwsr-test-strapi-media-library'),
ACL: 'private',
},
},
actionOptions: {
upload: {
ServerSideEncryption: 'AES256',
},
uploadStream: {
ServerSideEncryption: 'AES256',
},
},
},
},
});Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: core:uploadSource is core/upload packageSource is core/upload packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationWaiting for free time to reproduce the issue, or more information