docs: sync CLAUDE.md + AGENTS.md with actual project state
- 分支名 main→master(仓库实际使用 master) - Docker Compose: 4容器→3容器,aiops-backend/frontend→aiops embed - 访问地址: localhost:80→localhost:8080, /health→/version - 后端目录: cmd/internal→controller/model 扁平结构 - 移除 --dirty 版本后缀引用 - 新增日志中心(log_proxy/log_datasource/UnifiedQueryPanel等) - 新增 i18n 国际化(i18next, 120+翻译键) - Dockerfile.embed 说明更正为 K8s 专用
This commit is contained in:
1 parent
f725ca7cac
commit
0c1964aa85
2 files changed
+538
-25
No files matched your search
@@ -80,7 +80,7 @@
|
||||
|
||||
### 方式三:Docker Compose(`./run.sh docker up`)
|
||||
|
||||
传统 4 容器部署:`aiops-mysql` + `aiops-redis` + `aiops-backend` + `aiops-frontend` (nginx)。
|
||||
3 容器部署:`aiops` + `aiops-mysql` + `aiops-redis`。前端由后端 embed 服务,单端口 8080。
|
||||
|
||||
```bash
|
||||
./run.sh docker up # 构建 + 启动全部容器
|
||||
@@ -95,10 +95,9 @@
|
||||
**容器清单:**
|
||||
| 容器 | 镜像 | 端口 | 说明 |
|
||||
|------|------|------|------|
|
||||
| `aiops` | `Dockerfile` (3-stage) | 8080 | Go API + embed 前端 |
|
||||
| `aiops-mysql` | `mysql:8.0` | 3306 | 数据库 |
|
||||
| `aiops-redis` | `redis:7-alpine` | 6379 | 缓存 |
|
||||
| `aiops-backend` | `backend/Dockerfile` (3-stage) | 8080 | Go API |
|
||||
| `aiops-frontend` | `frontend/Dockerfile` (nginx:alpine) | 80 | React SPA |
|
||||
|
||||
### 本地开发(`./run.sh dev`)
|
||||
|
||||
@@ -159,25 +158,29 @@ GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o aiops-agent-linux-arm64 .
|
||||
```
|
||||
aiops/
|
||||
├── backend/
|
||||
│ ├── cmd/
|
||||
│ │ ├── main.go # 应用入口
|
||||
│ │ ├── embed.go # go:embed 前端静态资源
|
||||
│ │ ├── seed.go # 种子数据
|
||||
│ │ └── static/ # embed 目标目录 (必须存在)
|
||||
│ ├── internal/
|
||||
│ │ ├── config/config.go # Viper 配置
|
||||
│ │ ├── models/ # GORM 模型
|
||||
│ │ └── api/
|
||||
│ │ ├── handlers/ # HTTP handler
|
||||
│ │ ├── middleware/ # JWT + Admin + PipelineAccess
|
||||
│ │ └── routes/ # 路由注册
|
||||
│ ├── main.go # 应用入口
|
||||
│ ├── embed.go # go:embed 前端静态资源
|
||||
│ ├── seed.go # 种子数据
|
||||
│ ├── static/ # embed 目标目录 (必须存在)
|
||||
│ ├── config/config.go # Viper 配置
|
||||
│ ├── controller/ # HTTP handler(60+ 文件按领域拆分)
|
||||
│ ├── model/ # GORM 模型(30 文件 86+ 表)
|
||||
│ ├── dto/ # 请求/响应 DTO
|
||||
│ ├── service/ # 业务逻辑层
|
||||
│ ├── repository/ # 数据访问层
|
||||
│ ├── router/routes.go # 路由注册(~1000 行)
|
||||
│ ├── middleware/ # JWT + Admin + PipelineAccess
|
||||
│ ├── seed/ # 种子数据(默认账号、菜单等)
|
||||
│ ├── pkg/
|
||||
│ │ ├── database/ # DB 连接 + AutoMigrate
|
||||
│ │ ├── kubernetesclient/ # 轻量 K8s API 客户端
|
||||
│ │ ├── remoteexec/ # Go-native SSH 远程执行
|
||||
│ │ ├── agentcli/ # AI 运维 Agent 引擎(ReAct + 工具 + 安全 + Evolver,见 docs/agent/)
|
||||
│ │ └── toolinstaller/ # 工具懒加载 + 镜像回退
|
||||
│ └── Dockerfile # 3 阶段构建 (Backend+Agent→Alpine Runtime)
|
||||
│ │ ├── agentcli/ # AI 运维 Agent 引擎(ReAct + 工具 + 安全 + Evolver)
|
||||
│ │ ├── toolinstaller/ # 工具懒加载 + 镜像回退
|
||||
│ │ ├── logger/ # Zap 日志
|
||||
│ │ ├── redis/ # Redis 连接
|
||||
│ │ └── wshub/ # WebSocket Hub
|
||||
│ └── Dockerfile # 3 阶段构建 (Frontend→Backend+Agent→Alpine Runtime)
|
||||
│
|
||||
├── frontend/
|
||||
│ ├── src/components/
|
||||
@@ -186,15 +189,16 @@ aiops/
|
||||
│ │ ├── cloud/ # 云资源
|
||||
│ │ ├── k8s/ # K8s 集群管理
|
||||
│ │ ├── deploy/ # 应用发布(流水线/发布配置/发布权限/工具配置)
|
||||
│ │ ├── monitor/ # 监控告警
|
||||
│ │ ├── monitor/ # 监控告警(含 log-center 日志中心)
|
||||
│ │ ├── automation/ # 定时任务/脚本库/远程执行
|
||||
│ │ ├── approval/ # 资源申请审批
|
||||
│ │ ├── aiops/ # AI 智能运维(助手/告警分析/容量预测/Agent CLI/大模型设置)
|
||||
│ │ ├── system/ # 系统管理
|
||||
│ │ └── layout/ # Sidebar/Header
|
||||
│ ├── src/services/
|
||||
│ │ ├── api.ts # API 定义
|
||||
│ │ └── http.ts # http 封装(自动解包 data + Token 注入)
|
||||
│ ├── src/api/
|
||||
│ │ └── monitor/log-center.ts # 日志中心 API(Loki/ES 代理查询)
|
||||
│ ├── src/i18n/ # 国际化框架 (i18next)
|
||||
│ ├── src/locales/ # 翻译文件 (zh-CN / en-US)
|
||||
│ └── Dockerfile # Node build → nginx:alpine
|
||||
│
|
||||
├── agent/ # 监控 Agent(独立 Go module)
|
||||
@@ -300,9 +304,9 @@ WebSocket 无法设自定义 header → 后端 JWTAuth 支持 `?token=` query pa
|
||||
|
||||
## 访问地址
|
||||
|
||||
- 前端:`http://localhost:5173` (dev) / `http://localhost:80` (docker)
|
||||
- 前端:`http://localhost:5173` (dev) / `http://localhost:8080` (docker / binary)
|
||||
- 后端:`http://localhost:8080`
|
||||
- 健康检查:`http://localhost:8080/health`
|
||||
- 健康检查:`http://localhost:8080/version` (推荐) / `http://localhost:8080/health`
|
||||
- K8s:`http://<NODE_IP>:30080`
|
||||
|
||||
## 常见陷阱速查
|
||||
@@ -330,7 +334,7 @@ WebSocket 无法设自定义 header → 后端 JWTAuth 支持 `?token=` query pa
|
||||
```
|
||||
https://gitee.com/attacker/aiops.git
|
||||
Git 用户: attacker / attacker@gitee.com
|
||||
分支: main
|
||||
分支: master
|
||||
```
|
||||
|
||||
## 关键设计决策
|
||||
|
||||
Reference in new issue
Block a user