feat(server): MinIO/S3 对象存储兼容(F21)
- 新增 storage 抽象:local 与 s3: 前缀兼容(不改 schema) - invoice-pool 上传/预览/ocr 读取适配 S3/MinIO - trialrun compose 增加 minio profile + env 示例与 runbook 指引 - 更新 README 与 v3 CSV 状态推进
这个提交包含在:
+12
@@ -113,6 +113,18 @@ JOBS_ENABLED=true npm run worker
|
||||
- 启用 worker profile:`--profile worker`
|
||||
- 同时将 server 的 `JOBS_ENABLED=false`(worker 进程内强制为 true)
|
||||
|
||||
### 2.3.5 存储驱动(local vs S3/MinIO)(F21)
|
||||
> 目标:把“票据文件存储”从本地目录可选演进到 S3 兼容(单机优先 MinIO),保持签名 URL 契约不变。
|
||||
|
||||
- 默认:`STORAGE_DRIVER=local`(写入 `STORAGE_DIR`)
|
||||
- 可选:`STORAGE_DRIVER=s3`(写入 S3/MinIO)
|
||||
- 需要配置:`S3_ENDPOINT/S3_REGION/S3_BUCKET/S3_ACCESS_KEY_ID/S3_SECRET_ACCESS_KEY/S3_FORCE_PATH_STYLE`
|
||||
- 为兼容混合存储,`invoice_pool.storage_path` 对 S3 会写成 `s3:<key>`(无 schema 变更)
|
||||
|
||||
签名 URL 兼容策略:
|
||||
- `/api/invoice-pool/:id/signed-url` 仍返回本系统 URL(带 token)
|
||||
- `/api/invoice-pool/:id/file` 内部按 `storage_path` 自动从本地或 S3 读取并返回文件流
|
||||
|
||||
### 2.4 启动服务
|
||||
```bash
|
||||
cd /home/shunli/Projects/hyb-oa/server
|
||||
|
||||
在新工单中引用
屏蔽一个用户