mirror of https://github.com/halo-dev/halo
fix: add region for operate minio attachment (halo-dev#1439) (#1440)
Co-authored-by: li-guohao <liguohao_cn@qq.com>pull/1446/head
parent
84056cf9a0
commit
6a84483b15
|
@ -50,12 +50,15 @@ public class MinioFileHandler implements FileHandler {
|
||||||
optionService.getByPropertyOfNonNull(MinioProperties.BUCKET_NAME).toString();
|
optionService.getByPropertyOfNonNull(MinioProperties.BUCKET_NAME).toString();
|
||||||
String source =
|
String source =
|
||||||
optionService.getByPropertyOrDefault(MinioProperties.SOURCE, String.class, "");
|
optionService.getByPropertyOrDefault(MinioProperties.SOURCE, String.class, "");
|
||||||
|
String region =
|
||||||
|
optionService.getByPropertyOfNonNull(MinioProperties.REGION).toString();
|
||||||
|
|
||||||
endpoint = StringUtils.appendIfMissing(endpoint, HaloConst.URL_SEPARATOR);
|
endpoint = StringUtils.appendIfMissing(endpoint, HaloConst.URL_SEPARATOR);
|
||||||
|
|
||||||
MinioClient minioClient = MinioClient.builder()
|
MinioClient minioClient = MinioClient.builder()
|
||||||
.endpoint(endpoint)
|
.endpoint(endpoint)
|
||||||
.credentials(accessKey, accessSecret)
|
.credentials(accessKey, accessSecret)
|
||||||
|
.region(region)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -110,10 +113,13 @@ public class MinioFileHandler implements FileHandler {
|
||||||
optionService.getByPropertyOfNonNull(MinioProperties.ACCESS_SECRET).toString();
|
optionService.getByPropertyOfNonNull(MinioProperties.ACCESS_SECRET).toString();
|
||||||
String bucketName =
|
String bucketName =
|
||||||
optionService.getByPropertyOfNonNull(MinioProperties.BUCKET_NAME).toString();
|
optionService.getByPropertyOfNonNull(MinioProperties.BUCKET_NAME).toString();
|
||||||
|
String region =
|
||||||
|
optionService.getByPropertyOfNonNull(MinioProperties.REGION).toString();
|
||||||
|
|
||||||
MinioClient minioClient = MinioClient.builder()
|
MinioClient minioClient = MinioClient.builder()
|
||||||
.endpoint(endPoint)
|
.endpoint(endPoint)
|
||||||
.credentials(accessKey, accessSecret)
|
.credentials(accessKey, accessSecret)
|
||||||
|
.region(region)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -31,7 +31,12 @@ public enum MinioProperties implements PropertyEnum {
|
||||||
/**
|
/**
|
||||||
* Minio source
|
* Minio source
|
||||||
*/
|
*/
|
||||||
SOURCE("minio_source", String.class, "");
|
SOURCE("minio_source", String.class, ""),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minio regoin
|
||||||
|
*/
|
||||||
|
REGION("minio_region", String.class, "");
|
||||||
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue