plugin-cloud-storage: Update S3 URL generation #5591
Replies: 3 comments
-
@hdodov please take into account that S3 doesn't mean AWS only, so for example a self hosted minio should work as well. So the current url generation is more generic usable. |
Beta Was this translation helpful? Give feedback.
-
This plugin is now being maintained in the Packages Directory of the Payload Monorepo. This repo will soon be archived and all open issues will be closed. This issue, however, will be transferred over. |
Beta Was this translation helpful? Give feedback.
-
Moving this to feature request. We can continue the discussion there. |
Beta Was this translation helpful? Give feedback.
-
Currently, the plugin generates URLs like that:
Notice how the bucket is specified as part of the path. S3 also supports specifying the bucket as part of the origin, like that:
I think the latter is preferred, because all URLs in the Amazon console look like that. Also, this answer on Server Fault states that Amazon my sometimes redirect from the old deprecated form (that Payload uses) to the new one.
I think this should be changed:
https://github.com/payloadcms/plugin-cloud-storage/blob/e11a0fb28534b7d9fd0e91b51e7ab4df6cad664c/src/adapters/s3/generateURL.ts#L10-L14
If the new URL scheme is used, I think the
bucket
option can be dropped, because theendpoint
will contain the bucket name already.Beta Was this translation helpful? Give feedback.
All reactions