Skip to content
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

feat: add HostnameImmutable to aws endpoint config #1230

Merged
merged 3 commits into from
Apr 14, 2023

Conversation

zhaochunqi
Copy link
Contributor

When uploading files without the old config. Server url like "https://minio.test.com" would be converted to "https://bucketname.minio.test.com". For the self-host minio instance, the upload would get errors. With this config enabled, everything would just work perfectly!

some resource related: https://stackoverflow.com/questions/67575681/is-aws-go-sdk-v2-integrated-with-local-minio-server

@zhaochunqi zhaochunqi requested a review from boojack as a code owner March 2, 2023 14:52
@github-actions
Copy link

github-actions bot commented Mar 2, 2023

Uffizzi Preview deployment-17992 was deleted.

@boojack boojack requested a review from Zeng1998 March 2, 2023 16:36
@HappyZ
Copy link
Contributor

HappyZ commented Mar 2, 2023

I think this relates to my question about using UsePathStyle flag. See https://stackoverflow.com/questions/65953564/issue-with-s3-bucket-naming-policy-and-attempting-to-send-sdk-generated-requests (see updated comment) for counter argument to this change.

@zhaochunqi
Copy link
Contributor Author

zhaochunqi commented Mar 3, 2023

I think this relates to my question about using UsePathStyle flag. See https://stackoverflow.com/questions/65953564/issue-with-s3-bucket-naming-policy-and-attempting-to-send-sdk-generated-requests (see updated comment) for counter argument to this change.

Thanks for the information. That explains why I saw some people here using minio without a problem. Seems like using camelCase won't encounter this problem due to the SDK fallback.

Copy link
Contributor

@Zeng1998 Zeng1998 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said in issue #1176 , in fact, personally, I don't recommend making some changes to the URL style of S3.

@zhaochunqi
Copy link
Contributor Author

As I said in issue #1176 , in fact, personally, I don't recommend making some changes to the URL style of S3.

Could we make an option for this? For self-hosted minio, it's not necessary to implement urls like bucketname.minio.test.com, and if we do want to use URLs like that for an s3 bucket, we can directly set url like https://bucketname.minio.test.com to the endpoint.

Copy link

@soheil soheil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I've reviewed your code changes, and have some feedback for you:

The added changes looks great, it looks like you've added support for S3-compatible urls for minio!

One suggestion I have is to add comments to explain the code changes. This should help other developers understand what you've done.

Apart from that, I have no further feedback to provide. Keep up the great work!

plugin/storage/s3/s3.go Outdated Show resolved Hide resolved
plugin/storage/s3/s3.go Show resolved Hide resolved
@zhaochunqi
Copy link
Contributor Author

In fact, it might be a better choice to add this as an option to the UI. That way, existing configurations won't have problems with it.

@zhaochunqi zhaochunqi requested a review from soheil April 14, 2023 15:28
Copy link
Collaborator

@boojack boojack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boojack boojack changed the title add config to support S3-compatible urls like minio feat: add HostnameImmutable to aws endpoint config Apr 14, 2023
@boojack boojack enabled auto-merge (squash) April 14, 2023 16:17
@boojack boojack merged commit d0c4049 into usememos:main Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants