From 0db789f9022dfbab1d6bde094c60884cfbfeee0a Mon Sep 17 00:00:00 2001 From: dingzhenznen <1324652616@qq.com> Date: Fri, 31 Oct 2025 17:38:57 +0800 Subject: [PATCH] fix:pathStyle --- lib/s3/config.ts | 3 ++- lib/s3/controller.ts | 6 ++++-- runtime/.env.template | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/s3/config.ts b/lib/s3/config.ts index f28367b2..db80d7bc 100644 --- a/lib/s3/config.ts +++ b/lib/s3/config.ts @@ -20,7 +20,8 @@ export const commonS3Config: Partial = { ? new HttpProxyAgent(process.env.HTTP_PROXY) : process.env.HTTPS_PROXY ? new HttpsProxyAgent(process.env.HTTPS_PROXY) - : undefined + : undefined, + pathStyle: process.env.S3_PATH_STYLE === 'false' ? false : true } as const; export const FileMetadataSchema = z.object({ diff --git a/lib/s3/controller.ts b/lib/s3/controller.ts index 6fefe4f3..0e337c43 100644 --- a/lib/s3/controller.ts +++ b/lib/s3/controller.ts @@ -37,7 +37,8 @@ export class S3Service { useSSL: this.config.useSSL, accessKey: this.config.accessKey, secretKey: this.config.secretKey, - transportAgent: this.config.transportAgent + transportAgent: this.config.transportAgent, + pathStyle: this.config.pathStyle }); if (this.config.externalBaseURL) { @@ -57,7 +58,8 @@ export class S3Service { port: externalPort, accessKey: this.config.accessKey, secretKey: this.config.secretKey, - transportAgent: this.config.transportAgent + transportAgent: this.config.transportAgent, + pathStyle: this.config.pathStyle }); } } diff --git a/runtime/.env.template b/runtime/.env.template index 6ca5ca3e..c0c50662 100644 --- a/runtime/.env.template +++ b/runtime/.env.template @@ -21,6 +21,7 @@ S3_ACCESS_KEY=minioadmin S3_SECRET_KEY=minioadmin S3_PUBLIC_BUCKET=fastgpt-public # 公开读私有写桶。用于系统工具,创建的临时文件,存储的桶。 S3_PRIVATE_BUCKET=fastgpt-private # 私有读写桶。用于系统插件热安装文件的桶。 +S3_PATH_STYLE=false #pathStyle 模式 默认true # Signoz SIGNOZ_BASE_URL=