adminjs-upload icon indicating copy to clipboard operation
adminjs-upload copied to clipboard

AWS provider improvements

Open ivictbor opened this issue 1 year ago • 0 comments

  1. Add previewBaseUrl, which allows overriding hardcoded 'https://${bucket}.s3.amazonaws.com' why: This allows specifying URL for buckets served via CDN and static website hosting, example of such hosting https://support.cloudflare.com/hc/en-us/articles/360037983412-Configuring-an-Amazon-Web-Services-static-site-to-use-Cloudflare For example, if my S3 bucket is named static.example.com then I will not be able to get it's public files (with public-read ACL) using https://${bucket}.s3.amazonaws.com/myfile.png -> https://static.example.com.s3.amazonaws.com/myfile.png, because buckets with dot's not covered by AWS SSL certificate. To fix this you might also want to use https://s3.${region}.amazonaws.com/${bucket}/myfile.png - here we use a standard domain, which has a good certificate, I would recommend using this endpoint because this is more universal (I did not perform this in pull request because probably you also other reasons, and my current option is backward compatible for all existing installations) But ideally, me and other users who are serving S3 buckets via CDN, need the ability to load images from https://static.example.com/myfile.png (it preaches images on CDN and makes URLs more similar to those which we use in prod

  2. I added Content-Type Metadata to s3 which is useful in multiple cases. For example, when you upload SVGs, S3 sets System Content-Type application/octet-stream which brakes disposition and is subject to CORB

ivictbor avatar Mar 13 '23 15:03 ivictbor