@@ -27,7 +27,7 @@ export function createDefaultStorageOptions() {
2727 case 'minio' : {
2828 return {
2929 vendor : 'minio' ,
30- forcePathStyle : true ,
30+ forcePathStyle : process . env . STORAGE_S3_FORCE_PATH_STYLE === ' true' ? true : false ,
3131 externalBaseUrl : process . env . STORAGE_EXTERNAL_ENDPOINT || undefined ,
3232 endpoint : process . env . STORAGE_S3_ENDPOINT || 'http://localhost:9000' ,
3333 region : process . env . STORAGE_REGION || 'us-east-1' ,
@@ -70,6 +70,29 @@ export function createDefaultStorageOptions() {
7070 } ;
7171 }
7272
73+ case 'huarun-oss' : {
74+ return {
75+ vendor : 'huarun-oss' ,
76+ forcePathStyle : process . env . STORAGE_S3_FORCE_PATH_STYLE === 'true' ? true : false ,
77+ externalBaseUrl : process . env . STORAGE_EXTERNAL_ENDPOINT || undefined ,
78+ endpoint : process . env . STORAGE_S3_ENDPOINT || '' ,
79+ region : process . env . STORAGE_REGION || 'us-east-1' ,
80+ publicBucket : process . env . STORAGE_PUBLIC_BUCKET || 'fastgpt-public' ,
81+ privateBucket : process . env . STORAGE_PRIVATE_BUCKET || 'fastgpt-private' ,
82+ credentials : {
83+ accessKeyId : process . env . STORAGE_ACCESS_KEY_ID || '' ,
84+ secretAccessKey : process . env . STORAGE_SECRET_ACCESS_KEY || ''
85+ } ,
86+ maxRetries : process . env . STORAGE_S3_MAX_RETRIES
87+ ? parseInt ( process . env . STORAGE_S3_MAX_RETRIES )
88+ : 3
89+ } satisfies Omit < IAwsS3CompatibleStorageOptions , 'bucket' > & {
90+ publicBucket : string ;
91+ privateBucket : string ;
92+ externalBaseUrl ?: string ;
93+ } ;
94+ }
95+
7396 case 'cos' : {
7497 return {
7598 vendor : 'cos' ,
@@ -115,6 +138,7 @@ export function createDefaultStorageOptions() {
115138 } ;
116139 }
117140
141+
118142 default : {
119143 throw new Error ( `Unsupported storage vendor: ${ vendor } ` ) ;
120144 }
0 commit comments