From f48a23cbfaf9e96bcaff002f3b563c021a2ca3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Wed, 3 Dec 2025 14:04:11 +0800 Subject: [PATCH] fix(region): aliyun vnc addr (#23883) --- go.mod | 2 +- go.sum | 4 ++-- pkg/webconsole/options/options.go | 2 +- pkg/webconsole/session/remote_console.go | 13 ++++++------- vendor/modules.txt | 2 +- .../x/cloudmux/pkg/multicloud/aliyun/instance.go | 7 ------- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index c9fc8dca5b..7eb8c70154 100644 --- a/go.mod +++ b/go.mod @@ -98,7 +98,7 @@ require ( k8s.io/cri-api v0.28.15 k8s.io/klog/v2 v2.20.0 moul.io/http2curl/v2 v2.3.0 - yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251130090640-988b91734be4 + yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251202110347-66e60ae88e4f yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0 yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1 yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 diff --git a/go.sum b/go.sum index d19cc9abe3..7ba0a9679e 100644 --- a/go.sum +++ b/go.sum @@ -1661,8 +1661,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251130090640-988b91734be4 h1:FsVs00YbXgtIAkG5vKlsuv3SJXFLQpyqRvRlaY4sc4I= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251130090640-988b91734be4/go.mod h1:aWRX5Phwz3nbHUNnIAm1oVogjguXPYDDgCOy/9Hnnvk= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251202110347-66e60ae88e4f h1:XbF3dPkwrLs9ndX8QP23EGFljbnkII76UjPDKeIJvhA= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251202110347-66e60ae88e4f/go.mod h1:aWRX5Phwz3nbHUNnIAm1oVogjguXPYDDgCOy/9Hnnvk= yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0 h1:msG4SiDSVU7CrXH06WuHlNEZXIooTcmNbfrIGHuIHBU= yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634= diff --git a/pkg/webconsole/options/options.go b/pkg/webconsole/options/options.go index 2f33f505ac..88cad57781 100644 --- a/pkg/webconsole/options/options.go +++ b/pkg/webconsole/options/options.go @@ -30,7 +30,7 @@ type WebConsoleOptions struct { IpmitoolPath string `help:"ipmitool binary path used to connect baremetal sol" default:"/usr/bin/ipmitool"` EnableAutoLogin bool `help:"allow webconsole to log in directly with the cloudroot public key" default:"false"` ApsaraConsoleAddr string `help:"Apsara console addr" default:"https://xxxx.com.cn/module/ecs/vnc/index.html"` - AliyunConsoleAddr string `help:"Aliyun vnc addr" default:"https://ecs.console.aliyun.com/vnc/index.htm"` + AliyunConsoleAddr string `help:"Aliyun vnc addr" default:"https://g.alicdn.com/aliyun/ecs-console-vnc2/0.0.8/index.html"` SshSessionTimeoutMinutes int `help:"ssh timeout session" default:"-1"` RdpSessionTimeoutMinutes int `help:"rdp timeout session" default:"-1"` diff --git a/pkg/webconsole/session/remote_console.go b/pkg/webconsole/session/remote_console.go index abc311dae9..8e5b320050 100644 --- a/pkg/webconsole/session/remote_console.go +++ b/pkg/webconsole/session/remote_console.go @@ -19,6 +19,7 @@ import ( "fmt" "net/url" "os/exec" + "strings" "yunion.io/x/cloudmux/pkg/cloudprovider" "yunion.io/x/jsonutils" @@ -172,16 +173,14 @@ func (info *RemoteConsoleInfo) getQcloudURL() (string, error) { func (info *RemoteConsoleInfo) getAliyunURL() (string, error) { isWindows := "false" - if info.OsName == "Windows" { + if strings.EqualFold(info.OsName, "windows") { isWindows = "true" } - params := url.Values{ - "vncUrl": {info.Url}, - "instanceId": {info.InstanceId}, - "isWindows": {isWindows}, - "password": {info.Password}, + vncUrl, err := url.QueryUnescape(info.Url) + if err != nil { + return "", errors.Wrap(err, "url.QueryUnescape") } - return info.getConnParamsURL(options.Options.AliyunConsoleAddr, params), nil + return fmt.Sprintf("%s?vncUrl=%s&instanceId=%s&isWindows=%s", options.Options.AliyunConsoleAddr, vncUrl, info.InstanceId, isWindows), nil } func (info *RemoteConsoleInfo) getCloudpodsURL() (string, error) { diff --git a/vendor/modules.txt b/vendor/modules.txt index 2e6aab043a..0e292e3a6d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2243,7 +2243,7 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251130090640-988b91734be4 +# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251202110347-66e60ae88e4f ## explicit; go 1.24 yunion.io/x/cloudmux/pkg/apis yunion.io/x/cloudmux/pkg/apis/billing diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/aliyun/instance.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/aliyun/instance.go index f580e64825..cc34c99850 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/aliyun/instance.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/aliyun/instance.go @@ -29,7 +29,6 @@ import ( "yunion.io/x/pkg/util/billing" "yunion.io/x/pkg/util/imagetools" "yunion.io/x/pkg/util/osprofile" - "yunion.io/x/pkg/util/seclib" "yunion.io/x/pkg/utils" billing_api "yunion.io/x/cloudmux/pkg/apis/billing" @@ -444,14 +443,8 @@ func (self *SInstance) GetVNCInfo(input *cloudprovider.ServerVncInput) (*cloudpr if err != nil { return nil, err } - passwd := seclib.RandomPassword(6) - err = self.host.zone.region.ModifyInstanceVNCUrlPassword(self.InstanceId, passwd) - if err != nil { - return nil, err - } ret := &cloudprovider.ServerVncOutput{ Url: url, - Password: passwd, Protocol: "aliyun", InstanceId: self.InstanceId, Hypervisor: api.HYPERVISOR_ALIYUN,