mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-07 01:02:55 +08:00
7506a147e6
* batch node (#6732) * batch node * docs: add local code quality standards and style guides for automated review * refactor: remove enforced minimum for parallel concurrency, simplify edge handling in task runtime context, and fix loop output mapping * feat: auto-infer and sync valueType for parallel loop input and output based on referenced array source * fix: refactor parallelRun output type synchronization and improve sub-workflow error handling in dispatch service * feat: enforce parallel concurrency limits and validate against workflow loop constraints * feat: implement retry mechanism for parallel workflow tasks with usage tracking per attempt * fix review * perf: use function * refactor: abstract nested node logic into useNestedNode hook and update parallelRun icon/service logic * fix: type import * refactor: update ParallelRunStatusEnum and i18n labels for improved status clarity * feat: parallel run details and input/output display to chat response modal and service dispatch * fix: config limit error * refactor: optimize parallel run task execution, fix point accumulation, and improve error handling for sub-workflows * fix: include totalPoints in parallel task results * refactor: centralize nested input injection and point safety utilities for workflow dispatchers * test: add unit tests for safePoints utility function * refactor: update parallel workflow runtime types and clean up docstring placement in dispatch utils * fix: include all runtime nodes in parallel execution to ensure variable reference accessibility * refactor: update pushSubWorkflowUsage signature to use object parameter for improved consistency --------- Co-authored-by: DigHuang <114602213+DigHuang@users.noreply.github.com> * feat(s3): add proxy transfer mode with tokenized upload/download (#6729) * feat(s3): add proxy transfer mode with tokenized upload/download * wip: switch to proxy mode for upload progress * fix: office mime types * fix(s3): upload MIME validation, multer whitelist, API error status - Treat AVI/MPEG mime aliases (incl. video/mp1s vs video/mpeg) as matching - Optional allowedExtensions on multer for dataset images and localFile - Map S3/business errors to 4xx in jsonRes where appropriate - Align presign max size with team plan; fix dataset import size UX - Add upload validation tests Made-with: Cursor * fix: show clear message when upload frequency limit is exceeded - Reject ERROR_ENUM.uploadFileIntervalLimit from authFrequencyLimit instead of Mongo doc - Add i18n for upload_file_interval_limit (zh-CN/en/zh-Hant) Made-with: Cursor * fix file token validation and upload mime checks * fix: test * fix(s3): treat m4a audio/mp4 and audio/x-m4a as equivalent - Add MIME equivalence group for AAC/M4A container mismatch (mime-types vs file-type) - Add upload validation test for minimal ftyp/M4A buffer - Test env: keep FILE_TOKEN_KEY in vitest test.env and test/setup.ts (drop loadTestEnv file) Made-with: Cursor * fix(chat): 调试区文件类型与编辑态一致,并修复 accept 在 WebKit 下不更新 - ChatTest: 用 getAppChatConfig + getGuideModule 合并画布引导节点与 chatConfig - useChatTest: 依赖 fileSelectConfig 序列化与 chatConfig,避免深层变更未触发预览更新 - useSelectFile: 用 useCallback + input key 替代 useMemoizedFn,确保 accept 变更后重建 input Made-with: Cursor * fix: invalid request * feat: prompt inject (#6757) * feat: resume chat stream (#6722) * fix: openapi schema issue while creating openapi json * feat: resume chat stream * wip: chat status and read status * feat: sync chat side bar status * fix: allow reassignment of variables in chatTest handler Made-with: Cursor * feat(chat): stream resume hardening, resume modules in @fastgpt/service, stale generating cron - Move stream resume mirror + resumeStatus into packages/service; update API imports - chatTest: ensurePendingChatRoundItems, default responseChatItemId; zod default import for client - useChatTest + HomeChatWindow: enableAutoResume and sync init chatGenerateStatus - ChatContext: safe no-op defaults without provider - Cron: clean MongoChat stuck in generating >30min; timer lock cleanStaleGeneratingChat Made-with: Cursor * fix(chat): address stream-resume PR review (zod/mongoose enum, legacy status, upsert, UI race) - Zod: use z.nativeEnum(ChatGenerateStatusEnum); mongoose chatGenerateStatus enum as [0,1,2] only - Init APIs: default missing chatGenerateStatus to done before read/unread logic - ensurePendingChatRoundItems: unique index + upsert; rename ChatGenerateStatusEnum - ChatBox auto-resume: guard by chatId; sidebar sync via targetChatId - Tests: chat history/feedback APIs pass with schema fixes Made-with: Cursor * fix(chat): expose resume at /api/v2/chat/resume; openapi + review tidy - Move handler from v1/stream to v2/chat/resume (pairs with v2 completions + Redis mirror) - Update fetch, OpenAPI AIPath, comments; remove slim projects/app global chat api - getHistoryStatus default chatGenerateStatus; team init + chatTest notes; ChatItem tweak Made-with: Cursor * fix(chat): fix resume JSON parse catch shadowing; drop unused resumeChatStream Made-with: Cursor * docs(chat): comment closed+stream mirror write path in workflow dispatch Made-with: Cursor * refactor: unify resumable stream mirroring * fix: keep v1 chat completions out of resume flow * refactor: make prepared chat rounds transactional * fix: handle resume stream terminal errors * fix: rerank max token * feat(workflow): extend variable update node with Number/Boolean/Array operations (#6752) * feat(workflow): extend variable update node with Number/Boolean/Array ops * feat: math operator icons and refactor variable update renderers for improved layout and consistency * chore(workflow): clean up variable update types and restore icon cleanup * feat: add test * fix:md_ascii_bug (#6755) * md_ascii_bug * md_ascii_bug * md_ascii_bug * md_ascii_bug * md_ascii_bug * perf: test --------- Co-authored-by: archer <545436317@qq.com> * doc * del dataset * perf: date auto coerce * doc * add test * perf: channel setting * doc * fix: chat resume stream (#6759) * refactor(api): move stream resume to /api/core/chat/resume Relocate resume handler from pages/api/v2 to pages/api/core, update OpenAPI paths, frontend streamResumeFetch URL, tests, and comments. Made-with: Cursor * fix: remove stray conflict markers; use z.nativeEnum for chatGenerateStatus Made-with: Cursor * fix: use enum instead of nativeEnum * fix(chat): address resume review suggestions * fix(chat): require sse when resuming generating chats * revert(chat): keep chatitem dataId index non-unique * fix: ts * fix doc * fix(chat): gate stream resume mirror by header (#6760) * fix: remove stray conflict markers; use z.nativeEnum for chatGenerateStatus Made-with: Cursor * fix: use enum instead of nativeEnum * fix(chat): address resume review suggestions * fix(chat): require sse when resuming generating chats * feat(chat): gate stream resume mirror by header * refactor(chat): decouple resume mirror header parsing * perf: dataset queue * fix: multipleselect * perf: workflow bug * doc * doc * perf: deploy yml;fix: child nodes watch * adapt embedding model defaultconfig * install shell * add mcp zod check * feat: http tool zod schema * Feat/batch UI (#6763) * feat: aggregate parallel run results into task-specific virtual nodes and update UI to support i18n arguments for module names * style: update workflow node card padding and table styling for improved layout consistency * feat: implement parallel run workflow node with documentation and i18n support * style(modal): WholeResponseModal UI and layout styling * chore: improve chat resume UX (#6764) * fix: remove stray conflict markers; use z.nativeEnum for chatGenerateStatus Made-with: Cursor * fix: use enum instead of nativeEnum * fix(chat): address resume review suggestions * fix(chat): require sse when resuming generating chats * feat(chat): gate stream resume mirror by header * refactor(chat): decouple resume mirror header parsing * feat: improve stream resume fallback * feat: block duplicate chat generation * feat: polish resume unavailable recovery * test: stabilize resume stream timeout * fix: harden resume wait flow * fix: get mcp tool raw schema * style: update UI styling and layout for LLM request detail and response modals * perf: http tool * fix: test * fix: http raw schema * fix: test * deploy yml * deploy yml --------- Co-authored-by: DigHuang <114602213+DigHuang@users.noreply.github.com> Co-authored-by: Ryo <whoeverimf5@gmail.com> Co-authored-by: YeYuheng <57035043+YYH211@users.noreply.github.com>
107 lines
5.0 KiB
Plaintext
107 lines
5.0 KiB
Plaintext
---
|
|
title: 对象存储配置
|
|
description: 如何通过环境变量配置并连接个各厂商的对象存储
|
|
---
|
|
|
|
import { Alert } from '@/components/docs/Alert';
|
|
import FastGPTLink from '@/components/docs/linkFastGPT';
|
|
|
|
## 对象存储服务配置介绍
|
|
|
|
这里提供了 FastGPT 目前支持的对象存储厂商,包括自部署的 MinIO、AWS S3、阿里云 OSS 和腾讯云 COS 的环境变量配置说明
|
|
|
|
### 通用且必需的环境变量
|
|
|
|
> - 不支持对临时身份校验密钥的支持,比如 STS 等,请自行保证服务的安全性。
|
|
> - 不支持对私有桶的复用,如果把私有桶名和公开桶名设置为同一个的话,请保证存储桶的策略至少为【公开读私有写】
|
|
|
|
- `STORAGE_VENDOR` 该变量为一个枚举值,可选值为:`minio`、`aws-s3`、`oss` 和 `cos`。
|
|
- `STORAGE_REGION` 提供的对象存储服务所在的地区如 `us-east-1` 等,具体请根据服务厂商所提供的地区来填写;如果是自部署的 MinIO 等服务这个值可随意填写。
|
|
- `STORAGE_ACCESS_KEY_ID` 服务访问密钥的 Access Key ID
|
|
- `STORAGE_SECRET_ACCESS_KEY` 服务访问密钥的 Secret Access Key
|
|
- `STORAGE_PUBLIC_BUCKET` FastGPT 公开资源存储桶桶名
|
|
- `STORAGE_PRIVATE_BUCKET` FastGPT 私有资源存储桶桶名
|
|
|
|
### 传输模式说明
|
|
|
|
- 上传固定走 FastGPT 后端代理。
|
|
- 下载支持 `proxy` 和 `presigned` 两种模式。
|
|
- 默认下载模式会根据 `STORAGE_EXTERNAL_ENDPOINT` 自动判断:
|
|
- 未配置:默认 `proxy`
|
|
- 已配置:默认 `presigned`
|
|
|
|
### 自部署的 MinIO 和 AWS S3
|
|
|
|
> MinIO 这类产品对 AWS S3 协议支持比较完整,因此使用 Minio 和AWS S3 配置几乎可以是相同的,只是因为服务商提供和自部署的区别,会有额外的配置。
|
|
> 因此理论上任何对 AWS S3 协议的支持程度至少和 MinIO 相当的对象存储服务都可以使用,比如 SeaweedFS、RustFS 等。
|
|
|
|
- `STORAGE_S3_ENDPOINT` 内网连接地址,可以是容器 id 连接,比如 `http://fastgpt-minio:9000`
|
|
- `STORAGE_EXTERNAL_ENDPOINT` 一个**服务器**和**客户端**均可访问到存储桶的地址,可以是固定的宿主机 IP 或者域名,注意不要填写成 127.0.0.1 或者 localhost 等本地回环地址(因为容器里无法使用)。配置后,默认下载模式会自动切换为 `presigned`。
|
|
- `STORAGE_S3_FORCE_PATH_STYLE` 【可选】虚拟主机风格路由或路径路由风格,其中如果厂商填写了 `minio` 的话,该值被固定为 `true`
|
|
- `STORAGE_S3_MAX_RETRIES` 【可选】请求最大尝试次数,默认为 3 次
|
|
|
|
**完整示例**
|
|
|
|
> 如果使用的是 Sealos 的对象存储服务请将 `STORAGE_VENDOR` 填写为 `aws-s3`
|
|
|
|
```dotenv
|
|
STORAGE_VENDOR=minio
|
|
STORAGE_REGION=us-east-1
|
|
STORAGE_ACCESS_KEY_ID=your_access_key
|
|
STORAGE_SECRET_ACCESS_KEY=your_secret_key
|
|
STORAGE_PUBLIC_BUCKET=fastgpt-public
|
|
STORAGE_PRIVATE_BUCKET=fastgpt-private
|
|
STORAGE_EXTERNAL_ENDPOINT=http://127.0.0.1:9000
|
|
STORAGE_S3_ENDPOINT=http://127.0.0.1:9000
|
|
STORAGE_S3_FORCE_PATH_STYLE=true
|
|
STORAGE_S3_MAX_RETRIES=3
|
|
```
|
|
|
|
### 阿里云 OSS
|
|
|
|
> - [跨域配置](https://help.aliyun.com/zh/oss/user-guide/configure-cross-origin-resource-sharing/?spm=5176.8466032.console-base_help.dexternal.1bcd1450Wau6J6#b58400ec36rqf)
|
|
|
|
- `STORAGE_OSS_ENDPOINT` 阿里云对象存储连接主机名,厂商提供的默认值一般都是 `{地区}.aliyuncs.com`,如 `oss-cn-hangzhou.aliyuncs.com`;注意,如果配置了自定义域名的话也填在这里,比如 `your-domain.com`
|
|
- `STORAGE_OSS_CNAME` 是否开启自定义域名
|
|
- `STORAGE_OSS_SECURE` 是否开启了 TLS,如果域名没有认证证书的话,请关闭该选项
|
|
- `STORAGE_OSS_INTERNAL` 【可选】是否开启内网访问,如果你的服务也在阿里云的话可以开启并节省流量,默认关闭
|
|
|
|
**完整示例**
|
|
|
|
```dotenv
|
|
STORAGE_VENDOR=oss
|
|
STORAGE_REGION=oss-cn-hangzhou
|
|
STORAGE_ACCESS_KEY_ID=your_access_key
|
|
STORAGE_SECRET_ACCESS_KEY=your_secret_key
|
|
STORAGE_PUBLIC_BUCKET=fastgpt-public
|
|
STORAGE_PRIVATE_BUCKET=fastgpt-private
|
|
STORAGE_OSS_ENDPOINT=oss-cn-hangzhou.aliyuncs.com
|
|
STORAGE_OSS_CNAME=false
|
|
STORAGE_OSS_SECURE=false
|
|
STORAGE_OSS_INTERNAL=false
|
|
```
|
|
|
|
### 腾讯云 COS
|
|
|
|
> - [跨域配置](https://cloud.tencent.com/document/product/436/13318)
|
|
|
|
- `STORAGE_COS_PROTOCOL` 枚举可选值 `https:`、`http:`,注意不要忘记 `:`;如果自定义域名没有上传证书的话,请不要设置为 `https:`
|
|
- `STORAGE_COS_USE_ACCELERATE` 【可选】是否启用全球加速域名,默认为 false。若改为 true,需要存储桶开启全球加速功能
|
|
- `STORAGE_COS_CNAME_DOMAIN` 【可选】自定义域名,如 `your-domain.com`
|
|
- `STORAGE_COS_PROXY` 【可选】代理服务器,如 `http://localhost:7897`
|
|
|
|
**完整示例**
|
|
|
|
```dotenv
|
|
STORAGE_VENDOR=cos
|
|
STORAGE_REGION=ap-shanghai
|
|
STORAGE_ACCESS_KEY_ID=your_access_key
|
|
STORAGE_SECRET_ACCESS_KEY=your_secret_key
|
|
STORAGE_PUBLIC_BUCKET=fastgpt-public
|
|
STORAGE_PRIVATE_BUCKET=fastgpt-private
|
|
STORAGE_COS_PROTOCOL=http:
|
|
STORAGE_COS_USE_ACCELERATE=false
|
|
STORAGE_COS_CNAME_DOMAIN=
|
|
STORAGE_COS_PROXY=
|
|
```
|