Version: 0.9.82.dev.260507

后端:
1. 登录注册补齐极验行为验证与跨域入口:gateway 新增 `/user/captcha/register`,登录/注册先做 GeeTest 初始化与二次校验,再进入 user/auth RPC;补充验证码失败/初始化失败/服务不可用响应码,并新增可配置 CORS middleware 适配分域部署。
2. 容器部署配置入口收口:`bootstrap.LoadConfig` 支持 `SMARTFLOW_CONFIG_FILE` 与环境变量覆盖,`config.example.yaml` / `config.docker.yaml` 补齐 geetest 与容器内服务地址,网关新增配置列表解析,便于 compose 场景直接挂载配置启动。
3. LLM outbox 与助手时间线稳定性修正:`cmd/llm` 显式绑定 llm 自身 topic/group,避免误入 agent consumer group;agent timeline 在 Redis 热缓存未落 MySQL 时改用 `seq` 兜底临时 id,避免前端历史回放撞 key。

前端:
4. 认证页接入极验并补齐提交前校验:新增 GeeTest 脚本加载与实例封装,登录/注册面板支持 challenge 初始化、切换面板重挂载、失败提示与提交前校验,认证 API/types 同步透传 geetest 三元组。
5. 前端部署基址与网关对接收口:Axios `baseURL`、Vue Router `history base` 与 Vite `base/dev proxy` 改为读取环境变量,新增 `frontend/.env.example`,支持子路径部署、容器内反向代理和本地联调共存。
6. 助手与工作台展示细节修正:AssistantPanel 历史重建优先使用真实 timeline id、缺失时退回 `seq` 保证消息主键唯一;首页主面板改为纵向可滚动并补底部留白,避免内容截断。

仓库:
7. 整站容器化交付链路补齐并重写说明文档:新增后端/前端 Dockerfile、`.dockerignore`、前端 Nginx 代理、`docker-compose.full.yml`、`.env.full.example` 与镜像打包/导入脚本,README 改写数据库/路由/部署章节,并新增 `docs/容器化部署说明.md` 说明离线镜像分发方案。
This commit is contained in:
Losita
2026-05-07 00:58:27 +08:00
parent 7b04b073ce
commit 25a608eaeb
35 changed files with 2412 additions and 327 deletions

29
deploy/docker-load.sh Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env sh
set -eu
BUNDLE_DIR="${1:-$(cd "$(dirname "$0")/.." && pwd)/.docker-bundles}"
if [ ! -d "$BUNDLE_DIR" ]; then
echo "Bundle directory not found: $BUNDLE_DIR" >&2
exit 1
fi
found_bundle=0
for bundle in "$BUNDLE_DIR"/*.tar; do
if [ ! -e "$bundle" ]; then
continue
fi
found_bundle=1
echo "==> Load bundle $bundle"
docker load -i "$bundle"
done
if [ "$found_bundle" -eq 0 ]; then
echo "No tar bundles found in: $BUNDLE_DIR" >&2
exit 1
fi
echo "==> Done"

90
deploy/docker-pack.ps1 Normal file
View File

@@ -0,0 +1,90 @@
param(
[string]$AppTag = "latest",
[string]$BackendImage = "smartflow/backend-suite",
[string]$FrontendImage = "smartflow/frontend",
[string]$OutputDir = ".docker-bundles",
[switch]$IncludeInfra
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
function Get-ImageRef {
param(
[string]$EnvName,
[string]$DefaultValue
)
$value = [Environment]::GetEnvironmentVariable($EnvName)
if ([string]::IsNullOrWhiteSpace($value)) {
return $DefaultValue
}
return $value.Trim()
}
$repoRoot = Split-Path -Parent $PSScriptRoot
$bundleDir = Join-Path $repoRoot $OutputDir
$backendRef = "{0}:{1}" -f $BackendImage, $AppTag
$frontendRef = "{0}:{1}" -f $FrontendImage, $AppTag
$appBundlePath = Join-Path $bundleDir ("smartflow-app-{0}.tar" -f $AppTag)
$infraBundlePath = Join-Path $bundleDir ("smartflow-infra-{0}.tar" -f $AppTag)
New-Item -ItemType Directory -Force -Path $bundleDir | Out-Null
Write-Host "==> Build backend image $backendRef"
docker build --platform linux/amd64 -f (Join-Path $repoRoot "backend\Dockerfile") -t $backendRef (Join-Path $repoRoot "backend")
if ($LASTEXITCODE -ne 0) {
throw "Backend image build failed."
}
Write-Host "==> Build frontend image $frontendRef"
docker build --platform linux/amd64 -f (Join-Path $repoRoot "frontend\Dockerfile") -t $frontendRef (Join-Path $repoRoot "frontend")
if ($LASTEXITCODE -ne 0) {
throw "Frontend image build failed."
}
if (Test-Path $appBundlePath) {
Remove-Item -LiteralPath $appBundlePath -Force
}
Write-Host "==> Export app bundle to $appBundlePath"
docker save -o $appBundlePath $backendRef $frontendRef
if ($LASTEXITCODE -ne 0) {
throw "App bundle export failed."
}
if (-not $IncludeInfra) {
Write-Host "==> Done. App bundle exported."
return
}
$infraImages = @(
(Get-ImageRef -EnvName "SMARTFLOW_MYSQL_IMAGE" -DefaultValue "mysql:8.0"),
(Get-ImageRef -EnvName "SMARTFLOW_REDIS_IMAGE" -DefaultValue "redis:7"),
(Get-ImageRef -EnvName "SMARTFLOW_KAFKA_IMAGE" -DefaultValue "apache/kafka:3.7.2"),
(Get-ImageRef -EnvName "SMARTFLOW_ETCD_IMAGE" -DefaultValue "quay.io/coreos/etcd:v3.5.5"),
(Get-ImageRef -EnvName "SMARTFLOW_MINIO_IMAGE" -DefaultValue "minio/minio:RELEASE.2023-03-20T20-16-18Z"),
(Get-ImageRef -EnvName "SMARTFLOW_MILVUS_IMAGE" -DefaultValue "milvusdb/milvus:v2.4.4"),
(Get-ImageRef -EnvName "SMARTFLOW_ATTU_IMAGE" -DefaultValue "zilliz/attu:v2.4.3")
)
foreach ($imageRef in $infraImages) {
Write-Host "==> Pull infra image $imageRef"
docker pull $imageRef
if ($LASTEXITCODE -ne 0) {
throw ("Infra image pull failed: {0}" -f $imageRef)
}
}
if (Test-Path $infraBundlePath) {
Remove-Item -LiteralPath $infraBundlePath -Force
}
Write-Host "==> Export infra bundle to $infraBundlePath"
docker save -o $infraBundlePath @infraImages
if ($LASTEXITCODE -ne 0) {
throw "Infra bundle export failed."
}
Write-Host "==> Done. App bundle and infra bundle exported."