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

Fix S3 Endpoint or Region configuration. #55

Merged

Conversation

Antiarchitect
Copy link
Contributor

No description provided.

@schabdo
Copy link
Contributor

schabdo commented Mar 26, 2020

Cool, thanks a lot for handing in a fix! It looks like you used the wrong email which has no ECA attached

@schabdo schabdo added the bug label Mar 26, 2020
@Antiarchitect Antiarchitect force-pushed the fix-s3-endpoint-configuration branch from b298db4 to 5ab68fd Compare March 26, 2020 16:46
Signed-off-by: Andrey Voronkov <avoronkov@enapter.com>
@Antiarchitect Antiarchitect force-pushed the fix-s3-endpoint-configuration branch from 5ab68fd to bba8bbf Compare March 26, 2020 16:48
@Antiarchitect
Copy link
Contributor Author

Antiarchitect commented Mar 26, 2020

Now it looks much better. If we have an endpoint we don't need a region at all. But let me test it a bit

Signed-off-by: Andrey Voronkov <avoronkov@enapter.com>
@Antiarchitect
Copy link
Contributor Author

Good news, everyone!
Just tested it with S3 and MinIO - everything works just fine. Updated README with MinIO section. Think you can merge.

@@ -83,11 +83,10 @@ public ClientConfiguration awsClientConfiguration() {
public AmazonS3 amazonS3() {
final AmazonS3ClientBuilder s3ClientBuilder = AmazonS3ClientBuilder.standard()
.withCredentials(awsCredentialsProvider()).withClientConfiguration(awsClientConfiguration());
if (!StringUtils.isEmpty(region)) {
if (!StringUtils.isEmpty(endpoint)) {
s3ClientBuilder.withEndpointConfiguration(new EndpointConfiguration(endpoint, ""));
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't you set region as well if it is provided via property aws.region?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not necessary as it goes

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, for my briefness. I was thinking more about other users/programmers who maybe want to use manually set S3 endpoint and use AWS's SigV4 signing (which may require the region to be set). What do you think? Will this work for MinIO as well?

if (!StringUtils.isEmpty(endpoint)) {
   final String signingRegion = StringUtils.isEmpty(region) ? "" : region;
   s3ClientBuilder.withEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion));
} else if (!StringUtils.isEmpty(region)) {
   s3ClientBuilder.withRegion(region);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably. I will try to build it and test tomorrow.

@schabdo
Copy link
Contributor

schabdo commented Mar 31, 2020

Good news, everyone!
Just tested it with S3 and MinIO - everything works just fine. Updated README with MinIO section

Indeed! Thanks a lot for providing a small "how to setup" for MinIO right away. I only have one minor remark about the region (see above) before we merge this PR to master

@schabdo schabdo linked an issue Mar 31, 2020 that may be closed by this pull request
Signed-off-by: Andrey Voronkov <avoronkov@enapter.com>
@Antiarchitect Antiarchitect force-pushed the fix-s3-endpoint-configuration branch from 3dbcf87 to 2641942 Compare April 2, 2020 18:53
@Antiarchitect
Copy link
Contributor Author

Antiarchitect commented Apr 2, 2020

@schabdo Sorry for the delay! I've just tested your variant with MinIO (aws.region + aws.s3.endpoint) and true AWS S3 (aws.region only) and all works fine!

@schabdo
Copy link
Contributor

schabdo commented Apr 7, 2020

No worries, as you see I need sometimes a bit more time to answer, too 😄
Thanks a lot for testing! I think we're good to go ...

@schabdo schabdo merged commit 909dc56 into eclipse-hawkbit:master Apr 7, 2020
@Antiarchitect Antiarchitect deleted the fix-s3-endpoint-configuration branch April 7, 2020 09:38
@schabdo schabdo added this to the 0.3.0M7 milestone Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

S3 configuration: request for help
2 participants