This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 16fb0f7fb1a445567c3c82033601012124124e5f Author: Raphael Ouazana <[email protected]> AuthorDate: Tue Aug 25 16:12:02 2020 +0200 JAMES-3028 Docker configuration change for S3 usage --- dockerfiles/run/docker-compose.yml | 12 +++++++++--- .../cassandra-rabbitmq-ldap/destination/conf/blob.properties | 5 +++-- .../cassandra-rabbitmq/destination/conf/blob.properties | 5 +++-- .../apache/james/blob/objectstorage/aws/S3DumbBlobStore.java | 5 +++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dockerfiles/run/docker-compose.yml b/dockerfiles/run/docker-compose.yml index d0fc0fe..3922905 100644 --- a/dockerfiles/run/docker-compose.yml +++ b/dockerfiles/run/docker-compose.yml @@ -43,6 +43,12 @@ services: - "15672:15672" s3: - image: scality/s3server:6018536a - ports: - - "8080:8000" + image: zenko/cloudserver:8.2.6 + container_name: s3.docker.test + environment: + - SCALITY_ACCESS_KEY_ID=accessKey1 + - SCALITY_SECRET_ACCESS_KEY=secretKey1 + - S3BACKEND=mem + - LOG_LEVEL=trace + - REMOTE_MANAGEMENT_DISABLE=1 + diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/blob.properties b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/blob.properties index a0cc636..c70b3c7 100644 --- a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/blob.properties +++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/blob.properties @@ -48,10 +48,11 @@ cache.enable=false # ========================================= ObjectStorage on S3 ============================================= # Mandatory if you choose s3 storage service, S3 authentication endpoint -objectstorage.s3.endPoint=http://scality:8080/ +objectstorage.s3.endPoint=http://s3.docker.test:8000/ # Mandatory if you choose s3 storage service, S3 region -objectstorage.s3.region=eu-west-1 +#objectstorage.s3.region=eu-west-1 +objectstorage.s3.region=us-east-1 # Mandatory if you choose aws-s3 storage service, access key id configured in S3 objectstorage.s3.accessKeyId=accessKey1 diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/blob.properties b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/blob.properties index bfe3c59..1797038 100644 --- a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/blob.properties +++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/blob.properties @@ -47,10 +47,11 @@ cache.enable=false # ========================================= ObjectStorage on S3 ============================================= # Mandatory if you choose s3 storage service, S3 authentication endpoint -objectstorage.s3.endPoint=http://scality:8080/ +objectstorage.s3.endPoint=http://s3.docker.test:8000/ # Mandatory if you choose s3 storage service, S3 region -objectstorage.s3.region=eu-west-1 +#objectstorage.s3.region=eu-west-1 +objectstorage.s3.region=us-east-1 # Mandatory if you choose aws-s3 storage service, access key id configured in S3 objectstorage.s3.accessKeyId=accessKey1 diff --git a/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3DumbBlobStore.java b/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3DumbBlobStore.java index 629c94f..476f98a 100644 --- a/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3DumbBlobStore.java +++ b/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3DumbBlobStore.java @@ -60,6 +60,7 @@ import software.amazon.awssdk.core.async.SdkPublisher; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient; import software.amazon.awssdk.services.s3.S3AsyncClient; +import software.amazon.awssdk.services.s3.S3Configuration; import software.amazon.awssdk.services.s3.model.BucketAlreadyOwnedByYouException; import software.amazon.awssdk.services.s3.model.DeleteObjectsResponse; import software.amazon.awssdk.services.s3.model.GetObjectResponse; @@ -85,6 +86,9 @@ public class S3DumbBlobStore implements DumbBlobStore, Closeable { @Inject S3DumbBlobStore(AwsS3AuthConfiguration configuration, Region region) { + S3Configuration pathStyleAccess = S3Configuration.builder() + .pathStyleAccessEnabled(true) + .build(); client = S3AsyncClient.builder() .credentialsProvider(StaticCredentialsProvider.create( AwsBasicCredentials.create(configuration.getAccessKeyId(), configuration.getSecretKey()))) @@ -93,6 +97,7 @@ public class S3DumbBlobStore implements DumbBlobStore, Closeable { .maxPendingConnectionAcquires(10_000)) .endpointOverride(configuration.getEndpoint()) .region(region.asAws()) + .serviceConfiguration(pathStyleAccess) .build(); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
