Skip to content

Commit e832c80

Browse files
authored
fix:pathStyle (#269)
1 parent 053711e commit e832c80

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

lib/s3/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export const commonS3Config: Partial<S3ConfigType> = {
2020
? new HttpProxyAgent(process.env.HTTP_PROXY)
2121
: process.env.HTTPS_PROXY
2222
? new HttpsProxyAgent(process.env.HTTPS_PROXY)
23-
: undefined
23+
: undefined,
24+
pathStyle: process.env.S3_PATH_STYLE === 'false' ? false : true
2425
} as const;
2526

2627
export const FileMetadataSchema = z.object({

lib/s3/controller.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export class S3Service {
3737
useSSL: this.config.useSSL,
3838
accessKey: this.config.accessKey,
3939
secretKey: this.config.secretKey,
40-
transportAgent: this.config.transportAgent
40+
transportAgent: this.config.transportAgent,
41+
pathStyle: this.config.pathStyle
4142
});
4243

4344
if (this.config.externalBaseURL) {
@@ -57,7 +58,8 @@ export class S3Service {
5758
port: externalPort,
5859
accessKey: this.config.accessKey,
5960
secretKey: this.config.secretKey,
60-
transportAgent: this.config.transportAgent
61+
transportAgent: this.config.transportAgent,
62+
pathStyle: this.config.pathStyle
6163
});
6264
}
6365
}

runtime/.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ S3_ACCESS_KEY=minioadmin
2121
S3_SECRET_KEY=minioadmin
2222
S3_PUBLIC_BUCKET=fastgpt-public # 公开读私有写桶。用于系统工具,创建的临时文件,存储的桶。
2323
S3_PRIVATE_BUCKET=fastgpt-private # 私有读写桶。用于系统插件热安装文件的桶。
24+
S3_PATH_STYLE=false #pathStyle 模式 默认true
2425

2526
# Signoz
2627
SIGNOZ_BASE_URL=

0 commit comments

Comments
 (0)