Make the offline RAG chain observable without widening credential access
Some checks failed
verify / verify (push) Has been cancelled
Some checks failed
verify / verify (push) Has been cancelled
Expose the verified synthetic retrieval path through a typed React client and a non-root Nginx edge while keeping database credentials and data-network reachability out of the browser tier. A fixed-origin gateway preserves request boundaries and now closes upstream streams even when downstream disconnects before body iteration. The deployment ADR and runbooks record the four-network topology and its accepted Web edge-egress risk. Constraint: The previously exposed Bailian key must be revoked and no live provider credential may enter Git, images, logs, or the browser. Rejected: Connect Web directly to the data network | expands lateral reach to PostgreSQL. Rejected: Publish the database-aware API on the edge network | gives a credential-bearing process a public default route. Rejected: Buffer streaming responses in either proxy | prevents incremental chat delivery in the future. Confidence: high Scope-risk: moderate Reversibility: clean Directive: Do not mark Stage 1 or Stage 2 complete until the rotated-key live smoke and remaining stage gates pass. Tested: make verify; 65 backend tests; 14 frontend tests; Docker image build; container health and isolation probes; real HTTP demo/status/search/docs/OpenAPI checks. Not-tested: Live Bailian models, real document ingestion, business chat SSE generation, and final browser screenshot automation because the browser skill runtime was unavailable.
This commit is contained in:
@@ -132,7 +132,8 @@ deepseek-v4-flash
|
||||
```mermaid
|
||||
flowchart LR
|
||||
U["浏览器用户"] -->|"HTTPS / SSE"| W["React + Nginx"]
|
||||
W -->|"/api/v1"| A["FastAPI API"]
|
||||
W -->|"同源 /api"| G["无 Secret 固定上游 Gateway"]
|
||||
G -->|"internal data"| A["FastAPI API"]
|
||||
A --> D[("PostgreSQL + pgvector")]
|
||||
A --> F[("文件卷 / OSS 适配器")]
|
||||
A --> E["text-embedding-v4"]
|
||||
@@ -150,6 +151,7 @@ flowchart LR
|
||||
| 组件 | 职责 | 不承担 |
|
||||
|---|---|---|
|
||||
| `web` | React 静态页面、Nginx 代理、SSE 透传 | 模型凭证、业务权限判断 |
|
||||
| `gateway` | 固定 API 上游、请求大小/头边界、脱敏错误和流式转发 | 数据库凭证、模型凭证、业务权限判断 |
|
||||
| `api` | 认证、知识库、检索、问答、评测 API | 长时间 OCR/批量入库 |
|
||||
| `worker` | 解析、OCR、分块、向量化、索引、评测批任务 | 对外开放端口 |
|
||||
| `db` | 元数据、向量、任务、会话、评测事实来源 | 原始大文件长期存储 |
|
||||
|
||||
Reference in New Issue
Block a user