evershop icon indicating copy to clipboard operation
evershop copied to clipboard

[BUG] AWS S3 Extension doesn't upload images correctly

Open casank25 opened this issue 10 months ago • 5 comments

Describe the bug After installing the AWS S3 extension and uploading the product image, the image fails to load and returns ERR_CERT_COMMON_NAME_INVALID error. There are multiple issues when uploading images.

  1. AWS does not provide SSL certificates for bucket-specific urls and Evershop extension doesn't use generic aws s3 url which are ok with HTTPS.
  2. When uploading the image, there is missing param acl: public-read so that images can be available online
  3. the Content-Type is set to application/octet-stream which will download the picture as a file instead of rendering it on the screen.
  4. There is no option to set any settings to correct this or to use Cloudfront.

There's no documentation that explains how to go around this and properly set configure the s3 extension.

To Reproduce Steps to reproduce the behavior:

  1. Login to dashboard
  2. Create New Product
  3. Under Media upload the image
  4. Image uploads but doesn't display

Expected behavior The product image should display in the dashboard

Background (please complete the following information):

  • NodeJS Version 20
  • Postgres Version 16.4
  • EverShop Version 1.2.2
  • OS: [e.g. Window, Ubuntu, Mac-OS] Ubuntu
  • Browser [e.g. Chrome, Safari] ANY

Additional context Add any other context about the problem here.

casank25 avatar Feb 12 '25 05:02 casank25

@treoden If you want I can create a PR for this. It should be literally 3 lines of code to get it to work unless you have different plans for this.

casank25 avatar Feb 12 '25 21:02 casank25

Hi @casank25 ,

Sure, Please go ahead.

Thanks again

treoden avatar Feb 13 '25 01:02 treoden

@treoden I've created a PR. How often do you release the fixes like these to production?

casank25 avatar Feb 13 '25 16:02 casank25

Hi @casank25 ,

This fix is for the extension s3 only it does not make changes to the core. So Let me give it a look and will release the new version for the extension soon.

Thanks

treoden avatar Feb 16 '25 10:02 treoden

@treoden - any news on s3 release ?

aramhakobyan avatar Mar 11 '25 20:03 aramhakobyan