Skip to content

Commit 74a2478

Browse files
authored
feat: Make MinIO storage provider region setting configurable (casdoor#3433)
* fix: Make MinIO provider region setting configurable * Fix: Correct the issue where modifications to MinIO's default logic caused behavioral discrepancies
1 parent acc6f3e commit 74a2478

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

storage/storage.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ func GetStorageProvider(providerType string, clientId string, clientSecret strin
2323
case "AWS S3":
2424
return NewAwsS3StorageProvider(clientId, clientSecret, region, bucket, endpoint), nil
2525
case "MinIO":
26-
return NewMinIOS3StorageProvider(clientId, clientSecret, "_", bucket, endpoint), nil
26+
if region == "" {
27+
region = "_"
28+
}
29+
return NewMinIOS3StorageProvider(clientId, clientSecret, region, bucket, endpoint), nil
2730
case "Aliyun OSS":
2831
return NewAliyunOssStorageProvider(clientId, clientSecret, region, bucket, endpoint), nil
2932
case "Tencent Cloud COS":

web/src/ProviderEditPage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ class ProviderEditPage extends React.Component {
932932
</Col>
933933
</Row>
934934
) : null}
935-
{["AWS S3", "Tencent Cloud COS", "Qiniu Cloud Kodo", "Casdoor", "CUCloud OSS"].includes(this.state.provider.type) ? (
935+
{["AWS S3", "Tencent Cloud COS", "Qiniu Cloud Kodo", "Casdoor", "CUCloud OSS", "MinIO"].includes(this.state.provider.type) ? (
936936
<Row style={{marginTop: "20px"}} >
937937
<Col style={{marginTop: "5px"}} span={2}>
938938
{["Casdoor"].includes(this.state.provider.type) ?

0 commit comments

Comments
 (0)