Skip to content

Commit

Permalink
Refactoring (R3) storage profile service WiP (#4 #6).
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkins committed Dec 15, 2023
1 parent f32a2ed commit a91d711
Show file tree
Hide file tree
Showing 18 changed files with 437 additions and 374 deletions.
46 changes: 46 additions & 0 deletions backend/config/application.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@


#
################
# AWS STS
################
#
# storage configuration: backends.backends[1].id=https: //sts.amazonaws.com
backends.backends[1].name=AWS S3 STS
#
# bucket creation: backends.backends[1].bucket-prefix=cipherduck
backends.backends[1].sts-role-arn-hub=arn: aws: iam:: 930717317329: role/cipherduck-createbucket
backends.backends[1].sts-role-arn-client=arn: aws: iam:: 930717317329: role/cipherduck-createbucket
backends.backends[1].region=eu-west-1
backends.backends[1].regions=eu-west-1, eu-west-2, eu-west-3
#
# bookmark: backends.backends[1].jwe.protocol=s3-sts
backends.backends[1].jwe.provider=s3-sts-https
backends.backends[1].jwe.sts-role-arn=arn: aws: iam:: 930717317329: role/cipherduck_chain_01
backends.backends[1].jwe.sts-role-arn2=arn: aws: iam:: 930717317329: role/cipherduck_chain_02
#
##################
# MinIO localhost permanent
###################
#
# storage configuration: backends.backends[2].id=http: //minio:9000_static
backends.backends[2].name=MinIO S3 static
backends.backends[2].s3-endpoint=http: //minio:9000
#
# bookmark: backends.backends[2].jwe.protocol=s3
backends.backends[2].jwe.provider=s3-http-path-style
backends.backends[2].jwe.hostname=minio
backends.backends[2].jwe.port=9000
#
#
################
# AWS static
################
#
# storage configuration: backends.backends[3].id=AWS static
backends.backends[3].name=AWS S3 static
backends.backends[3].region=eu-central-1
#
# bookmark
backends.backends[3].jwe.protocol=s3
backends.backends[3].jwe.provider=s3-https
82 changes: 1 addition & 81 deletions backend/config/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,84 +10,4 @@
%cipherduck-testing.hub.keycloak.local-url=https://testing.hub.cryptomator.org/kc
%cipherduck-testing.quarkus.oidc.auth-server-url=https://testing.hub.cryptomator.org/kc/realms/cipherduck
%cipherduck-staging.hub.keycloak.realm=cipherduck
%cipherduck-testing.hub.keycloak.realm=cipherduck

#
##################
# MinIO localhost STS
###################
#
# storage configuration:
backends.backends[0].id=http://minio:9000
backends.backends[0].name=MinIO S3 STS
#
# bucket creation:
backends.backends[0].bucket-prefix=cipherduck
backends.backends[0].region=eu-central-1
backends.backends[0].regions=eu-west-1,eu-west-2,eu-west-3,eu-north-1,eu-south-1,eu-south-2,eu-central-1,eu-central-2
backends.backends[0].with-path-style-access-enabled=true
# (role for cryptomatorhub client -> bucket creation from hub frontend)
backends.backends[0].sts-role-arn-hub=arn:minio:iam:::role/HGKdlY4eFFsXVvJmwlMYMhmbnDE
# (role for cryptomator client -> bucket creation from Desktop client)
backends.backends[0].sts-role-arn-client=arn:minio:iam:::role/IqZpDC5ahW_DCAvZPZA4ACjEnDE
backends.backends[0].sts-endpoint=http://minio:9000
#
# bookmark:
backends.backends[0].jwe.protocol=s3-sts
backends.backends[0].jwe.provider=s3-sts-http
backends.backends[0].jwe.hostname=minio
backends.backends[0].jwe.port=9000
backends.backends[0].jwe.sts-endpoint=http://minio:9000
# (role for cryptomatorvaults client -> after token-exchange)
backends.backends[0].jwe.sts-role-arn=arn:minio:iam:::role/Hdms6XDZ6oOpuWYI3gu4gmgHN94
#
#
################
# AWS STS
################
#
# storage configuration:
backends.backends[1].id=https://sts.amazonaws.com
backends.backends[1].name=AWS S3 STS
#
# bucket creation:
backends.backends[1].bucket-prefix=cipherduck
backends.backends[1].sts-role-arn-hub=arn:aws:iam::930717317329:role/cipherduck-createbucket
backends.backends[1].sts-role-arn-client=arn:aws:iam::930717317329:role/cipherduck-createbucket
backends.backends[1].region=eu-west-1
backends.backends[1].regions=eu-west-1,eu-west-2,eu-west-3
#
# bookmark:
backends.backends[1].jwe.protocol=s3-sts
backends.backends[1].jwe.provider=s3-sts-https
backends.backends[1].jwe.sts-role-arn=arn:aws:iam::930717317329:role/cipherduck_chain_01
backends.backends[1].jwe.sts-role-arn2=arn:aws:iam::930717317329:role/cipherduck_chain_02
#
##################
# MinIO localhost permanent
###################
#
# storage configuration:
backends.backends[2].id=http://minio:9000_static
backends.backends[2].name=MinIO S3 static
backends.backends[2].s3-endpoint=http://minio:9000
#
# bookmark:
backends.backends[2].jwe.protocol=s3
backends.backends[2].jwe.provider=s3-http-path-style
backends.backends[2].jwe.hostname=minio
backends.backends[2].jwe.port=9000
#
#
################
# AWS static
################
#
# storage configuration:
backends.backends[3].id=AWS static
backends.backends[3].name=AWS S3 static
backends.backends[3].region=eu-central-1
#
# bookmark
backends.backends[3].jwe.protocol=s3
backends.backends[3].jwe.provider=s3-https
%cipherduck-testing.hub.keycloak.realm=cipherduck
25 changes: 25 additions & 0 deletions backend/config/blup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"id": "8fe86719022530493c3c1b852a2c0b6748781f69",
"name": "MinIO S3 STS",
"bucketPrefix": "cipherduck",
"region": "eu-central-1",
"regions": [
"eu-west-1",
"eu-west-2",
"eu-west-3",
"eu-north-1",
"eu-south-1",
"eu-south-2",
"eu-central-1",
"eu-central-2"
],
"withPathStyleAccessEnabled": "true",
"stsRoleArnHub": "arn:minio:iam:::role/HGKdlY4eFFsXVvJmwlMYMhmbnDE",
"stsRoleArnClient": "arn:minio:iam:::role/IqZpDC5ahW_DCAvZPZA4ACjEnDE",
"stsEndpoint": "http://minio:9000",
"protocol": "s3-sts",
"scheme": "http",
"hostname": "minio",
"port": "9000",
"stsRoleArn": "arn:minio:iam:::role/Hdms6XDZ6oOpuWYI3gu4gmgHN94"
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import jakarta.inject.Inject;
import org.eclipse.microprofile.config.inject.ConfigProperty;

import java.util.ArrayList;
import java.util.List;

// TODO review: backport to ConfigResource.ConfigDto upstream?
@ApplicationScoped
public class CipherduckConfig {
Expand Down Expand Up @@ -37,6 +40,8 @@ public class CipherduckConfig {
@Inject
OidcConfigurationMetadata oidcConfData;

public List<StorageProfileDto> inMemoryStorageConfigs = new ArrayList<>();

String replacePrefix(String str, String prefix, String replacement) {
int index = str.indexOf(prefix);
if (index == 0) {
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit a91d711

Please sign in to comment.