feat: 添加版本更新功能

- 新增 .version 文件(JSON 格式:version/release_date/changelog)
- 新增 lib/update.ts 更新逻辑(版本检查、git clone、docker compose)
- 新增 /api/update/check 版本检查 API
- 新增 /api/update/execute 执行更新 API(SSE 流式日志)
- 新增设置页「版本更新」界面(含 changelog 展示)
- Dockerfile 添加 git、docker CLI;compose 挂载 docker socket
- .env.docker 添加 ONEDEV_ACCESS_TOKEN 配置
This commit is contained in:
2026-05-24 22:35:53 +08:00
parent 8b308b6adb
commit f7060b056d
10 changed files with 857 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
import { NextResponse } from "next/server";
import { checkForUpdate } from "@/lib/update";
// GET /api/update/check - 检查是否有可用更新
export async function GET() {
try {
const versionInfo = await checkForUpdate();
return NextResponse.json({
success: true,
data: versionInfo,
});
} catch (error) {
return NextResponse.json(
{ success: false, error: "检查更新失败" },
{ status: 500 }
);
}
}