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
+43
-2
@@ -66,15 +66,56 @@ func (a *AliyunProvider) sign(params map[string]string) string {
|
||||
return base64.StdEncoding.EncodeToString(mac.Sum(nil))
|
||||
}
|
||||
|
||||
// call 调用阿里云 RPC API
|
||||
// call 调用阿里云 ECS RPC API
|
||||
func (a *AliyunProvider) call(action string, extra map[string]string, endpoint string) ([]byte, error) {
|
||||
if endpoint == "" {
|
||||
endpoint = "https://ecs.aliyuncs.com/"
|
||||
}
|
||||
return a.callWithVersion(action, extra, endpoint, a.version)
|
||||
}
|
||||
|
||||
// aliyunBSSEndpoints BSS 国内站与国际站接入点(站点不匹配时需自动切换) // Logan.Li
|
||||
var aliyunBSSEndpoints = []string{
|
||||
"https://business.aliyuncs.com/", // 国内站 aliyun.com
|
||||
"https://business.ap-southeast-1.aliyuncs.com/", // 国际站 alibabacloud.com
|
||||
}
|
||||
|
||||
// callBSS 调用阿里云费用中心 BSS OpenAPI,自动适配国内/国际站 // Logan.Li
|
||||
func (a *AliyunProvider) callBSS(action string, extra map[string]string) ([]byte, error) {
|
||||
var lastErr error
|
||||
for _, endpoint := range aliyunBSSEndpoints {
|
||||
body, err := a.callWithVersion(action, extra, endpoint, "2017-12-14")
|
||||
if err == nil {
|
||||
return body, nil
|
||||
}
|
||||
if isAliyunBSSSiteMismatch(err) {
|
||||
lastErr = err
|
||||
continue
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
if lastErr != nil {
|
||||
return nil, fmt.Errorf("阿里云账单 API 站点不匹配(请确认 AK 属于国内站 aliyun.com 或国际站 alibabacloud.com): %w", lastErr)
|
||||
}
|
||||
return nil, fmt.Errorf("阿里云账单 API 调用失败")
|
||||
}
|
||||
|
||||
// isAliyunBSSSiteMismatch 判断是否为国内/国际站 endpoint 不匹配 // Logan.Li
|
||||
func isAliyunBSSSiteMismatch(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
msg := err.Error()
|
||||
return strings.Contains(msg, "NotApplicable") ||
|
||||
strings.Contains(msg, "caller site") ||
|
||||
strings.Contains(msg, "regionId")
|
||||
}
|
||||
|
||||
// callWithVersion 通用阿里云 RPC 签名请求
|
||||
func (a *AliyunProvider) callWithVersion(action string, extra map[string]string, endpoint, version string) ([]byte, error) {
|
||||
params := map[string]string{
|
||||
"Format": "JSON",
|
||||
"Version": a.version,
|
||||
"Version": version,
|
||||
"AccessKeyId": a.accessKey,
|
||||
"SignatureMethod": "HMAC-SHA1",
|
||||
"Timestamp": time.Now().UTC().Format("2006-01-02T15:04:05Z"),
|
||||
|
||||
Reference in new issue
Block a user