新增xa空能院项目,新增大量的更新内容

This commit is contained in:
zeaslity
2025-11-05 16:44:40 +08:00
parent 0a1b92acc2
commit baf9272e2d
88 changed files with 18872 additions and 305 deletions

View File

@@ -0,0 +1,40 @@
# 基础功能
1. 所有支持的基础功能指令
# 业务功能
## wdd-server初始化操作
## cmii-master功能
## cmii-worker功能
# 执行模式
## 脚本模式
1. 根据输入的参数,执行特定的基础功能函数
## 交互模式
1. 进入交互模式只有输入exit或者 强制退出
2. 持续监听用户命令,匹配基础功能则执行命令
1. 显示执行过程
2. 正常写入日志
# 设计原则
## 基础功能可重复执行原则
1. 每一个基础函数均可以重复执行,重复执行的效果需要保证最终实现函数的功能
1. 未安装,需要执行安装
2. 已安装,请覆盖安装,或者跳过安装
3. 未配置,需要进行配置
4. 已进行配置,则跳过或者覆盖配置
## 日志记录原则
1. 基础功能开始,需要有明显的日志标识
2. 基础功能关键执行日志,需要被保存
3. 日志固定保存至特定的本地文件中
## 参数信息原则
1. 每次执行基础功能,默认是无状态的,不加载本地参数信息
2. 需要本机参数信息的基础功能,可以调用加载函数,加载本地保存的参数信息
1. 加载若没有本地参数信息,执行本地参数信息获取程序

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# 下载安装最新的agent-wdd
# 检查agent-wdd是否正常输出指令若无则程序退出
# 执行获取信息指令 info all
# 执行系统初始化操作
# agent-wdd base tools
# agent-wdd base swap
# agent-wdd base firewall
# agent-wdd base selinux
# agent-wdd base sysconfig
# 读取配置文件,判断是否能够联网
# 能联网 在线安装 docker
# 不能联网 离线安装docker
# 交互模式

View File

@@ -17,12 +17,34 @@ import (
var (
ubuntuCommonTools = []string{
"apt-utils", "iputils-ping", "net-tools", "dnsutils", "lsof", "curl", "wget", "mtr-tiny", "vim", "htop", "lrzsz",
"apt-utils",
"iputils-ping",
"net-tools",
"dnsutils",
"lsof",
"curl",
"wget",
"mtr-tiny",
"vim",
"htop",
"lrzsz",
}
centosCommonTools = []string{
"deltarpm", "net-tools", "iputils", "bind-utils", "lsof", "curl", "wget", "vim", "mtr", "htop",
"deltarpm",
"net-tools",
"iputils",
"bind-utils",
"lsof",
"curl",
"wget",
"vim",
"mtr",
"htop",
}
// https://download.docker.com/linux/static/stable/ 官方下载地址
// https://github.com/docker/compose/releases?page=8&tags=2.18.0
dockerLocalInstallPath = "/root/wdd/docker-amd64-20.10.15.tgz" // 本地安装docker的文件路径
dockerComposeLocalInstallPath = "/root/wdd/docker-compose-v2.18.0-linux-amd64" // 本地安装docker compose的文件路径
harborLocalInstallPath = "/root/wdd/harbor-offline-installer-v2.9.0.tgz" // 本地安装harbor的文件路径

View File

@@ -53,6 +53,8 @@ ListenAddress ::
#MaxSessions 10
#PubkeyAuthentication yes
PubkeyAcceptedKeyTypes +ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
HostKeyAlgorithms +ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2

View File

@@ -139,7 +139,7 @@ func InitConfig() {
}
// 写入配置文件
// SaveConfig 写入配置文件
func SaveConfig() {
// 每次写入新的时间
@@ -158,7 +158,7 @@ func SaveConfig() {
}
}
// 归一化配置-重命名主机名
// NormalizeConfig 归一化配置-重命名主机名
func (c *Config) NormalizeConfig() {
// 重命名主机名

View File

@@ -2,10 +2,12 @@ package main
import "agent-wdd/cmd"
// C:\Users\wdd\go\bin\gox.exe -osarch="linux/amd64" -output "build/agent-wdd_{{.OS}}_{{.Arch}}"
// C:\Users\wddsh\go\bin\gox.exe -osarch="linux/amd64" -output "build/agent-wdd_{{.OS}}_{{.Arch}}"
// rm -rf agent-wdd_linux_amd64
// chmod +x agent-wdd_linux_amd64 && ./agent-wdd_linux_amd64 version
// arm64
// C:\Users\wddsh\go\bin\gox.exe -osarch="linux/arm64" -output "build/agent-wdd_{{.OS}}_{{.Arch}}"
func main() {
// WDD 启动