feat(rdp): 新增 RDP 远程桌面/SMB/账单同步能力 + 清理编译产物
主要变更: - RDP 远程桌面:新增 backend/pkg/rdp(RDP 引擎 + credssp/display/rle/trace)、 backend/controller/rdp*(连接/凭证/文件/会话/实时)、frontend RDP 组件与 API - Windows SMB 文件传输:backend/pkg/winsmb - 云账单同步:backend/pkg/billingsync + billing_sync/aliyun_billing,前端账单详情 - Agent CLI Kubernetes 工具:kubernetes_action/get、pod_execute/logs - 服务器导入助手:server_import_helpers、ImportCredentialSettings - 国际化与组件重构(cloud/deploy/monitor/server/system 等多模块) - 清理编译产物二进制:移除 backend/server、backend/agent/bin/aiops-agent-* - .gitignore:新增 backend/agent/ 与 .cache/(避免 334MB go-build 缓存误入库) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
777d9e4e71
commit
76ec9387f0
202 files changed
+16555
-2543
No files matched your search
+72
-53
@@ -9,27 +9,29 @@ import (
|
||||
// 核心加密字段 content 存储类型特有数据(JSON),API 不返回
|
||||
//
|
||||
// 类型与内容 JSON 映射:
|
||||
// ssh → {"private_key":"...","public_key":"...","ssh_user":"...","ssh_port":22}
|
||||
// docker → {"server":"...","username":"...","password":"..."}
|
||||
// tls → {"cert":"...","key":"...","ca":"..."}
|
||||
// aksk → {"provider":"...","access_key":"...","secret_key":"...","region":"..."}
|
||||
// database → {"db_type":"...","host":"...","port":3306,"db_name":"...","username":"...","password":"..."}
|
||||
// api → {"key":"...","endpoint":"..."}
|
||||
// generic → {"key":"...","value":"..."}
|
||||
//
|
||||
// ssh → {"private_key":"...","public_key":"...","ssh_user":"...","ssh_port":22}
|
||||
// rdp → {"username":"...","password":"...","domain":"...","security":"nla"}
|
||||
// docker → {"server":"...","username":"...","password":"..."}
|
||||
// tls → {"cert":"...","key":"...","ca":"..."}
|
||||
// aksk → {"provider":"...","access_key":"...","secret_key":"...","region":"..."}
|
||||
// database → {"db_type":"...","host":"...","port":3306,"db_name":"...","username":"...","password":"..."}
|
||||
// api → {"key":"...","endpoint":"..."}
|
||||
// generic → {"key":"...","value":"..."}
|
||||
type Credential struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
Name string `gorm:"size:128;not null" json:"name"` // 凭据名称
|
||||
VariableName string `gorm:"size:64;index" json:"variable_name,omitempty"` // 环境变量别名 e.g. MYSQL_PROD
|
||||
SecretType string `gorm:"size:32;not null;index" json:"secret_type"` // ssh/docker/tls/aksk/database/api/generic
|
||||
Summary string `gorm:"size:255" json:"summary,omitempty"` // 关键信息摘要(脱敏展示)
|
||||
Content string `gorm:"type:text;not null" json:"-"` // AES 加密后的 JSON,API 不返回
|
||||
Tags string `gorm:"type:text" json:"tags,omitempty"` // JSON 数组: ["生产环境","阿里云"]
|
||||
Description string `gorm:"size:500" json:"description,omitempty"`
|
||||
ExpiresAt *time.Time `json:"expires_at,omitempty"` // 过期时间
|
||||
IsActive bool `gorm:"default:true" json:"is_active"` // 启用/禁用
|
||||
EnvPrefix string `gorm:"size:32" json:"env_prefix,omitempty"` // 引用 ID(可复制)
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
Name string `gorm:"size:128;not null" json:"name"` // 凭据名称
|
||||
VariableName string `gorm:"size:64;index" json:"variable_name,omitempty"` // 环境变量别名 e.g. MYSQL_PROD
|
||||
SecretType string `gorm:"size:32;not null;index" json:"secret_type"` // ssh/rdp/docker/tls/aksk/database/api/generic
|
||||
Summary string `gorm:"size:255" json:"summary,omitempty"` // 关键信息摘要(脱敏展示)
|
||||
Content string `gorm:"type:text;not null" json:"-"` // AES 加密后的 JSON,API 不返回
|
||||
Tags string `gorm:"type:text" json:"tags,omitempty"` // JSON 数组: ["生产环境","阿里云"]
|
||||
Description string `gorm:"size:500" json:"description,omitempty"`
|
||||
ExpiresAt *time.Time `json:"expires_at,omitempty"` // 过期时间
|
||||
IsActive bool `gorm:"default:true" json:"is_active"` // 启用/禁用
|
||||
EnvPrefix string `gorm:"size:32" json:"env_prefix,omitempty"` // 引用 ID(可复制)
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
func (Credential) TableName() string {
|
||||
@@ -47,6 +49,14 @@ type SSHSecretContent struct {
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
// RDPSecretContent RDP 凭据 content,后端渲染模式下仅服务端解密使用 // Logan.Li
|
||||
type RDPSecretContent struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Domain string `json:"domain,omitempty"`
|
||||
Security string `json:"security,omitempty"`
|
||||
}
|
||||
|
||||
// DockerSecretContent Docker 凭据 content
|
||||
type DockerSecretContent struct {
|
||||
Server string `json:"server"`
|
||||
@@ -95,13 +105,13 @@ type GenericSecretContent struct {
|
||||
|
||||
// CreateSecretRequest 创建凭据请求
|
||||
type CreateSecretRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
VariableName string `json:"variable_name"`
|
||||
SecretType string `json:"secret_type" binding:"required,oneof=ssh docker tls aksk database api generic"`
|
||||
Tags []string `json:"tags"`
|
||||
Description string `json:"description"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
VariableName string `json:"variable_name"`
|
||||
SecretType string `json:"secret_type" binding:"required,oneof=ssh rdp docker tls aksk database api generic"`
|
||||
Tags []string `json:"tags"`
|
||||
Description string `json:"description"`
|
||||
ExpiresAt *time.Time `json:"expires_at"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
|
||||
// 类型特有字段(明文,后端组装成 JSON 加密存储)
|
||||
// SSH
|
||||
@@ -110,6 +120,11 @@ type CreateSecretRequest struct {
|
||||
SSHUser string `json:"ssh_user,omitempty"`
|
||||
SSHPort int `json:"ssh_port,omitempty"`
|
||||
SSHPassword string `json:"ssh_password,omitempty"`
|
||||
// RDP
|
||||
RDPUsername string `json:"rdp_username,omitempty"`
|
||||
RDPPassword string `json:"rdp_password,omitempty"`
|
||||
RDPDomain string `json:"rdp_domain,omitempty"`
|
||||
RDPSecurity string `json:"rdp_security,omitempty"`
|
||||
// Docker
|
||||
DockerServer string `json:"docker_server,omitempty"`
|
||||
DockerUsername string `json:"docker_username,omitempty"`
|
||||
@@ -140,39 +155,43 @@ type CreateSecretRequest struct {
|
||||
|
||||
// UpdateSecretRequest 更新凭据请求
|
||||
type UpdateSecretRequest struct {
|
||||
Name *string `json:"name"`
|
||||
VariableName *string `json:"variable_name"`
|
||||
Tags []string `json:"tags"`
|
||||
Description *string `json:"description"`
|
||||
Name *string `json:"name"`
|
||||
VariableName *string `json:"variable_name"`
|
||||
Tags []string `json:"tags"`
|
||||
Description *string `json:"description"`
|
||||
ExpiresAt *time.Time `json:"expires_at"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
|
||||
// 类型特有字段 — 传了才更新
|
||||
SSHPrivateKey *string `json:"ssh_private_key,omitempty"`
|
||||
SSHPublicKey *string `json:"ssh_public_key,omitempty"`
|
||||
SSHUser *string `json:"ssh_user,omitempty"`
|
||||
SSHPort *int `json:"ssh_port,omitempty"`
|
||||
SSHPassword *string `json:"ssh_password,omitempty"`
|
||||
SSHPrivateKey *string `json:"ssh_private_key,omitempty"`
|
||||
SSHPublicKey *string `json:"ssh_public_key,omitempty"`
|
||||
SSHUser *string `json:"ssh_user,omitempty"`
|
||||
SSHPort *int `json:"ssh_port,omitempty"`
|
||||
SSHPassword *string `json:"ssh_password,omitempty"`
|
||||
RDPUsername *string `json:"rdp_username,omitempty"`
|
||||
RDPPassword *string `json:"rdp_password,omitempty"`
|
||||
RDPDomain *string `json:"rdp_domain,omitempty"`
|
||||
RDPSecurity *string `json:"rdp_security,omitempty"`
|
||||
DockerServer *string `json:"docker_server,omitempty"`
|
||||
DockerUsername *string `json:"docker_username,omitempty"`
|
||||
DockerPassword *string `json:"docker_password,omitempty"`
|
||||
TLSCert *string `json:"tls_cert,omitempty"`
|
||||
TLSKey *string `json:"tls_key,omitempty"`
|
||||
TLSCA *string `json:"tls_ca,omitempty"`
|
||||
AKSKProvider *string `json:"aksk_provider,omitempty"`
|
||||
AKSKAccessKey *string `json:"aksk_access_key,omitempty"`
|
||||
AKSKSecretKey *string `json:"aksk_secret_key,omitempty"`
|
||||
AKSKRegion *string `json:"aksk_region,omitempty"`
|
||||
DBType *string `json:"db_type,omitempty"`
|
||||
DBHost *string `json:"db_host,omitempty"`
|
||||
DBPort *int `json:"db_port,omitempty"`
|
||||
DBName *string `json:"db_name,omitempty"`
|
||||
DBUsername *string `json:"db_username,omitempty"`
|
||||
DBPassword *string `json:"db_password,omitempty"`
|
||||
APIKey *string `json:"api_key,omitempty"`
|
||||
APIEndpoint *string `json:"api_endpoint,omitempty"`
|
||||
GenericKey *string `json:"generic_key,omitempty"`
|
||||
GenericValue *string `json:"generic_value,omitempty"`
|
||||
TLSCert *string `json:"tls_cert,omitempty"`
|
||||
TLSKey *string `json:"tls_key,omitempty"`
|
||||
TLSCA *string `json:"tls_ca,omitempty"`
|
||||
AKSKProvider *string `json:"aksk_provider,omitempty"`
|
||||
AKSKAccessKey *string `json:"aksk_access_key,omitempty"`
|
||||
AKSKSecretKey *string `json:"aksk_secret_key,omitempty"`
|
||||
AKSKRegion *string `json:"aksk_region,omitempty"`
|
||||
DBType *string `json:"db_type,omitempty"`
|
||||
DBHost *string `json:"db_host,omitempty"`
|
||||
DBPort *int `json:"db_port,omitempty"`
|
||||
DBName *string `json:"db_name,omitempty"`
|
||||
DBUsername *string `json:"db_username,omitempty"`
|
||||
DBPassword *string `json:"db_password,omitempty"`
|
||||
APIKey *string `json:"api_key,omitempty"`
|
||||
APIEndpoint *string `json:"api_endpoint,omitempty"`
|
||||
GenericKey *string `json:"generic_key,omitempty"`
|
||||
GenericValue *string `json:"generic_value,omitempty"`
|
||||
}
|
||||
|
||||
// SecretListResponse 列表返回(内容脱敏)
|
||||
|
||||
Reference in new issue
Block a user