Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin-cloud-storage: Update S3 URL generation #4832

Closed
hdodov opened this issue Dec 19, 2022 · 3 comments
Closed

plugin-cloud-storage: Update S3 URL generation #4832

hdodov opened this issue Dec 19, 2022 · 3 comments
Labels
plugin: cloud-storage @payloadcms/plugin-cloud-storage

Comments

@hdodov
Copy link
Contributor

hdodov commented Dec 19, 2022

Currently, the plugin generates URLs like that:

https://s3.us-west-1.amazonaws.com/my-bucket/my-prefix/my-image.jpg

Notice how the bucket is specified as part of the path. S3 also supports specifying the bucket as part of the origin, like that:

https://my-bucket.s3.us-west-1.amazonaws.com/my-prefix/my-image.jpg

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 the endpoint will contain the bucket name already.

@dominikzogg
Copy link
Contributor

@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.

@paulpopus
Copy link
Contributor

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.

@paulpopus paulpopus transferred this issue from payloadcms/plugin-cloud-storage Jan 16, 2024
@paulpopus paulpopus added the plugin: cloud-storage @payloadcms/plugin-cloud-storage label Jan 16, 2024
@paulpopus paulpopus changed the title Update S3 URL generation plugin-cloud-storage: Update S3 URL generation Jan 16, 2024
@denolfe
Copy link
Member

denolfe commented Apr 2, 2024

Moving this to feature request. We can continue the discussion there.

@payloadcms payloadcms locked and limited conversation to collaborators Apr 2, 2024
@denolfe denolfe converted this issue into discussion #5591 Apr 2, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
plugin: cloud-storage @payloadcms/plugin-cloud-storage
Projects
None yet
Development

No branches or pull requests

4 participants