From c0536a1a8414fce44f28a703dfa772e95eee3d24 Mon Sep 17 00:00:00 2001
From: Johannes Buechele <johannes@bujo.at>
Date: Wed, 12 Jul 2023 16:48:51 +0200
Subject: [PATCH] added region to minio properties

---
 Frontend/src/services/ApiService.js                             | 2 +-
 .../api-service/src/main/resources/application.yml              | 1 +
 .../eu/fairkom/faircommons/common/minio/MinioConfiguration.java | 1 +
 .../common/minio/models/MinioConfigurationProperties.java       | 1 +
 .../hashing-service/src/main/resources/application.yml          | 1 +
 .../ipfs-service/src/main/resources/application.yml             | 1 +
 .../src/main/resources/application.yml                          | 1 +
 7 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Frontend/src/services/ApiService.js b/Frontend/src/services/ApiService.js
index 66f038c..f399b43 100644
--- a/Frontend/src/services/ApiService.js
+++ b/Frontend/src/services/ApiService.js
@@ -195,7 +195,7 @@ const putAsset = async (url, file, setLoading) => {
 const postAsset = async (raw) => {
   console.log(JSON.stringify(raw));
 
-  await fetch("${REACT_APP_API}/works/register", {
+  await fetch(`${REACT_APP_API}/works/register`, {
     method: "POST",
     headers: {
       "Content-Type": "application/json",
diff --git a/faircommons-services/api-service/src/main/resources/application.yml b/faircommons-services/api-service/src/main/resources/application.yml
index b26e245..fbcb101 100644
--- a/faircommons-services/api-service/src/main/resources/application.yml
+++ b/faircommons-services/api-service/src/main/resources/application.yml
@@ -35,6 +35,7 @@ server:
 
 minio:
   bucketPrefix: fairregister-
+  region: eu-central-1
 
 security:
   web:
diff --git a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioConfiguration.java b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioConfiguration.java
index 49a18e0..0afb0d2 100644
--- a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioConfiguration.java
+++ b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioConfiguration.java
@@ -21,6 +21,7 @@ public class MinioConfiguration {
     public MinioClient minioClient() {
         return MinioClient.builder()
                 .endpoint(properties.getUrl())
+                .region(properties.getRegion())
                 .credentials(properties.getAccessKey(), properties.getSecretKey())
                 .build();
     }
diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/minio/models/MinioConfigurationProperties.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/minio/models/MinioConfigurationProperties.java
index d4e7e38..ce5ef44 100644
--- a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/minio/models/MinioConfigurationProperties.java
+++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/minio/models/MinioConfigurationProperties.java
@@ -11,5 +11,6 @@ public class MinioConfigurationProperties {
     private String secretKey;
     private boolean secure;
     private String bucketPrefix;
+    private String region;
 
 }
diff --git a/faircommons-services/hashing-service/src/main/resources/application.yml b/faircommons-services/hashing-service/src/main/resources/application.yml
index 0cb96f1..06d4f28 100644
--- a/faircommons-services/hashing-service/src/main/resources/application.yml
+++ b/faircommons-services/hashing-service/src/main/resources/application.yml
@@ -17,6 +17,7 @@ server:
 
 minio:
   bucketPrefix: fairregister-
+  region: eu-central-1
 
 security:
   web:
diff --git a/faircommons-services/ipfs-service/src/main/resources/application.yml b/faircommons-services/ipfs-service/src/main/resources/application.yml
index d397e0a..7c39f32 100644
--- a/faircommons-services/ipfs-service/src/main/resources/application.yml
+++ b/faircommons-services/ipfs-service/src/main/resources/application.yml
@@ -18,6 +18,7 @@ server:
 
 minio:
   bucketPrefix: fairregister-
+  region: eu-central-1
 
 security:
   web:
diff --git a/faircommons-services/post-registration-service/src/main/resources/application.yml b/faircommons-services/post-registration-service/src/main/resources/application.yml
index 2a53948..cc67ec5 100644
--- a/faircommons-services/post-registration-service/src/main/resources/application.yml
+++ b/faircommons-services/post-registration-service/src/main/resources/application.yml
@@ -22,6 +22,7 @@ server:
 
 minio:
   bucketPrefix: fairregister-
+  region: eu-central-1
 
 security:
   web:
-- 
GitLab