feat: 完善堡垒机与 Agent 智能运维能力

- 支持 Windows Agent 构建、安装脚本和统一上报协议

- 增强 RDP 剪贴板、虚拟盘和文件传输能力

- 新增 AIOps 上下文工具、告警 RCA trace 落库和回放接口

- 重构 docs 模块文档并补充终端、堡垒机、监控、AI Agent 设计
This commit is contained in:
Logan.Li committed 2026-07-05 23:49:36 +08:00
1 parent a9513c2056
commit e0d652d211
169 files changed
+12192 -9116

No files matched your search

+20 -11
View File
@@ -582,7 +582,7 @@ build_standalone_binary() {
ldflags+=" -X main.Version=${BUILD_VERSION}"
ldflags+=" -X main.BuildTime=${BUILD_TIME}"
ldflags+=" -X main.GitCommit=${GIT_COMMIT}"
CGO_ENABLED=1 GOPROXY=https://goproxy.cn,direct GONOSUMCHECK='*' GOTOOLCHAIN=go1.24.0 \
CGO_ENABLED=1 GOPROXY=https://goproxy.cn,direct GOSUMDB=sum.golang.org GONOSUMCHECK='*' \
go build -ldflags="$ldflags" -o "$STANDALONE_BIN_PATH" .
if [ ! -f "$STANDALONE_BIN_PATH" ]; then
error "编译失败"
@@ -632,15 +632,15 @@ migrate_binary_args_file() {
load_binary_args() {
migrate_binary_args_file
local -n _out=$1
_out=()
# macOS 默认 Bash 3 不支持 local -n,这里使用全局数组承载启动参数。// Logan.Li
BINARY_ARGS=()
if [ -f "$BINARY_ARGS_FILE" ]; then
while IFS= read -r line || [ -n "$line" ]; do
[ -n "$line" ] && _out+=("$line")
[ -n "$line" ] && BINARY_ARGS+=("$line")
done < "$BINARY_ARGS_FILE"
fi
if [ ${#_out[@]} -eq 0 ]; then
_out=(--mode local --port 8080)
if [ ${#BINARY_ARGS[@]} -eq 0 ]; then
BINARY_ARGS=(--mode local --port 8080)
fi
}
@@ -681,8 +681,10 @@ start_binary_daemon() {
mkdir -p "$LOGS_DIR" uploads
rotate_log "$LOGS_DIR/aiops.log"
stop_binary_process "$port"
nohup ./"$STANDALONE_BIN" "${args[@]}" >> "$LOGS_DIR/aiops.log" 2>&1 &
echo $! > "$BINARY_PID_FILE"
nohup ./"$STANDALONE_BIN" "${args[@]}" </dev/null >> "$LOGS_DIR/aiops.log" 2>&1 &
local pid=$!
disown "$pid" 2>/dev/null || true
echo "$pid" > "$BINARY_PID_FILE"
save_binary_args "${args[@]}"
if wait_binary_ready "$port"; then
success "二进制已启动 (PID: $(cat "$BINARY_PID_FILE"), 端口: $port)"
@@ -894,6 +896,10 @@ cmd_build() {
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="-w -s" -o bin/aiops-agent-darwin-arm64 .
success "bin/aiops-agent-darwin-arm64 ($(du -h bin/aiops-agent-darwin-arm64 | cut -f1))"
info "编译 Windows AMD64..."
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-w -s" -o bin/aiops-agent-windows-amd64.exe .
success "bin/aiops-agent-windows-amd64.exe ($(du -h bin/aiops-agent-windows-amd64.exe | cut -f1))"
if [ "$OS" = "macos" ]; then
info "编译 macOS (当前平台)..."
CGO_ENABLED=0 go build -ldflags="-w -s" -o bin/aiops-agent .
@@ -981,7 +987,8 @@ cmd_binary() {
if [ $# -gt 0 ]; then
args=("$@")
else
load_binary_args args
load_binary_args
args=("${BINARY_ARGS[@]}")
fi
local port
port=$(binary_listen_port "${args[@]}")
@@ -1000,7 +1007,8 @@ cmd_binary() {
if [ $# -gt 0 ]; then
args=("$@")
else
load_binary_args args
load_binary_args
args=("${BINARY_ARGS[@]}")
fi
if [ ! -f "$STANDALONE_BIN_PATH" ]; then
info "二进制不存在,先编译..."
@@ -1015,7 +1023,8 @@ cmd_binary() {
;;
status)
local args=()
load_binary_args args
load_binary_args
args=("${BINARY_ARGS[@]}")
local port
port=$(binary_listen_port "${args[@]}")
info "监听端口: $port"