diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..065620b --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,28 @@ +{ + "permissions": { + "allow": [ + "Bash(grep:*)", + "Bash(protoc:*)", + "Bash(go version:*)", + "Bash(go build:*)", + "Bash(go vet:*)", + "Bash(go get:*)", + "Bash(python3:*)", + "Bash(python:*)", + "Bash(chmod +x:*)", + "Bash(tr }:*)", + "Bash(xxd:*)", + "Bash(curl:*)", + "Bash(/tmp/protoc-install/bin/protoc.exe:*)", + "Bash(protoc-gen-go-grpc:*)", + "Bash(netstat:*)", + "Bash(tasklist:*)", + "Bash(tail:*)", + "Bash(echo:*)", + "Bash(where protoc:*)", + "Bash(/c/Users/robin/AppData/Local/Temp/protoc-install/bin/protoc.exe:*)", + "Bash(protoc-gen-go:*)", + "Bash(cp:*)" + ] + } +} diff --git a/EdgeAPI/internal/db/models/httpdns_app_dao.go b/EdgeAPI/internal/db/models/httpdns_app_dao.go index 641dab3..bbcd9e0 100644 --- a/EdgeAPI/internal/db/models/httpdns_app_dao.go +++ b/EdgeAPI/internal/db/models/httpdns_app_dao.go @@ -1,6 +1,8 @@ package models import ( + "encoding/json" + _ "github.com/go-sql-driver/mysql" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/dbs" @@ -35,12 +37,17 @@ func init() { }) } -func (this *HTTPDNSAppDAO) CreateApp(tx *dbs.Tx, name string, appId string, primaryClusterId int64, backupClusterId int64, isOn bool, userId int64) (int64, error) { +func (this *HTTPDNSAppDAO) CreateApp(tx *dbs.Tx, name string, appId string, clusterIdsJSON []byte, isOn bool, userId int64) (int64, error) { var op = NewHTTPDNSAppOperator() op.Name = name op.AppId = appId - op.PrimaryClusterId = primaryClusterId - op.BackupClusterId = backupClusterId + + if len(clusterIdsJSON) > 0 { + op.ClusterIdsJSON = string(clusterIdsJSON) + } else { + op.ClusterIdsJSON = "[]" + } + op.IsOn = isOn op.UserId = userId op.SNIMode = HTTPDNSSNIModeFixedHide @@ -54,18 +61,37 @@ func (this *HTTPDNSAppDAO) CreateApp(tx *dbs.Tx, name string, appId string, prim return types.Int64(op.Id), nil } -func (this *HTTPDNSAppDAO) UpdateApp(tx *dbs.Tx, appDbId int64, name string, primaryClusterId int64, backupClusterId int64, isOn bool, userId int64) error { +func (this *HTTPDNSAppDAO) UpdateApp(tx *dbs.Tx, appDbId int64, name string, clusterIdsJSON []byte, isOn bool, userId int64) error { var op = NewHTTPDNSAppOperator() op.Id = appDbId op.Name = name - op.PrimaryClusterId = primaryClusterId - op.BackupClusterId = backupClusterId + + if len(clusterIdsJSON) > 0 { + op.ClusterIdsJSON = string(clusterIdsJSON) + } else { + op.ClusterIdsJSON = "[]" + } + op.IsOn = isOn op.UserId = userId op.UpdatedAt = time.Now().Unix() return this.Save(tx, op) } +// ReadAppClusterIds reads cluster IDs from ClusterIdsJSON. +func (this *HTTPDNSAppDAO) ReadAppClusterIds(app *HTTPDNSApp) []int64 { + if app == nil { + return nil + } + if len(app.ClusterIdsJSON) > 0 { + var ids []int64 + if err := json.Unmarshal([]byte(app.ClusterIdsJSON), &ids); err == nil && len(ids) > 0 { + return ids + } + } + return nil +} + func (this *HTTPDNSAppDAO) DisableApp(tx *dbs.Tx, appDbId int64) error { _, err := this.Query(tx). Pk(appDbId). diff --git a/EdgeAPI/internal/db/models/httpdns_app_model.go b/EdgeAPI/internal/db/models/httpdns_app_model.go index 113fe9f..58d5b29 100644 --- a/EdgeAPI/internal/db/models/httpdns_app_model.go +++ b/EdgeAPI/internal/db/models/httpdns_app_model.go @@ -6,8 +6,7 @@ type HTTPDNSApp struct { Name string `field:"name"` // app name AppId string `field:"appId"` // external app id IsOn bool `field:"isOn"` // enabled - PrimaryClusterId uint32 `field:"primaryClusterId"` // primary cluster id - BackupClusterId uint32 `field:"backupClusterId"` // backup cluster id + ClusterIdsJSON string `field:"clusterIdsJSON"` // cluster ids json SNIMode string `field:"sniMode"` // sni mode UserId int64 `field:"userId"` // owner user id CreatedAt uint64 `field:"createdAt"` // created unix ts @@ -21,8 +20,7 @@ type HTTPDNSAppOperator struct { Name any // app name AppId any // external app id IsOn any // enabled - PrimaryClusterId any // primary cluster id - BackupClusterId any // backup cluster id + ClusterIdsJSON any // cluster ids json SNIMode any // sni mode UserId any // owner user id CreatedAt any // created unix ts diff --git a/EdgeAPI/internal/db/models/user_dao.go b/EdgeAPI/internal/db/models/user_dao.go index f4a4a66..0a495b7 100644 --- a/EdgeAPI/internal/db/models/user_dao.go +++ b/EdgeAPI/internal/db/models/user_dao.go @@ -246,7 +246,7 @@ func (this *UserDAO) CreateUser(tx *dbs.Tx, username string, } // UpdateUser 修改用户 -func (this *UserDAO) UpdateUser(tx *dbs.Tx, userId int64, username string, password string, fullname string, mobile string, tel string, email string, remark string, isOn bool, nodeClusterId int64, bandwidthAlgo systemconfigs.BandwidthAlgo) error { +func (this *UserDAO) UpdateUser(tx *dbs.Tx, userId int64, username string, password string, fullname string, mobile string, tel string, email string, remark string, isOn bool, nodeClusterId int64, bandwidthAlgo systemconfigs.BandwidthAlgo, httpdnsClusterIdsJSON []byte) error { if userId <= 0 { return errors.New("invalid userId") } @@ -265,6 +265,11 @@ func (this *UserDAO) UpdateUser(tx *dbs.Tx, userId int64, username string, passw op.ClusterId = nodeClusterId op.BandwidthAlgo = bandwidthAlgo op.IsOn = isOn + if len(httpdnsClusterIdsJSON) > 0 { + op.HttpdnsClusterIds = string(httpdnsClusterIdsJSON) + } else { + op.HttpdnsClusterIds = "[]" + } err := this.Save(tx, op) if err != nil { return err @@ -466,6 +471,21 @@ func (this *UserDAO) FindUserClusterId(tx *dbs.Tx, userId int64) (int64, error) FindInt64Col(0) } +// UpdateUserHttpdnsClusterIds 更新用户的HTTPDNS关联集群ID列表 +func (this *UserDAO) UpdateUserHttpdnsClusterIds(tx *dbs.Tx, userId int64, httpdnsClusterIdsJSON []byte) error { + if userId <= 0 { + return errors.New("invalid userId") + } + if len(httpdnsClusterIdsJSON) == 0 { + httpdnsClusterIdsJSON = []byte("[]") + } + _, err := this.Query(tx). + Pk(userId). + Set("httpdnsClusterIds", httpdnsClusterIdsJSON). + Update() + return err +} + // UpdateUserFeatures 更新单个用户Features func (this *UserDAO) UpdateUserFeatures(tx *dbs.Tx, userId int64, featuresJSON []byte) error { if userId <= 0 { diff --git a/EdgeAPI/internal/db/models/user_model.go b/EdgeAPI/internal/db/models/user_model.go index d259100..ed85eb6 100644 --- a/EdgeAPI/internal/db/models/user_model.go +++ b/EdgeAPI/internal/db/models/user_model.go @@ -37,6 +37,7 @@ const ( UserField_BandwidthAlgo dbs.FieldName = "bandwidthAlgo" // 带宽算法 UserField_BandwidthModifier dbs.FieldName = "bandwidthModifier" // 带宽修正值 UserField_Lang dbs.FieldName = "lang" // 语言代号 + UserField_HttpdnsClusterIds dbs.FieldName = "httpdnsClusterIds" // HTTPDNS关联集群ID列表 ) // User 用户 @@ -75,6 +76,7 @@ type User struct { BandwidthAlgo string `field:"bandwidthAlgo"` // 带宽算法 BandwidthModifier float64 `field:"bandwidthModifier"` // 带宽修正值 Lang string `field:"lang"` // 语言代号 + HttpdnsClusterIds dbs.JSON `field:"httpdnsClusterIds"` // HTTPDNS关联集群ID列表 } type UserOperator struct { @@ -112,6 +114,7 @@ type UserOperator struct { BandwidthAlgo any // 带宽算法 BandwidthModifier any // 带宽修正值 Lang any // 语言代号 + HttpdnsClusterIds any // HTTPDNS关联集群ID列表 } func NewUserOperator() *UserOperator { diff --git a/EdgeAPI/internal/installers/fluent_bit.go b/EdgeAPI/internal/installers/fluent_bit.go index 09ab0ff..9357b1d 100644 --- a/EdgeAPI/internal/installers/fluent_bit.go +++ b/EdgeAPI/internal/installers/fluent_bit.go @@ -33,11 +33,13 @@ const ( fluentBitServiceName = "fluent-bit" fluentBitDefaultBinPath = "/opt/fluent-bit/bin/fluent-bit" fluentBitLocalPackagesRoot = "packages" - fluentBitHTTPPathPattern = "/var/log/edge/edge-node/*.log" - fluentBitDNSPathPattern = "/var/log/edge/edge-dns/*.log" - fluentBitManagedMarker = "managed-by-edgeapi" - fluentBitRoleNode = "node" - fluentBitRoleDNS = "dns" + fluentBitHTTPPathPattern = "/var/log/edge/edge-node/*.log" + fluentBitDNSPathPattern = "/var/log/edge/edge-dns/*.log" + fluentBitHTTPDNSPathPattern = "/var/log/edge/edge-httpdns/*.log" + fluentBitManagedMarker = "managed-by-edgeapi" + fluentBitRoleNode = "node" + fluentBitRoleDNS = "dns" + fluentBitRoleHTTPDNS = "httpdns" ) var errFluentBitLocalPackageNotFound = errors.New("fluent-bit local package not found") @@ -57,10 +59,11 @@ type fluentBitManagedMeta struct { } type fluentBitDesiredConfig struct { - Roles []string - ClickHouse *systemconfigs.ClickHouseSetting - HTTPPathPattern string - DNSPathPattern string + Roles []string + ClickHouse *systemconfigs.ClickHouseSetting + HTTPPathPattern string + DNSPathPattern string + HTTPDNSPathPattern string } // SetupFluentBit 安装并托管 Fluent Bit 配置(离线包 + 平台渲染配置)。 @@ -344,7 +347,7 @@ func mapNodeRole(role nodeconfigs.NodeRole) (string, error) { case nodeconfigs.NodeRoleDNS: return fluentBitRoleDNS, nil case nodeconfigs.NodeRoleHTTPDNS: - return fluentBitRoleDNS, nil + return fluentBitRoleHTTPDNS, nil default: return "", fmt.Errorf("unsupported fluent-bit role '%s'", role) } @@ -354,7 +357,7 @@ func normalizeRoles(rawRoles []string) []string { roleSet := map[string]struct{}{} for _, role := range rawRoles { role = strings.ToLower(strings.TrimSpace(role)) - if role != fluentBitRoleNode && role != fluentBitRoleDNS { + if role != fluentBitRoleNode && role != fluentBitRoleDNS && role != fluentBitRoleHTTPDNS { continue } roleSet[role] = struct{}{} @@ -420,6 +423,7 @@ func (this *BaseInstaller) buildDesiredFluentBitConfig(roles []string) (*fluentB httpPathPattern := fluentBitHTTPPathPattern dnsPathPattern := fluentBitDNSPathPattern + httpdnsPathPattern := fluentBitHTTPDNSPathPattern publicPolicyPath, err := this.readPublicAccessLogPolicyPath() if err != nil { return nil, err @@ -429,13 +433,15 @@ func (this *BaseInstaller) buildDesiredFluentBitConfig(roles []string) (*fluentB pattern := strings.TrimRight(policyDir, "/") + "/*.log" httpPathPattern = pattern dnsPathPattern = pattern + httpdnsPathPattern = pattern } return &fluentBitDesiredConfig{ - Roles: normalizeRoles(roles), - ClickHouse: ch, - HTTPPathPattern: httpPathPattern, - DNSPathPattern: dnsPathPattern, + Roles: normalizeRoles(roles), + ClickHouse: ch, + HTTPPathPattern: httpPathPattern, + DNSPathPattern: dnsPathPattern, + HTTPDNSPathPattern: httpdnsPathPattern, }, nil } @@ -556,6 +562,7 @@ func renderManagedConfig(desired *fluentBitDesiredConfig) (string, error) { insertHTTP := url.QueryEscape(fmt.Sprintf("INSERT INTO %s.logs_ingest FORMAT JSONEachRow", desired.ClickHouse.Database)) insertDNS := url.QueryEscape(fmt.Sprintf("INSERT INTO %s.dns_logs_ingest FORMAT JSONEachRow", desired.ClickHouse.Database)) + insertHTTPDNS := url.QueryEscape(fmt.Sprintf("INSERT INTO %s.httpdns_access_logs_ingest FORMAT JSONEachRow", desired.ClickHouse.Database)) lines := []string{ "# " + fluentBitManagedMarker, @@ -604,6 +611,23 @@ func renderManagedConfig(desired *fluentBitDesiredConfig) (string, error) { ) } + if hasRole(desired.Roles, fluentBitRoleHTTPDNS) { + lines = append(lines, + "[INPUT]", + " Name tail", + " Path "+desired.HTTPDNSPathPattern, + " Tag app.httpdns.logs", + " Parser json", + " Refresh_Interval 2", + " Read_from_Head false", + " DB /var/lib/fluent-bit/httpdns-logs.db", + " storage.type filesystem", + " Mem_Buf_Limit 256MB", + " Skip_Long_Lines On", + "", + ) + } + if hasRole(desired.Roles, fluentBitRoleNode) { lines = append(lines, "[OUTPUT]", @@ -666,6 +690,37 @@ func renderManagedConfig(desired *fluentBitDesiredConfig) (string, error) { lines = append(lines, "") } + if hasRole(desired.Roles, fluentBitRoleHTTPDNS) { + lines = append(lines, + "[OUTPUT]", + " Name http", + " Match app.httpdns.logs", + " Host "+desired.ClickHouse.Host, + " Port "+strconv.Itoa(desired.ClickHouse.Port), + " URI /?query="+insertHTTPDNS, + " Format json_lines", + " http_user ${CH_USER}", + " http_passwd ${CH_PASSWORD}", + " json_date_key timestamp", + " json_date_format epoch", + " workers 2", + " net.keepalive On", + " Retry_Limit False", + ) + if useTLS { + lines = append(lines, " tls On") + if desired.ClickHouse.TLSSkipVerify { + lines = append(lines, " tls.verify Off") + } else { + lines = append(lines, " tls.verify On") + } + if strings.TrimSpace(desired.ClickHouse.TLSServerName) != "" { + lines = append(lines, " tls.vhost "+strings.TrimSpace(desired.ClickHouse.TLSServerName)) + } + } + lines = append(lines, "") + } + return strings.Join(lines, "\n"), nil } diff --git a/EdgeAPI/internal/installers/queue_httpdns_node.go b/EdgeAPI/internal/installers/queue_httpdns_node.go index d2d5449..197eb0f 100644 --- a/EdgeAPI/internal/installers/queue_httpdns_node.go +++ b/EdgeAPI/internal/installers/queue_httpdns_node.go @@ -13,10 +13,10 @@ import ( "github.com/TeaOSLab/EdgeAPI/internal/goman" "github.com/TeaOSLab/EdgeAPI/internal/utils" "github.com/TeaOSLab/EdgeAPI/internal/utils/numberutils" + "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/sslconfigs" "github.com/iwind/TeaGo/logs" - "github.com/iwind/TeaGo/maps" ) var sharedHTTPDNSNodeQueue = NewHTTPDNSNodeQueue() @@ -98,9 +98,8 @@ func (q *HTTPDNSNodeQueue) InstallNode(nodeId int64, installStatus *models.NodeI return errors.New("can not find cluster") } - sshHost, sshPort, grantId, err := q.parseSSHInfo(node) + sshHost, sshPort, grantId, err := q.parseSSHInfo(node, installStatus) if err != nil { - installStatus.ErrorCode = "EMPTY_SSH" return err } @@ -287,35 +286,37 @@ func (q *HTTPDNSNodeQueue) resolveClusterTLSListenAddr(cluster *models.HTTPDNSCl return defaultListenAddr, nil } -func (q *HTTPDNSNodeQueue) parseSSHInfo(node *models.HTTPDNSNode) (string, int, int64, error) { +func (q *HTTPDNSNodeQueue) parseSSHInfo(node *models.HTTPDNSNode, installStatus *models.NodeInstallStatus) (string, int, int64, error) { if node == nil { return "", 0, 0, errors.New("node should not be nil") } - if len(node.InstallStatus) == 0 { - return "", 0, 0, errors.New("ssh config should not be empty") - } - statusMap := maps.Map{} - err := json.Unmarshal(node.InstallStatus, &statusMap) + login, err := models.SharedNodeLoginDAO.FindEnabledNodeLoginWithNodeId(nil, nodeconfigs.NodeRoleHTTPDNS, int64(node.Id)) if err != nil { - return "", 0, 0, errors.New("invalid install status data") + return "", 0, 0, err } - sshMap := statusMap.GetMap("ssh") - if sshMap == nil { - return "", 0, 0, errors.New("ssh config should not be empty") + if login == nil { + installStatus.ErrorCode = "EMPTY_SSH" + return "", 0, 0, errors.New("ssh login not found for node '" + numberutils.FormatInt64(int64(node.Id)) + "'") } - host := sshMap.GetString("host") - port := sshMap.GetInt("port") - grantId := sshMap.GetInt64("grantId") - if len(host) == 0 { + sshParams, err := login.DecodeSSHParams() + if err != nil { + installStatus.ErrorCode = "EMPTY_SSH" + return "", 0, 0, err + } + + if len(sshParams.Host) == 0 { + installStatus.ErrorCode = "EMPTY_SSH_HOST" return "", 0, 0, errors.New("ssh host should not be empty") } - if port <= 0 { - port = 22 + if sshParams.Port <= 0 { + sshParams.Port = 22 } - if grantId <= 0 { + if sshParams.GrantId <= 0 { + installStatus.ErrorCode = "EMPTY_GRANT" return "", 0, 0, errors.New("grant id should not be empty") } - return host, port, grantId, nil + + return sshParams.Host, sshParams.Port, sshParams.GrantId, nil } diff --git a/EdgeAPI/internal/rpc/services/httpdns/converters.go b/EdgeAPI/internal/rpc/services/httpdns/converters.go index cd57a78..98d2b4d 100644 --- a/EdgeAPI/internal/rpc/services/httpdns/converters.go +++ b/EdgeAPI/internal/rpc/services/httpdns/converters.go @@ -1,6 +1,8 @@ package httpdns import ( + "encoding/json" + "github.com/TeaOSLab/EdgeAPI/internal/db/models" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" ) @@ -58,20 +60,23 @@ func toPBApp(app *models.HTTPDNSApp, secret *models.HTTPDNSAppSecret) *pb.HTTPDN signSecret = secret.SignSecret signUpdatedAt = int64(secret.SignUpdatedAt) } + // 构建 clusterIdsJSON + clusterIds := models.SharedHTTPDNSAppDAO.ReadAppClusterIds(app) + clusterIdsJSON, _ := json.Marshal(clusterIds) + return &pb.HTTPDNSApp{ - Id: int64(app.Id), - Name: app.Name, - AppId: app.AppId, - IsOn: app.IsOn, - PrimaryClusterId: int64(app.PrimaryClusterId), - BackupClusterId: int64(app.BackupClusterId), - SniMode: app.SNIMode, - SignEnabled: signEnabled, - SignSecret: signSecret, - SignUpdatedAt: signUpdatedAt, - CreatedAt: int64(app.CreatedAt), - UpdatedAt: int64(app.UpdatedAt), - UserId: int64(app.UserId), + Id: int64(app.Id), + Name: app.Name, + AppId: app.AppId, + IsOn: app.IsOn, + SniMode: app.SNIMode, + SignEnabled: signEnabled, + SignSecret: signSecret, + SignUpdatedAt: signUpdatedAt, + CreatedAt: int64(app.CreatedAt), + UpdatedAt: int64(app.UpdatedAt), + UserId: int64(app.UserId), + ClusterIdsJSON: clusterIdsJSON, } } diff --git a/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_app.go b/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_app.go index a159435..79a9b70 100644 --- a/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_app.go +++ b/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_app.go @@ -2,12 +2,13 @@ package httpdns import ( "context" + "encoding/json" "errors" "github.com/TeaOSLab/EdgeAPI/internal/rpc/services" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs" + "github.com/TeaOSLab/EdgeCommon/pkg/userconfigs" "github.com/iwind/TeaGo/dbs" - "github.com/iwind/TeaGo/types" "strings" "time" @@ -66,25 +67,35 @@ func (this *HTTPDNSAppService) CreateHTTPDNSApp(ctx context.Context, req *pb.Cre return errors.New("appId already exists") } - primaryClusterId := req.PrimaryClusterId - backupClusterId := req.BackupClusterId - if primaryClusterId <= 0 || backupClusterId <= 0 { - defaultPrimaryClusterId, defaultBackupClusterId, err := readHTTPDNSDefaultClusterIds(tx) - if err != nil { - return err + // 使用 clusterIdsJSON;若为空则优先从用户关联集群获取,再 fallback 到全局默认 + clusterIdsJSON := req.ClusterIdsJSON + if len(clusterIdsJSON) == 0 || string(clusterIdsJSON) == "[]" || string(clusterIdsJSON) == "null" { + // 优先读取用户关联的 HTTPDNS 集群 + if req.UserId > 0 { + user, userErr := models.SharedUserDAO.FindEnabledUser(tx, req.UserId, nil) + if userErr != nil { + return userErr + } + if user != nil && len(user.HttpdnsClusterIds) > 0 { + var userClusterIds []int64 + if json.Unmarshal([]byte(user.HttpdnsClusterIds), &userClusterIds) == nil && len(userClusterIds) > 0 { + clusterIdsJSON, _ = json.Marshal(userClusterIds) + } + } } - if primaryClusterId <= 0 { - primaryClusterId = defaultPrimaryClusterId + // fallback 到全局默认 + if len(clusterIdsJSON) == 0 || string(clusterIdsJSON) == "[]" || string(clusterIdsJSON) == "null" { + defaultClusterIds, defaultErr := readHTTPDNSDefaultClusterIdList(tx) + if defaultErr != nil { + return defaultErr + } + if len(defaultClusterIds) > 0 { + clusterIdsJSON, _ = json.Marshal(defaultClusterIds) + } } - if backupClusterId <= 0 { - backupClusterId = defaultBackupClusterId - } - } - if primaryClusterId > 0 && backupClusterId == primaryClusterId { - backupClusterId = 0 } - appDbId, err = models.SharedHTTPDNSAppDAO.CreateApp(tx, appName, appId, primaryClusterId, backupClusterId, req.IsOn, req.UserId) + appDbId, err = models.SharedHTTPDNSAppDAO.CreateApp(tx, appName, appId, clusterIdsJSON, req.IsOn, req.UserId) if err != nil { return err } @@ -100,44 +111,47 @@ func (this *HTTPDNSAppService) CreateHTTPDNSApp(ctx context.Context, req *pb.Cre return &pb.CreateHTTPDNSAppResponse{AppDbId: appDbId}, nil } -func readHTTPDNSDefaultClusterIds(tx *dbs.Tx) (primaryClusterId int64, backupClusterId int64, err error) { - primaryClusterId, err = models.SharedHTTPDNSClusterDAO.FindDefaultPrimaryClusterId(tx) +// readHTTPDNSDefaultClusterIdList reads default cluster IDs from UserRegisterConfig. +func readHTTPDNSDefaultClusterIdList(tx *dbs.Tx) ([]int64, error) { + // 优先从 UserRegisterConfig 中读取 + configJSON, err := models.SharedSysSettingDAO.ReadSetting(tx, systemconfigs.SettingCodeUserRegisterConfig) if err != nil { - return 0, 0, err + return nil, err } - - backupClusterId = 0 - backupValueJSON, err := models.SharedSysSettingDAO.ReadSetting(tx, systemconfigs.SettingCodeHTTPDNSDefaultBackupClusterId) - if err != nil { - return 0, 0, err - } - if len(backupValueJSON) > 0 { - backupClusterId = types.Int64(string(backupValueJSON)) - } - if backupClusterId > 0 { - backupCluster, err := models.SharedHTTPDNSClusterDAO.FindEnabledCluster(tx, backupClusterId) - if err != nil { - return 0, 0, err - } - if backupCluster == nil || !backupCluster.IsOn { - backupClusterId = 0 + if len(configJSON) > 0 { + var config userconfigs.UserRegisterConfig + if err := json.Unmarshal(configJSON, &config); err == nil { + if len(config.HTTPDNSDefaultClusterIds) > 0 { + // 验证集群有效性 + var validIds []int64 + for _, id := range config.HTTPDNSDefaultClusterIds { + if id <= 0 { + continue + } + cluster, err := models.SharedHTTPDNSClusterDAO.FindEnabledCluster(tx, id) + if err != nil { + return nil, err + } + if cluster != nil && cluster.IsOn { + validIds = append(validIds, id) + } + } + if len(validIds) > 0 { + return validIds, nil + } + } } } + // fallback:默认主集群 + primaryClusterId, err := models.SharedHTTPDNSClusterDAO.FindDefaultPrimaryClusterId(tx) + if err != nil { + return nil, err + } if primaryClusterId > 0 { - primaryCluster, err := models.SharedHTTPDNSClusterDAO.FindEnabledCluster(tx, primaryClusterId) - if err != nil { - return 0, 0, err - } - if primaryCluster == nil || !primaryCluster.IsOn { - primaryClusterId = 0 - } + return []int64{primaryClusterId}, nil } - - if primaryClusterId > 0 && backupClusterId == primaryClusterId { - backupClusterId = 0 - } - return primaryClusterId, backupClusterId, nil + return nil, nil } func (this *HTTPDNSAppService) UpdateHTTPDNSApp(ctx context.Context, req *pb.UpdateHTTPDNSAppRequest) (*pb.RPCSuccess, error) { @@ -161,13 +175,8 @@ func (this *HTTPDNSAppService) UpdateHTTPDNSApp(ctx context.Context, req *pb.Upd if userId > 0 { targetUserId = userId } - primaryClusterId := req.PrimaryClusterId - backupClusterId := req.BackupClusterId - if primaryClusterId > 0 && backupClusterId == primaryClusterId { - backupClusterId = 0 - } - err = models.SharedHTTPDNSAppDAO.UpdateApp(tx, req.AppDbId, req.Name, primaryClusterId, backupClusterId, req.IsOn, targetUserId) + err = models.SharedHTTPDNSAppDAO.UpdateApp(tx, req.AppDbId, req.Name, req.ClusterIdsJSON, req.IsOn, targetUserId) if err != nil { return err } diff --git a/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_node.go b/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_node.go index 463159b..5c7eb06 100644 --- a/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_node.go +++ b/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_node.go @@ -8,6 +8,7 @@ import ( "github.com/TeaOSLab/EdgeAPI/internal/goman" "github.com/TeaOSLab/EdgeAPI/internal/installers" "github.com/TeaOSLab/EdgeAPI/internal/rpc/services" + "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/iwind/TeaGo/dbs" "github.com/iwind/TeaGo/logs" @@ -114,7 +115,26 @@ func (this *HTTPDNSNodeService) FindHTTPDNSNode(ctx context.Context, req *pb.Fin if err != nil { return nil, err } - return &pb.FindHTTPDNSNodeResponse{Node: toPBNode(node)}, nil + + pbNode := toPBNode(node) + + // 认证信息 + if pbNode != nil { + login, loginErr := models.SharedNodeLoginDAO.FindEnabledNodeLoginWithNodeId(this.NullTx(), nodeconfigs.NodeRoleHTTPDNS, nodeId) + if loginErr != nil { + return nil, loginErr + } + if login != nil { + pbNode.NodeLogin = &pb.NodeLogin{ + Id: int64(login.Id), + Name: login.Name, + Type: login.Type, + Params: login.Params, + } + } + } + + return &pb.FindHTTPDNSNodeResponse{Node: pbNode}, nil } func (this *HTTPDNSNodeService) ListHTTPDNSNodes(ctx context.Context, req *pb.ListHTTPDNSNodesRequest) (*pb.ListHTTPDNSNodesResponse, error) { @@ -171,6 +191,31 @@ func (this *HTTPDNSNodeService) UpdateHTTPDNSNodeStatus(ctx context.Context, req return this.Success() } +// UpdateHTTPDNSNodeLogin 修改HTTPDNS节点登录信息 +func (this *HTTPDNSNodeService) UpdateHTTPDNSNodeLogin(ctx context.Context, req *pb.UpdateHTTPDNSNodeLoginRequest) (*pb.RPCSuccess, error) { + _, err := this.ValidateAdmin(ctx) + if err != nil { + return nil, err + } + + var tx = this.NullTx() + + if req.NodeLogin.Id <= 0 { + loginId, createErr := models.SharedNodeLoginDAO.CreateNodeLogin(tx, nodeconfigs.NodeRoleHTTPDNS, req.NodeId, req.NodeLogin.Name, req.NodeLogin.Type, req.NodeLogin.Params) + if createErr != nil { + return nil, createErr + } + req.NodeLogin.Id = loginId + } + + err = models.SharedNodeLoginDAO.UpdateNodeLogin(tx, req.NodeLogin.Id, req.NodeLogin.Name, req.NodeLogin.Type, req.NodeLogin.Params) + if err != nil { + return nil, err + } + + return this.Success() +} + func shouldTriggerHTTPDNSInstall(installStatusJSON []byte) bool { if len(installStatusJSON) == 0 { return false diff --git a/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_sandbox.go b/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_sandbox.go index 3892a9d..d0b4a86 100644 --- a/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_sandbox.go +++ b/EdgeAPI/internal/rpc/services/httpdns/service_httpdns_sandbox.go @@ -83,12 +83,23 @@ func (this *HTTPDNSSandboxService) TestHTTPDNSResolve(ctx context.Context, req * RequestId: "rid-" + rands.HexString(12), }, nil } - if req.ClusterId > 0 && req.ClusterId != int64(app.PrimaryClusterId) && req.ClusterId != int64(app.BackupClusterId) { - return &pb.TestHTTPDNSResolveResponse{ - Code: "APP_CLUSTER_MISMATCH", - Message: "当前应用未绑定到该集群 (主集群: " + strconv.FormatInt(int64(app.PrimaryClusterId), 10) + ", 备用集群: " + strconv.FormatInt(int64(app.BackupClusterId), 10) + ")", - RequestId: "rid-" + rands.HexString(12), - }, nil + // 检查集群是否绑定 + appClusterIds := models.SharedHTTPDNSAppDAO.ReadAppClusterIds(app) + if req.ClusterId > 0 { + var found bool + for _, cid := range appClusterIds { + if cid == req.ClusterId { + found = true + break + } + } + if !found { + return &pb.TestHTTPDNSResolveResponse{ + Code: "APP_CLUSTER_MISMATCH", + Message: "当前应用未绑定到该集群", + RequestId: "rid-" + rands.HexString(12), + }, nil + } } qtype := strings.ToUpper(strings.TrimSpace(req.Qtype)) @@ -98,8 +109,8 @@ func (this *HTTPDNSSandboxService) TestHTTPDNSResolve(ctx context.Context, req * // 获取集群服务域名 clusterId := req.ClusterId - if clusterId <= 0 { - clusterId = int64(app.PrimaryClusterId) + if clusterId <= 0 && len(appClusterIds) > 0 { + clusterId = appClusterIds[0] } cluster, err := models.SharedHTTPDNSClusterDAO.FindEnabledCluster(this.NullTx(), clusterId) if err != nil { @@ -128,6 +139,25 @@ func (this *HTTPDNSSandboxService) TestHTTPDNSResolve(ctx context.Context, req * return nil, err } + port := "443" + if len(cluster.TLSPolicy) > 0 { + var tlsConfig map[string]interface{} + if err := json.Unmarshal(cluster.TLSPolicy, &tlsConfig); err == nil { + if listenRaw, ok := tlsConfig["listen"]; ok && listenRaw != nil { + if data, err := json.Marshal(listenRaw); err == nil { + var listenAddresses []map[string]interface{} + if err := json.Unmarshal(data, &listenAddresses); err == nil { + if len(listenAddresses) > 0 { + if portRange, ok := listenAddresses[0]["portRange"].(string); ok && len(portRange) > 0 { + port = portRange + } + } + } + } + } + } + } + query := url.Values{} query.Set("appId", req.AppId) query.Set("dn", req.Domain) @@ -167,7 +197,7 @@ func (this *HTTPDNSSandboxService) TestHTTPDNSResolve(ctx context.Context, req * query.Set("sign", sign) } - resolveURL := "https://" + serviceDomain + "/resolve?" + query.Encode() + resolveURL := "https://" + serviceDomain + ":" + port + "/resolve?" + query.Encode() httpClient := &http.Client{ Timeout: 5 * time.Second, diff --git a/EdgeAPI/internal/rpc/services/httpdns/task_notify.go b/EdgeAPI/internal/rpc/services/httpdns/task_notify.go index a6a1088..b87301b 100644 --- a/EdgeAPI/internal/rpc/services/httpdns/task_notify.go +++ b/EdgeAPI/internal/rpc/services/httpdns/task_notify.go @@ -18,16 +18,14 @@ func notifyHTTPDNSAppTasksByApp(tx *dbs.Tx, app *models.HTTPDNSApp, taskType mod return nil } - primaryClusterId := int64(app.PrimaryClusterId) - backupClusterId := int64(app.BackupClusterId) - - err := notifyHTTPDNSClusterTask(tx, primaryClusterId, taskType) - if err != nil { - return err - } - - if backupClusterId > 0 && backupClusterId != primaryClusterId { - err = notifyHTTPDNSClusterTask(tx, backupClusterId, taskType) + clusterIds := models.SharedHTTPDNSAppDAO.ReadAppClusterIds(app) + notified := map[int64]bool{} + for _, clusterId := range clusterIds { + if clusterId <= 0 || notified[clusterId] { + continue + } + notified[clusterId] = true + err := notifyHTTPDNSClusterTask(tx, clusterId, taskType) if err != nil { return err } diff --git a/EdgeAPI/internal/rpc/services/users/service_user.go b/EdgeAPI/internal/rpc/services/users/service_user.go index afe7ee3..55c4931 100644 --- a/EdgeAPI/internal/rpc/services/users/service_user.go +++ b/EdgeAPI/internal/rpc/services/users/service_user.go @@ -71,7 +71,7 @@ func (this *UserService) UpdateUser(ctx context.Context, req *pb.UpdateUserReque return nil, err } - err = models.SharedUserDAO.UpdateUser(tx, req.UserId, req.Username, req.Password, req.Fullname, req.Mobile, req.Tel, req.Email, req.Remark, req.IsOn, req.NodeClusterId, req.BandwidthAlgo) + err = models.SharedUserDAO.UpdateUser(tx, req.UserId, req.Username, req.Password, req.Fullname, req.Mobile, req.Tel, req.Email, req.Remark, req.IsOn, req.NodeClusterId, req.BandwidthAlgo, req.HttpdnsClusterIdsJSON) if err != nil { return nil, err } @@ -242,6 +242,20 @@ func (this *UserService) FindEnabledUser(ctx context.Context, req *pb.FindEnable } } + // 用户功能列表 + var pbFeatures []*pb.UserFeature + userFeatures, err := models.SharedUserDAO.FindUserFeatures(tx, req.UserId) + if err != nil { + return nil, err + } + for _, f := range userFeatures { + pbFeatures = append(pbFeatures, &pb.UserFeature{ + Name: f.Name, + Code: f.Code, + Description: f.Description, + }) + } + return &pb.FindEnabledUserResponse{ User: &pb.User{ Id: int64(user.Id), @@ -265,6 +279,8 @@ func (this *UserService) FindEnabledUser(ctx context.Context, req *pb.FindEnable BandwidthAlgo: user.BandwidthAlgo, OtpLogin: pbOtpAuth, Lang: user.Lang, + Features: pbFeatures, + HttpdnsClusterIdsJSON: user.HttpdnsClusterIds, }, }, nil } diff --git a/EdgeAPI/internal/rpc/services/users/service_user_ext_plus.go b/EdgeAPI/internal/rpc/services/users/service_user_ext_plus.go index c106a0c..41f91de 100644 --- a/EdgeAPI/internal/rpc/services/users/service_user_ext_plus.go +++ b/EdgeAPI/internal/rpc/services/users/service_user_ext_plus.go @@ -5,11 +5,13 @@ package users import ( "context" + "encoding/json" "errors" "github.com/TeaOSLab/EdgeAPI/internal/db/models" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/userconfigs" "github.com/iwind/TeaGo/dbs" + "github.com/iwind/TeaGo/lists" ) // FindUserPriceInfo 读取用户计费信息 @@ -142,13 +144,27 @@ func (this *UserService) RegisterUser(ctx context.Context, req *pb.RegisterUserR return errors.New("the username exists already") } + features := registerConfig.Features + if registerConfig.HTTPDNSIsOn && !lists.ContainsString(features, userconfigs.UserFeatureCodeHTTPDNS) { + features = append(features, userconfigs.UserFeatureCodeHTTPDNS) + } + // 创建用户 - userId, err := models.SharedUserDAO.CreateUser(tx, req.Username, req.Password, req.Fullname, req.Mobile, "", req.Email, "", req.Source, registerConfig.ClusterId, registerConfig.Features, req.Ip, !registerConfig.RequireVerification) + userId, err := models.SharedUserDAO.CreateUser(tx, req.Username, req.Password, req.Fullname, req.Mobile, "", req.Email, "", req.Source, registerConfig.ClusterId, features, req.Ip, !registerConfig.RequireVerification) if err != nil { return err } createdUserId = userId + // 自动关联默认 HTTPDNS 集群 + if registerConfig.HTTPDNSIsOn && len(registerConfig.HTTPDNSDefaultClusterIds) > 0 { + httpdnsJSON, _ := json.Marshal(registerConfig.HTTPDNSDefaultClusterIds) + err = models.SharedUserDAO.UpdateUserHttpdnsClusterIds(tx, userId, httpdnsJSON) + if err != nil { + return err + } + } + // 发送激活邮件 if len(req.Email) > 0 && registerConfig.EmailVerification.IsOn { _, err := models.SharedUserEmailVerificationDAO.CreateVerification(tx, userId, req.Email) diff --git a/EdgeAPI/internal/setup/sql_upgrade.go b/EdgeAPI/internal/setup/sql_upgrade.go index 205f16b..2b986b9 100644 --- a/EdgeAPI/internal/setup/sql_upgrade.go +++ b/EdgeAPI/internal/setup/sql_upgrade.go @@ -1258,14 +1258,27 @@ func upgradeV1_4_4(db *dbs.DB) error { // 1.4.8 func upgradeV1_4_8(db *dbs.DB) error { - return createHTTPDNSTables(db) + err := createHTTPDNSTables(db) + if err != nil { + return err + } + + // edgeUsers: 增加 httpdnsClusterIds 字段 + _, alterErr := db.Exec("ALTER TABLE `edgeUsers` ADD COLUMN `httpdnsClusterIds` text DEFAULT NULL") + if alterErr != nil { + if strings.Contains(alterErr.Error(), "Duplicate column") { + return nil + } + return alterErr + } + return nil } func createHTTPDNSTables(db *dbs.DB) error { sqls := []string{ "CREATE TABLE IF NOT EXISTS `edgeHTTPDNSClusters` (`id` bigint unsigned NOT NULL AUTO_INCREMENT,`name` varchar(255) DEFAULT NULL,`isOn` tinyint unsigned DEFAULT '1',`isDefault` tinyint unsigned DEFAULT '0',`serviceDomain` varchar(255) DEFAULT NULL,`defaultTTL` int unsigned DEFAULT '30',`fallbackTimeoutMs` int unsigned DEFAULT '300',`installDir` varchar(255) DEFAULT '/opt/edge-httpdns',`tlsPolicy` json DEFAULT NULL,`createdAt` bigint unsigned DEFAULT '0',`updatedAt` bigint unsigned DEFAULT '0',`state` tinyint unsigned DEFAULT '1',PRIMARY KEY (`id`),KEY `name` (`name`),KEY `isDefault` (`isDefault`),KEY `state` (`state`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='HTTPDNS集群配置表(默认TTL、回退超时、服务域名等)'", "CREATE TABLE IF NOT EXISTS `edgeHTTPDNSNodes` (`id` bigint unsigned NOT NULL AUTO_INCREMENT,`clusterId` bigint unsigned DEFAULT '0',`name` varchar(255) DEFAULT NULL,`isOn` tinyint unsigned DEFAULT '1',`isUp` tinyint unsigned DEFAULT '0',`isInstalled` tinyint unsigned DEFAULT '0',`isActive` tinyint unsigned DEFAULT '0',`uniqueId` varchar(64) DEFAULT NULL,`secret` varchar(64) DEFAULT NULL,`installDir` varchar(255) DEFAULT '/opt/edge-httpdns',`status` json DEFAULT NULL,`installStatus` json DEFAULT NULL,`createdAt` bigint unsigned DEFAULT '0',`updatedAt` bigint unsigned DEFAULT '0',`state` tinyint unsigned DEFAULT '1',PRIMARY KEY (`id`),UNIQUE KEY `uniqueId` (`uniqueId`),KEY `clusterId` (`clusterId`),KEY `state` (`state`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='HTTPDNS节点表(节点基础信息与运行状态)'", - "CREATE TABLE IF NOT EXISTS `edgeHTTPDNSApps` (`id` bigint unsigned NOT NULL AUTO_INCREMENT,`name` varchar(255) DEFAULT NULL,`appId` varchar(64) DEFAULT NULL,`isOn` tinyint unsigned DEFAULT '1',`primaryClusterId` bigint unsigned DEFAULT '0',`backupClusterId` bigint unsigned DEFAULT '0',`sniMode` varchar(64) DEFAULT 'fixed_hide',`userId` bigint unsigned DEFAULT '0',`createdAt` bigint unsigned DEFAULT '0',`updatedAt` bigint unsigned DEFAULT '0',`state` tinyint unsigned DEFAULT '1',PRIMARY KEY (`id`),UNIQUE KEY `appId` (`appId`),KEY `name` (`name`),KEY `state` (`state`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='HTTPDNS应用表(应用与主备集群绑定关系)'", + "CREATE TABLE IF NOT EXISTS `edgeHTTPDNSApps` (`id` bigint unsigned NOT NULL AUTO_INCREMENT,`name` varchar(255) DEFAULT NULL,`appId` varchar(64) DEFAULT NULL,`isOn` tinyint unsigned DEFAULT '1',`clusterIdsJSON` text DEFAULT NULL,`sniMode` varchar(64) DEFAULT 'fixed_hide',`userId` bigint unsigned DEFAULT '0',`createdAt` bigint unsigned DEFAULT '0',`updatedAt` bigint unsigned DEFAULT '0',`state` tinyint unsigned DEFAULT '1',PRIMARY KEY (`id`),UNIQUE KEY `appId` (`appId`),KEY `name` (`name`),KEY `userId` (`userId`),KEY `state` (`state`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='HTTPDNS应用表(应用与集群绑定关系)'", "CREATE TABLE IF NOT EXISTS `edgeHTTPDNSAppSecrets` (`id` bigint unsigned NOT NULL AUTO_INCREMENT,`appId` bigint unsigned DEFAULT '0',`signEnabled` tinyint unsigned DEFAULT '0',`signSecret` varchar(255) DEFAULT NULL,`signUpdatedAt` bigint unsigned DEFAULT '0',`updatedAt` bigint unsigned DEFAULT '0',`state` tinyint unsigned DEFAULT '1',PRIMARY KEY (`id`),UNIQUE KEY `appId` (`appId`),KEY `state` (`state`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='HTTPDNS应用密钥表(请求验签开关与加签Secret)'", "CREATE TABLE IF NOT EXISTS `edgeHTTPDNSDomains` (`id` bigint unsigned NOT NULL AUTO_INCREMENT,`appId` bigint unsigned DEFAULT '0',`domain` varchar(255) DEFAULT NULL,`isOn` tinyint unsigned DEFAULT '1',`createdAt` bigint unsigned DEFAULT '0',`updatedAt` bigint unsigned DEFAULT '0',`state` tinyint unsigned DEFAULT '1',PRIMARY KEY (`id`),UNIQUE KEY `appId_domain` (`appId`,`domain`),KEY `domain` (`domain`),KEY `state` (`state`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='HTTPDNS应用域名表(应用绑定的业务域名)'", "CREATE TABLE IF NOT EXISTS `edgeHTTPDNSCustomRules` (`id` bigint unsigned NOT NULL AUTO_INCREMENT,`appId` bigint unsigned DEFAULT '0',`domainId` bigint unsigned DEFAULT '0',`ruleName` varchar(255) DEFAULT NULL,`lineScope` varchar(64) DEFAULT NULL,`lineCarrier` varchar(64) DEFAULT NULL,`lineRegion` varchar(64) DEFAULT NULL,`lineProvince` varchar(64) DEFAULT NULL,`lineContinent` varchar(64) DEFAULT NULL,`lineCountry` varchar(128) DEFAULT NULL,`ttl` int unsigned DEFAULT '30',`isOn` tinyint unsigned DEFAULT '1',`priority` int unsigned DEFAULT '0',`updatedAt` bigint unsigned DEFAULT '0',`state` tinyint unsigned DEFAULT '1',PRIMARY KEY (`id`),KEY `domainId_isOn_priority` (`domainId`,`isOn`,`priority`),KEY `state` (`state`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='HTTPDNS自定义解析规则表(按线路/地域匹配)'", diff --git a/EdgeAdmin/edge-admin b/EdgeAdmin/edge-admin new file mode 100644 index 0000000..e8e6c24 Binary files /dev/null and b/EdgeAdmin/edge-admin differ diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/apps/appSettings.go b/EdgeAdmin/internal/web/actions/default/httpdns/apps/appSettings.go index d97444c..e28aea8 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/apps/appSettings.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/apps/appSettings.go @@ -1,15 +1,14 @@ package apps import ( + "encoding/json" "strconv" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/httpdns/httpdnsutils" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" - "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs" "github.com/iwind/TeaGo/actions" "github.com/iwind/TeaGo/maps" - "github.com/iwind/TeaGo/types" ) type AppSettingsAction struct { @@ -60,55 +59,70 @@ func (this *AppSettingsAction) RunGet(params struct { return } clusters := make([]maps.Map, 0, len(clusterResp.GetClusters())) - clusterDomainMap := map[int64]string{} + clusterApiAddressMap := map[int64]string{} clusterNameMap := map[int64]string{} - defaultPrimaryClusterId := int64(0) for _, cluster := range clusterResp.GetClusters() { clusterId := cluster.GetId() clusterName := cluster.GetName() + + port := "443" + if rawTLS := cluster.GetTlsPolicyJSON(); len(rawTLS) > 0 { + var tlsConfig map[string]interface{} + if err := json.Unmarshal(rawTLS, &tlsConfig); err == nil { + if listenRaw, ok := tlsConfig["listen"]; ok && listenRaw != nil { + if data, err := json.Marshal(listenRaw); err == nil { + var listenAddresses []map[string]interface{} + if err := json.Unmarshal(data, &listenAddresses); err == nil { + if len(listenAddresses) > 0 { + if portRange, ok := listenAddresses[0]["portRange"].(string); ok && len(portRange) > 0 { + port = portRange + } + } + } + } + } + } + } + apiAddress := "https://" + cluster.GetServiceDomain() + ":" + port + clusters = append(clusters, maps.Map{ - "id": clusterId, - "name": clusterName, - "serviceDomain": cluster.GetServiceDomain(), - "isDefault": cluster.GetIsDefault(), + "id": clusterId, + "name": clusterName, }) - clusterDomainMap[clusterId] = cluster.GetServiceDomain() + clusterApiAddressMap[clusterId] = apiAddress clusterNameMap[clusterId] = clusterName - if defaultPrimaryClusterId <= 0 && cluster.GetIsDefault() { - defaultPrimaryClusterId = clusterId + } + + // 读取应用绑定的集群列表,取第一个作为当前选中。 + var selectedClusterId int64 + if raw := app.Get("clusterIds"); raw != nil { + if ids, ok := raw.([]int64); ok && len(ids) > 0 { + selectedClusterId = ids[0] } } - defaultBackupClusterId := int64(0) - defaultBackupResp, err := this.RPC().SysSettingRPC().ReadSysSetting(this.AdminContext(), &pb.ReadSysSettingRequest{ - Code: string(systemconfigs.SettingCodeHTTPDNSDefaultBackupClusterId), - }) - if err != nil { - this.ErrorPage(err) - return + // 构建服务地址列表。 + serviceAddresses := make([]maps.Map, 0) + if selectedClusterId > 0 { + addr := clusterApiAddressMap[selectedClusterId] + name := clusterNameMap[selectedClusterId] + if len(addr) > 0 { + serviceAddresses = append(serviceAddresses, maps.Map{ + "address": addr, + "clusterName": name, + }) + } } - if defaultBackupResp != nil && len(defaultBackupResp.GetValueJSON()) > 0 { - defaultBackupClusterId = types.Int64(string(defaultBackupResp.GetValueJSON())) - } - - primaryClusterId := app.GetInt64("primaryClusterId") - backupClusterId := app.GetInt64("backupClusterId") settings := maps.Map{ - "appId": app.GetString("appId"), - "appStatus": app.GetBool("isOn"), - "primaryClusterId": primaryClusterId, - "backupClusterId": backupClusterId, - "defaultPrimaryClusterId": defaultPrimaryClusterId, - "defaultPrimaryClusterName": clusterNameMap[defaultPrimaryClusterId], - "defaultBackupClusterId": defaultBackupClusterId, - "defaultBackupClusterName": clusterNameMap[defaultBackupClusterId], - "primaryServiceDomain": clusterDomainMap[primaryClusterId], - "backupServiceDomain": clusterDomainMap[backupClusterId], - "signEnabled": app.GetBool("signEnabled"), - "signSecretPlain": app.GetString("signSecretPlain"), - "signSecretMasked": app.GetString("signSecretMasked"), - "signSecretUpdatedAt": app.GetString("signSecretUpdated"), + "appId": app.GetString("appId"), + "appStatus": app.GetBool("isOn"), + "selectedClusterId": selectedClusterId, + "serviceAddresses": serviceAddresses, + "signEnabled": app.GetBool("signEnabled"), + "signSecretPlain": app.GetString("signSecretPlain"), + "signSecretMasked": app.GetString("signSecretMasked"), + "signSecretUpdatedAt": app.GetString("signSecretUpdated"), } this.Data["app"] = app this.Data["settings"] = settings @@ -119,18 +133,13 @@ func (this *AppSettingsAction) RunGet(params struct { func (this *AppSettingsAction) RunPost(params struct { AppId int64 - AppStatus bool - PrimaryClusterId int64 - BackupClusterId int64 + AppStatus bool + ClusterId int64 Must *actions.Must CSRF *actionutils.CSRF }) { params.Must.Field("appId", params.AppId).Gt(0, "请选择应用") - if params.PrimaryClusterId > 0 && params.BackupClusterId > 0 && params.PrimaryClusterId == params.BackupClusterId { - this.FailField("backupClusterId", "备用集群不能与主集群相同") - return - } appResp, err := this.RPC().HTTPDNSAppRPC().FindHTTPDNSApp(this.AdminContext(), &pb.FindHTTPDNSAppRequest{ AppDbId: params.AppId, @@ -144,13 +153,18 @@ func (this *AppSettingsAction) RunPost(params struct { return } + var clusterIds []int64 + if params.ClusterId > 0 { + clusterIds = []int64{params.ClusterId} + } + clusterIdsJSON, _ := json.Marshal(clusterIds) + _, err = this.RPC().HTTPDNSAppRPC().UpdateHTTPDNSApp(this.AdminContext(), &pb.UpdateHTTPDNSAppRequest{ - AppDbId: params.AppId, - Name: appResp.GetApp().GetName(), - PrimaryClusterId: params.PrimaryClusterId, - BackupClusterId: params.BackupClusterId, - IsOn: params.AppStatus, - UserId: appResp.GetApp().GetUserId(), + AppDbId: params.AppId, + Name: appResp.GetApp().GetName(), + ClusterIdsJSON: clusterIdsJSON, + IsOn: params.AppStatus, + UserId: appResp.GetApp().GetUserId(), }) if err != nil { this.ErrorPage(err) diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/apps/create.go b/EdgeAdmin/internal/web/actions/default/httpdns/apps/create.go index 46c31b1..0f57cc1 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/apps/create.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/apps/create.go @@ -1,6 +1,7 @@ package apps import ( + "encoding/json" "strconv" "time" @@ -33,28 +34,6 @@ func (this *CreateAction) RunGet(params struct{}) { } this.Data["clusters"] = clusters - defaultPrimaryClusterId := int64(0) - for _, cluster := range clusterResp.GetClusters() { - if cluster.GetIsDefault() { - defaultPrimaryClusterId = cluster.GetId() - break - } - } - if defaultPrimaryClusterId <= 0 && len(clusters) > 0 { - defaultPrimaryClusterId = clusters[0].GetInt64("id") - } - this.Data["defaultPrimaryClusterId"] = defaultPrimaryClusterId - - defaultBackupClusterId := int64(0) - for _, cluster := range clusters { - clusterId := cluster.GetInt64("id") - if clusterId > 0 && clusterId != defaultPrimaryClusterId { - defaultBackupClusterId = clusterId - break - } - } - this.Data["defaultBackupClusterId"] = defaultBackupClusterId - usersResp, err := this.RPC().UserRPC().ListEnabledUsers(this.AdminContext(), &pb.ListEnabledUsersRequest{ Offset: 0, Size: 10_000, @@ -77,28 +56,28 @@ func (this *CreateAction) RunGet(params struct{}) { } func (this *CreateAction) RunPost(params struct { - Name string - PrimaryClusterId int64 - BackupClusterId int64 - UserId int64 + Name string + ClusterId int64 + UserId int64 Must *actions.Must CSRF *actionutils.CSRF }) { params.Must.Field("name", params.Name).Require("请输入应用名称") - params.Must.Field("primaryClusterId", params.PrimaryClusterId).Gt(0, "请输入主服务集群") - if params.BackupClusterId > 0 && params.BackupClusterId == params.PrimaryClusterId { - this.FailField("backupClusterId", "备用服务集群必须和主服务集群不一致") + if params.ClusterId <= 0 { + this.FailField("clusterId", "请选择集群") + return } + clusterIdsJSON, _ := json.Marshal([]int64{params.ClusterId}) + createResp, err := this.RPC().HTTPDNSAppRPC().CreateHTTPDNSApp(this.AdminContext(), &pb.CreateHTTPDNSAppRequest{ - Name: params.Name, - AppId: "app" + strconv.FormatInt(time.Now().UnixNano()%1_000_000_000_000, 36), - PrimaryClusterId: params.PrimaryClusterId, - BackupClusterId: params.BackupClusterId, - IsOn: true, - SignEnabled: true, - UserId: params.UserId, + Name: params.Name, + AppId: "app" + strconv.FormatInt(time.Now().UnixNano()%1_000_000_000_000, 36), + ClusterIdsJSON: clusterIdsJSON, + IsOn: true, + SignEnabled: true, + UserId: params.UserId, }) if err != nil { this.ErrorPage(err) diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/apps/index.go b/EdgeAdmin/internal/web/actions/default/httpdns/apps/index.go index 232d390..2a2f742 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/apps/index.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/apps/index.go @@ -24,5 +24,6 @@ func (this *IndexAction) RunGet(params struct { return } this.Data["apps"] = apps + this.Data["page"] = "" this.Show() } diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/apps/rpc_helpers.go b/EdgeAdmin/internal/web/actions/default/httpdns/apps/rpc_helpers.go index b528091..d8832af 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/apps/rpc_helpers.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/apps/rpc_helpers.go @@ -1,6 +1,7 @@ package apps import ( + "encoding/json" "strconv" "strings" "time" @@ -87,15 +88,14 @@ func findAppMap(parent *actionutils.ParentAction, appDbId int64) (maps.Map, erro return apps[0], nil } -func createApp(parent *actionutils.ParentAction, name string, primaryClusterId int64, backupClusterId int64) (int64, error) { +func createApp(parent *actionutils.ParentAction, name string, clusterIdsJSON []byte) (int64, error) { newAppId := "app" + strconv.FormatInt(time.Now().UnixNano()%1_000_000_000_000, 36) resp, err := parent.RPC().HTTPDNSAppRPC().CreateHTTPDNSApp(parent.AdminContext(), &pb.CreateHTTPDNSAppRequest{ - Name: strings.TrimSpace(name), - AppId: newAppId, - PrimaryClusterId: primaryClusterId, - BackupClusterId: backupClusterId, - IsOn: true, - SignEnabled: true, + Name: strings.TrimSpace(name), + AppId: newAppId, + ClusterIdsJSON: clusterIdsJSON, + IsOn: true, + SignEnabled: true, }) if err != nil { return 0, err @@ -110,14 +110,13 @@ func deleteAppByID(parent *actionutils.ParentAction, appDbId int64) error { return err } -func updateAppSettings(parent *actionutils.ParentAction, appDbId int64, name string, primaryClusterId int64, backupClusterId int64, isOn bool, userId int64) error { +func updateAppSettings(parent *actionutils.ParentAction, appDbId int64, name string, clusterIdsJSON []byte, isOn bool, userId int64) error { _, err := parent.RPC().HTTPDNSAppRPC().UpdateHTTPDNSApp(parent.AdminContext(), &pb.UpdateHTTPDNSAppRequest{ - AppDbId: appDbId, - Name: strings.TrimSpace(name), - PrimaryClusterId: primaryClusterId, - BackupClusterId: backupClusterId, - IsOn: isOn, - UserId: userId, + AppDbId: appDbId, + Name: strings.TrimSpace(name), + ClusterIdsJSON: clusterIdsJSON, + IsOn: isOn, + UserId: userId, }) return err } @@ -277,13 +276,24 @@ func toggleCustomRule(parent *actionutils.ParentAction, ruleId int64, isOn bool) return err } -func appPBToMap(app *pb.HTTPDNSApp, domainCount int64, clusterNameMap map[int64]string, userMapByID map[int64]maps.Map) maps.Map { +func appPBToMap(app *pb.HTTPDNSApp, domainCount int64, clusterMapByID map[int64]maps.Map, userMapByID map[int64]maps.Map) maps.Map { signSecret := app.GetSignSecret() - primaryClusterID := app.GetPrimaryClusterId() - backupClusterID := app.GetBackupClusterId() - primaryClusterMap := maps.Map{"id": primaryClusterID, "name": clusterNameMap[primaryClusterID]} - backupClusterMap := maps.Map{"id": backupClusterID, "name": clusterNameMap[backupClusterID]} + // 读取集群 ID 列表 + var clusterIds []int64 + if len(app.GetClusterIdsJSON()) > 0 { + _ = json.Unmarshal(app.GetClusterIdsJSON(), &clusterIds) + } + + // 构建集群映射列表 + var clusterMaps []maps.Map + for _, cid := range clusterIds { + cm := clusterMapByID[cid] + if cm == nil { + cm = maps.Map{"id": cid, "name": "", "apiAddress": ""} + } + clusterMaps = append(clusterMaps, cm) + } var userMap maps.Map if app.GetUserId() > 0 { @@ -301,11 +311,8 @@ func appPBToMap(app *pb.HTTPDNSApp, domainCount int64, clusterNameMap map[int64] "id": app.GetId(), "name": app.GetName(), "appId": app.GetAppId(), - "clusterId": primaryClusterID, - "primaryClusterId": primaryClusterID, - "backupClusterId": backupClusterID, - "primaryCluster": primaryClusterMap, - "backupCluster": backupClusterMap, + "clusterIds": clusterIds, + "clusters": clusterMaps, "userId": app.GetUserId(), "user": userMap, "isOn": app.GetIsOn(), @@ -318,15 +325,37 @@ func appPBToMap(app *pb.HTTPDNSApp, domainCount int64, clusterNameMap map[int64] } } -func loadHTTPDNSClusterNameMap(parent *actionutils.ParentAction) (map[int64]string, error) { +func loadHTTPDNSClusterNameMap(parent *actionutils.ParentAction) (map[int64]maps.Map, error) { resp, err := parent.RPC().HTTPDNSClusterRPC().FindAllHTTPDNSClusters(parent.AdminContext(), &pb.FindAllHTTPDNSClustersRequest{}) if err != nil { return nil, err } - result := map[int64]string{} + result := map[int64]maps.Map{} for _, cluster := range resp.GetClusters() { - result[cluster.GetId()] = cluster.GetName() + port := "443" + if rawTLS := cluster.GetTlsPolicyJSON(); len(rawTLS) > 0 { + tlsConfig := maps.Map{} + if err := json.Unmarshal(rawTLS, &tlsConfig); err == nil { + if listenRaw := tlsConfig.Get("listen"); listenRaw != nil { + var listenAddresses []maps.Map + if data, err := json.Marshal(listenRaw); err == nil { + if err := json.Unmarshal(data, &listenAddresses); err == nil { + if len(listenAddresses) > 0 && len(listenAddresses[0].GetString("portRange")) > 0 { + port = listenAddresses[0].GetString("portRange") + } + } + } + } + } + } + apiAddress := "https://" + cluster.GetServiceDomain() + ":" + port + + result[cluster.GetId()] = maps.Map{ + "id": cluster.GetId(), + "name": cluster.GetName(), + "apiAddress": apiAddress, + } } return result, nil } diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/install.go b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/install.go index c90c86d..8da9713 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/install.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/install.go @@ -2,11 +2,14 @@ package node import ( "encoding/json" + "fmt" "strings" "time" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/TeaOSLab/EdgeCommon/pkg/configutils" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" + "github.com/iwind/TeaGo/maps" ) type InstallAction struct { @@ -55,7 +58,22 @@ func (this *InstallAction) RunGet(params struct { apiEndpoints = []string{"http://127.0.0.1:7788"} } this.Data["apiEndpoints"] = "\"" + strings.Join(apiEndpoints, "\", \"") + "\"" + // 从 NodeLogin 中提取 SSH 地址 this.Data["sshAddr"] = "" + loginMap, _ := node.Get("login").(maps.Map) + if loginMap != nil { + paramsMap, _ := loginMap.Get("params").(maps.Map) + if paramsMap != nil { + host := paramsMap.GetString("host") + if len(host) > 0 { + port := paramsMap.GetInt("port") + if port <= 0 { + port = 22 + } + this.Data["sshAddr"] = fmt.Sprintf("%s:%d", configutils.QuoteIP(host), port) + } + } + } this.Show() } diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/rpc_helpers.go b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/rpc_helpers.go index d4764e4..2f1d6e5 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/rpc_helpers.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/rpc_helpers.go @@ -57,7 +57,21 @@ func findHTTPDNSNodeMap(parent *actionutils.ParentAction, nodeID int64) (maps.Ma if installStatusMap.Has("ipAddresses") { for _, addr := range installStatusMap.GetSlice("ipAddresses") { if addrMap, ok := addr.(map[string]interface{}); ok { - ipAddresses = append(ipAddresses, maps.Map(addrMap)) + m := maps.Map(addrMap) + // 确保必要字段存在,防止前端组件报错 + if !m.Has("name") { + m["name"] = "" + } + if !m.Has("canAccess") { + m["canAccess"] = true + } + if !m.Has("isOn") { + m["isOn"] = true + } + if !m.Has("isUp") { + m["isUp"] = true + } + ipAddresses = append(ipAddresses, m) } } } else { @@ -87,11 +101,16 @@ func findHTTPDNSNodeMap(parent *actionutils.ParentAction, nodeID int64) (maps.Ma return nil, err } - // 构造 node.login 用于 index.html 展示 SSH 信息 + // 构造 node.login 用于 index.html 展示 SSH 信息(从 NodeLogin 读取) var loginMap maps.Map = nil - sshInfo := installStatusMap.GetMap("ssh") - if sshInfo != nil { - grantId := sshInfo.GetInt64("grantId") + if node.GetNodeLogin() != nil { + nodeLogin := node.GetNodeLogin() + sshLoginParams := maps.Map{} + if len(nodeLogin.Params) > 0 { + _ = json.Unmarshal(nodeLogin.Params, &sshLoginParams) + } + + grantId := sshLoginParams.GetInt64("grantId") var grantMap maps.Map = nil if grantId > 0 { grantResp, grantErr := parent.RPC().NodeGrantRPC().FindEnabledNodeGrant(parent.AdminContext(), &pb.FindEnabledNodeGrantRequest{ @@ -110,8 +129,8 @@ func findHTTPDNSNodeMap(parent *actionutils.ParentAction, nodeID int64) (maps.Ma loginMap = maps.Map{ "params": maps.Map{ - "host": sshInfo.GetString("host"), - "port": sshInfo.GetInt("port"), + "host": sshLoginParams.GetString("host"), + "port": sshLoginParams.GetInt("port"), }, "grant": grantMap, } @@ -169,8 +188,8 @@ func decodeNodeStatus(raw []byte) maps.Map { func decodeInstallStatus(raw []byte) maps.Map { result := maps.Map{ "isRunning": false, - "isFinished": true, - "isOk": true, + "isFinished": false, + "isOk": false, "error": "", "errorCode": "", } diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/update.go b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/update.go index 3459d5f..a6a90d5 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/update.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/update.go @@ -47,39 +47,62 @@ func (this *UpdateAction) RunGet(params struct { sshPort := 22 ipAddresses := []maps.Map{} var grantId int64 + var loginId int64 this.Data["grant"] = nil resp, err := this.RPC().HTTPDNSNodeRPC().FindHTTPDNSNode(this.AdminContext(), &pb.FindHTTPDNSNodeRequest{ NodeId: params.NodeId, }) if err == nil && resp.GetNode() != nil { + // 从 NodeLogin 读取 SSH 信息 + if resp.GetNode().GetNodeLogin() != nil { + nodeLogin := resp.GetNode().GetNodeLogin() + loginId = nodeLogin.Id + if len(nodeLogin.Params) > 0 { + sshLoginParams := maps.Map{} + _ = json.Unmarshal(nodeLogin.Params, &sshLoginParams) + if h := strings.TrimSpace(sshLoginParams.GetString("host")); len(h) > 0 { + sshHost = h + } + if p := sshLoginParams.GetInt("port"); p > 0 { + sshPort = p + } + grantId = sshLoginParams.GetInt64("grantId") + } + } + + // IP 地址仍从 installStatus 读取 if len(resp.GetNode().GetInstallStatusJSON()) > 0 { installStatus := maps.Map{} _ = json.Unmarshal(resp.GetNode().GetInstallStatusJSON(), &installStatus) - sshInfo := installStatus.GetMap("ssh") - if sshInfo != nil { - if h := strings.TrimSpace(sshInfo.GetString("host")); len(h) > 0 { - sshHost = h - } - if p := sshInfo.GetInt("port"); p > 0 { - sshPort = p - } - grantId = sshInfo.GetInt64("grantId") - } - + if installStatus.Has("ipAddresses") { for _, addr := range installStatus.GetSlice("ipAddresses") { if addrMap, ok := addr.(map[string]interface{}); ok { - ipAddresses = append(ipAddresses, maps.Map(addrMap)) + m := maps.Map(addrMap) + // 确保必要字段存在,防止前端组件报错 + if !m.Has("name") { + m["name"] = "" + } + if !m.Has("canAccess") { + m["canAccess"] = true + } + if !m.Has("isOn") { + m["isOn"] = true + } + if !m.Has("isUp") { + m["isUp"] = true + } + ipAddresses = append(ipAddresses, m) } } } else if ip := strings.TrimSpace(installStatus.GetString("ipAddr")); len(ip) > 0 { ipAddresses = append(ipAddresses, maps.Map{ - "ip": ip, - "name": "", + "ip": ip, + "name": "", "canAccess": true, - "isOn": true, - "isUp": true, + "isOn": true, + "isUp": true, }) } } @@ -87,6 +110,7 @@ func (this *UpdateAction) RunGet(params struct { this.Data["sshHost"] = sshHost this.Data["sshPort"] = sshPort + this.Data["loginId"] = loginId this.Data["ipAddresses"] = ipAddresses if grantId > 0 { @@ -107,11 +131,12 @@ func (this *UpdateAction) RunGet(params struct { } func (this *UpdateAction) RunPost(params struct { - NodeId int64 - Name string - ClusterId int64 - IsOn bool - SshHost string + NodeId int64 + Name string + ClusterId int64 + IsOn bool + LoginId int64 + SshHost string SshPort int GrantId int64 IpAddressesJSON []byte @@ -155,8 +180,6 @@ func (this *UpdateAction) RunPost(params struct { } } - needUpdateInstallStatus := hasSSHUpdate || len(ipAddresses) > 0 - resp, err := this.RPC().HTTPDNSNodeRPC().FindHTTPDNSNode(this.AdminContext(), &pb.FindHTTPDNSNodeRequest{ NodeId: params.NodeId, }) @@ -186,7 +209,31 @@ func (this *UpdateAction) RunPost(params struct { return } - if needUpdateInstallStatus { + // SSH 保存到 NodeLogin + if hasSSHUpdate { + login := &pb.NodeLogin{ + Id: params.LoginId, + Name: "SSH", + Type: "ssh", + Params: maps.Map{ + "grantId": params.GrantId, + "host": params.SshHost, + "port": params.SshPort, + }.AsJSON(), + } + + _, err = this.RPC().HTTPDNSNodeRPC().UpdateHTTPDNSNodeLogin(this.AdminContext(), &pb.UpdateHTTPDNSNodeLoginRequest{ + NodeId: params.NodeId, + NodeLogin: login, + }) + if err != nil { + this.ErrorPage(err) + return + } + } + + // IP 地址仍保存在 installStatus 中 + if len(ipAddresses) > 0 { installStatus := maps.Map{ "isRunning": false, "isFinished": true, @@ -197,19 +244,10 @@ func (this *UpdateAction) RunPost(params struct { if len(node.GetInstallStatusJSON()) > 0 { _ = json.Unmarshal(node.GetInstallStatusJSON(), &installStatus) } - if hasSSHUpdate { - installStatus["ssh"] = maps.Map{ - "host": params.SshHost, - "port": params.SshPort, - "grantId": params.GrantId, - } - } - if len(ipAddresses) > 0 { - installStatus["ipAddresses"] = ipAddresses - } else { - delete(installStatus, "ipAddresses") - delete(installStatus, "ipAddr") // Cleanup legacy - } + installStatus["ipAddresses"] = ipAddresses + // 清理旧的 ssh 字段 + delete(installStatus, "ssh") + delete(installStatus, "ipAddr") installStatusJSON, _ := json.Marshal(installStatus) _, err = this.RPC().HTTPDNSNodeRPC().UpdateHTTPDNSNodeStatus(this.AdminContext(), &pb.UpdateHTTPDNSNodeStatusRequest{ diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/updateInstallStatus.go b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/updateInstallStatus.go index e713a97..73e94f0 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/updateInstallStatus.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/cluster/node/updateInstallStatus.go @@ -34,7 +34,7 @@ func (this *UpdateInstallStatusAction) RunPost(params struct { _ = json.Unmarshal(node.GetInstallStatusJSON(), &installStatus) } installStatus["isRunning"] = false - installStatus["isFinished"] = true + installStatus["isFinished"] = params.IsInstalled // 标记为未安装时重置为"未开始"状态 installStatus["isOk"] = params.IsInstalled installStatus["error"] = "" installStatus["errorCode"] = "" diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/clusterSettings.go b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/clusterSettings.go index 1f6ef3a..71768d1 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/clusterSettings.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/clusterSettings.go @@ -10,10 +10,8 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/sslconfigs" - "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs" "github.com/iwind/TeaGo/actions" "github.com/iwind/TeaGo/maps" - "github.com/iwind/TeaGo/types" ) type ClusterSettingsAction struct { @@ -49,11 +47,9 @@ func (this *ClusterSettingsAction) RunGet(params struct { "fallbackTimeout": cluster.GetInt("fallbackTimeout"), "installDir": cluster.GetString("installDir"), "isOn": cluster.GetBool("isOn"), - "isDefaultCluster": cluster.GetBool("isDefault"), - "isDefaultBackupCluster": false, } if settings.GetInt("cacheTtl") <= 0 { - settings["cacheTtl"] = 30 + settings["cacheTtl"] = 60 } if settings.GetInt("fallbackTimeout") <= 0 { settings["fallbackTimeout"] = 300 @@ -62,22 +58,9 @@ func (this *ClusterSettingsAction) RunGet(params struct { settings["installDir"] = "/opt/edge-httpdns" } - defaultBackupResp, err := this.RPC().SysSettingRPC().ReadSysSetting(this.AdminContext(), &pb.ReadSysSettingRequest{ - Code: string(systemconfigs.SettingCodeHTTPDNSDefaultBackupClusterId), - }) - if err != nil { - this.ErrorPage(err) - return - } - defaultBackupClusterId := int64(0) - if defaultBackupResp != nil && len(defaultBackupResp.GetValueJSON()) > 0 { - defaultBackupClusterId = types.Int64(string(defaultBackupResp.GetValueJSON())) - } - settings["isDefaultBackupCluster"] = defaultBackupClusterId == params.ClusterId - listenAddresses := []*serverconfigs.NetworkAddressConfig{ { - Protocol: serverconfigs.ProtocolHTTPS, + Protocol: serverconfigs.ProtocolTLS, Host: "", PortRange: "443", }, @@ -126,9 +109,7 @@ func (this *ClusterSettingsAction) RunPost(params struct { CacheTtl int32 FallbackTimeout int32 InstallDir string - IsOn bool - IsDefaultCluster bool - IsDefaultBackupCluster bool + IsOn bool Addresses []byte SslPolicyJSON []byte @@ -145,7 +126,7 @@ func (this *ClusterSettingsAction) RunPost(params struct { params.Must.Field("gatewayDomain", params.GatewayDomain).Require("请输入服务域名") if params.CacheTtl <= 0 { - params.CacheTtl = 30 + params.CacheTtl = 60 } if params.FallbackTimeout <= 0 { params.FallbackTimeout = 300 @@ -153,18 +134,6 @@ func (this *ClusterSettingsAction) RunPost(params struct { if len(params.InstallDir) == 0 { params.InstallDir = "/opt/edge-httpdns" } - if params.IsDefaultCluster && !params.IsOn { - this.Fail("默认主集群必须保持启用状态") - return - } - if params.IsDefaultBackupCluster && !params.IsOn { - this.Fail("默认备用集群必须保持启用状态") - return - } - if params.IsDefaultCluster && params.IsDefaultBackupCluster { - this.Fail("默认主集群和默认备用集群不能是同一个集群") - return - } cluster, err := findClusterMap(this.Parent(), params.ClusterId) if err != nil { @@ -213,35 +182,7 @@ func (this *ClusterSettingsAction) RunPost(params struct { InstallDir: params.InstallDir, TlsPolicyJSON: tlsPolicyJSON, IsOn: params.IsOn, - IsDefault: params.IsDefaultCluster, - }) - if err != nil { - this.ErrorPage(err) - return - } - - backupClusterValue := int64(0) - if params.IsDefaultBackupCluster { - backupClusterValue = params.ClusterId - } else { - readResp, err := this.RPC().SysSettingRPC().ReadSysSetting(this.AdminContext(), &pb.ReadSysSettingRequest{ - Code: string(systemconfigs.SettingCodeHTTPDNSDefaultBackupClusterId), - }) - if err != nil { - this.ErrorPage(err) - return - } - if readResp != nil && len(readResp.GetValueJSON()) > 0 { - oldBackupClusterId := types.Int64(string(readResp.GetValueJSON())) - if oldBackupClusterId != params.ClusterId { - backupClusterValue = oldBackupClusterId - } - } - } - - _, err = this.RPC().SysSettingRPC().UpdateSysSetting(this.AdminContext(), &pb.UpdateSysSettingRequest{ - Code: string(systemconfigs.SettingCodeHTTPDNSDefaultBackupClusterId), - ValueJSON: []byte(strconv.FormatInt(backupClusterValue, 10)), + IsDefault: false, }) if err != nil { this.ErrorPage(err) diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/create.go b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/create.go index 61b0957..0823114 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/create.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/create.go @@ -1,13 +1,11 @@ package clusters import ( - "strconv" "strings" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/httpdns/httpdnsutils" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" - "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs" "github.com/iwind/TeaGo/actions" ) @@ -25,14 +23,12 @@ func (this *CreateAction) RunGet(params struct{}) { } func (this *CreateAction) RunPost(params struct { - Name string - GatewayDomain string - CacheTtl int32 - FallbackTimeout int32 - InstallDir string - IsOn bool - IsDefaultPrimary bool - IsDefaultBackup bool + Name string + GatewayDomain string + CacheTtl int32 + FallbackTimeout int32 + InstallDir string + IsOn bool Must *actions.Must }) { @@ -43,7 +39,7 @@ func (this *CreateAction) RunPost(params struct { params.InstallDir = "/opt/edge-httpdns" } if params.CacheTtl <= 0 { - params.CacheTtl = 30 + params.CacheTtl = 60 } if params.FallbackTimeout <= 0 { params.FallbackTimeout = 300 @@ -52,19 +48,6 @@ func (this *CreateAction) RunPost(params struct { params.Must.Field("name", params.Name).Require("请输入集群名称") params.Must.Field("gatewayDomain", params.GatewayDomain).Require("请输入服务域名") - if params.IsDefaultPrimary && !params.IsOn { - this.Fail("默认主集群必须保持启用状态") - return - } - if params.IsDefaultBackup && !params.IsOn { - this.Fail("默认备用集群必须保持启用状态") - return - } - if params.IsDefaultPrimary && params.IsDefaultBackup { - this.Fail("默认主集群和默认备用集群不能是同一个集群") - return - } - resp, err := this.RPC().HTTPDNSClusterRPC().CreateHTTPDNSCluster(this.AdminContext(), &pb.CreateHTTPDNSClusterRequest{ Name: params.Name, ServiceDomain: params.GatewayDomain, @@ -72,24 +55,13 @@ func (this *CreateAction) RunPost(params struct { FallbackTimeoutMs: params.FallbackTimeout, InstallDir: params.InstallDir, IsOn: params.IsOn, - IsDefault: params.IsDefaultPrimary, + IsDefault: false, }) if err != nil { this.ErrorPage(err) return } - if params.IsDefaultBackup { - _, err = this.RPC().SysSettingRPC().UpdateSysSetting(this.AdminContext(), &pb.UpdateSysSettingRequest{ - Code: string(systemconfigs.SettingCodeHTTPDNSDefaultBackupClusterId), - ValueJSON: []byte(strconv.FormatInt(resp.GetClusterId(), 10)), - }) - if err != nil { - this.ErrorPage(err) - return - } - } - this.Data["clusterId"] = resp.GetClusterId() this.Success() } diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/rpc_helpers.go b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/rpc_helpers.go index 968cb16..36cdbd3 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/rpc_helpers.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/rpc_helpers.go @@ -37,10 +37,29 @@ func listClusterMaps(parent *actionutils.ParentAction, keyword string) ([]maps.M } } + port := "443" + if rawTLS := cluster.GetTlsPolicyJSON(); len(rawTLS) > 0 { + tlsConfig := maps.Map{} + if err := json.Unmarshal(rawTLS, &tlsConfig); err == nil { + if listenRaw := tlsConfig.Get("listen"); listenRaw != nil { + var listenAddresses []maps.Map + if data, err := json.Marshal(listenRaw); err == nil { + if err := json.Unmarshal(data, &listenAddresses); err == nil { + if len(listenAddresses) > 0 && len(listenAddresses[0].GetString("portRange")) > 0 { + port = listenAddresses[0].GetString("portRange") + } + } + } + } + } + } + apiAddress := "https://" + cluster.GetServiceDomain() + ":" + port + result = append(result, maps.Map{ "id": cluster.GetId(), "name": cluster.GetName(), "gatewayDomain": cluster.GetServiceDomain(), + "apiAddress": apiAddress, "defaultTTL": cluster.GetDefaultTTL(), "fallbackTimeout": cluster.GetFallbackTimeoutMs(), "installDir": cluster.GetInstallDir(), @@ -86,7 +105,7 @@ func findClusterMap(parent *actionutils.ParentAction, clusterID int64) (maps.Map "id": int64(0), "name": "", "gatewayDomain": "", - "defaultTTL": 30, + "defaultTTL": 60, "fallbackTimeout": 300, "installDir": "/opt/edge-httpdns", }, nil diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/updateNodeSSH.go b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/updateNodeSSH.go index 789bc98..778b573 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/clusters/updateNodeSSH.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/clusters/updateNodeSSH.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" - "github.com/iwind/TeaGo/actions" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" + "github.com/iwind/TeaGo/actions" "github.com/iwind/TeaGo/maps" ) @@ -47,25 +47,36 @@ func (this *UpdateNodeSSHAction) RunGet(params struct { } this.Data["loginId"] = 0 - if resp.GetNode() != nil && len(resp.GetNode().GetInstallStatusJSON()) > 0 { - installStatus := maps.Map{} - _ = json.Unmarshal(resp.GetNode().GetInstallStatusJSON(), &installStatus) - sshInfo := installStatus.GetMap("ssh") - if sshInfo != nil { - if host := strings.TrimSpace(sshInfo.GetString("host")); len(host) > 0 { - loginParams["host"] = host - } - if port := sshInfo.GetInt("port"); port > 0 { - loginParams["port"] = port - } - if grantID := sshInfo.GetInt64("grantId"); grantID > 0 { - loginParams["grantId"] = grantID - } + // 从 NodeLogin 读取 SSH 信息 + if resp.GetNode() != nil && resp.GetNode().GetNodeLogin() != nil { + nodeLogin := resp.GetNode().GetNodeLogin() + this.Data["loginId"] = nodeLogin.Id + if len(nodeLogin.Params) > 0 { + _ = json.Unmarshal(nodeLogin.Params, &loginParams) } } this.Data["params"] = loginParams - this.Data["grant"] = nil + + // 认证信息 + grantId := loginParams.GetInt64("grantId") + var grantMap maps.Map = nil + if grantId > 0 { + grantResp, grantErr := this.RPC().NodeGrantRPC().FindEnabledNodeGrant(this.AdminContext(), &pb.FindEnabledNodeGrantRequest{ + NodeGrantId: grantId, + }) + if grantErr == nil && grantResp.GetNodeGrant() != nil { + g := grantResp.GetNodeGrant() + grantMap = maps.Map{ + "id": g.Id, + "name": g.Name, + "method": g.Method, + "methodName": g.Method, + } + } + } + this.Data["grant"] = grantMap + this.Show() } @@ -93,46 +104,23 @@ func (this *UpdateNodeSSHAction) RunPost(params struct { this.Fail("SSH 主机地址 IP 格式错误") } - resp, err := this.RPC().HTTPDNSNodeRPC().FindHTTPDNSNode(this.AdminContext(), &pb.FindHTTPDNSNodeRequest{ - NodeId: params.NodeId, - }) - if err != nil { - this.ErrorPage(err) - return - } - node := resp.GetNode() - if node == nil { - this.Fail("节点不存在") - return + login := &pb.NodeLogin{ + Id: params.LoginId, + Name: "SSH", + Type: "ssh", + Params: maps.Map{ + "grantId": params.GrantId, + "host": params.SshHost, + "port": params.SshPort, + }.AsJSON(), } - installStatus := maps.Map{ - "isRunning": false, - "isFinished": true, - "isOk": node.GetIsInstalled(), - "error": "", - "errorCode": "", - } - if len(node.GetInstallStatusJSON()) > 0 { - _ = json.Unmarshal(node.GetInstallStatusJSON(), &installStatus) - } - installStatus["ssh"] = maps.Map{ - "host": params.SshHost, - "port": params.SshPort, - "grantId": params.GrantId, - } - - installStatusJSON, _ := json.Marshal(installStatus) - _, err = this.RPC().HTTPDNSNodeRPC().UpdateHTTPDNSNodeStatus(this.AdminContext(), &pb.UpdateHTTPDNSNodeStatusRequest{ - NodeId: params.NodeId, - IsUp: node.GetIsUp(), - IsInstalled: node.GetIsInstalled(), - IsActive: node.GetIsActive(), - StatusJSON: node.GetStatusJSON(), - InstallStatusJSON: installStatusJSON, + _, err := this.RPC().HTTPDNSNodeRPC().UpdateHTTPDNSNodeLogin(this.AdminContext(), &pb.UpdateHTTPDNSNodeLoginRequest{ + NodeId: params.NodeId, + NodeLogin: login, }) if err != nil { - this.ErrorPage(err) + this.Fail("保存SSH登录信息失败: " + err.Error()) return } diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/guide/index.go b/EdgeAdmin/internal/web/actions/default/httpdns/guide/index.go deleted file mode 100644 index 251ce5e..0000000 --- a/EdgeAdmin/internal/web/actions/default/httpdns/guide/index.go +++ /dev/null @@ -1,15 +0,0 @@ -package guide - -import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" - -type IndexAction struct { - actionutils.ParentAction -} - -func (this *IndexAction) Init() { - this.Nav("httpdns", "app", "") -} - -func (this *IndexAction) RunGet(params struct{}) { - this.RedirectURL("/httpdns/apps") -} diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/guide/init.go b/EdgeAdmin/internal/web/actions/default/httpdns/guide/init.go deleted file mode 100644 index efccb9d..0000000 --- a/EdgeAdmin/internal/web/actions/default/httpdns/guide/init.go +++ /dev/null @@ -1,19 +0,0 @@ -package guide - -import ( - "github.com/TeaOSLab/EdgeAdmin/internal/configloaders" - "github.com/TeaOSLab/EdgeAdmin/internal/web/helpers" - "github.com/iwind/TeaGo" -) - -func init() { - TeaGo.BeforeStart(func(server *TeaGo.Server) { - server. - Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeHttpDNS)). - Data("teaMenu", "httpdns"). - Data("teaSubMenu", "guide"). - Prefix("/httpdns/guide"). - Get("", new(IndexAction)). - EndAll() - }) -} diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/policies/index.go b/EdgeAdmin/internal/web/actions/default/httpdns/policies/index.go deleted file mode 100644 index 546bcd3..0000000 --- a/EdgeAdmin/internal/web/actions/default/httpdns/policies/index.go +++ /dev/null @@ -1,19 +0,0 @@ -package policies - -import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" - -type IndexAction struct { - actionutils.ParentAction -} - -func (this *IndexAction) Init() { - this.Nav("httpdns", "policy", "") -} - -func (this *IndexAction) RunGet(params struct{}) { - this.RedirectURL("/httpdns/clusters") -} - -func (this *IndexAction) RunPost(params struct{}) { - this.Success() -} diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/policies/init.go b/EdgeAdmin/internal/web/actions/default/httpdns/policies/init.go deleted file mode 100644 index cef7fcf..0000000 --- a/EdgeAdmin/internal/web/actions/default/httpdns/policies/init.go +++ /dev/null @@ -1,19 +0,0 @@ -package policies - -import ( - "github.com/TeaOSLab/EdgeAdmin/internal/configloaders" - "github.com/TeaOSLab/EdgeAdmin/internal/web/helpers" - "github.com/iwind/TeaGo" -) - -func init() { - TeaGo.BeforeStart(func(server *TeaGo.Server) { - server. - Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeHttpDNS)). - Data("teaMenu", "httpdns"). - Data("teaSubMenu", "policy"). - Prefix("/httpdns/policies"). - GetPost("", new(IndexAction)). - EndAll() - }) -} diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/sandbox/index.go b/EdgeAdmin/internal/web/actions/default/httpdns/sandbox/index.go index 243c8e5..11f640b 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/sandbox/index.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/sandbox/index.go @@ -1,6 +1,9 @@ package sandbox import ( + "encoding/json" + "strings" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/httpdns/httpdnsutils" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" @@ -25,9 +28,37 @@ func (this *IndexAction) RunGet(params struct{}) { } clusters := make([]maps.Map, 0, len(clusterResp.GetClusters())) for _, cluster := range clusterResp.GetClusters() { + serviceDomain := strings.TrimSpace(cluster.GetServiceDomain()) + + port := "443" + if rawTLS := cluster.GetTlsPolicyJSON(); len(rawTLS) > 0 { + var tlsConfig map[string]interface{} + if err := json.Unmarshal(rawTLS, &tlsConfig); err == nil { + if listenRaw, ok := tlsConfig["listen"]; ok && listenRaw != nil { + if data, err := json.Marshal(listenRaw); err == nil { + var listenAddresses []map[string]interface{} + if err := json.Unmarshal(data, &listenAddresses); err == nil { + if len(listenAddresses) > 0 { + if portRange, ok := listenAddresses[0]["portRange"].(string); ok && len(portRange) > 0 { + port = portRange + } + } + } + } + } + } + } + apiAddress := "https://" + serviceDomain + ":" + port + + displayName := apiAddress + if len(serviceDomain) == 0 { + displayName = cluster.GetName() + } clusters = append(clusters, maps.Map{ - "id": cluster.GetId(), - "name": cluster.GetName(), + "id": cluster.GetId(), + "name": cluster.GetName(), + "serviceDomain": serviceDomain, + "displayName": displayName, }) } this.Data["clusters"] = clusters @@ -50,14 +81,18 @@ func (this *IndexAction) RunGet(params struct{}) { for _, domain := range domainResp.GetDomains() { domains = append(domains, domain.GetDomain()) } + // 解析集群ID列表 + var clusterIds []int64 + if len(app.GetClusterIdsJSON()) > 0 { + _ = json.Unmarshal(app.GetClusterIdsJSON(), &clusterIds) + } + apps = append(apps, maps.Map{ - "id": app.GetId(), - "name": app.GetName(), - "appId": app.GetAppId(), - "clusterId": app.GetPrimaryClusterId(), - "primaryClusterId": app.GetPrimaryClusterId(), - "backupClusterId": app.GetBackupClusterId(), - "domains": domains, + "id": app.GetId(), + "name": app.GetName(), + "appId": app.GetAppId(), + "clusterIds": clusterIds, + "domains": domains, }) } this.Data["apps"] = apps diff --git a/EdgeAdmin/internal/web/actions/default/httpdns/sandbox/test.go b/EdgeAdmin/internal/web/actions/default/httpdns/sandbox/test.go index 7eab116..5a66eae 100644 --- a/EdgeAdmin/internal/web/actions/default/httpdns/sandbox/test.go +++ b/EdgeAdmin/internal/web/actions/default/httpdns/sandbox/test.go @@ -4,6 +4,7 @@ import ( "crypto/hmac" "crypto/sha256" "encoding/hex" + "encoding/json" "net/url" "strconv" "strings" @@ -52,12 +53,30 @@ func (this *TestAction) RunPost(params struct { } clusterDomain := "" + port := "443" if params.ClusterId > 0 { clusterResp, findErr := this.RPC().HTTPDNSClusterRPC().FindHTTPDNSCluster(this.AdminContext(), &pb.FindHTTPDNSClusterRequest{ ClusterId: params.ClusterId, }) if findErr == nil && clusterResp.GetCluster() != nil { clusterDomain = strings.TrimSpace(clusterResp.GetCluster().GetServiceDomain()) + if rawTLS := clusterResp.GetCluster().GetTlsPolicyJSON(); len(rawTLS) > 0 { + var tlsConfig map[string]interface{} + if err := json.Unmarshal(rawTLS, &tlsConfig); err == nil { + if listenRaw, ok := tlsConfig["listen"]; ok && listenRaw != nil { + if data, err := json.Marshal(listenRaw); err == nil { + var listenAddresses []map[string]interface{} + if err := json.Unmarshal(data, &listenAddresses); err == nil { + if len(listenAddresses) > 0 { + if portRange, ok := listenAddresses[0]["portRange"].(string); ok && len(portRange) > 0 { + port = portRange + } + } + } + } + } + } + } } } if len(clusterDomain) == 0 { @@ -80,7 +99,7 @@ func (this *TestAction) RunPost(params struct { query.Set("nonce", nonce) query.Set("sign", sign) } - requestURL := "https://" + clusterDomain + "/resolve?" + query.Encode() + requestURL := "https://" + clusterDomain + ":" + port + "/resolve?" + query.Encode() resultCode := 1 if strings.EqualFold(resp.GetCode(), "SUCCESS") { diff --git a/EdgeAdmin/internal/web/actions/default/users/createPopup.go b/EdgeAdmin/internal/web/actions/default/users/createPopup.go index 889efe8..8fc14c6 100644 --- a/EdgeAdmin/internal/web/actions/default/users/createPopup.go +++ b/EdgeAdmin/internal/web/actions/default/users/createPopup.go @@ -10,6 +10,7 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/userconfigs" "github.com/iwind/TeaGo/actions" + "github.com/iwind/TeaGo/lists" "github.com/iwind/TeaGo/maps" "github.com/xlzd/gotp" ) @@ -23,6 +24,38 @@ func (this *CreatePopupAction) Init() { } func (this *CreatePopupAction) RunGet(params struct{}) { + // 检查是否启用了 HTTPDNS 功能(全局用户注册设置中) + var hasHTTPDNSFeature = false + var defaultHttpdnsClusterId int64 = 0 + + resp, err := this.RPC().SysSettingRPC().ReadSysSetting(this.AdminContext(), &pb.ReadSysSettingRequest{Code: systemconfigs.SettingCodeUserRegisterConfig}) + if err == nil && len(resp.ValueJSON) > 0 { + var config = userconfigs.DefaultUserRegisterConfig() + if json.Unmarshal(resp.ValueJSON, config) == nil { + hasHTTPDNSFeature = config.HTTPDNSIsOn + if len(config.HTTPDNSDefaultClusterIds) > 0 { + defaultHttpdnsClusterId = config.HTTPDNSDefaultClusterIds[0] + } + } + } + this.Data["hasHTTPDNSFeature"] = hasHTTPDNSFeature + this.Data["httpdnsClusterId"] = defaultHttpdnsClusterId + + // 加载所有 HTTPDNS 集群 + var httpdnsClusters = []maps.Map{} + if hasHTTPDNSFeature { + httpdnsClusterResp, err := this.RPC().HTTPDNSClusterRPC().FindAllHTTPDNSClusters(this.AdminContext(), &pb.FindAllHTTPDNSClustersRequest{}) + if err == nil { + for _, c := range httpdnsClusterResp.GetClusters() { + httpdnsClusters = append(httpdnsClusters, maps.Map{ + "id": c.GetId(), + "name": c.GetName(), + }) + } + } + } + this.Data["httpdnsClusters"] = httpdnsClusters + this.Show() } @@ -35,8 +68,9 @@ func (this *CreatePopupAction) RunPost(params struct { Tel string Email string Remark string - ClusterId int64 - FeaturesType string + ClusterId int64 + HttpdnsClusterId int64 + FeaturesType string // OTP OtpOn bool @@ -111,6 +145,28 @@ func (this *CreatePopupAction) RunPost(params struct { userId = createResp.UserId + // 如果表单选择了 HTTPDNS 关联集群,在这里予以保存 + if params.HttpdnsClusterId > 0 { + httpdnsJSON, _ := json.Marshal([]int64{params.HttpdnsClusterId}) + _, err = this.RPC().UserRPC().UpdateUser(this.AdminContext(), &pb.UpdateUserRequest{ + UserId: userId, + Username: params.Username, + Password: params.Pass1, + Fullname: params.Fullname, + Mobile: params.Mobile, + Tel: params.Tel, + Email: params.Email, + Remark: params.Remark, + IsOn: true, + NodeClusterId: params.ClusterId, + HttpdnsClusterIdsJSON: httpdnsJSON, + }) + if err != nil { + this.ErrorPage(err) + return + } + } + // 功能 if teaconst.IsPlus { if params.FeaturesType == "default" { @@ -127,14 +183,41 @@ func (this *CreatePopupAction) RunPost(params struct { this.ErrorPage(err) return } + var featureCodes = config.Features + if config.HTTPDNSIsOn && !lists.ContainsString(featureCodes, userconfigs.UserFeatureCodeHTTPDNS) { + featureCodes = append(featureCodes, userconfigs.UserFeatureCodeHTTPDNS) + } + _, err = this.RPC().UserRPC().UpdateUserFeatures(this.AdminContext(), &pb.UpdateUserFeaturesRequest{ UserId: userId, - FeatureCodes: config.Features, + FeatureCodes: featureCodes, }) if err != nil { this.ErrorPage(err) return } + + // 自动关联默认 HTTPDNS 集群 (如果没有在表单中选择的话) + if config.HTTPDNSIsOn && params.HttpdnsClusterId <= 0 && len(config.HTTPDNSDefaultClusterIds) > 0 { + httpdnsJSON, _ := json.Marshal(config.HTTPDNSDefaultClusterIds) + _, err = this.RPC().UserRPC().UpdateUser(this.AdminContext(), &pb.UpdateUserRequest{ + UserId: userId, + Username: params.Username, + Password: params.Pass1, + Fullname: params.Fullname, + Mobile: params.Mobile, + Tel: params.Tel, + Email: params.Email, + Remark: params.Remark, + IsOn: true, + NodeClusterId: params.ClusterId, + HttpdnsClusterIdsJSON: httpdnsJSON, + }) + if err != nil { + this.ErrorPage(err) + return + } + } } } else if params.FeaturesType == "all" { featuresResp, err := this.RPC().UserRPC().FindAllUserFeatureDefinitions(this.AdminContext(), &pb.FindAllUserFeatureDefinitionsRequest{}) diff --git a/EdgeAdmin/internal/web/actions/default/users/setting/index.go b/EdgeAdmin/internal/web/actions/default/users/setting/index.go index 1fa06a8..77f120b 100644 --- a/EdgeAdmin/internal/web/actions/default/users/setting/index.go +++ b/EdgeAdmin/internal/web/actions/default/users/setting/index.go @@ -66,6 +66,28 @@ func (this *IndexAction) RunGet(params struct{}) { // 当前默认的智能DNS设置 this.Data["nsIsVisible"] = plus.AllowComponent(plus.ComponentCodeNS) + // HTTPDNS 集群列表(用于默认集群多选) + httpdnsClusterResp, err := this.RPC().HTTPDNSClusterRPC().FindAllHTTPDNSClusters(this.AdminContext(), &pb.FindAllHTTPDNSClustersRequest{}) + if err != nil { + this.ErrorPage(err) + return + } + httpdnsClusters := make([]maps.Map, 0, len(httpdnsClusterResp.GetClusters())) + for _, cluster := range httpdnsClusterResp.GetClusters() { + httpdnsClusters = append(httpdnsClusters, maps.Map{ + "id": cluster.GetId(), + "name": cluster.GetName(), + }) + } + this.Data["httpdnsClusters"] = httpdnsClusters + + // 当前选中的默认集群(取数组第一个元素) + var httpdnsDefaultClusterId int64 + if len(config.HTTPDNSDefaultClusterIds) > 0 { + httpdnsDefaultClusterId = config.HTTPDNSDefaultClusterIds[0] + } + this.Data["httpdnsDefaultClusterId"] = httpdnsDefaultClusterId + this.Show() } @@ -102,7 +124,8 @@ func (this *IndexAction) RunPost(params struct { NsIsOn bool - HttpdnsIsOn bool + HttpdnsIsOn bool + HttpdnsDefaultClusterId int64 Must *actions.Must CSRF *actionutils.CSRF @@ -154,6 +177,11 @@ func (this *IndexAction) RunPost(params struct { config.NSIsOn = params.NsIsOn config.HTTPDNSIsOn = params.HttpdnsIsOn + if params.HttpdnsDefaultClusterId > 0 { + config.HTTPDNSDefaultClusterIds = []int64{params.HttpdnsDefaultClusterId} + } else { + config.HTTPDNSDefaultClusterIds = []int64{} + } configJSON, err := json.Marshal(config) if err != nil { diff --git a/EdgeAdmin/internal/web/actions/default/users/update.go b/EdgeAdmin/internal/web/actions/default/users/update.go index 8ab6687..d67631b 100644 --- a/EdgeAdmin/internal/web/actions/default/users/update.go +++ b/EdgeAdmin/internal/web/actions/default/users/update.go @@ -1,6 +1,8 @@ package users import ( + "encoding/json" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/users/userutils" "github.com/TeaOSLab/EdgeCommon/pkg/langs/codes" @@ -85,6 +87,46 @@ func (this *UpdateAction) RunGet(params struct { this.Data["clusterId"] = user.NodeCluster.Id } + // 检查用户是否开通了 HTTPDNS 功能 + var hasHTTPDNSFeature = false + userFeaturesResp, err := this.RPC().UserRPC().FindUserFeatures(this.AdminContext(), &pb.FindUserFeaturesRequest{UserId: params.UserId}) + if err != nil { + this.ErrorPage(err) + return + } + for _, f := range userFeaturesResp.Features { + if f.Code == "httpdns" { + hasHTTPDNSFeature = true + break + } + } + this.Data["hasHTTPDNSFeature"] = hasHTTPDNSFeature + + // 读取用户已关联的 HTTPDNS 集群(取第一个作为下拉默认值) + var httpdnsClusterId int64 + if len(user.HttpdnsClusterIdsJSON) > 0 { + var userHTTPDNSClusterIds []int64 + if json.Unmarshal(user.HttpdnsClusterIdsJSON, &userHTTPDNSClusterIds) == nil && len(userHTTPDNSClusterIds) > 0 { + httpdnsClusterId = userHTTPDNSClusterIds[0] + } + } + this.Data["httpdnsClusterId"] = httpdnsClusterId + + // 加载所有 HTTPDNS 集群 + httpdnsClusterResp, err := this.RPC().HTTPDNSClusterRPC().FindAllHTTPDNSClusters(this.AdminContext(), &pb.FindAllHTTPDNSClustersRequest{}) + if err != nil { + this.ErrorPage(err) + return + } + httpdnsClusters := make([]maps.Map, 0, len(httpdnsClusterResp.GetClusters())) + for _, c := range httpdnsClusterResp.GetClusters() { + httpdnsClusters = append(httpdnsClusters, maps.Map{ + "id": c.GetId(), + "name": c.GetName(), + }) + } + this.Data["httpdnsClusters"] = httpdnsClusters + this.Show() } @@ -99,8 +141,9 @@ func (this *UpdateAction) RunPost(params struct { Email string Remark string IsOn bool - ClusterId int64 - BandwidthAlgo string + ClusterId int64 + HttpdnsClusterId int64 + BandwidthAlgo string // OTP OtpOn bool @@ -151,18 +194,25 @@ func (this *UpdateAction) RunPost(params struct { Email("请输入正确的电子邮箱") } + var httpdnsClusterIds []int64 + if params.HttpdnsClusterId > 0 { + httpdnsClusterIds = []int64{params.HttpdnsClusterId} + } + httpdnsClusterIdsJSON, _ := json.Marshal(httpdnsClusterIds) + _, err = this.RPC().UserRPC().UpdateUser(this.AdminContext(), &pb.UpdateUserRequest{ - UserId: params.UserId, - Username: params.Username, - Password: params.Pass1, - Fullname: params.Fullname, - Mobile: params.Mobile, - Tel: params.Tel, - Email: params.Email, - Remark: params.Remark, - IsOn: params.IsOn, - NodeClusterId: params.ClusterId, - BandwidthAlgo: params.BandwidthAlgo, + UserId: params.UserId, + Username: params.Username, + Password: params.Pass1, + Fullname: params.Fullname, + Mobile: params.Mobile, + Tel: params.Tel, + Email: params.Email, + Remark: params.Remark, + IsOn: params.IsOn, + NodeClusterId: params.ClusterId, + BandwidthAlgo: params.BandwidthAlgo, + HttpdnsClusterIdsJSON: httpdnsClusterIdsJSON, }) if err != nil { this.ErrorPage(err) diff --git a/EdgeAdmin/internal/web/actions/default/users/user.go b/EdgeAdmin/internal/web/actions/default/users/user.go index f42daa6..72e2377 100644 --- a/EdgeAdmin/internal/web/actions/default/users/user.go +++ b/EdgeAdmin/internal/web/actions/default/users/user.go @@ -6,6 +6,8 @@ import ( "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/users/userutils" "github.com/TeaOSLab/EdgeCommon/pkg/iplibrary" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" + "github.com/TeaOSLab/EdgeCommon/pkg/systemconfigs" + "github.com/TeaOSLab/EdgeCommon/pkg/userconfigs" "github.com/iwind/TeaGo/maps" ) @@ -89,6 +91,37 @@ func (this *UserAction) RunGet(params struct { } } + // 检查全局是否启用了 HTTPDNS 功能 + var hasHTTPDNSFeature = false + sysResp, sysErr := this.RPC().SysSettingRPC().ReadSysSetting(this.AdminContext(), &pb.ReadSysSettingRequest{Code: systemconfigs.SettingCodeUserRegisterConfig}) + if sysErr == nil && len(sysResp.ValueJSON) > 0 { + var config = userconfigs.DefaultUserRegisterConfig() + if json.Unmarshal(sysResp.ValueJSON, config) == nil { + hasHTTPDNSFeature = config.HTTPDNSIsOn + } + } + this.Data["hasHTTPDNSFeature"] = hasHTTPDNSFeature + + // 读取用户关联的 HTTPDNS 集群 + var httpdnsClusterMap maps.Map = nil + if hasHTTPDNSFeature && len(user.HttpdnsClusterIdsJSON) > 0 { + var httpdnsClusterIds []int64 + if json.Unmarshal(user.HttpdnsClusterIdsJSON, &httpdnsClusterIds) == nil && len(httpdnsClusterIds) > 0 { + httpdnsClusterResp, httpdnsErr := this.RPC().HTTPDNSClusterRPC().FindAllHTTPDNSClusters(this.AdminContext(), &pb.FindAllHTTPDNSClustersRequest{}) + if httpdnsErr == nil { + for _, c := range httpdnsClusterResp.GetClusters() { + if c.GetId() == httpdnsClusterIds[0] { + httpdnsClusterMap = maps.Map{ + "id": c.GetId(), + "name": c.GetName(), + } + break + } + } + } + } + } + this.Data["user"] = maps.Map{ "id": user.Id, "username": user.Username, @@ -100,6 +133,7 @@ func (this *UserAction) RunGet(params struct { "mobile": user.Mobile, "isOn": user.IsOn, "cluster": clusterMap, + "httpdnsCluster": httpdnsClusterMap, "countAccessKeys": countAccessKeys, "isRejected": user.IsRejected, "rejectReason": user.RejectReason, diff --git a/EdgeAdmin/web/public/js/components.js b/EdgeAdmin/web/public/js/components.js index e5f74f0..11d2339 100644 --- a/EdgeAdmin/web/public/js/components.js +++ b/EdgeAdmin/web/public/js/components.js @@ -531,6 +531,57 @@ Vue.component("ddos-protection-ports-config-box", { ` }) +Vue.component("httpdns-clusters-selector", { + props: ["vClusters", "vName"], + data: function () { + let inputClusters = this.vClusters + let clusters = [] + + if (inputClusters != null && inputClusters.length > 0) { + if (inputClusters[0].isChecked !== undefined) { + // 带 isChecked 标志的完整集群列表 + clusters = inputClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: c.isChecked} + }) + } else { + // 仅包含已选集群,全部标记为选中 + clusters = inputClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: true} + }) + } + } + + // 无 prop 时从根实例读取所有集群(如创建应用页面) + if (clusters.length === 0) { + let rootClusters = this.$root.clusters + if (rootClusters != null && rootClusters.length > 0) { + clusters = rootClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: false} + }) + } + } + + return { + clusters: clusters, + fieldName: this.vName || "clusterIds" + } + }, + methods: { + changeCluster: function (cluster) { + cluster.isChecked = !cluster.isChecked + } + }, + template: `
+
+ + {{cluster.name}} + +
+ 暂无可用集群 +
` +}) + + Vue.component("node-cluster-combo-box", { props: ["v-cluster-id"], data: function () { diff --git a/EdgeAdmin/web/public/js/components.src.js b/EdgeAdmin/web/public/js/components.src.js index e5f74f0..11d2339 100644 --- a/EdgeAdmin/web/public/js/components.src.js +++ b/EdgeAdmin/web/public/js/components.src.js @@ -531,6 +531,57 @@ Vue.component("ddos-protection-ports-config-box", { ` }) +Vue.component("httpdns-clusters-selector", { + props: ["vClusters", "vName"], + data: function () { + let inputClusters = this.vClusters + let clusters = [] + + if (inputClusters != null && inputClusters.length > 0) { + if (inputClusters[0].isChecked !== undefined) { + // 带 isChecked 标志的完整集群列表 + clusters = inputClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: c.isChecked} + }) + } else { + // 仅包含已选集群,全部标记为选中 + clusters = inputClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: true} + }) + } + } + + // 无 prop 时从根实例读取所有集群(如创建应用页面) + if (clusters.length === 0) { + let rootClusters = this.$root.clusters + if (rootClusters != null && rootClusters.length > 0) { + clusters = rootClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: false} + }) + } + } + + return { + clusters: clusters, + fieldName: this.vName || "clusterIds" + } + }, + methods: { + changeCluster: function (cluster) { + cluster.isChecked = !cluster.isChecked + } + }, + template: `
+
+ + {{cluster.name}} + +
+ 暂无可用集群 +
` +}) + + Vue.component("node-cluster-combo-box", { props: ["v-cluster-id"], data: function () { diff --git a/EdgeAdmin/web/public/js/components/cluster/httpdns-clusters-selector.js b/EdgeAdmin/web/public/js/components/cluster/httpdns-clusters-selector.js new file mode 100644 index 0000000..fb67aed --- /dev/null +++ b/EdgeAdmin/web/public/js/components/cluster/httpdns-clusters-selector.js @@ -0,0 +1,49 @@ +Vue.component("httpdns-clusters-selector", { + props: ["vClusters", "vName"], + data: function () { + let inputClusters = this.vClusters + let clusters = [] + + if (inputClusters != null && inputClusters.length > 0) { + if (inputClusters[0].isChecked !== undefined) { + // 带 isChecked 标志的完整集群列表 + clusters = inputClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: c.isChecked} + }) + } else { + // 仅包含已选集群,全部标记为选中 + clusters = inputClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: true} + }) + } + } + + // 无 prop 时从根实例读取所有集群(如创建应用页面) + if (clusters.length === 0) { + let rootClusters = this.$root.clusters + if (rootClusters != null && rootClusters.length > 0) { + clusters = rootClusters.map(function (c) { + return {id: c.id, name: c.name, isChecked: false} + }) + } + } + + return { + clusters: clusters, + fieldName: this.vName || "clusterIds" + } + }, + methods: { + changeCluster: function (cluster) { + cluster.isChecked = !cluster.isChecked + } + }, + template: `
+
+ + {{cluster.name}} + +
+ 暂无可用集群 +
` +}) diff --git a/EdgeAdmin/web/views/@default/httpdns/apps/appSettings.html b/EdgeAdmin/web/views/@default/httpdns/apps/appSettings.html index 75a47a6..91d0c0b 100644 --- a/EdgeAdmin/web/views/@default/httpdns/apps/appSettings.html +++ b/EdgeAdmin/web/views/@default/httpdns/apps/appSettings.html @@ -1,4 +1,4 @@ -{$layout} +{$layout} {$template "menu"} {$template "/left_menu_with_menu"} @@ -67,23 +67,13 @@ - + - - - - @@ -106,30 +96,29 @@ - + - - - - @@ -138,9 +127,14 @@ - + - - - -
主集群所属集群 - -

未设置时,按默认主集群处理(当前默认主集群:{{settings.defaultPrimaryClusterName || '-' }})。

-
备集群 - -

未设置时,按默认备用集群处理(当前默认备用集群:{{settings.defaultBackupClusterName || '-' }})。

+ + +

选择该应用绑定的集群。

App ID {{settings.appId}} - +
主服务域名服务地址 - {{settings.primaryServiceDomain}} - 未配置 - -
备用服务域名 - {{settings.backupServiceDomain}} - 未配置 - +
+
+ {{sa.address}} +
+
+ 未配置集群
请求验签 - {{settings.signEnabled ? "已开启" : "已关闭"}} - {{settings.signEnabled ? "关闭请求验签" : "开启请求验签"}} + {{settings.signEnabled + ? "已开启" : "已关闭"}} + {{settings.signEnabled ? "关闭请求验签" : "开启请求验签"}}

打开后,服务端会对请求进行签名校验。

{{signSecretVisible ? settings.signSecretPlain : settings.signSecretMasked}} - - - + + +

最近更新:{{settings.signSecretUpdatedAt}}

请求验签已关闭,当前不使用加签 Secret。

@@ -151,4 +145,4 @@ - + \ No newline at end of file diff --git a/EdgeAdmin/web/views/@default/httpdns/apps/create.html b/EdgeAdmin/web/views/@default/httpdns/apps/create.html index 60f814a..4fc405a 100644 --- a/EdgeAdmin/web/views/@default/httpdns/apps/create.html +++ b/EdgeAdmin/web/views/@default/httpdns/apps/create.html @@ -1,4 +1,4 @@ -{$layout} +{$layout} {$template "menu"}
@@ -12,35 +12,20 @@
主集群 *所属集群 * - -

主集群用于优先处理应用解析请求。

-
备集群 - -

当主集群不可用时,可切换到备集群。

+ + +

选择该应用绑定的集群。

所属用户 - +

可以选择当前应用所属的平台用户。

- + \ No newline at end of file diff --git a/EdgeAdmin/web/views/@default/httpdns/apps/customRecordsCreatePopup.js b/EdgeAdmin/web/views/@default/httpdns/apps/customRecordsCreatePopup.js index edfd5a7..e8bc6a0 100644 --- a/EdgeAdmin/web/views/@default/httpdns/apps/customRecordsCreatePopup.js +++ b/EdgeAdmin/web/views/@default/httpdns/apps/customRecordsCreatePopup.js @@ -18,15 +18,18 @@ "西南": ["默认", "重庆", "四川", "贵州", "云南", "西藏"] }; - vm.continents = ["默认", "非洲", "南极洲", "亚洲", "欧洲", "北美洲", "南美洲", "大洋洲"]; + vm.continents = ["默认", "亚洲", "欧洲", "北美洲", "南美洲", "非洲", "大洋洲"]; vm.continentCountries = { "默认": ["默认"], - "非洲": ["默认", "南非", "埃及", "尼日利亚", "肯尼亚", "摩洛哥"], - "南极洲": ["默认"], - "亚洲": ["默认", "中国香港", "中国澳门", "中国台湾", "日本", "韩国", "新加坡", "印度", "泰国", "越南"], - "欧洲": ["默认", "德国", "英国", "法国", "荷兰", "西班牙", "意大利", "俄罗斯"], - "北美洲": ["默认", "美国", "加拿大", "墨西哥"], - "南美洲": ["默认", "巴西", "阿根廷", "智利", "哥伦比亚"], + "亚洲": ["默认", "中国香港", "中国澳门", "中国台湾", "日本", "韩国", "新加坡", "印度", "泰国", "越南", + "印度尼西亚", "马来西亚", "菲律宾", "柬埔寨", "缅甸", "老挝", "斯里兰卡", "孟加拉国", "巴基斯坦", "尼泊尔", + "阿联酋", "沙特阿拉伯", "土耳其", "以色列", "伊朗", "伊拉克", "卡塔尔", "科威特", "蒙古"], + "欧洲": ["默认", "德国", "英国", "法国", "荷兰", "西班牙", "意大利", "俄罗斯", + "波兰", "瑞典", "瑞士", "挪威", "芬兰", "丹麦", "葡萄牙", "爱尔兰", "比利时", "奥地利", + "乌克兰", "捷克", "罗马尼亚", "匈牙利", "希腊"], + "北美洲": ["默认", "美国", "加拿大", "墨西哥", "巴拿马", "哥斯达黎加", "古巴"], + "南美洲": ["默认", "巴西", "阿根廷", "智利", "哥伦比亚", "秘鲁", "委内瑞拉", "厄瓜多尔"], + "非洲": ["默认", "南非", "埃及", "尼日利亚", "肯尼亚", "摩洛哥", "阿尔及利亚", "坦桑尼亚", "埃塞俄比亚", "加纳", "突尼斯"], "大洋洲": ["默认", "澳大利亚", "新西兰"] }; diff --git a/EdgeAdmin/web/views/@default/httpdns/apps/domains.js b/EdgeAdmin/web/views/@default/httpdns/apps/domains.js index a93df1f..290ffbf 100644 --- a/EdgeAdmin/web/views/@default/httpdns/apps/domains.js +++ b/EdgeAdmin/web/views/@default/httpdns/apps/domains.js @@ -34,8 +34,8 @@ this.bindDomain = function () { teaweb.popup("/httpdns/apps/domains/createPopup?appId=" + this.app.id, { - height: "24em", - width: "46em", + height: "12em", + width: "36em", title: "添加域名", callback: function () { teaweb.success("保存成功", function () { diff --git a/EdgeAdmin/web/views/@default/httpdns/apps/index.html b/EdgeAdmin/web/views/@default/httpdns/apps/index.html index 30effd9..87e4fe2 100644 --- a/EdgeAdmin/web/views/@default/httpdns/apps/index.html +++ b/EdgeAdmin/web/views/@default/httpdns/apps/index.html @@ -28,8 +28,7 @@ - - + @@ -39,8 +38,7 @@ 应用名称 AppID - 主集群 - 备用集群 + 集群 用户 绑定域名数 状态 @@ -61,16 +59,10 @@ - - {{app.primaryCluster.name || ('#' + app.primaryCluster.id)}} - - - - - - - - {{app.backupCluster.name || ('#' + app.backupCluster.id)}} - + + + {{cluster.name || ('#' + cluster.id)}} + - diff --git a/EdgeAdmin/web/views/@default/httpdns/apps/policies.html b/EdgeAdmin/web/views/@default/httpdns/apps/policies.html deleted file mode 100644 index 0471258..0000000 --- a/EdgeAdmin/web/views/@default/httpdns/apps/policies.html +++ /dev/null @@ -1,78 +0,0 @@ -{$layout} -{$template "menu"} - -
- -

HTTPDNS 鍏ㄥ眬绛栫暐

- -
- - - - - - - - - - - - - - - - - - - - - - - -
鍏ㄥ眬榛樿瑙f瀽 TTL 绉?/td> -
鍏ㄥ眬榛樿 SNI 绛夌骇 - -
- level1 浠呬娇鐢ㄥ浐瀹?SNI锛屼笉鍚敤 ECS 鍜岃瘉涔︽牎楠岀瓥鐣ャ€?
-
- level2 浠呭惎鐢ㄩ殣鍖?SNI锛屼笉瑕佹眰閰嶇疆 ECS 涓庤瘉涔︾瓥鐣ャ€?
-
- level3 鍚敤 ECH锛屽缓璁悓鏃堕厤缃?ECS 涓庤瘉涔︽牎楠岀瓥鐣ャ€?
-
鍏ㄥ眬闄嶇骇瓒呮椂 姣
全局 ECS 掩码策略 - - - IPv4 / - - IPv6 / - - - 仅在“自定义”模式下配置掩码。 - - - -
鍏ㄥ眬璇佷功鏍¢獙绛栫暐 - 证书指纹校验(Pinning) - - 证书 SAN 域名校验 - -
- - -
- diff --git a/EdgeAdmin/web/views/@default/httpdns/apps/policies.js b/EdgeAdmin/web/views/@default/httpdns/apps/policies.js deleted file mode 100644 index dc96d3c..0000000 --- a/EdgeAdmin/web/views/@default/httpdns/apps/policies.js +++ /dev/null @@ -1,40 +0,0 @@ -Tea.context(function () { - this.success = NotifyReloadSuccess("保存成功"); - - this.$delay(function () { - this.$watch("policies.defaultSniPolicy", function (level) { - if (level == "level1" || level == "level2") { - this.policies.ecsMode = "off"; - this.policies.pinningMode = "off"; - this.policies.sanMode = "off"; - return; - } - - if (level == "level3") { - if (this.policies.ecsMode == "off") { - this.policies.ecsMode = "auto"; - } - if (this.policies.pinningMode == "off") { - this.policies.pinningMode = "report"; - } - if (this.policies.sanMode == "off") { - this.policies.sanMode = "strict"; - } - } - }); - - this.$watch("policies.ecsMode", function (mode) { - if (this.policies.defaultSniPolicy != "level3") { - return; - } - if (mode == "custom") { - if (!this.policies.ecsIPv4Prefix || this.policies.ecsIPv4Prefix <= 0) { - this.policies.ecsIPv4Prefix = 24; - } - if (!this.policies.ecsIPv6Prefix || this.policies.ecsIPv6Prefix <= 0) { - this.policies.ecsIPv6Prefix = 56; - } - } - }); - }); -}); diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/install.html b/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/install.html index d222f39..6129a00 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/install.html +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/install.html @@ -2,16 +2,17 @@ {$template "node_menu"} {$template "/code_editor"} +
当前节点为已安装状态。
- [修改为未安装] + [重新安装]

配置文件

@@ -19,27 +20,45 @@
配置文件 - configs/api_httpdns.yaml + configs/api_httpdns.yaml   [下载]
配置内容 rpc.endpoints: [ {{apiEndpoints}} ] - nodeId: "{{node.uniqueId}}" - secret: "{{node.secret}}" + nodeId: "{{node.uniqueId}}" + secret: "{{node.secret}}" +

每个节点的配置文件内容均不相同,不能混用。

安装目录 -
使用集群设置({{node.cluster.installDir}})
+
使用集群设置({{node.cluster.installDir}}) +
{{node.installDir}}
+
-

通过控制台标记安装

-
+

方法1:通过SSH自动安装

+ + + + + + +
SSH地址 + {{sshAddr}}   [修改] + 尚未设置   [设置] +
+ +
安装中...
- 安装成功 - 安装失败:{{installStatus.error}} + 已安装成功 + 安装过程中发生错误:{{installStatus.error}}
@@ -49,12 +68,12 @@
-

配置文件

+

方法2:手动安装

@@ -62,18 +81,21 @@
配置文件 - configs/api_httpdns.yaml + configs/api_httpdns.yaml   [下载]
配置内容 rpc.endpoints: [ {{apiEndpoints}} ] - nodeId: "{{node.uniqueId}}" - secret: "{{node.secret}}" + nodeId: "{{node.uniqueId}}" + secret: "{{node.secret}}" +

每个节点的配置文件内容均不相同,不能混用。

安装目录 -
使用集群设置({{node.cluster.installDir}})
+
使用集群设置({{node.cluster.installDir}}) +
{{node.installDir}}
- [修改为已安装] -
+ [修改为已安装状态] +
\ No newline at end of file diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/install.js b/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/install.js index 5a25314..718182b 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/install.js +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/install.js @@ -28,6 +28,7 @@ Tea.context(function () { }) } + // 刷新状态 this.reloadStatus = function (nodeId) { let that = this @@ -44,10 +45,50 @@ Tea.context(function () { } let installStatus = this.installStatus || {} - let errorCode = installStatus.errorCode || "" - if (errorCode.length > 0) { + let errMsg = installStatus.error || "" + + if (installStatus.errorCode != null && installStatus.errorCode.length > 0) { isInstalling = false - teaweb.warn("安装失败:" + (installStatus.error || "未知错误")) + } + + switch (installStatus.errorCode) { + case "EMPTY_LOGIN": + case "EMPTY_SSH_HOST": + case "EMPTY_SSH_PORT": + case "EMPTY_GRANT": + teaweb.warn("需要填写SSH登录信息", function () { + teaweb.popup("/httpdns/clusters/updateNodeSSH?nodeId=" + nodeId, { + height: "20em", + callback: function () { + that.install() + } + }) + }) + return + case "SSH_LOGIN_FAILED": + teaweb.warn("SSH登录失败,请检查设置", function () { + teaweb.popup("/httpdns/clusters/updateNodeSSH?nodeId=" + nodeId, { + height: "20em", + callback: function () { + that.install() + } + }) + }) + return + case "CREATE_ROOT_DIRECTORY_FAILED": + teaweb.warn("创建根目录失败,请检查目录权限或者手工创建:" + errMsg) + return + case "INSTALL_HELPER_FAILED": + teaweb.warn("安装助手失败:" + errMsg) + return + case "TEST_FAILED": + teaweb.warn("环境测试失败:" + errMsg) + return + case "RPC_TEST_FAILED": + teaweb.confirm("html:要安装的节点到API服务之间的RPC通讯测试失败,具体错误:" + errMsg + ",
现在修改API信息?", function () { + window.location = "/settings/api" + }) + return } }) .done(function () { @@ -59,7 +100,7 @@ Tea.context(function () { this.showSSHPopup = function (nodeId) { teaweb.popup("/httpdns/clusters/updateNodeSSH?nodeId=" + nodeId, { - height: "30em", + height: "20em", callback: function () { teaweb.success("保存成功", function () { teaweb.reload() diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/update.html b/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/update.html index 6fd282c..4f3cc14 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/update.html +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/cluster/node/update.html @@ -4,8 +4,8 @@

修改节点

- + diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/clusterSettings.html b/EdgeAdmin/web/views/@default/httpdns/clusters/clusterSettings.html index a70afec..8389623 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/clusterSettings.html +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/clusterSettings.html @@ -65,40 +65,12 @@ - - - -
节点名称 *启用当前集群
- +

取消启用后,该集群不会参与 HTTPDNS 服务。

默认集群 -
- - -
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -

同一时刻最多 1 个默认集群角色,新设置会自动取消旧设置。

-
diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/clusterSettings.js b/EdgeAdmin/web/views/@default/httpdns/clusters/clusterSettings.js index e932192..a487d0e 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/clusterSettings.js +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/clusterSettings.js @@ -1,4 +1,4 @@ -Tea.context(function () { +Tea.context(function () { this.success = NotifyReloadSuccess("保存成功") this.activeSection = this.activeSection || "basic" @@ -7,39 +7,4 @@ if (!this.settings) { this.settings = {} } - - // 兼容旧字段,转换成统一“默认集群 + 角色”表现 - let isDefaultPrimary = !!this.settings.isDefaultCluster - let isDefaultBackup = !!this.settings.isDefaultBackupCluster - this.settings.defaultClusterEnabled = isDefaultPrimary || isDefaultBackup - this.settings.defaultClusterRole = isDefaultBackup ? "backup" : "primary" - - this.syncDefaultCluster = function () { - if (!this.settings.isOn) { - this.settings.defaultClusterEnabled = false - this.settings.defaultClusterRole = "primary" - this.settings.isDefaultCluster = false - this.settings.isDefaultBackupCluster = false - return - } - this.syncDefaultClusterSelection() - } - - this.syncDefaultClusterSelection = function () { - if (!this.settings.defaultClusterEnabled) { - this.settings.isDefaultCluster = false - this.settings.isDefaultBackupCluster = false - return - } - - if (this.settings.defaultClusterRole === "backup") { - this.settings.isDefaultCluster = false - this.settings.isDefaultBackupCluster = true - } else { - this.settings.defaultClusterRole = "primary" - this.settings.isDefaultCluster = true - this.settings.isDefaultBackupCluster = false - } - } - }) diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/create.html b/EdgeAdmin/web/views/@default/httpdns/clusters/create.html index c8a88d1..7b4872d 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/create.html +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/create.html @@ -24,7 +24,7 @@ - - - -
默认解析 TTL
- +

SDK 通过 HTTPDNS 解析域名时返回的默认 TTL。

@@ -51,38 +51,12 @@
启用当前集群
- +
默认集群 -
- - -
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
+ \ No newline at end of file diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/create.js b/EdgeAdmin/web/views/@default/httpdns/clusters/create.js index 4b6cb0c..0918023 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/create.js +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/create.js @@ -1,14 +1,5 @@ -Tea.context(function () { +Tea.context(function () { this.isOn = true - this.defaultClusterEnabled = false - this.defaultClusterRole = "primary" - - this.syncDefaultClusterEnabled = function () { - if (!this.isOn) { - this.defaultClusterEnabled = false - this.defaultClusterRole = "primary" - } - } this.success = function (resp) { let clusterId = 0 diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/index.html b/EdgeAdmin/web/views/@default/httpdns/clusters/index.html index 0af0f68..88163a3 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/index.html +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/index.html @@ -28,7 +28,7 @@ 集群名称 - 服务域名 + API服务地址 节点数 在线节点数 状态 @@ -43,7 +43,7 @@ - {{cluster.gatewayDomain}} + {{cluster.apiAddress}} @@ -67,5 +67,4 @@
- - + \ No newline at end of file diff --git a/EdgeAdmin/web/views/@default/httpdns/clusters/updateNodeSSH.html b/EdgeAdmin/web/views/@default/httpdns/clusters/updateNodeSSH.html index 0962887..b95ec99 100644 --- a/EdgeAdmin/web/views/@default/httpdns/clusters/updateNodeSSH.html +++ b/EdgeAdmin/web/views/@default/httpdns/clusters/updateNodeSSH.html @@ -3,7 +3,6 @@

修改节点"{{node.name}}"的SSH登录信息

- diff --git a/EdgeAdmin/web/views/@default/httpdns/guide/@menu.html b/EdgeAdmin/web/views/@default/httpdns/guide/@menu.html deleted file mode 100644 index 2d8439a..0000000 --- a/EdgeAdmin/web/views/@default/httpdns/guide/@menu.html +++ /dev/null @@ -1,4 +0,0 @@ - - - SDK接入向导 - diff --git a/EdgeAdmin/web/views/@default/httpdns/guide/index.html b/EdgeAdmin/web/views/@default/httpdns/guide/index.html deleted file mode 100644 index 74c8d82..0000000 --- a/EdgeAdmin/web/views/@default/httpdns/guide/index.html +++ /dev/null @@ -1,146 +0,0 @@ -{$layout} -{$template "menu"} - - - -
-
-
-
- -
-
- -
-
-
- -
- -

璇峰厛閫夋嫨搴旂敤锛岀劧鍚庢煡鐪嬮厤缃苟瀹屾垚 SDK 鎺ュ叆銆?/p> -

- -
-
- - - - - - - - - - - - - - - - - - - - -
App ID - {{selectedApp.appId}} - -
搴旂敤鍚嶇О{{selectedApp.name}}
闆嗙兢鏈嶅姟鍦板潃 - {{selectedApp.gatewayDomainDisplay}} - -

宸插惎鐢ㄤ富澶囷細绗竴涓负涓婚泦缇わ紝鍚庣画涓哄闆嗙兢銆?/p> -

鍔犵 Secret - {{signSecretVisible ? selectedApp.signSecret : selectedApp.signSecretMasked}} - - -
璇锋眰楠岀 - 宸插紑鍚?/span> - 宸插叧闂?/span> -
- - 涓嬩竴姝? - - - -
-

寮€鍙戞帴鍏?/h4> -

閫夋嫨瀵瑰簲骞冲彴 SDK 涓嬭浇骞舵煡闃呴泦鎴愭枃妗c€?/p> - -

-
-
-
Android SDK
-
- 閫傜敤浜?Android 5.0+ 鐨勫師鐢?SDK锛屾敮鎸?Java / Kotlin銆?
-
- -
-
-
-
iOS SDK
-
- 閫傜敤浜?iOS 12+ 鐨勫師鐢?SDK锛屾敮鎸?Swift / Objective-C銆?
-
- -
-
-
-
Flutter SDK
-
- 璺ㄥ钩鍙?Flutter 鎻掍欢锛屽悓鏃舵敮鎸?Android 鍜?iOS銆?
-
- -
-
-

- - - diff --git a/EdgeAdmin/web/views/@default/httpdns/guide/index.js b/EdgeAdmin/web/views/@default/httpdns/guide/index.js deleted file mode 100644 index e1fe07a..0000000 --- a/EdgeAdmin/web/views/@default/httpdns/guide/index.js +++ /dev/null @@ -1,76 +0,0 @@ -Tea.context(function () { - this.selectedAppId = "" - this.selectedApp = {} - this.currentStep = 1 - this.signSecretVisible = false - - if (typeof this.apps == "undefined") { - this.apps = [] - } - - this.onAppChange = function () { - if (this.selectedAppId.length == 0) { - this.selectedApp = {} - return - } - - for (var i = 0; i < this.apps.length; i++) { - if (this.apps[i].appId == this.selectedAppId) { - this.selectedApp = this.apps[i] - break - } - } - if (!this.selectedApp.gatewayDomain || this.selectedApp.gatewayDomain.length == 0) { - this.selectedApp.gatewayDomain = "gw.httpdns.example.com" - } - if (!this.selectedApp.gatewayDomainDisplay || this.selectedApp.gatewayDomainDisplay.length == 0) { - this.selectedApp.gatewayDomainDisplay = this.selectedApp.gatewayDomain - } - - this.signSecretVisible = false - this.currentStep = 1 - } - - this.copyText = function (text, name) { - if (typeof text != "string" || text.length == 0) { - teaweb.warn("没有可复制的内容") - return - } - - if (navigator.clipboard && navigator.clipboard.writeText) { - navigator.clipboard.writeText(text).then(function () { - teaweb.success(name + "已复制") - }).catch(function () { - this.copyByTextarea(text, name) - }.bind(this)) - return - } - - this.copyByTextarea(text, name) - } - - this.copyByTextarea = function (text, name) { - var input = document.createElement("textarea") - input.value = text - input.setAttribute("readonly", "readonly") - input.style.position = "fixed" - input.style.left = "-10000px" - input.style.top = "-10000px" - document.body.appendChild(input) - input.select() - - var ok = false - try { - ok = document.execCommand("copy") - } catch (e) { - ok = false - } - document.body.removeChild(input) - - if (ok) { - teaweb.success(name + "已复制") - } else { - teaweb.warn("复制失败,请手动复制") - } - } -}) diff --git a/EdgeAdmin/web/views/@default/httpdns/policies/@menu.html b/EdgeAdmin/web/views/@default/httpdns/policies/@menu.html deleted file mode 100644 index 36b7d32..0000000 --- a/EdgeAdmin/web/views/@default/httpdns/policies/@menu.html +++ /dev/null @@ -1,3 +0,0 @@ - - 全局策略 - diff --git a/EdgeAdmin/web/views/@default/httpdns/policies/index.html b/EdgeAdmin/web/views/@default/httpdns/policies/index.html deleted file mode 100644 index 18cd853..0000000 --- a/EdgeAdmin/web/views/@default/httpdns/policies/index.html +++ /dev/null @@ -1,114 +0,0 @@ -{$layout} -{$template "menu"} - - - -
- - - - -
- - -
- - - - - -
默认部署集群 - -

用户新建应用时默认落到此集群。

-
- - - - - - - - - - - - - - -
SNI 防护配置 - 隐匿 SNI -

当前统一采用隐匿 SNI 策略,避免在握手阶段暴露业务域名。

-
全局默认解析 TTL -
-
- -
-
-
-

建议 30~120 秒,兼顾缓存命中与切换速度。

-
全局降级超时 -
-
- -
毫秒
-
-
-

超时后可走降级解析流程,建议 200~800ms。

-
- - -
-
-
diff --git a/EdgeAdmin/web/views/@default/httpdns/policies/index.js b/EdgeAdmin/web/views/@default/httpdns/policies/index.js deleted file mode 100644 index adf91d0..0000000 --- a/EdgeAdmin/web/views/@default/httpdns/policies/index.js +++ /dev/null @@ -1,19 +0,0 @@ -Tea.context(function () { - this.success = NotifyReloadSuccess("保存成功"); - this.activeSection = "user"; - - if (!Array.isArray(this.availableClusters)) { - this.availableClusters = []; - } - if (!this.policies.defaultClusterId || this.policies.defaultClusterId <= 0) { - if (this.availableClusters.length > 0) { - this.policies.defaultClusterId = this.availableClusters[0].id; - } - } - if (typeof this.policies.defaultTTL == "undefined" || this.policies.defaultTTL <= 0) { - this.policies.defaultTTL = 30; - } - if (typeof this.policies.defaultFallbackMs == "undefined" || this.policies.defaultFallbackMs <= 0) { - this.policies.defaultFallbackMs = 300; - } -}); diff --git a/EdgeAdmin/web/views/@default/httpdns/sandbox/index.html b/EdgeAdmin/web/views/@default/httpdns/sandbox/index.html index 09b16b9..fc0e481 100644 --- a/EdgeAdmin/web/views/@default/httpdns/sandbox/index.html +++ b/EdgeAdmin/web/views/@default/httpdns/sandbox/index.html @@ -17,10 +17,10 @@
- +
diff --git a/EdgeAdmin/web/views/@default/httpdns/sandbox/index.js b/EdgeAdmin/web/views/@default/httpdns/sandbox/index.js index 0e1ed8a..f7c6bcf 100644 --- a/EdgeAdmin/web/views/@default/httpdns/sandbox/index.js +++ b/EdgeAdmin/web/views/@default/httpdns/sandbox/index.js @@ -58,8 +58,7 @@ Tea.context(function () { this.request.domain = "" } - let primaryClusterId = (typeof selectedApp.primaryClusterId !== "undefined" && selectedApp.primaryClusterId !== null) ? Number(selectedApp.primaryClusterId) : 0 - let backupClusterId = (typeof selectedApp.backupClusterId !== "undefined" && selectedApp.backupClusterId !== null) ? Number(selectedApp.backupClusterId) : 0 + let appClusterIds = Array.isArray(selectedApp.clusterIds) ? selectedApp.clusterIds.map(Number) : [] let allowed = [] for (let i = 0; i < this.clusters.length; i++) { @@ -68,7 +67,7 @@ Tea.context(function () { if (clusterId <= 0) { continue } - if (clusterId === primaryClusterId || clusterId === backupClusterId) { + if (appClusterIds.indexOf(clusterId) >= 0) { allowed.push(cluster) } } @@ -120,7 +119,7 @@ Tea.context(function () { return } if (this.request.clusterId.length === 0) { - teaweb.warn("当前应用未绑定可用集群,请先在应用设置中配置主集群/备集群") + teaweb.warn("当前应用未绑定可用集群,请先在应用设置中配置所属集群") return } if (this.request.domain.length === 0) { diff --git a/EdgeAdmin/web/views/@default/users/createPopup.html b/EdgeAdmin/web/views/@default/users/createPopup.html index 77c5d3c..92ed641 100644 --- a/EdgeAdmin/web/views/@default/users/createPopup.html +++ b/EdgeAdmin/web/views/@default/users/createPopup.html @@ -3,41 +3,51 @@

创建用户

- - + +
- + + + + + @@ -83,6 +93,6 @@ -
用户名 * - +

用户名只能是英文、数字、下划线的组合。

密码 * - +
确认密码 * - +
全名 * - +

用户姓名或者公司名称等等。

关联集群 *CDN关联集群 *

用户发布的网站会自动部署到此集群。

HTTPDNS关联集群 + +

用户发布的 HTTPDNS 应用会自动关联到此集群。

+
开通功能 @@ -54,19 +64,19 @@
手机号 - +
联系电话 - +
电子邮箱 - +
- + +
\ No newline at end of file diff --git a/EdgeAdmin/web/views/@default/users/setting/index.html b/EdgeAdmin/web/views/@default/users/setting/index.html index ec150b8..ea41281 100644 --- a/EdgeAdmin/web/views/@default/users/setting/index.html +++ b/EdgeAdmin/web/views/@default/users/setting/index.html @@ -43,7 +43,9 @@ 检查客户端区域 -

选中后,表示每次用户访问时都检查客户端所在地理区域是否和登录时一致,以提升安全性;如果当前系统下游有反向代理设置,请在[用户界面设置]中设置“自定义客户端IP报头”选项。

+

选中后,表示每次用户访问时都检查客户端所在地理区域是否和登录时一致,以提升安全性;如果当前系统下游有反向代理设置,请在[用户界面设置]中设置“自定义客户端IP报头”选项。 +

@@ -54,14 +56,16 @@ 启用电子邮箱绑定功能 -

选中后,电子邮箱需要激活之后可以使用邮箱登录、找回密码等。此功能需要事先设置 [激活邮件设置]

+

选中后,电子邮箱需要激活之后可以使用邮箱登录、找回密码等。此功能需要事先设置 [激活邮件设置]

提示用户未绑定 - + +

选中后,将在页面上提示用户尚未绑定电子邮箱.

@@ -73,20 +77,25 @@ - + + 激活邮件标题 - -

其中${product.name}为当前设置的产品名称

+ +

其中${product.name}为当前设置的产品名称

激活邮件内容 -

可以使用简单的HTML,其中${product.name}为当前设置的产品名称${url.verify}为生成的激活地址,${url.home}为用户平台主页地址,由用户节点访问地址组合而成。

+

可以使用简单的HTML,其中${product.name}为当前设置的产品名称${url.verify}为生成的激活地址,${url.home}为用户平台主页地址,由用户节点访问地址组合而成。

@@ -106,20 +115,27 @@ - + 找回密码邮件标题 - -

其中${product.name}为当前设置的产品名称

+ +

其中${product.name}为当前设置的产品名称

找回密码邮件内容 - -

可以使用简单的HTML,其中${product.name}为当前设置的产品名称${code}为找回密码时用到的验证码,${url.home}为用户平台主页地址,由用户节点访问地址组合而成。

+ +

可以使用简单的HTML,其中${product.name}为当前设置的产品名称${code}为找回密码时用到的验证码,${url.home}为用户平台主页地址,由用户节点访问地址组合而成。

@@ -133,14 +149,16 @@ 启用手机号码绑定功能 -

选中后,手机号码需要激活之后可以使用手机号码、找回密码等。此功能需要事先设置 [激活短信设置]

+

选中后,手机号码需要激活之后可以使用手机号码、找回密码等。此功能需要事先设置 [激活短信设置]

提示用户未绑定 - + +

选中后,将在页面上提示用户尚未绑定手机号码.

@@ -159,12 +177,14 @@ - + 激活短信内容 - +

其中使用${code}表示验证码。

@@ -200,12 +220,14 @@
暂时还没有开通任何功能。
- 修改 + 修改
- {{feature.name}} + + {{feature.name}}

{{feature.description}}

@@ -233,7 +255,8 @@ - @@ -247,8 +270,9 @@
开通DDoS高防管理 + +

选中表示自动为用户开通DDoS高防IP使用服务。

-
开通智能DNS服务 -

选中表示自动为用户开通智能DNS服务。

+
+ +

选中表示自动为用户开通智能DNS服务。使用默认集群资源,如需使用其他集群,请到用户新增和业务设置页面中进行选择。

@@ -261,12 +285,23 @@ - + + + +
开通HTTPDNS服务 -

选中表示自动为用户开通HTTPDNS服务。

+
+ +

选中表示自动为用户开通HTTPDNS服务。使用默认集群资源,如需使用其他集群,请到用户新增和业务设置页面中进行选择。

+
默认分配集群 + +

用户新建 HTTPDNS 应用时默认分配的集群。

- + \ No newline at end of file diff --git a/EdgeAdmin/web/views/@default/users/update.html b/EdgeAdmin/web/views/@default/users/update.html index 61f4b8a..c28f825 100644 --- a/EdgeAdmin/web/views/@default/users/update.html +++ b/EdgeAdmin/web/views/@default/users/update.html @@ -39,12 +39,22 @@ - 关联集群 * + CDN关联集群 *

用户发布的网站会自动部署到此集群,修改此选项会同步修改当前用户下的所有网站,但不影响和套餐绑定的服务。

+ + HTTPDNS关联集群 + + +

用户新建 HTTPDNS 应用时默认分配的集群。

+ + diff --git a/EdgeAdmin/web/views/@default/users/user.html b/EdgeAdmin/web/views/@default/users/user.html index 51e28b8..03f06cd 100644 --- a/EdgeAdmin/web/views/@default/users/user.html +++ b/EdgeAdmin/web/views/@default/users/user.html @@ -9,12 +9,13 @@ 信息未审核   [审核]
已拒绝 -   [重新审核] +   [重新审核] -

拒绝原因:{{user.rejectReason}}

+

+ 拒绝原因:{{user.rejectReason}}

@@ -30,9 +31,18 @@ - 关联集群 + CDN关联集群 - {{user.cluster.name}} + {{user.cluster.name}} + 没有设置。 + + + + HTTPDNS关联集群 + + {{user.httpdnsCluster.name}} 没有设置。 @@ -106,8 +116,9 @@ 认证二维码 - qrcode -

[下载]   可以通过二维码快速添加OTP认证信息到认证App中。

+ qrcode +

[下载]   + 可以通过二维码快速添加OTP认证信息到认证App中。

diff --git a/EdgeCommon/pkg/rpc/pb/model_httpdns_app.pb.go b/EdgeCommon/pkg/rpc/pb/model_httpdns_app.pb.go index 4adbe96..36c43f1 100644 --- a/EdgeCommon/pkg/rpc/pb/model_httpdns_app.pb.go +++ b/EdgeCommon/pkg/rpc/pb/model_httpdns_app.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.36.11 // protoc v3.21.12 // source: models/model_httpdns_app.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,23 +22,21 @@ const ( ) type HTTPDNSApp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - AppId string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"` - IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` - PrimaryClusterId int64 `protobuf:"varint,5,opt,name=primaryClusterId,proto3" json:"primaryClusterId,omitempty"` - BackupClusterId int64 `protobuf:"varint,6,opt,name=backupClusterId,proto3" json:"backupClusterId,omitempty"` - SniMode string `protobuf:"bytes,7,opt,name=sniMode,proto3" json:"sniMode,omitempty"` - SignEnabled bool `protobuf:"varint,8,opt,name=signEnabled,proto3" json:"signEnabled,omitempty"` - SignSecret string `protobuf:"bytes,9,opt,name=signSecret,proto3" json:"signSecret,omitempty"` - SignUpdatedAt int64 `protobuf:"varint,10,opt,name=signUpdatedAt,proto3" json:"signUpdatedAt,omitempty"` - CreatedAt int64 `protobuf:"varint,11,opt,name=createdAt,proto3" json:"createdAt,omitempty"` - UpdatedAt int64 `protobuf:"varint,12,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` - UserId int64 `protobuf:"varint,13,opt,name=userId,proto3" json:"userId,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + AppId string `protobuf:"bytes,3,opt,name=appId,proto3" json:"appId,omitempty"` + IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` + SniMode string `protobuf:"bytes,7,opt,name=sniMode,proto3" json:"sniMode,omitempty"` + SignEnabled bool `protobuf:"varint,8,opt,name=signEnabled,proto3" json:"signEnabled,omitempty"` + SignSecret string `protobuf:"bytes,9,opt,name=signSecret,proto3" json:"signSecret,omitempty"` + SignUpdatedAt int64 `protobuf:"varint,10,opt,name=signUpdatedAt,proto3" json:"signUpdatedAt,omitempty"` + CreatedAt int64 `protobuf:"varint,11,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + UpdatedAt int64 `protobuf:"varint,12,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` + UserId int64 `protobuf:"varint,13,opt,name=userId,proto3" json:"userId,omitempty"` + ClusterIdsJSON []byte `protobuf:"bytes,14,opt,name=clusterIdsJSON,proto3" json:"clusterIdsJSON,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *HTTPDNSApp) Reset() { @@ -98,20 +97,6 @@ func (x *HTTPDNSApp) GetIsOn() bool { return false } -func (x *HTTPDNSApp) GetPrimaryClusterId() int64 { - if x != nil { - return x.PrimaryClusterId - } - return 0 -} - -func (x *HTTPDNSApp) GetBackupClusterId() int64 { - if x != nil { - return x.BackupClusterId - } - return 0 -} - func (x *HTTPDNSApp) GetSniMode() string { if x != nil { return x.SniMode @@ -161,48 +146,44 @@ func (x *HTTPDNSApp) GetUserId() int64 { return 0 } +func (x *HTTPDNSApp) GetClusterIdsJSON() []byte { + if x != nil { + return x.ClusterIdsJSON + } + return nil +} + var File_models_model_httpdns_app_proto protoreflect.FileDescriptor -var file_models_model_httpdns_app_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68, - 0x74, 0x74, 0x70, 0x64, 0x6e, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x02, 0x70, 0x62, 0x22, 0x86, 0x03, 0x0a, 0x0a, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, - 0x41, 0x70, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, - 0x6e, 0x12, 0x2a, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x70, 0x72, 0x69, - 0x6d, 0x61, 0x72, 0x79, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, - 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6e, 0x69, 0x4d, 0x6f, - 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x6e, 0x69, 0x4d, 0x6f, 0x64, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_models_model_httpdns_app_proto_rawDesc = "" + + "\n" + + "\x1emodels/model_httpdns_app.proto\x12\x02pb\"\xe4\x02\n" + + "\n" + + "HTTPDNSApp\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05appId\x18\x03 \x01(\tR\x05appId\x12\x12\n" + + "\x04isOn\x18\x04 \x01(\bR\x04isOn\x12\x18\n" + + "\asniMode\x18\a \x01(\tR\asniMode\x12 \n" + + "\vsignEnabled\x18\b \x01(\bR\vsignEnabled\x12\x1e\n" + + "\n" + + "signSecret\x18\t \x01(\tR\n" + + "signSecret\x12$\n" + + "\rsignUpdatedAt\x18\n" + + " \x01(\x03R\rsignUpdatedAt\x12\x1c\n" + + "\tcreatedAt\x18\v \x01(\x03R\tcreatedAt\x12\x1c\n" + + "\tupdatedAt\x18\f \x01(\x03R\tupdatedAt\x12\x16\n" + + "\x06userId\x18\r \x01(\x03R\x06userId\x12&\n" + + "\x0eclusterIdsJSON\x18\x0e \x01(\fR\x0eclusterIdsJSONJ\x04\b\x05\x10\x06J\x04\b\x06\x10\aB\x06Z\x04./pbb\x06proto3" var ( file_models_model_httpdns_app_proto_rawDescOnce sync.Once - file_models_model_httpdns_app_proto_rawDescData = file_models_model_httpdns_app_proto_rawDesc + file_models_model_httpdns_app_proto_rawDescData []byte ) func file_models_model_httpdns_app_proto_rawDescGZIP() []byte { file_models_model_httpdns_app_proto_rawDescOnce.Do(func() { - file_models_model_httpdns_app_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_httpdns_app_proto_rawDescData) + file_models_model_httpdns_app_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_models_model_httpdns_app_proto_rawDesc), len(file_models_model_httpdns_app_proto_rawDesc))) }) return file_models_model_httpdns_app_proto_rawDescData } @@ -228,7 +209,7 @@ func file_models_model_httpdns_app_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_models_model_httpdns_app_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_models_model_httpdns_app_proto_rawDesc), len(file_models_model_httpdns_app_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -239,7 +220,6 @@ func file_models_model_httpdns_app_proto_init() { MessageInfos: file_models_model_httpdns_app_proto_msgTypes, }.Build() File_models_model_httpdns_app_proto = out.File - file_models_model_httpdns_app_proto_rawDesc = nil file_models_model_httpdns_app_proto_goTypes = nil file_models_model_httpdns_app_proto_depIdxs = nil } diff --git a/EdgeCommon/pkg/rpc/pb/model_httpdns_node.pb.go b/EdgeCommon/pkg/rpc/pb/model_httpdns_node.pb.go index b2f84e2..204d8bd 100644 --- a/EdgeCommon/pkg/rpc/pb/model_httpdns_node.pb.go +++ b/EdgeCommon/pkg/rpc/pb/model_httpdns_node.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.36.11 // protoc v3.21.12 // source: models/model_httpdns_node.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,24 +22,24 @@ const ( ) type HTTPDNSNode struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - ClusterId int64 `protobuf:"varint,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` - IsUp bool `protobuf:"varint,5,opt,name=isUp,proto3" json:"isUp,omitempty"` - IsInstalled bool `protobuf:"varint,6,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"` - IsActive bool `protobuf:"varint,7,opt,name=isActive,proto3" json:"isActive,omitempty"` - UniqueId string `protobuf:"bytes,8,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"` - Secret string `protobuf:"bytes,9,opt,name=secret,proto3" json:"secret,omitempty"` - InstallDir string `protobuf:"bytes,10,opt,name=installDir,proto3" json:"installDir,omitempty"` - StatusJSON []byte `protobuf:"bytes,11,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"` - InstallStatusJSON []byte `protobuf:"bytes,12,opt,name=installStatusJSON,proto3" json:"installStatusJSON,omitempty"` - CreatedAt int64 `protobuf:"varint,13,opt,name=createdAt,proto3" json:"createdAt,omitempty"` - UpdatedAt int64 `protobuf:"varint,14,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ClusterId int64 `protobuf:"varint,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` + IsUp bool `protobuf:"varint,5,opt,name=isUp,proto3" json:"isUp,omitempty"` + IsInstalled bool `protobuf:"varint,6,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"` + IsActive bool `protobuf:"varint,7,opt,name=isActive,proto3" json:"isActive,omitempty"` + UniqueId string `protobuf:"bytes,8,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"` + Secret string `protobuf:"bytes,9,opt,name=secret,proto3" json:"secret,omitempty"` + InstallDir string `protobuf:"bytes,10,opt,name=installDir,proto3" json:"installDir,omitempty"` + StatusJSON []byte `protobuf:"bytes,11,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"` + InstallStatusJSON []byte `protobuf:"bytes,12,opt,name=installStatusJSON,proto3" json:"installStatusJSON,omitempty"` + CreatedAt int64 `protobuf:"varint,13,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + UpdatedAt int64 `protobuf:"varint,14,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` + NodeLogin *NodeLogin `protobuf:"bytes,15,opt,name=nodeLogin,proto3" json:"nodeLogin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *HTTPDNSNode) Reset() { @@ -169,48 +170,48 @@ func (x *HTTPDNSNode) GetUpdatedAt() int64 { return 0 } +func (x *HTTPDNSNode) GetNodeLogin() *NodeLogin { + if x != nil { + return x.NodeLogin + } + return nil +} + var File_models_model_httpdns_node_proto protoreflect.FileDescriptor -var file_models_model_httpdns_node_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68, - 0x74, 0x74, 0x70, 0x64, 0x6e, 0x73, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x93, 0x03, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, - 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, - 0x73, 0x55, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x55, 0x70, 0x12, - 0x20, 0x0a, 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1a, 0x0a, - 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, - 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, - 0x4e, 0x12, 0x2c, 0x0a, 0x11, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, - 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_models_model_httpdns_node_proto_rawDesc = "" + + "\n" + + "\x1fmodels/model_httpdns_node.proto\x12\x02pb\x1a\x1dmodels/model_node_login.proto\"\xc0\x03\n" + + "\vHTTPDNSNode\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1c\n" + + "\tclusterId\x18\x02 \x01(\x03R\tclusterId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + + "\x04isOn\x18\x04 \x01(\bR\x04isOn\x12\x12\n" + + "\x04isUp\x18\x05 \x01(\bR\x04isUp\x12 \n" + + "\visInstalled\x18\x06 \x01(\bR\visInstalled\x12\x1a\n" + + "\bisActive\x18\a \x01(\bR\bisActive\x12\x1a\n" + + "\buniqueId\x18\b \x01(\tR\buniqueId\x12\x16\n" + + "\x06secret\x18\t \x01(\tR\x06secret\x12\x1e\n" + + "\n" + + "installDir\x18\n" + + " \x01(\tR\n" + + "installDir\x12\x1e\n" + + "\n" + + "statusJSON\x18\v \x01(\fR\n" + + "statusJSON\x12,\n" + + "\x11installStatusJSON\x18\f \x01(\fR\x11installStatusJSON\x12\x1c\n" + + "\tcreatedAt\x18\r \x01(\x03R\tcreatedAt\x12\x1c\n" + + "\tupdatedAt\x18\x0e \x01(\x03R\tupdatedAt\x12+\n" + + "\tnodeLogin\x18\x0f \x01(\v2\r.pb.NodeLoginR\tnodeLoginB\x06Z\x04./pbb\x06proto3" var ( file_models_model_httpdns_node_proto_rawDescOnce sync.Once - file_models_model_httpdns_node_proto_rawDescData = file_models_model_httpdns_node_proto_rawDesc + file_models_model_httpdns_node_proto_rawDescData []byte ) func file_models_model_httpdns_node_proto_rawDescGZIP() []byte { file_models_model_httpdns_node_proto_rawDescOnce.Do(func() { - file_models_model_httpdns_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_httpdns_node_proto_rawDescData) + file_models_model_httpdns_node_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_models_model_httpdns_node_proto_rawDesc), len(file_models_model_httpdns_node_proto_rawDesc))) }) return file_models_model_httpdns_node_proto_rawDescData } @@ -218,13 +219,15 @@ func file_models_model_httpdns_node_proto_rawDescGZIP() []byte { var file_models_model_httpdns_node_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_models_model_httpdns_node_proto_goTypes = []any{ (*HTTPDNSNode)(nil), // 0: pb.HTTPDNSNode + (*NodeLogin)(nil), // 1: pb.NodeLogin } var file_models_model_httpdns_node_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 1, // 0: pb.HTTPDNSNode.nodeLogin:type_name -> pb.NodeLogin + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_models_model_httpdns_node_proto_init() } @@ -232,11 +235,12 @@ func file_models_model_httpdns_node_proto_init() { if File_models_model_httpdns_node_proto != nil { return } + file_models_model_node_login_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_models_model_httpdns_node_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_models_model_httpdns_node_proto_rawDesc), len(file_models_model_httpdns_node_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -247,7 +251,6 @@ func file_models_model_httpdns_node_proto_init() { MessageInfos: file_models_model_httpdns_node_proto_msgTypes, }.Build() File_models_model_httpdns_node_proto = out.File - file_models_model_httpdns_node_proto_rawDesc = nil file_models_model_httpdns_node_proto_goTypes = nil file_models_model_httpdns_node_proto_depIdxs = nil } diff --git a/EdgeCommon/pkg/rpc/pb/model_user.pb.go b/EdgeCommon/pkg/rpc/pb/model_user.pb.go index c2f9bb3..8724012 100644 --- a/EdgeCommon/pkg/rpc/pb/model_user.pb.go +++ b/EdgeCommon/pkg/rpc/pb/model_user.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 -// protoc v6.33.2 +// protoc-gen-go v1.36.11 +// protoc v3.21.12 // source: models/model_user.proto package pb @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -42,6 +43,7 @@ type User struct { IsEnterpriseIdentified bool `protobuf:"varint,18,opt,name=isEnterpriseIdentified,proto3" json:"isEnterpriseIdentified,omitempty"` // 是否已通过企业验证 BandwidthAlgo string `protobuf:"bytes,21,opt,name=bandwidthAlgo,proto3" json:"bandwidthAlgo,omitempty"` // 带宽算法 Lang string `protobuf:"bytes,22,opt,name=lang,proto3" json:"lang,omitempty"` // 语言代号 + HttpdnsClusterIdsJSON []byte `protobuf:"bytes,24,opt,name=httpdnsClusterIdsJSON,proto3" json:"httpdnsClusterIdsJSON,omitempty"` // HTTPDNS关联集群ID列表 OtpLogin *Login `protobuf:"bytes,19,opt,name=otpLogin,proto3" json:"otpLogin,omitempty"` // OTP认证 NodeCluster *NodeCluster `protobuf:"bytes,10,opt,name=nodeCluster,proto3" json:"nodeCluster,omitempty"` // 集群信息 Features []*UserFeature `protobuf:"bytes,11,rep,name=features,proto3" json:"features,omitempty"` // 开通功能 @@ -219,6 +221,13 @@ func (x *User) GetLang() string { return "" } +func (x *User) GetHttpdnsClusterIdsJSON() []byte { + if x != nil { + return x.HttpdnsClusterIdsJSON + } + return nil +} + func (x *User) GetOtpLogin() *Login { if x != nil { return x.OtpLogin @@ -242,74 +251,48 @@ func (x *User) GetFeatures() []*UserFeature { var File_models_model_user_proto protoreflect.FileDescriptor -var file_models_model_user_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x75, - 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, - 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6c, 0x6f, - 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x05, 0x0a, 0x04, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, - 0x62, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, - 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x74, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x14, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, - 0x12, 0x26, 0x0a, 0x0e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4d, 0x6f, 0x62, 0x69, - 0x6c, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, - 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, - 0x49, 0x50, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x65, 0x64, 0x49, 0x50, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x56, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x6a, 0x65, - 0x63, 0x74, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, - 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, - 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x16, 0x69, 0x73, 0x49, 0x6e, - 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x69, 0x73, 0x49, 0x6e, 0x64, 0x69, - 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x12, 0x36, 0x0a, 0x16, 0x69, 0x73, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x16, 0x69, 0x73, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x61, 0x6e, 0x64, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x41, 0x6c, 0x67, 0x6f, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x41, 0x6c, 0x67, 0x6f, 0x12, 0x12, - 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, - 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x08, 0x6f, 0x74, 0x70, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x13, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, - 0x08, 0x6f, 0x74, 0x70, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, - 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x08, - 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, - 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_models_model_user_proto_rawDesc = "" + + "\n" + + "\x17models/model_user.proto\x12\x02pb\x1a\x1fmodels/model_node_cluster.proto\x1a\x1fmodels/model_user_feature.proto\x1a\x18models/model_login.proto\"\xb3\x06\n" + + "\x04User\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x1a\n" + + "\bfullname\x18\x03 \x01(\tR\bfullname\x12\x16\n" + + "\x06mobile\x18\x04 \x01(\tR\x06mobile\x12\x10\n" + + "\x03tel\x18\x05 \x01(\tR\x03tel\x12\x14\n" + + "\x05email\x18\x06 \x01(\tR\x05email\x12$\n" + + "\rverifiedEmail\x18\x14 \x01(\tR\rverifiedEmail\x12&\n" + + "\x0everifiedMobile\x18\x17 \x01(\tR\x0everifiedMobile\x12\x16\n" + + "\x06remark\x18\a \x01(\tR\x06remark\x12\x12\n" + + "\x04isOn\x18\b \x01(\bR\x04isOn\x12\x1c\n" + + "\tcreatedAt\x18\t \x01(\x03R\tcreatedAt\x12\"\n" + + "\fregisteredIP\x18\f \x01(\tR\fregisteredIP\x12\x1e\n" + + "\n" + + "isVerified\x18\r \x01(\bR\n" + + "isVerified\x12\x1e\n" + + "\n" + + "isRejected\x18\x0e \x01(\bR\n" + + "isRejected\x12\"\n" + + "\frejectReason\x18\x0f \x01(\tR\frejectReason\x12\x1c\n" + + "\tisDeleted\x18\x10 \x01(\bR\tisDeleted\x126\n" + + "\x16isIndividualIdentified\x18\x11 \x01(\bR\x16isIndividualIdentified\x126\n" + + "\x16isEnterpriseIdentified\x18\x12 \x01(\bR\x16isEnterpriseIdentified\x12$\n" + + "\rbandwidthAlgo\x18\x15 \x01(\tR\rbandwidthAlgo\x12\x12\n" + + "\x04lang\x18\x16 \x01(\tR\x04lang\x124\n" + + "\x15httpdnsClusterIdsJSON\x18\x18 \x01(\fR\x15httpdnsClusterIdsJSON\x12%\n" + + "\botpLogin\x18\x13 \x01(\v2\t.pb.LoginR\botpLogin\x121\n" + + "\vnodeCluster\x18\n" + + " \x01(\v2\x0f.pb.NodeClusterR\vnodeCluster\x12+\n" + + "\bfeatures\x18\v \x03(\v2\x0f.pb.UserFeatureR\bfeaturesB\x06Z\x04./pbb\x06proto3" var ( file_models_model_user_proto_rawDescOnce sync.Once - file_models_model_user_proto_rawDescData = file_models_model_user_proto_rawDesc + file_models_model_user_proto_rawDescData []byte ) func file_models_model_user_proto_rawDescGZIP() []byte { file_models_model_user_proto_rawDescOnce.Do(func() { - file_models_model_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_user_proto_rawDescData) + file_models_model_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_models_model_user_proto_rawDesc), len(file_models_model_user_proto_rawDesc))) }) return file_models_model_user_proto_rawDescData } @@ -344,7 +327,7 @@ func file_models_model_user_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_models_model_user_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_models_model_user_proto_rawDesc), len(file_models_model_user_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, @@ -355,7 +338,6 @@ func file_models_model_user_proto_init() { MessageInfos: file_models_model_user_proto_msgTypes, }.Build() File_models_model_user_proto = out.File - file_models_model_user_proto_rawDesc = nil file_models_model_user_proto_goTypes = nil file_models_model_user_proto_depIdxs = nil } diff --git a/EdgeCommon/pkg/rpc/pb/service_httpdns_app.pb.go b/EdgeCommon/pkg/rpc/pb/service_httpdns_app.pb.go index f4a34fd..45cfd7d 100644 --- a/EdgeCommon/pkg/rpc/pb/service_httpdns_app.pb.go +++ b/EdgeCommon/pkg/rpc/pb/service_httpdns_app.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.36.11 // protoc v3.21.12 // source: service_httpdns_app.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,17 +22,15 @@ const ( ) type CreateHTTPDNSAppRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - AppId string `protobuf:"bytes,2,opt,name=appId,proto3" json:"appId,omitempty"` - PrimaryClusterId int64 `protobuf:"varint,3,opt,name=primaryClusterId,proto3" json:"primaryClusterId,omitempty"` - BackupClusterId int64 `protobuf:"varint,4,opt,name=backupClusterId,proto3" json:"backupClusterId,omitempty"` - IsOn bool `protobuf:"varint,5,opt,name=isOn,proto3" json:"isOn,omitempty"` - SignEnabled bool `protobuf:"varint,6,opt,name=signEnabled,proto3" json:"signEnabled,omitempty"` - UserId int64 `protobuf:"varint,7,opt,name=userId,proto3" json:"userId,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + AppId string `protobuf:"bytes,2,opt,name=appId,proto3" json:"appId,omitempty"` + IsOn bool `protobuf:"varint,5,opt,name=isOn,proto3" json:"isOn,omitempty"` + SignEnabled bool `protobuf:"varint,6,opt,name=signEnabled,proto3" json:"signEnabled,omitempty"` + UserId int64 `protobuf:"varint,7,opt,name=userId,proto3" json:"userId,omitempty"` + ClusterIdsJSON []byte `protobuf:"bytes,8,opt,name=clusterIdsJSON,proto3" json:"clusterIdsJSON,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateHTTPDNSAppRequest) Reset() { @@ -78,20 +77,6 @@ func (x *CreateHTTPDNSAppRequest) GetAppId() string { return "" } -func (x *CreateHTTPDNSAppRequest) GetPrimaryClusterId() int64 { - if x != nil { - return x.PrimaryClusterId - } - return 0 -} - -func (x *CreateHTTPDNSAppRequest) GetBackupClusterId() int64 { - if x != nil { - return x.BackupClusterId - } - return 0 -} - func (x *CreateHTTPDNSAppRequest) GetIsOn() bool { if x != nil { return x.IsOn @@ -113,12 +98,18 @@ func (x *CreateHTTPDNSAppRequest) GetUserId() int64 { return 0 } -type CreateHTTPDNSAppResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func (x *CreateHTTPDNSAppRequest) GetClusterIdsJSON() []byte { + if x != nil { + return x.ClusterIdsJSON + } + return nil +} - AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` +type CreateHTTPDNSAppResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *CreateHTTPDNSAppResponse) Reset() { @@ -159,16 +150,14 @@ func (x *CreateHTTPDNSAppResponse) GetAppDbId() int64 { } type UpdateHTTPDNSAppRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - PrimaryClusterId int64 `protobuf:"varint,3,opt,name=primaryClusterId,proto3" json:"primaryClusterId,omitempty"` - BackupClusterId int64 `protobuf:"varint,4,opt,name=backupClusterId,proto3" json:"backupClusterId,omitempty"` - IsOn bool `protobuf:"varint,5,opt,name=isOn,proto3" json:"isOn,omitempty"` - UserId int64 `protobuf:"varint,6,opt,name=userId,proto3" json:"userId,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + IsOn bool `protobuf:"varint,5,opt,name=isOn,proto3" json:"isOn,omitempty"` + UserId int64 `protobuf:"varint,6,opt,name=userId,proto3" json:"userId,omitempty"` + ClusterIdsJSON []byte `protobuf:"bytes,7,opt,name=clusterIdsJSON,proto3" json:"clusterIdsJSON,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateHTTPDNSAppRequest) Reset() { @@ -215,20 +204,6 @@ func (x *UpdateHTTPDNSAppRequest) GetName() string { return "" } -func (x *UpdateHTTPDNSAppRequest) GetPrimaryClusterId() int64 { - if x != nil { - return x.PrimaryClusterId - } - return 0 -} - -func (x *UpdateHTTPDNSAppRequest) GetBackupClusterId() int64 { - if x != nil { - return x.BackupClusterId - } - return 0 -} - func (x *UpdateHTTPDNSAppRequest) GetIsOn() bool { if x != nil { return x.IsOn @@ -243,12 +218,18 @@ func (x *UpdateHTTPDNSAppRequest) GetUserId() int64 { return 0 } -type DeleteHTTPDNSAppRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +func (x *UpdateHTTPDNSAppRequest) GetClusterIdsJSON() []byte { + if x != nil { + return x.ClusterIdsJSON + } + return nil +} - AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` +type DeleteHTTPDNSAppRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DeleteHTTPDNSAppRequest) Reset() { @@ -289,11 +270,10 @@ func (x *DeleteHTTPDNSAppRequest) GetAppDbId() int64 { } type FindHTTPDNSAppRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` unknownFields protoimpl.UnknownFields - - AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FindHTTPDNSAppRequest) Reset() { @@ -334,11 +314,10 @@ func (x *FindHTTPDNSAppRequest) GetAppDbId() int64 { } type FindHTTPDNSAppResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + App *HTTPDNSApp `protobuf:"bytes,1,opt,name=app,proto3" json:"app,omitempty"` unknownFields protoimpl.UnknownFields - - App *HTTPDNSApp `protobuf:"bytes,1,opt,name=app,proto3" json:"app,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FindHTTPDNSAppResponse) Reset() { @@ -379,13 +358,12 @@ func (x *FindHTTPDNSAppResponse) GetApp() *HTTPDNSApp { } type ListHTTPDNSAppsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"` unknownFields protoimpl.UnknownFields - - Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListHTTPDNSAppsRequest) Reset() { @@ -440,11 +418,10 @@ func (x *ListHTTPDNSAppsRequest) GetKeyword() string { } type ListHTTPDNSAppsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Apps []*HTTPDNSApp `protobuf:"bytes,1,rep,name=apps,proto3" json:"apps,omitempty"` unknownFields protoimpl.UnknownFields - - Apps []*HTTPDNSApp `protobuf:"bytes,1,rep,name=apps,proto3" json:"apps,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListHTTPDNSAppsResponse) Reset() { @@ -485,9 +462,9 @@ func (x *ListHTTPDNSAppsResponse) GetApps() []*HTTPDNSApp { } type FindAllHTTPDNSAppsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FindAllHTTPDNSAppsRequest) Reset() { @@ -521,11 +498,10 @@ func (*FindAllHTTPDNSAppsRequest) Descriptor() ([]byte, []int) { } type FindAllHTTPDNSAppsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Apps []*HTTPDNSApp `protobuf:"bytes,1,rep,name=apps,proto3" json:"apps,omitempty"` unknownFields protoimpl.UnknownFields - - Apps []*HTTPDNSApp `protobuf:"bytes,1,rep,name=apps,proto3" json:"apps,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FindAllHTTPDNSAppsResponse) Reset() { @@ -566,12 +542,11 @@ func (x *FindAllHTTPDNSAppsResponse) GetApps() []*HTTPDNSApp { } type UpdateHTTPDNSAppSignEnabledRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` + SignEnabled bool `protobuf:"varint,2,opt,name=signEnabled,proto3" json:"signEnabled,omitempty"` unknownFields protoimpl.UnknownFields - - AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` - SignEnabled bool `protobuf:"varint,2,opt,name=signEnabled,proto3" json:"signEnabled,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UpdateHTTPDNSAppSignEnabledRequest) Reset() { @@ -619,11 +594,10 @@ func (x *UpdateHTTPDNSAppSignEnabledRequest) GetSignEnabled() bool { } type ResetHTTPDNSAppSignSecretRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` unknownFields protoimpl.UnknownFields - - AppDbId int64 `protobuf:"varint,1,opt,name=appDbId,proto3" json:"appDbId,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ResetHTTPDNSAppSignSecretRequest) Reset() { @@ -664,12 +638,11 @@ func (x *ResetHTTPDNSAppSignSecretRequest) GetAppDbId() int64 { } type ResetHTTPDNSAppSignSecretResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + SignSecret string `protobuf:"bytes,1,opt,name=signSecret,proto3" json:"signSecret,omitempty"` + UpdatedAt int64 `protobuf:"varint,2,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` unknownFields protoimpl.UnknownFields - - SignSecret string `protobuf:"bytes,1,opt,name=signSecret,proto3" json:"signSecret,omitempty"` - UpdatedAt int64 `protobuf:"varint,2,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ResetHTTPDNSAppSignSecretResponse) Reset() { @@ -718,139 +691,67 @@ func (x *ResetHTTPDNSAppSignSecretResponse) GetUpdatedAt() int64 { var File_service_httpdns_app_proto protoreflect.FileDescriptor -var file_service_httpdns_app_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x64, 0x6e, - 0x73, 0x5f, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, - 0x1e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68, 0x74, - 0x74, 0x70, 0x64, 0x6e, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x01, 0x0a, 0x17, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, - 0x12, 0x2a, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x70, 0x72, 0x69, 0x6d, - 0x61, 0x72, 0x79, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, - 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x69, - 0x67, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x18, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x44, - 0x62, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, - 0x49, 0x64, 0x22, 0xc9, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, - 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, - 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x62, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0f, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x33, - 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x22, 0x31, 0x0a, 0x15, 0x46, - 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x22, 0x3a, - 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x44, - 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x03, 0x61, 0x70, 0x70, 0x22, 0x5e, 0x0a, 0x16, 0x4c, 0x69, - 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x3d, 0x0a, 0x17, 0x4c, 0x69, - 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x61, 0x70, 0x70, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, - 0x41, 0x70, 0x70, 0x52, 0x04, 0x61, 0x70, 0x70, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x46, 0x69, 0x6e, - 0x64, 0x41, 0x6c, 0x6c, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x40, 0x0a, 0x1a, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, - 0x6c, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x61, 0x70, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, - 0x70, 0x70, 0x52, 0x04, 0x61, 0x70, 0x70, 0x73, 0x22, 0x60, 0x0a, 0x22, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x53, 0x69, 0x67, 0x6e, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, - 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x3c, 0x0a, 0x20, 0x52, 0x65, - 0x73, 0x65, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x53, 0x69, 0x67, - 0x6e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x61, 0x70, 0x70, 0x44, 0x62, 0x49, 0x64, 0x22, 0x61, 0x0a, 0x21, 0x52, 0x65, 0x73, 0x65, - 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x53, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, - 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x32, 0x8f, 0x05, 0x0a, 0x11, - 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, - 0x4e, 0x53, 0x41, 0x70, 0x70, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, - 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3f, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, - 0x53, 0x41, 0x70, 0x70, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, - 0x4e, 0x53, 0x41, 0x70, 0x70, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x66, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, - 0x53, 0x41, 0x70, 0x70, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, - 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, - 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x6c, - 0x69, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x73, 0x12, 0x1a, - 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, - 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x64, 0x41, - 0x6c, 0x6c, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x73, 0x12, 0x1d, 0x2e, - 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, - 0x53, 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, - 0x41, 0x70, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x1b, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, - 0x53, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x2e, 0x70, 0x62, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, - 0x70, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x12, 0x68, 0x0a, 0x19, 0x72, 0x65, 0x73, 0x65, 0x74, 0x48, 0x54, 0x54, 0x50, - 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, - 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, - 0x4e, 0x53, 0x41, 0x70, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x65, - 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x41, 0x70, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x53, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_service_httpdns_app_proto_rawDesc = "" + + "\n" + + "\x19service_httpdns_app.proto\x12\x02pb\x1a\x1emodels/model_httpdns_app.proto\x1a\x19models/rpc_messages.proto\"\xc5\x01\n" + + "\x17CreateHTTPDNSAppRequest\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05appId\x18\x02 \x01(\tR\x05appId\x12\x12\n" + + "\x04isOn\x18\x05 \x01(\bR\x04isOn\x12 \n" + + "\vsignEnabled\x18\x06 \x01(\bR\vsignEnabled\x12\x16\n" + + "\x06userId\x18\a \x01(\x03R\x06userId\x12&\n" + + "\x0eclusterIdsJSON\x18\b \x01(\fR\x0eclusterIdsJSONJ\x04\b\x03\x10\x04J\x04\b\x04\x10\x05\"4\n" + + "\x18CreateHTTPDNSAppResponse\x12\x18\n" + + "\aappDbId\x18\x01 \x01(\x03R\aappDbId\"\xa7\x01\n" + + "\x17UpdateHTTPDNSAppRequest\x12\x18\n" + + "\aappDbId\x18\x01 \x01(\x03R\aappDbId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04isOn\x18\x05 \x01(\bR\x04isOn\x12\x16\n" + + "\x06userId\x18\x06 \x01(\x03R\x06userId\x12&\n" + + "\x0eclusterIdsJSON\x18\a \x01(\fR\x0eclusterIdsJSONJ\x04\b\x03\x10\x04J\x04\b\x04\x10\x05\"3\n" + + "\x17DeleteHTTPDNSAppRequest\x12\x18\n" + + "\aappDbId\x18\x01 \x01(\x03R\aappDbId\"1\n" + + "\x15FindHTTPDNSAppRequest\x12\x18\n" + + "\aappDbId\x18\x01 \x01(\x03R\aappDbId\":\n" + + "\x16FindHTTPDNSAppResponse\x12 \n" + + "\x03app\x18\x01 \x01(\v2\x0e.pb.HTTPDNSAppR\x03app\"^\n" + + "\x16ListHTTPDNSAppsRequest\x12\x16\n" + + "\x06offset\x18\x01 \x01(\x03R\x06offset\x12\x12\n" + + "\x04size\x18\x02 \x01(\x03R\x04size\x12\x18\n" + + "\akeyword\x18\x03 \x01(\tR\akeyword\"=\n" + + "\x17ListHTTPDNSAppsResponse\x12\"\n" + + "\x04apps\x18\x01 \x03(\v2\x0e.pb.HTTPDNSAppR\x04apps\"\x1b\n" + + "\x19FindAllHTTPDNSAppsRequest\"@\n" + + "\x1aFindAllHTTPDNSAppsResponse\x12\"\n" + + "\x04apps\x18\x01 \x03(\v2\x0e.pb.HTTPDNSAppR\x04apps\"`\n" + + "\"UpdateHTTPDNSAppSignEnabledRequest\x12\x18\n" + + "\aappDbId\x18\x01 \x01(\x03R\aappDbId\x12 \n" + + "\vsignEnabled\x18\x02 \x01(\bR\vsignEnabled\"<\n" + + " ResetHTTPDNSAppSignSecretRequest\x12\x18\n" + + "\aappDbId\x18\x01 \x01(\x03R\aappDbId\"a\n" + + "!ResetHTTPDNSAppSignSecretResponse\x12\x1e\n" + + "\n" + + "signSecret\x18\x01 \x01(\tR\n" + + "signSecret\x12\x1c\n" + + "\tupdatedAt\x18\x02 \x01(\x03R\tupdatedAt2\x8f\x05\n" + + "\x11HTTPDNSAppService\x12M\n" + + "\x10createHTTPDNSApp\x12\x1b.pb.CreateHTTPDNSAppRequest\x1a\x1c.pb.CreateHTTPDNSAppResponse\x12?\n" + + "\x10updateHTTPDNSApp\x12\x1b.pb.UpdateHTTPDNSAppRequest\x1a\x0e.pb.RPCSuccess\x12?\n" + + "\x10deleteHTTPDNSApp\x12\x1b.pb.DeleteHTTPDNSAppRequest\x1a\x0e.pb.RPCSuccess\x12G\n" + + "\x0efindHTTPDNSApp\x12\x19.pb.FindHTTPDNSAppRequest\x1a\x1a.pb.FindHTTPDNSAppResponse\x12J\n" + + "\x0flistHTTPDNSApps\x12\x1a.pb.ListHTTPDNSAppsRequest\x1a\x1b.pb.ListHTTPDNSAppsResponse\x12S\n" + + "\x12findAllHTTPDNSApps\x12\x1d.pb.FindAllHTTPDNSAppsRequest\x1a\x1e.pb.FindAllHTTPDNSAppsResponse\x12U\n" + + "\x1bupdateHTTPDNSAppSignEnabled\x12&.pb.UpdateHTTPDNSAppSignEnabledRequest\x1a\x0e.pb.RPCSuccess\x12h\n" + + "\x19resetHTTPDNSAppSignSecret\x12$.pb.ResetHTTPDNSAppSignSecretRequest\x1a%.pb.ResetHTTPDNSAppSignSecretResponseB\x06Z\x04./pbb\x06proto3" var ( file_service_httpdns_app_proto_rawDescOnce sync.Once - file_service_httpdns_app_proto_rawDescData = file_service_httpdns_app_proto_rawDesc + file_service_httpdns_app_proto_rawDescData []byte ) func file_service_httpdns_app_proto_rawDescGZIP() []byte { file_service_httpdns_app_proto_rawDescOnce.Do(func() { - file_service_httpdns_app_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_httpdns_app_proto_rawDescData) + file_service_httpdns_app_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_service_httpdns_app_proto_rawDesc), len(file_service_httpdns_app_proto_rawDesc))) }) return file_service_httpdns_app_proto_rawDescData } @@ -911,7 +812,7 @@ func file_service_httpdns_app_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_httpdns_app_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_service_httpdns_app_proto_rawDesc), len(file_service_httpdns_app_proto_rawDesc)), NumEnums: 0, NumMessages: 13, NumExtensions: 0, @@ -922,7 +823,6 @@ func file_service_httpdns_app_proto_init() { MessageInfos: file_service_httpdns_app_proto_msgTypes, }.Build() File_service_httpdns_app_proto = out.File - file_service_httpdns_app_proto_rawDesc = nil file_service_httpdns_app_proto_goTypes = nil file_service_httpdns_app_proto_depIdxs = nil } diff --git a/EdgeCommon/pkg/rpc/pb/service_httpdns_app_grpc.pb.go b/EdgeCommon/pkg/rpc/pb/service_httpdns_app_grpc.pb.go index b01b80e..6f5242c 100644 --- a/EdgeCommon/pkg/rpc/pb/service_httpdns_app_grpc.pb.go +++ b/EdgeCommon/pkg/rpc/pb/service_httpdns_app_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.1 // - protoc v3.21.12 // source: service_httpdns_app.proto @@ -132,7 +132,7 @@ func (c *hTTPDNSAppServiceClient) ResetHTTPDNSAppSignSecret(ctx context.Context, } // HTTPDNSAppServiceServer is the server API for HTTPDNSAppService service. -// All implementations should embed UnimplementedHTTPDNSAppServiceServer +// All implementations must embed UnimplementedHTTPDNSAppServiceServer // for forward compatibility. type HTTPDNSAppServiceServer interface { CreateHTTPDNSApp(context.Context, *CreateHTTPDNSAppRequest) (*CreateHTTPDNSAppResponse, error) @@ -143,9 +143,10 @@ type HTTPDNSAppServiceServer interface { FindAllHTTPDNSApps(context.Context, *FindAllHTTPDNSAppsRequest) (*FindAllHTTPDNSAppsResponse, error) UpdateHTTPDNSAppSignEnabled(context.Context, *UpdateHTTPDNSAppSignEnabledRequest) (*RPCSuccess, error) ResetHTTPDNSAppSignSecret(context.Context, *ResetHTTPDNSAppSignSecretRequest) (*ResetHTTPDNSAppSignSecretResponse, error) + mustEmbedUnimplementedHTTPDNSAppServiceServer() } -// UnimplementedHTTPDNSAppServiceServer should be embedded to have +// UnimplementedHTTPDNSAppServiceServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil @@ -153,30 +154,31 @@ type HTTPDNSAppServiceServer interface { type UnimplementedHTTPDNSAppServiceServer struct{} func (UnimplementedHTTPDNSAppServiceServer) CreateHTTPDNSApp(context.Context, *CreateHTTPDNSAppRequest) (*CreateHTTPDNSAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateHTTPDNSApp not implemented") + return nil, status.Error(codes.Unimplemented, "method CreateHTTPDNSApp not implemented") } func (UnimplementedHTTPDNSAppServiceServer) UpdateHTTPDNSApp(context.Context, *UpdateHTTPDNSAppRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPDNSApp not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateHTTPDNSApp not implemented") } func (UnimplementedHTTPDNSAppServiceServer) DeleteHTTPDNSApp(context.Context, *DeleteHTTPDNSAppRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteHTTPDNSApp not implemented") + return nil, status.Error(codes.Unimplemented, "method DeleteHTTPDNSApp not implemented") } func (UnimplementedHTTPDNSAppServiceServer) FindHTTPDNSApp(context.Context, *FindHTTPDNSAppRequest) (*FindHTTPDNSAppResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindHTTPDNSApp not implemented") + return nil, status.Error(codes.Unimplemented, "method FindHTTPDNSApp not implemented") } func (UnimplementedHTTPDNSAppServiceServer) ListHTTPDNSApps(context.Context, *ListHTTPDNSAppsRequest) (*ListHTTPDNSAppsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListHTTPDNSApps not implemented") + return nil, status.Error(codes.Unimplemented, "method ListHTTPDNSApps not implemented") } func (UnimplementedHTTPDNSAppServiceServer) FindAllHTTPDNSApps(context.Context, *FindAllHTTPDNSAppsRequest) (*FindAllHTTPDNSAppsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllHTTPDNSApps not implemented") + return nil, status.Error(codes.Unimplemented, "method FindAllHTTPDNSApps not implemented") } func (UnimplementedHTTPDNSAppServiceServer) UpdateHTTPDNSAppSignEnabled(context.Context, *UpdateHTTPDNSAppSignEnabledRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPDNSAppSignEnabled not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateHTTPDNSAppSignEnabled not implemented") } func (UnimplementedHTTPDNSAppServiceServer) ResetHTTPDNSAppSignSecret(context.Context, *ResetHTTPDNSAppSignSecretRequest) (*ResetHTTPDNSAppSignSecretResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResetHTTPDNSAppSignSecret not implemented") + return nil, status.Error(codes.Unimplemented, "method ResetHTTPDNSAppSignSecret not implemented") } -func (UnimplementedHTTPDNSAppServiceServer) testEmbeddedByValue() {} +func (UnimplementedHTTPDNSAppServiceServer) mustEmbedUnimplementedHTTPDNSAppServiceServer() {} +func (UnimplementedHTTPDNSAppServiceServer) testEmbeddedByValue() {} // UnsafeHTTPDNSAppServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to HTTPDNSAppServiceServer will @@ -186,7 +188,7 @@ type UnsafeHTTPDNSAppServiceServer interface { } func RegisterHTTPDNSAppServiceServer(s grpc.ServiceRegistrar, srv HTTPDNSAppServiceServer) { - // If the following call pancis, it indicates UnimplementedHTTPDNSAppServiceServer was + // If the following call panics, it indicates UnimplementedHTTPDNSAppServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/EdgeCommon/pkg/rpc/pb/service_httpdns_node.pb.go b/EdgeCommon/pkg/rpc/pb/service_httpdns_node.pb.go index 8c0e5b3..a89dbef 100644 --- a/EdgeCommon/pkg/rpc/pb/service_httpdns_node.pb.go +++ b/EdgeCommon/pkg/rpc/pb/service_httpdns_node.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.36.11 // protoc v3.21.12 // source: service_httpdns_node.proto @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -21,14 +22,13 @@ const ( ) type CreateHTTPDNSNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + InstallDir string `protobuf:"bytes,3,opt,name=installDir,proto3" json:"installDir,omitempty"` + IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` unknownFields protoimpl.UnknownFields - - ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - InstallDir string `protobuf:"bytes,3,opt,name=installDir,proto3" json:"installDir,omitempty"` - IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CreateHTTPDNSNodeRequest) Reset() { @@ -90,11 +90,10 @@ func (x *CreateHTTPDNSNodeRequest) GetIsOn() bool { } type CreateHTTPDNSNodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + sizeCache protoimpl.SizeCache } func (x *CreateHTTPDNSNodeResponse) Reset() { @@ -135,14 +134,13 @@ func (x *CreateHTTPDNSNodeResponse) GetNodeId() int64 { } type UpdateHTTPDNSNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + InstallDir string `protobuf:"bytes,3,opt,name=installDir,proto3" json:"installDir,omitempty"` + IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - InstallDir string `protobuf:"bytes,3,opt,name=installDir,proto3" json:"installDir,omitempty"` - IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` + sizeCache protoimpl.SizeCache } func (x *UpdateHTTPDNSNodeRequest) Reset() { @@ -204,11 +202,10 @@ func (x *UpdateHTTPDNSNodeRequest) GetIsOn() bool { } type DeleteHTTPDNSNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + sizeCache protoimpl.SizeCache } func (x *DeleteHTTPDNSNodeRequest) Reset() { @@ -249,11 +246,10 @@ func (x *DeleteHTTPDNSNodeRequest) GetNodeId() int64 { } type FindHTTPDNSNodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FindHTTPDNSNodeRequest) Reset() { @@ -294,11 +290,10 @@ func (x *FindHTTPDNSNodeRequest) GetNodeId() int64 { } type FindHTTPDNSNodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Node *HTTPDNSNode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` unknownFields protoimpl.UnknownFields - - Node *HTTPDNSNode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` + sizeCache protoimpl.SizeCache } func (x *FindHTTPDNSNodeResponse) Reset() { @@ -339,11 +334,10 @@ func (x *FindHTTPDNSNodeResponse) GetNode() *HTTPDNSNode { } type ListHTTPDNSNodesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` unknownFields protoimpl.UnknownFields - - ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListHTTPDNSNodesRequest) Reset() { @@ -384,11 +378,10 @@ func (x *ListHTTPDNSNodesRequest) GetClusterId() int64 { } type ListHTTPDNSNodesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Nodes []*HTTPDNSNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` unknownFields protoimpl.UnknownFields - - Nodes []*HTTPDNSNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ListHTTPDNSNodesResponse) Reset() { @@ -429,16 +422,15 @@ func (x *ListHTTPDNSNodesResponse) GetNodes() []*HTTPDNSNode { } type UpdateHTTPDNSNodeStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` - IsUp bool `protobuf:"varint,2,opt,name=isUp,proto3" json:"isUp,omitempty"` - IsInstalled bool `protobuf:"varint,3,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"` - IsActive bool `protobuf:"varint,4,opt,name=isActive,proto3" json:"isActive,omitempty"` - StatusJSON []byte `protobuf:"bytes,5,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"` - InstallStatusJSON []byte `protobuf:"bytes,6,opt,name=installStatusJSON,proto3" json:"installStatusJSON,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + IsUp bool `protobuf:"varint,2,opt,name=isUp,proto3" json:"isUp,omitempty"` + IsInstalled bool `protobuf:"varint,3,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"` + IsActive bool `protobuf:"varint,4,opt,name=isActive,proto3" json:"isActive,omitempty"` + StatusJSON []byte `protobuf:"bytes,5,opt,name=statusJSON,proto3" json:"statusJSON,omitempty"` + InstallStatusJSON []byte `protobuf:"bytes,6,opt,name=installStatusJSON,proto3" json:"installStatusJSON,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateHTTPDNSNodeStatusRequest) Reset() { @@ -513,112 +505,124 @@ func (x *UpdateHTTPDNSNodeStatusRequest) GetInstallStatusJSON() []byte { return nil } +// 修改HTTPDNS节点登录信息 +type UpdateHTTPDNSNodeLoginRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + NodeLogin *NodeLogin `protobuf:"bytes,2,opt,name=nodeLogin,proto3" json:"nodeLogin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateHTTPDNSNodeLoginRequest) Reset() { + *x = UpdateHTTPDNSNodeLoginRequest{} + mi := &file_service_httpdns_node_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateHTTPDNSNodeLoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateHTTPDNSNodeLoginRequest) ProtoMessage() {} + +func (x *UpdateHTTPDNSNodeLoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_httpdns_node_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateHTTPDNSNodeLoginRequest.ProtoReflect.Descriptor instead. +func (*UpdateHTTPDNSNodeLoginRequest) Descriptor() ([]byte, []int) { + return file_service_httpdns_node_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateHTTPDNSNodeLoginRequest) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +func (x *UpdateHTTPDNSNodeLoginRequest) GetNodeLogin() *NodeLogin { + if x != nil { + return x.NodeLogin + } + return nil +} + var File_service_httpdns_node_proto protoreflect.FileDescriptor -var file_service_httpdns_node_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x64, 0x6e, - 0x73, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, - 0x1a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x68, - 0x74, 0x74, 0x70, 0x64, 0x6e, 0x73, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, - 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x69, - 0x73, 0x4f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x22, - 0x33, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, - 0x64, 0x65, 0x49, 0x64, 0x22, 0x7a, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, - 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x12, 0x0a, 0x04, - 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, - 0x22, 0x32, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, - 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, - 0x64, 0x65, 0x49, 0x64, 0x22, 0x30, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, - 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, - 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x23, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x37, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x54, - 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x41, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, - 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x6e, - 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, - 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, - 0x65, 0x73, 0x22, 0xd8, 0x01, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, - 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x69, 0x73, 0x55, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x55, - 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, - 0x2c, 0x0a, 0x11, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x32, 0xd6, 0x03, - 0x0a, 0x12, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, - 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, - 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, - 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, - 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x4a, 0x0a, 0x0f, - 0x66, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x12, - 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, - 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x17, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x48, 0x54, 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x54, - 0x54, 0x50, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_service_httpdns_node_proto_rawDesc = "" + + "\n" + + "\x1aservice_httpdns_node.proto\x12\x02pb\x1a\x1fmodels/model_httpdns_node.proto\x1a\x1dmodels/model_node_login.proto\x1a\x19models/rpc_messages.proto\"\x80\x01\n" + + "\x18CreateHTTPDNSNodeRequest\x12\x1c\n" + + "\tclusterId\x18\x01 \x01(\x03R\tclusterId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1e\n" + + "\n" + + "installDir\x18\x03 \x01(\tR\n" + + "installDir\x12\x12\n" + + "\x04isOn\x18\x04 \x01(\bR\x04isOn\"3\n" + + "\x19CreateHTTPDNSNodeResponse\x12\x16\n" + + "\x06nodeId\x18\x01 \x01(\x03R\x06nodeId\"z\n" + + "\x18UpdateHTTPDNSNodeRequest\x12\x16\n" + + "\x06nodeId\x18\x01 \x01(\x03R\x06nodeId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1e\n" + + "\n" + + "installDir\x18\x03 \x01(\tR\n" + + "installDir\x12\x12\n" + + "\x04isOn\x18\x04 \x01(\bR\x04isOn\"2\n" + + "\x18DeleteHTTPDNSNodeRequest\x12\x16\n" + + "\x06nodeId\x18\x01 \x01(\x03R\x06nodeId\"0\n" + + "\x16FindHTTPDNSNodeRequest\x12\x16\n" + + "\x06nodeId\x18\x01 \x01(\x03R\x06nodeId\">\n" + + "\x17FindHTTPDNSNodeResponse\x12#\n" + + "\x04node\x18\x01 \x01(\v2\x0f.pb.HTTPDNSNodeR\x04node\"7\n" + + "\x17ListHTTPDNSNodesRequest\x12\x1c\n" + + "\tclusterId\x18\x01 \x01(\x03R\tclusterId\"A\n" + + "\x18ListHTTPDNSNodesResponse\x12%\n" + + "\x05nodes\x18\x01 \x03(\v2\x0f.pb.HTTPDNSNodeR\x05nodes\"\xd8\x01\n" + + "\x1eUpdateHTTPDNSNodeStatusRequest\x12\x16\n" + + "\x06nodeId\x18\x01 \x01(\x03R\x06nodeId\x12\x12\n" + + "\x04isUp\x18\x02 \x01(\bR\x04isUp\x12 \n" + + "\visInstalled\x18\x03 \x01(\bR\visInstalled\x12\x1a\n" + + "\bisActive\x18\x04 \x01(\bR\bisActive\x12\x1e\n" + + "\n" + + "statusJSON\x18\x05 \x01(\fR\n" + + "statusJSON\x12,\n" + + "\x11installStatusJSON\x18\x06 \x01(\fR\x11installStatusJSON\"d\n" + + "\x1dUpdateHTTPDNSNodeLoginRequest\x12\x16\n" + + "\x06nodeId\x18\x01 \x01(\x03R\x06nodeId\x12+\n" + + "\tnodeLogin\x18\x02 \x01(\v2\r.pb.NodeLoginR\tnodeLogin2\xa3\x04\n" + + "\x12HTTPDNSNodeService\x12P\n" + + "\x11createHTTPDNSNode\x12\x1c.pb.CreateHTTPDNSNodeRequest\x1a\x1d.pb.CreateHTTPDNSNodeResponse\x12A\n" + + "\x11updateHTTPDNSNode\x12\x1c.pb.UpdateHTTPDNSNodeRequest\x1a\x0e.pb.RPCSuccess\x12A\n" + + "\x11deleteHTTPDNSNode\x12\x1c.pb.DeleteHTTPDNSNodeRequest\x1a\x0e.pb.RPCSuccess\x12J\n" + + "\x0ffindHTTPDNSNode\x12\x1a.pb.FindHTTPDNSNodeRequest\x1a\x1b.pb.FindHTTPDNSNodeResponse\x12M\n" + + "\x10listHTTPDNSNodes\x12\x1b.pb.ListHTTPDNSNodesRequest\x1a\x1c.pb.ListHTTPDNSNodesResponse\x12M\n" + + "\x17updateHTTPDNSNodeStatus\x12\".pb.UpdateHTTPDNSNodeStatusRequest\x1a\x0e.pb.RPCSuccess\x12K\n" + + "\x16updateHTTPDNSNodeLogin\x12!.pb.UpdateHTTPDNSNodeLoginRequest\x1a\x0e.pb.RPCSuccessB\x06Z\x04./pbb\x06proto3" var ( file_service_httpdns_node_proto_rawDescOnce sync.Once - file_service_httpdns_node_proto_rawDescData = file_service_httpdns_node_proto_rawDesc + file_service_httpdns_node_proto_rawDescData []byte ) func file_service_httpdns_node_proto_rawDescGZIP() []byte { file_service_httpdns_node_proto_rawDescOnce.Do(func() { - file_service_httpdns_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_httpdns_node_proto_rawDescData) + file_service_httpdns_node_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_service_httpdns_node_proto_rawDesc), len(file_service_httpdns_node_proto_rawDesc))) }) return file_service_httpdns_node_proto_rawDescData } -var file_service_httpdns_node_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_service_httpdns_node_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_service_httpdns_node_proto_goTypes = []any{ (*CreateHTTPDNSNodeRequest)(nil), // 0: pb.CreateHTTPDNSNodeRequest (*CreateHTTPDNSNodeResponse)(nil), // 1: pb.CreateHTTPDNSNodeResponse @@ -629,29 +633,34 @@ var file_service_httpdns_node_proto_goTypes = []any{ (*ListHTTPDNSNodesRequest)(nil), // 6: pb.ListHTTPDNSNodesRequest (*ListHTTPDNSNodesResponse)(nil), // 7: pb.ListHTTPDNSNodesResponse (*UpdateHTTPDNSNodeStatusRequest)(nil), // 8: pb.UpdateHTTPDNSNodeStatusRequest - (*HTTPDNSNode)(nil), // 9: pb.HTTPDNSNode - (*RPCSuccess)(nil), // 10: pb.RPCSuccess + (*UpdateHTTPDNSNodeLoginRequest)(nil), // 9: pb.UpdateHTTPDNSNodeLoginRequest + (*HTTPDNSNode)(nil), // 10: pb.HTTPDNSNode + (*NodeLogin)(nil), // 11: pb.NodeLogin + (*RPCSuccess)(nil), // 12: pb.RPCSuccess } var file_service_httpdns_node_proto_depIdxs = []int32{ - 9, // 0: pb.FindHTTPDNSNodeResponse.node:type_name -> pb.HTTPDNSNode - 9, // 1: pb.ListHTTPDNSNodesResponse.nodes:type_name -> pb.HTTPDNSNode - 0, // 2: pb.HTTPDNSNodeService.createHTTPDNSNode:input_type -> pb.CreateHTTPDNSNodeRequest - 2, // 3: pb.HTTPDNSNodeService.updateHTTPDNSNode:input_type -> pb.UpdateHTTPDNSNodeRequest - 3, // 4: pb.HTTPDNSNodeService.deleteHTTPDNSNode:input_type -> pb.DeleteHTTPDNSNodeRequest - 4, // 5: pb.HTTPDNSNodeService.findHTTPDNSNode:input_type -> pb.FindHTTPDNSNodeRequest - 6, // 6: pb.HTTPDNSNodeService.listHTTPDNSNodes:input_type -> pb.ListHTTPDNSNodesRequest - 8, // 7: pb.HTTPDNSNodeService.updateHTTPDNSNodeStatus:input_type -> pb.UpdateHTTPDNSNodeStatusRequest - 1, // 8: pb.HTTPDNSNodeService.createHTTPDNSNode:output_type -> pb.CreateHTTPDNSNodeResponse - 10, // 9: pb.HTTPDNSNodeService.updateHTTPDNSNode:output_type -> pb.RPCSuccess - 10, // 10: pb.HTTPDNSNodeService.deleteHTTPDNSNode:output_type -> pb.RPCSuccess - 5, // 11: pb.HTTPDNSNodeService.findHTTPDNSNode:output_type -> pb.FindHTTPDNSNodeResponse - 7, // 12: pb.HTTPDNSNodeService.listHTTPDNSNodes:output_type -> pb.ListHTTPDNSNodesResponse - 10, // 13: pb.HTTPDNSNodeService.updateHTTPDNSNodeStatus:output_type -> pb.RPCSuccess - 8, // [8:14] is the sub-list for method output_type - 2, // [2:8] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 10, // 0: pb.FindHTTPDNSNodeResponse.node:type_name -> pb.HTTPDNSNode + 10, // 1: pb.ListHTTPDNSNodesResponse.nodes:type_name -> pb.HTTPDNSNode + 11, // 2: pb.UpdateHTTPDNSNodeLoginRequest.nodeLogin:type_name -> pb.NodeLogin + 0, // 3: pb.HTTPDNSNodeService.createHTTPDNSNode:input_type -> pb.CreateHTTPDNSNodeRequest + 2, // 4: pb.HTTPDNSNodeService.updateHTTPDNSNode:input_type -> pb.UpdateHTTPDNSNodeRequest + 3, // 5: pb.HTTPDNSNodeService.deleteHTTPDNSNode:input_type -> pb.DeleteHTTPDNSNodeRequest + 4, // 6: pb.HTTPDNSNodeService.findHTTPDNSNode:input_type -> pb.FindHTTPDNSNodeRequest + 6, // 7: pb.HTTPDNSNodeService.listHTTPDNSNodes:input_type -> pb.ListHTTPDNSNodesRequest + 8, // 8: pb.HTTPDNSNodeService.updateHTTPDNSNodeStatus:input_type -> pb.UpdateHTTPDNSNodeStatusRequest + 9, // 9: pb.HTTPDNSNodeService.updateHTTPDNSNodeLogin:input_type -> pb.UpdateHTTPDNSNodeLoginRequest + 1, // 10: pb.HTTPDNSNodeService.createHTTPDNSNode:output_type -> pb.CreateHTTPDNSNodeResponse + 12, // 11: pb.HTTPDNSNodeService.updateHTTPDNSNode:output_type -> pb.RPCSuccess + 12, // 12: pb.HTTPDNSNodeService.deleteHTTPDNSNode:output_type -> pb.RPCSuccess + 5, // 13: pb.HTTPDNSNodeService.findHTTPDNSNode:output_type -> pb.FindHTTPDNSNodeResponse + 7, // 14: pb.HTTPDNSNodeService.listHTTPDNSNodes:output_type -> pb.ListHTTPDNSNodesResponse + 12, // 15: pb.HTTPDNSNodeService.updateHTTPDNSNodeStatus:output_type -> pb.RPCSuccess + 12, // 16: pb.HTTPDNSNodeService.updateHTTPDNSNodeLogin:output_type -> pb.RPCSuccess + 10, // [10:17] is the sub-list for method output_type + 3, // [3:10] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_service_httpdns_node_proto_init() } @@ -660,14 +669,15 @@ func file_service_httpdns_node_proto_init() { return } file_models_model_httpdns_node_proto_init() + file_models_model_node_login_proto_init() file_models_rpc_messages_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_httpdns_node_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_service_httpdns_node_proto_rawDesc), len(file_service_httpdns_node_proto_rawDesc)), NumEnums: 0, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, @@ -676,7 +686,6 @@ func file_service_httpdns_node_proto_init() { MessageInfos: file_service_httpdns_node_proto_msgTypes, }.Build() File_service_httpdns_node_proto = out.File - file_service_httpdns_node_proto_rawDesc = nil file_service_httpdns_node_proto_goTypes = nil file_service_httpdns_node_proto_depIdxs = nil } diff --git a/EdgeCommon/pkg/rpc/pb/service_httpdns_node_grpc.pb.go b/EdgeCommon/pkg/rpc/pb/service_httpdns_node_grpc.pb.go index 51b3cd5..0d8f9e8 100644 --- a/EdgeCommon/pkg/rpc/pb/service_httpdns_node_grpc.pb.go +++ b/EdgeCommon/pkg/rpc/pb/service_httpdns_node_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.6.1 // - protoc v3.21.12 // source: service_httpdns_node.proto @@ -25,6 +25,7 @@ const ( HTTPDNSNodeService_FindHTTPDNSNode_FullMethodName = "/pb.HTTPDNSNodeService/findHTTPDNSNode" HTTPDNSNodeService_ListHTTPDNSNodes_FullMethodName = "/pb.HTTPDNSNodeService/listHTTPDNSNodes" HTTPDNSNodeService_UpdateHTTPDNSNodeStatus_FullMethodName = "/pb.HTTPDNSNodeService/updateHTTPDNSNodeStatus" + HTTPDNSNodeService_UpdateHTTPDNSNodeLogin_FullMethodName = "/pb.HTTPDNSNodeService/updateHTTPDNSNodeLogin" ) // HTTPDNSNodeServiceClient is the client API for HTTPDNSNodeService service. @@ -37,6 +38,8 @@ type HTTPDNSNodeServiceClient interface { FindHTTPDNSNode(ctx context.Context, in *FindHTTPDNSNodeRequest, opts ...grpc.CallOption) (*FindHTTPDNSNodeResponse, error) ListHTTPDNSNodes(ctx context.Context, in *ListHTTPDNSNodesRequest, opts ...grpc.CallOption) (*ListHTTPDNSNodesResponse, error) UpdateHTTPDNSNodeStatus(ctx context.Context, in *UpdateHTTPDNSNodeStatusRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 修改HTTPDNS节点登录信息 + UpdateHTTPDNSNodeLogin(ctx context.Context, in *UpdateHTTPDNSNodeLoginRequest, opts ...grpc.CallOption) (*RPCSuccess, error) } type hTTPDNSNodeServiceClient struct { @@ -107,8 +110,18 @@ func (c *hTTPDNSNodeServiceClient) UpdateHTTPDNSNodeStatus(ctx context.Context, return out, nil } +func (c *hTTPDNSNodeServiceClient) UpdateHTTPDNSNodeLogin(ctx context.Context, in *UpdateHTTPDNSNodeLoginRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, HTTPDNSNodeService_UpdateHTTPDNSNodeLogin_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // HTTPDNSNodeServiceServer is the server API for HTTPDNSNodeService service. -// All implementations should embed UnimplementedHTTPDNSNodeServiceServer +// All implementations must embed UnimplementedHTTPDNSNodeServiceServer // for forward compatibility. type HTTPDNSNodeServiceServer interface { CreateHTTPDNSNode(context.Context, *CreateHTTPDNSNodeRequest) (*CreateHTTPDNSNodeResponse, error) @@ -117,9 +130,12 @@ type HTTPDNSNodeServiceServer interface { FindHTTPDNSNode(context.Context, *FindHTTPDNSNodeRequest) (*FindHTTPDNSNodeResponse, error) ListHTTPDNSNodes(context.Context, *ListHTTPDNSNodesRequest) (*ListHTTPDNSNodesResponse, error) UpdateHTTPDNSNodeStatus(context.Context, *UpdateHTTPDNSNodeStatusRequest) (*RPCSuccess, error) + // 修改HTTPDNS节点登录信息 + UpdateHTTPDNSNodeLogin(context.Context, *UpdateHTTPDNSNodeLoginRequest) (*RPCSuccess, error) + mustEmbedUnimplementedHTTPDNSNodeServiceServer() } -// UnimplementedHTTPDNSNodeServiceServer should be embedded to have +// UnimplementedHTTPDNSNodeServiceServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil @@ -127,24 +143,28 @@ type HTTPDNSNodeServiceServer interface { type UnimplementedHTTPDNSNodeServiceServer struct{} func (UnimplementedHTTPDNSNodeServiceServer) CreateHTTPDNSNode(context.Context, *CreateHTTPDNSNodeRequest) (*CreateHTTPDNSNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateHTTPDNSNode not implemented") + return nil, status.Error(codes.Unimplemented, "method CreateHTTPDNSNode not implemented") } func (UnimplementedHTTPDNSNodeServiceServer) UpdateHTTPDNSNode(context.Context, *UpdateHTTPDNSNodeRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPDNSNode not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateHTTPDNSNode not implemented") } func (UnimplementedHTTPDNSNodeServiceServer) DeleteHTTPDNSNode(context.Context, *DeleteHTTPDNSNodeRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteHTTPDNSNode not implemented") + return nil, status.Error(codes.Unimplemented, "method DeleteHTTPDNSNode not implemented") } func (UnimplementedHTTPDNSNodeServiceServer) FindHTTPDNSNode(context.Context, *FindHTTPDNSNodeRequest) (*FindHTTPDNSNodeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindHTTPDNSNode not implemented") + return nil, status.Error(codes.Unimplemented, "method FindHTTPDNSNode not implemented") } func (UnimplementedHTTPDNSNodeServiceServer) ListHTTPDNSNodes(context.Context, *ListHTTPDNSNodesRequest) (*ListHTTPDNSNodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListHTTPDNSNodes not implemented") + return nil, status.Error(codes.Unimplemented, "method ListHTTPDNSNodes not implemented") } func (UnimplementedHTTPDNSNodeServiceServer) UpdateHTTPDNSNodeStatus(context.Context, *UpdateHTTPDNSNodeStatusRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateHTTPDNSNodeStatus not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateHTTPDNSNodeStatus not implemented") } -func (UnimplementedHTTPDNSNodeServiceServer) testEmbeddedByValue() {} +func (UnimplementedHTTPDNSNodeServiceServer) UpdateHTTPDNSNodeLogin(context.Context, *UpdateHTTPDNSNodeLoginRequest) (*RPCSuccess, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateHTTPDNSNodeLogin not implemented") +} +func (UnimplementedHTTPDNSNodeServiceServer) mustEmbedUnimplementedHTTPDNSNodeServiceServer() {} +func (UnimplementedHTTPDNSNodeServiceServer) testEmbeddedByValue() {} // UnsafeHTTPDNSNodeServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to HTTPDNSNodeServiceServer will @@ -154,7 +174,7 @@ type UnsafeHTTPDNSNodeServiceServer interface { } func RegisterHTTPDNSNodeServiceServer(s grpc.ServiceRegistrar, srv HTTPDNSNodeServiceServer) { - // If the following call pancis, it indicates UnimplementedHTTPDNSNodeServiceServer was + // If the following call panics, it indicates UnimplementedHTTPDNSNodeServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. @@ -272,6 +292,24 @@ func _HTTPDNSNodeService_UpdateHTTPDNSNodeStatus_Handler(srv interface{}, ctx co return interceptor(ctx, in, info, handler) } +func _HTTPDNSNodeService_UpdateHTTPDNSNodeLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateHTTPDNSNodeLoginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HTTPDNSNodeServiceServer).UpdateHTTPDNSNodeLogin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HTTPDNSNodeService_UpdateHTTPDNSNodeLogin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HTTPDNSNodeServiceServer).UpdateHTTPDNSNodeLogin(ctx, req.(*UpdateHTTPDNSNodeLoginRequest)) + } + return interceptor(ctx, in, info, handler) +} + // HTTPDNSNodeService_ServiceDesc is the grpc.ServiceDesc for HTTPDNSNodeService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -303,6 +341,10 @@ var HTTPDNSNodeService_ServiceDesc = grpc.ServiceDesc{ MethodName: "updateHTTPDNSNodeStatus", Handler: _HTTPDNSNodeService_UpdateHTTPDNSNodeStatus_Handler, }, + { + MethodName: "updateHTTPDNSNodeLogin", + Handler: _HTTPDNSNodeService_UpdateHTTPDNSNodeLogin_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_httpdns_node.proto", diff --git a/EdgeCommon/pkg/rpc/pb/service_user.pb.go b/EdgeCommon/pkg/rpc/pb/service_user.pb.go index 865cd1c..5940c43 100644 --- a/EdgeCommon/pkg/rpc/pb/service_user.pb.go +++ b/EdgeCommon/pkg/rpc/pb/service_user.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.0 -// protoc v6.33.2 +// protoc-gen-go v1.36.11 +// protoc v3.21.12 // source: service_user.proto package pb @@ -11,6 +11,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -381,20 +382,21 @@ func (x *VerifyUserRequest) GetRejectReason() string { // 修改用户 type UpdateUserRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` - Fullname string `protobuf:"bytes,4,opt,name=fullname,proto3" json:"fullname,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile,proto3" json:"mobile,omitempty"` - Tel string `protobuf:"bytes,6,opt,name=tel,proto3" json:"tel,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` - Remark string `protobuf:"bytes,8,opt,name=remark,proto3" json:"remark,omitempty"` - IsOn bool `protobuf:"varint,9,opt,name=isOn,proto3" json:"isOn,omitempty"` - NodeClusterId int64 `protobuf:"varint,10,opt,name=nodeClusterId,proto3" json:"nodeClusterId,omitempty"` - BandwidthAlgo string `protobuf:"bytes,11,opt,name=bandwidthAlgo,proto3" json:"bandwidthAlgo,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + Fullname string `protobuf:"bytes,4,opt,name=fullname,proto3" json:"fullname,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=mobile,proto3" json:"mobile,omitempty"` + Tel string `protobuf:"bytes,6,opt,name=tel,proto3" json:"tel,omitempty"` + Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` + Remark string `protobuf:"bytes,8,opt,name=remark,proto3" json:"remark,omitempty"` + IsOn bool `protobuf:"varint,9,opt,name=isOn,proto3" json:"isOn,omitempty"` + NodeClusterId int64 `protobuf:"varint,10,opt,name=nodeClusterId,proto3" json:"nodeClusterId,omitempty"` + BandwidthAlgo string `protobuf:"bytes,11,opt,name=bandwidthAlgo,proto3" json:"bandwidthAlgo,omitempty"` + HttpdnsClusterIdsJSON []byte `protobuf:"bytes,12,opt,name=httpdnsClusterIdsJSON,proto3" json:"httpdnsClusterIdsJSON,omitempty"` // HTTPDNS关联集群ID列表 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UpdateUserRequest) Reset() { @@ -504,6 +506,13 @@ func (x *UpdateUserRequest) GetBandwidthAlgo() string { return "" } +func (x *UpdateUserRequest) GetHttpdnsClusterIdsJSON() []byte { + if x != nil { + return x.HttpdnsClusterIdsJSON + } + return nil +} + // 删除用户 type DeleteUserRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2842,511 +2851,235 @@ func (x *ComposeUserGlobalBoardResponse_TrafficStat) GetBytes() int64 { var File_service_user_proto protoreflect.FileDescriptor -var file_service_user_proto_rawDesc = []byte{ - 0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, - 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x01, 0x0a, - 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, - 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, - 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x74, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x65, 0x6c, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6e, - 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x12, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xbf, 0x01, 0x0a, 0x13, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, - 0x62, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, - 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x6a, 0x0a, 0x14, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x18, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6f, 0x0a, 0x11, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x6a, 0x65, 0x63, - 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x6a, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xb7, 0x02, 0x0a, 0x11, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, - 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, - 0x69, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x74, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, - 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, - 0x61, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, - 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, - 0x0d, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x41, 0x6c, 0x67, 0x6f, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x41, - 0x6c, 0x67, 0x6f, 0x22, 0x2b, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x22, 0x85, 0x01, 0x0a, 0x1b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x73, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0b, 0x69, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, 0x12, 0x2a, 0x0a, 0x10, - 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x49, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x49, 0x73, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0xad, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x20, - 0x0a, 0x0b, 0x69, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, - 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x49, 0x73, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6d, 0x6f, 0x62, 0x69, - 0x6c, 0x65, 0x49, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x3a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x22, 0x30, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, - 0x4e, 0x0a, 0x18, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x33, 0x0a, 0x19, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, - 0x69, 0x73, 0x74, 0x73, 0x22, 0x4a, 0x0a, 0x10, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x22, 0x59, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, - 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x79, 0x0a, 0x15, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x66, 0x75, 0x6c, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, - 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x68, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x22, 0x35, 0x0a, 0x1b, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, - 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xa7, 0x07, 0x0a, 0x1c, 0x43, 0x6f, 0x6d, 0x70, - 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x13, - 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x6d, 0x6f, 0x6e, 0x74, 0x68, - 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x3c, - 0x0a, 0x19, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x42, 0x61, 0x6e, - 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x19, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x42, 0x61, - 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x11, - 0x64, 0x61, 0x69, 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x54, 0x72, - 0x61, 0x66, 0x66, 0x69, 0x63, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x17, 0x64, 0x61, - 0x69, 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x64, 0x61, 0x69, - 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x12, 0x5f, 0x0a, 0x11, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x54, 0x72, 0x61, - 0x66, 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x31, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, 0x74, - 0x61, 0x74, 0x52, 0x11, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x71, 0x0a, 0x17, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x65, - 0x65, 0x6b, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, - 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x65, - 0x65, 0x6b, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x52, - 0x17, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x62, 0x61, 0x6e, 0x64, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, - 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x17, 0x62, 0x61, - 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x6c, - 0x65, 0x42, 0x69, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x62, 0x61, 0x6e, - 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x6c, 0x65, - 0x42, 0x69, 0x74, 0x73, 0x1a, 0x88, 0x02, 0x0a, 0x10, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x54, 0x72, - 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x64, 0x42, 0x79, - 0x74, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x30, 0x0a, - 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, - 0x40, 0x0a, 0x16, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x42, 0x61, 0x6e, 0x64, - 0x77, 0x69, 0x64, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x62, - 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x22, 0x36, 0x0a, 0x1c, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, - 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x1d, 0x46, 0x69, 0x6e, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, - 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0d, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, - 0x22, 0x57, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x61, 0x0a, 0x1d, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x73, 0x46, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0c, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1c, - 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x22, 0x31, 0x0a, 0x17, - 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x47, 0x0a, 0x18, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x66, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x08, - 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x26, 0x0a, 0x24, 0x46, 0x69, 0x6e, 0x64, - 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x65, - 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x54, 0x0a, 0x25, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x46, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x66, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x08, 0x66, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x42, 0x6f, 0x61, 0x72, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa9, 0x06, 0x0a, 0x1e, 0x43, 0x6f, 0x6d, 0x70, - 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x42, 0x6f, 0x61, - 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x54, 0x6f, 0x64, 0x61, 0x79, 0x55, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x6f, 0x64, 0x61, 0x79, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x57, 0x65, 0x65, - 0x6b, 0x6c, 0x79, 0x55, 0x73, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x57, 0x65, 0x65, 0x6b, 0x6c, 0x79, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x15, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4f, 0x66, - 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x30, - 0x0a, 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x12, 0x4c, 0x0a, 0x0a, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x1e, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x42, 0x6f, 0x61, 0x72, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, - 0x61, 0x74, 0x52, 0x0a, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x33, - 0x0a, 0x0d, 0x63, 0x70, 0x75, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x63, 0x70, 0x75, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x10, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4e, 0x6f, 0x64, - 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x20, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x6d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x35, - 0x0a, 0x0e, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x18, 0x21, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x6c, 0x6f, 0x61, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x0f, 0x74, 0x6f, 0x70, 0x54, 0x72, 0x61, 0x66, - 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, - 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x52, 0x0f, - 0x74, 0x6f, 0x70, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x1a, - 0x33, 0x0a, 0x09, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, - 0x64, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x7d, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, - 0x74, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x22, 0x3d, 0x0a, 0x1f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, - 0x4f, 0x54, 0x50, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x42, 0x0a, 0x20, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x4f, - 0x54, 0x50, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x4f, 0x54, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x65, 0x71, 0x75, - 0x69, 0x72, 0x65, 0x4f, 0x54, 0x50, 0x22, 0x32, 0x0a, 0x18, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x5b, 0x0a, 0x19, 0x46, 0x69, - 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x50, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x52, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, - 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x58, 0x0a, 0x1c, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x50, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x50, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x36, 0x0a, 0x1c, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x3d, 0x0a, - 0x1d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x36, 0x0a, 0x1c, - 0x52, 0x65, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x1d, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x22, 0x2d, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, - 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x22, 0x30, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, - 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, - 0x69, 0x73, 0x74, 0x73, 0x22, 0x30, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, - 0x72, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x22, 0x31, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, - 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x46, 0x0a, 0x28, 0x46, 0x69, 0x6e, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x6d, 0x61, - 0x69, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x41, 0x0a, 0x29, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x32, 0xae, 0x11, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, - 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x33, - 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x12, 0x4d, 0x0a, 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, - 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, - 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, - 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, - 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x38, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x62, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x59, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, - 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, - 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, - 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x5c, 0x0a, 0x15, 0x66, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x46, - 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, - 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x12, 0x4b, 0x0a, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x21, 0x2e, - 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x12, 0x4d, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, - 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x74, 0x0a, 0x1d, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x28, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, - 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x70, 0x62, 0x2e, - 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x46, 0x65, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x12, - 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x18, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x55, - 0x73, 0x65, 0x72, 0x4f, 0x54, 0x50, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, - 0x72, 0x4f, 0x54, 0x50, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x54, 0x50, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, - 0x11, 0x66, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, - 0x50, 0x72, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x45, 0x0a, 0x13, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x15, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, 0x63, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, - 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, - 0x72, 0x69, 0x63, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x12, 0x5c, 0x0a, 0x15, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, - 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5c, 0x0a, 0x15, 0x72, 0x65, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, - 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, - 0x52, 0x65, 0x6e, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, - 0x0e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, - 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x55, - 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x21, 0x66, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x57, 0x69, 0x74, 0x68, - 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, - 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, - 0x6c, 0x57, 0x69, 0x74, 0x68, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_service_user_proto_rawDesc = "" + + "\n" + + "\x12service_user.proto\x12\x02pb\x1a\x19models/rpc_messages.proto\x1a\x17models/model_user.proto\x1a\x1fmodels/model_user_feature.proto\x1a\x1dmodels/model_node_value.proto\"\xfd\x01\n" + + "\x11CreateUserRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x1a\n" + + "\bfullname\x18\x03 \x01(\tR\bfullname\x12\x16\n" + + "\x06mobile\x18\x04 \x01(\tR\x06mobile\x12\x10\n" + + "\x03tel\x18\x05 \x01(\tR\x03tel\x12\x14\n" + + "\x05email\x18\x06 \x01(\tR\x05email\x12\x16\n" + + "\x06remark\x18\a \x01(\tR\x06remark\x12\x16\n" + + "\x06source\x18\b \x01(\tR\x06source\x12$\n" + + "\rnodeClusterId\x18\t \x01(\x03R\rnodeClusterId\",\n" + + "\x12CreateUserResponse\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"\xbf\x01\n" + + "\x13RegisterUserRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x16\n" + + "\x06mobile\x18\x03 \x01(\tR\x06mobile\x12\x14\n" + + "\x05email\x18\x04 \x01(\tR\x05email\x12\x1a\n" + + "\bfullname\x18\x05 \x01(\tR\bfullname\x12\x0e\n" + + "\x02ip\x18\x06 \x01(\tR\x02ip\x12\x16\n" + + "\x06source\x18\a \x01(\tR\x06source\"j\n" + + "\x14RegisterUserResponse\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12:\n" + + "\x18requireEmailVerification\x18\x02 \x01(\bR\x18requireEmailVerification\"o\n" + + "\x11VerifyUserRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x1e\n" + + "\n" + + "isRejected\x18\x02 \x01(\bR\n" + + "isRejected\x12\"\n" + + "\frejectReason\x18\x03 \x01(\tR\frejectReason\"\xed\x02\n" + + "\x11UpdateUserRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x03 \x01(\tR\bpassword\x12\x1a\n" + + "\bfullname\x18\x04 \x01(\tR\bfullname\x12\x16\n" + + "\x06mobile\x18\x05 \x01(\tR\x06mobile\x12\x10\n" + + "\x03tel\x18\x06 \x01(\tR\x03tel\x12\x14\n" + + "\x05email\x18\a \x01(\tR\x05email\x12\x16\n" + + "\x06remark\x18\b \x01(\tR\x06remark\x12\x12\n" + + "\x04isOn\x18\t \x01(\bR\x04isOn\x12$\n" + + "\rnodeClusterId\x18\n" + + " \x01(\x03R\rnodeClusterId\x12$\n" + + "\rbandwidthAlgo\x18\v \x01(\tR\rbandwidthAlgo\x124\n" + + "\x15httpdnsClusterIdsJSON\x18\f \x01(\fR\x15httpdnsClusterIdsJSON\"+\n" + + "\x11DeleteUserRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"\x85\x01\n" + + "\x1bCountAllEnabledUsersRequest\x12\x18\n" + + "\akeyword\x18\x01 \x01(\tR\akeyword\x12 \n" + + "\visVerifying\x18\x02 \x01(\bR\visVerifying\x12*\n" + + "\x10mobileIsVerified\x18\x03 \x01(\x05R\x10mobileIsVerified\"\xad\x01\n" + + "\x17ListEnabledUsersRequest\x12\x18\n" + + "\akeyword\x18\x01 \x01(\tR\akeyword\x12 \n" + + "\visVerifying\x18\x04 \x01(\bR\visVerifying\x12*\n" + + "\x10mobileIsVerified\x18\x05 \x01(\x05R\x10mobileIsVerified\x12\x16\n" + + "\x06offset\x18\x02 \x01(\x03R\x06offset\x12\x12\n" + + "\x04size\x18\x03 \x01(\x03R\x04size\":\n" + + "\x18ListEnabledUsersResponse\x12\x1e\n" + + "\x05users\x18\x01 \x03(\v2\b.pb.UserR\x05users\"0\n" + + "\x16FindEnabledUserRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"7\n" + + "\x17FindEnabledUserResponse\x12\x1c\n" + + "\x04user\x18\x01 \x01(\v2\b.pb.UserR\x04user\"N\n" + + "\x18CheckUserUsernameRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\"3\n" + + "\x19CheckUserUsernameResponse\x12\x16\n" + + "\x06exists\x18\x01 \x01(\bR\x06exists\"J\n" + + "\x10LoginUserRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\"Y\n" + + "\x11LoginUserResponse\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x12\n" + + "\x04isOk\x18\x02 \x01(\bR\x04isOk\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\"y\n" + + "\x15UpdateUserInfoRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" + + "\bfullname\x18\x02 \x01(\tR\bfullname\x12\x16\n" + + "\x06mobile\x18\x03 \x01(\tR\x06mobile\x12\x14\n" + + "\x05email\x18\x04 \x01(\tR\x05email\"h\n" + + "\x16UpdateUserLoginRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x03 \x01(\tR\bpassword\"5\n" + + "\x1bComposeUserDashboardRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"\xa7\a\n" + + "\x1cComposeUserDashboardResponse\x12\"\n" + + "\fcountServers\x18\x01 \x01(\x03R\fcountServers\x120\n" + + "\x13monthlyTrafficBytes\x18\x02 \x01(\x03R\x13monthlyTrafficBytes\x12<\n" + + "\x19monthlyPeekBandwidthBytes\x18\x03 \x01(\x03R\x19monthlyPeekBandwidthBytes\x12,\n" + + "\x11dailyTrafficBytes\x18\x04 \x01(\x03R\x11dailyTrafficBytes\x128\n" + + "\x17dailyPeekBandwidthBytes\x18\x05 \x01(\x03R\x17dailyPeekBandwidthBytes\x12_\n" + + "\x11dailyTrafficStats\x18\x06 \x03(\v21.pb.ComposeUserDashboardResponse.DailyTrafficStatR\x11dailyTrafficStats\x12q\n" + + "\x17dailyPeekBandwidthStats\x18\a \x03(\v27.pb.ComposeUserDashboardResponse.DailyPeekBandwidthStatR\x17dailyPeekBandwidthStats\x120\n" + + "\x13bandwidthPercentile\x18\b \x01(\x05R\x13bandwidthPercentile\x128\n" + + "\x17bandwidthPercentileBits\x18\t \x01(\x03R\x17bandwidthPercentileBits\x1a\x88\x02\n" + + "\x10DailyTrafficStat\x12\x10\n" + + "\x03day\x18\x01 \x01(\tR\x03day\x12\x14\n" + + "\x05bytes\x18\x02 \x01(\x03R\x05bytes\x12 \n" + + "\vcachedBytes\x18\x03 \x01(\x03R\vcachedBytes\x12 \n" + + "\vattackBytes\x18\x04 \x01(\x03R\vattackBytes\x12$\n" + + "\rcountRequests\x18\x05 \x01(\x03R\rcountRequests\x120\n" + + "\x13countCachedRequests\x18\x06 \x01(\x03R\x13countCachedRequests\x120\n" + + "\x13countAttackRequests\x18\a \x01(\x03R\x13countAttackRequests\x1a@\n" + + "\x16DailyPeekBandwidthStat\x12\x10\n" + + "\x03day\x18\x01 \x01(\tR\x03day\x12\x14\n" + + "\x05bytes\x18\x02 \x01(\x03R\x05bytes\"6\n" + + "\x1cFindUserNodeClusterIdRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"E\n" + + "\x1dFindUserNodeClusterIdResponse\x12$\n" + + "\rnodeClusterId\x18\x01 \x01(\x03R\rnodeClusterId\"W\n" + + "\x19UpdateUserFeaturesRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\"\n" + + "\ffeatureCodes\x18\x02 \x03(\tR\ffeatureCodes\"a\n" + + "\x1dUpdateAllUsersFeaturesRequest\x12\"\n" + + "\ffeatureCodes\x18\x01 \x03(\tR\ffeatureCodes\x12\x1c\n" + + "\toverwrite\x18\x02 \x01(\bR\toverwrite\"1\n" + + "\x17FindUserFeaturesRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"G\n" + + "\x18FindUserFeaturesResponse\x12+\n" + + "\bfeatures\x18\x01 \x03(\v2\x0f.pb.UserFeatureR\bfeatures\"&\n" + + "$FindAllUserFeatureDefinitionsRequest\"T\n" + + "%FindAllUserFeatureDefinitionsResponse\x12+\n" + + "\bfeatures\x18\x01 \x03(\v2\x0f.pb.UserFeatureR\bfeatures\"\x1f\n" + + "\x1dComposeUserGlobalBoardRequest\"\xa9\x06\n" + + "\x1eComposeUserGlobalBoardResponse\x12\x1e\n" + + "\n" + + "totalUsers\x18\x01 \x01(\x03R\n" + + "totalUsers\x12(\n" + + "\x0fcountTodayUsers\x18\x02 \x01(\x03R\x0fcountTodayUsers\x12*\n" + + "\x10countWeeklyUsers\x18\x03 \x01(\x03R\x10countWeeklyUsers\x12&\n" + + "\x0ecountUserNodes\x18\x04 \x01(\x03R\x0ecountUserNodes\x124\n" + + "\x15countOfflineUserNodes\x18\x05 \x01(\x03R\x15countOfflineUserNodes\x120\n" + + "\x13countVerifyingUsers\x18\x06 \x01(\x03R\x13countVerifyingUsers\x12L\n" + + "\n" + + "dailyStats\x18\x1e \x03(\v2,.pb.ComposeUserGlobalBoardResponse.DailyStatR\n" + + "dailyStats\x123\n" + + "\rcpuNodeValues\x18\x1f \x03(\v2\r.pb.NodeValueR\rcpuNodeValues\x129\n" + + "\x10memoryNodeValues\x18 \x03(\v2\r.pb.NodeValueR\x10memoryNodeValues\x125\n" + + "\x0eloadNodeValues\x18! \x03(\v2\r.pb.NodeValueR\x0eloadNodeValues\x12X\n" + + "\x0ftopTrafficStats\x18\" \x03(\v2..pb.ComposeUserGlobalBoardResponse.TrafficStatR\x0ftopTrafficStats\x1a3\n" + + "\tDailyStat\x12\x10\n" + + "\x03day\x18\x01 \x01(\tR\x03day\x12\x14\n" + + "\x05count\x18\x02 \x01(\x03R\x05count\x1a}\n" + + "\vTrafficStat\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x1a\n" + + "\buserName\x18\x02 \x01(\tR\buserName\x12$\n" + + "\rcountRequests\x18\x03 \x01(\x03R\rcountRequests\x12\x14\n" + + "\x05bytes\x18\x04 \x01(\x03R\x05bytes\"=\n" + + "\x1fCheckUserOTPWithUsernameRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\"B\n" + + " CheckUserOTPWithUsernameResponse\x12\x1e\n" + + "\n" + + "requireOTP\x18\x01 \x01(\bR\n" + + "requireOTP\"2\n" + + "\x18FindUserPriceInfoRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"[\n" + + "\x19FindUserPriceInfoResponse\x12\x1c\n" + + "\tpriceType\x18\x01 \x01(\tR\tpriceType\x12 \n" + + "\vpricePeriod\x18\x02 \x01(\tR\vpricePeriod\"R\n" + + "\x1aUpdateUserPriceTypeRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12\x1c\n" + + "\tpriceType\x18\x02 \x01(\tR\tpriceType\"X\n" + + "\x1cUpdateUserPricePeriodRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\x12 \n" + + "\vpricePeriod\x18\x02 \x01(\tR\vpricePeriod\"6\n" + + "\x1cCheckUserServersStateRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"=\n" + + "\x1dCheckUserServersStateResponse\x12\x1c\n" + + "\tisEnabled\x18\x01 \x01(\bR\tisEnabled\"6\n" + + "\x1cRenewUserServersStateRequest\x12\x16\n" + + "\x06userId\x18\x01 \x01(\x03R\x06userId\"=\n" + + "\x1dRenewUserServersStateResponse\x12\x1c\n" + + "\tisEnabled\x18\x01 \x01(\bR\tisEnabled\"-\n" + + "\x15CheckUserEmailRequest\x12\x14\n" + + "\x05email\x18\x01 \x01(\tR\x05email\"0\n" + + "\x16CheckUserEmailResponse\x12\x16\n" + + "\x06exists\x18\x01 \x01(\bR\x06exists\"0\n" + + "\x16CheckUserMobileRequest\x12\x16\n" + + "\x06mobile\x18\x01 \x01(\tR\x06mobile\"1\n" + + "\x17CheckUserMobileResponse\x12\x16\n" + + "\x06exists\x18\x01 \x01(\bR\x06exists\"F\n" + + "(FindUserVerifiedEmailWithUsernameRequest\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\"A\n" + + ")FindUserVerifiedEmailWithUsernameResponse\x12\x14\n" + + "\x05email\x18\x01 \x01(\tR\x05email2\xae\x11\n" + + "\vUserService\x12;\n" + + "\n" + + "createUser\x12\x15.pb.CreateUserRequest\x1a\x16.pb.CreateUserResponse\x12A\n" + + "\fregisterUser\x12\x17.pb.RegisterUserRequest\x1a\x18.pb.RegisterUserResponse\x123\n" + + "\n" + + "verifyUser\x12\x15.pb.VerifyUserRequest\x1a\x0e.pb.RPCSuccess\x123\n" + + "\n" + + "updateUser\x12\x15.pb.UpdateUserRequest\x1a\x0e.pb.RPCSuccess\x123\n" + + "\n" + + "deleteUser\x12\x15.pb.DeleteUserRequest\x1a\x0e.pb.RPCSuccess\x12M\n" + + "\x14countAllEnabledUsers\x12\x1f.pb.CountAllEnabledUsersRequest\x1a\x14.pb.RPCCountResponse\x12M\n" + + "\x10listEnabledUsers\x12\x1b.pb.ListEnabledUsersRequest\x1a\x1c.pb.ListEnabledUsersResponse\x12J\n" + + "\x0ffindEnabledUser\x12\x1a.pb.FindEnabledUserRequest\x1a\x1b.pb.FindEnabledUserResponse\x12P\n" + + "\x11checkUserUsername\x12\x1c.pb.CheckUserUsernameRequest\x1a\x1d.pb.CheckUserUsernameResponse\x128\n" + + "\tloginUser\x12\x14.pb.LoginUserRequest\x1a\x15.pb.LoginUserResponse\x12;\n" + + "\x0eupdateUserInfo\x12\x19.pb.UpdateUserInfoRequest\x1a\x0e.pb.RPCSuccess\x12=\n" + + "\x0fupdateUserLogin\x12\x1a.pb.UpdateUserLoginRequest\x1a\x0e.pb.RPCSuccess\x12Y\n" + + "\x14composeUserDashboard\x12\x1f.pb.ComposeUserDashboardRequest\x1a .pb.ComposeUserDashboardResponse\x12\\\n" + + "\x15findUserNodeClusterId\x12 .pb.FindUserNodeClusterIdRequest\x1a!.pb.FindUserNodeClusterIdResponse\x12C\n" + + "\x12updateUserFeatures\x12\x1d.pb.UpdateUserFeaturesRequest\x1a\x0e.pb.RPCSuccess\x12K\n" + + "\x16updateAllUsersFeatures\x12!.pb.UpdateAllUsersFeaturesRequest\x1a\x0e.pb.RPCSuccess\x12M\n" + + "\x10findUserFeatures\x12\x1b.pb.FindUserFeaturesRequest\x1a\x1c.pb.FindUserFeaturesResponse\x12t\n" + + "\x1dfindAllUserFeatureDefinitions\x12(.pb.FindAllUserFeatureDefinitionsRequest\x1a).pb.FindAllUserFeatureDefinitionsResponse\x12_\n" + + "\x16composeUserGlobalBoard\x12!.pb.ComposeUserGlobalBoardRequest\x1a\".pb.ComposeUserGlobalBoardResponse\x12e\n" + + "\x18checkUserOTPWithUsername\x12#.pb.CheckUserOTPWithUsernameRequest\x1a$.pb.CheckUserOTPWithUsernameResponse\x12P\n" + + "\x11findUserPriceInfo\x12\x1c.pb.FindUserPriceInfoRequest\x1a\x1d.pb.FindUserPriceInfoResponse\x12E\n" + + "\x13updateUserPriceType\x12\x1e.pb.UpdateUserPriceTypeRequest\x1a\x0e.pb.RPCSuccess\x12I\n" + + "\x15updateUserPricePeriod\x12 .pb.UpdateUserPricePeriodRequest\x1a\x0e.pb.RPCSuccess\x12\\\n" + + "\x15checkUserServersState\x12 .pb.CheckUserServersStateRequest\x1a!.pb.CheckUserServersStateResponse\x12\\\n" + + "\x15renewUserServersState\x12 .pb.RenewUserServersStateRequest\x1a!.pb.RenewUserServersStateResponse\x12G\n" + + "\x0echeckUserEmail\x12\x19.pb.CheckUserEmailRequest\x1a\x1a.pb.CheckUserEmailResponse\x12J\n" + + "\x0fcheckUserMobile\x12\x1a.pb.CheckUserMobileRequest\x1a\x1b.pb.CheckUserMobileResponse\x12\x80\x01\n" + + "!findUserVerifiedEmailWithUsername\x12,.pb.FindUserVerifiedEmailWithUsernameRequest\x1a-.pb.FindUserVerifiedEmailWithUsernameResponseB\x06Z\x04./pbb\x06proto3" var ( file_service_user_proto_rawDescOnce sync.Once - file_service_user_proto_rawDescData = file_service_user_proto_rawDesc + file_service_user_proto_rawDescData []byte ) func file_service_user_proto_rawDescGZIP() []byte { file_service_user_proto_rawDescOnce.Do(func() { - file_service_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_user_proto_rawDescData) + file_service_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_service_user_proto_rawDesc), len(file_service_user_proto_rawDesc))) }) return file_service_user_proto_rawDescData } @@ -3497,7 +3230,7 @@ func file_service_user_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_service_user_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_service_user_proto_rawDesc), len(file_service_user_proto_rawDesc)), NumEnums: 0, NumMessages: 50, NumExtensions: 0, @@ -3508,7 +3241,6 @@ func file_service_user_proto_init() { MessageInfos: file_service_user_proto_msgTypes, }.Build() File_service_user_proto = out.File - file_service_user_proto_rawDesc = nil file_service_user_proto_goTypes = nil file_service_user_proto_depIdxs = nil } diff --git a/EdgeCommon/pkg/rpc/pb/service_user_grpc.pb.go b/EdgeCommon/pkg/rpc/pb/service_user_grpc.pb.go index 97d95f4..8d24141 100644 --- a/EdgeCommon/pkg/rpc/pb/service_user_grpc.pb.go +++ b/EdgeCommon/pkg/rpc/pb/service_user_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v6.33.2 +// - protoc-gen-go-grpc v1.6.1 +// - protoc v3.21.12 // source: service_user.proto package pb @@ -473,88 +473,88 @@ type UserServiceServer interface { type UnimplementedUserServiceServer struct{} func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") + return nil, status.Error(codes.Unimplemented, "method CreateUser not implemented") } func (UnimplementedUserServiceServer) RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterUser not implemented") + return nil, status.Error(codes.Unimplemented, "method RegisterUser not implemented") } func (UnimplementedUserServiceServer) VerifyUser(context.Context, *VerifyUserRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyUser not implemented") + return nil, status.Error(codes.Unimplemented, "method VerifyUser not implemented") } func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented") } func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") + return nil, status.Error(codes.Unimplemented, "method DeleteUser not implemented") } func (UnimplementedUserServiceServer) CountAllEnabledUsers(context.Context, *CountAllEnabledUsersRequest) (*RPCCountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledUsers not implemented") + return nil, status.Error(codes.Unimplemented, "method CountAllEnabledUsers not implemented") } func (UnimplementedUserServiceServer) ListEnabledUsers(context.Context, *ListEnabledUsersRequest) (*ListEnabledUsersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListEnabledUsers not implemented") + return nil, status.Error(codes.Unimplemented, "method ListEnabledUsers not implemented") } func (UnimplementedUserServiceServer) FindEnabledUser(context.Context, *FindEnabledUserRequest) (*FindEnabledUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindEnabledUser not implemented") + return nil, status.Error(codes.Unimplemented, "method FindEnabledUser not implemented") } func (UnimplementedUserServiceServer) CheckUserUsername(context.Context, *CheckUserUsernameRequest) (*CheckUserUsernameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckUserUsername not implemented") + return nil, status.Error(codes.Unimplemented, "method CheckUserUsername not implemented") } func (UnimplementedUserServiceServer) LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LoginUser not implemented") + return nil, status.Error(codes.Unimplemented, "method LoginUser not implemented") } func (UnimplementedUserServiceServer) UpdateUserInfo(context.Context, *UpdateUserInfoRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateUserInfo not implemented") } func (UnimplementedUserServiceServer) UpdateUserLogin(context.Context, *UpdateUserLoginRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUserLogin not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateUserLogin not implemented") } func (UnimplementedUserServiceServer) ComposeUserDashboard(context.Context, *ComposeUserDashboardRequest) (*ComposeUserDashboardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ComposeUserDashboard not implemented") + return nil, status.Error(codes.Unimplemented, "method ComposeUserDashboard not implemented") } func (UnimplementedUserServiceServer) FindUserNodeClusterId(context.Context, *FindUserNodeClusterIdRequest) (*FindUserNodeClusterIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindUserNodeClusterId not implemented") + return nil, status.Error(codes.Unimplemented, "method FindUserNodeClusterId not implemented") } func (UnimplementedUserServiceServer) UpdateUserFeatures(context.Context, *UpdateUserFeaturesRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUserFeatures not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateUserFeatures not implemented") } func (UnimplementedUserServiceServer) UpdateAllUsersFeatures(context.Context, *UpdateAllUsersFeaturesRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateAllUsersFeatures not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateAllUsersFeatures not implemented") } func (UnimplementedUserServiceServer) FindUserFeatures(context.Context, *FindUserFeaturesRequest) (*FindUserFeaturesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindUserFeatures not implemented") + return nil, status.Error(codes.Unimplemented, "method FindUserFeatures not implemented") } func (UnimplementedUserServiceServer) FindAllUserFeatureDefinitions(context.Context, *FindAllUserFeatureDefinitionsRequest) (*FindAllUserFeatureDefinitionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllUserFeatureDefinitions not implemented") + return nil, status.Error(codes.Unimplemented, "method FindAllUserFeatureDefinitions not implemented") } func (UnimplementedUserServiceServer) ComposeUserGlobalBoard(context.Context, *ComposeUserGlobalBoardRequest) (*ComposeUserGlobalBoardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ComposeUserGlobalBoard not implemented") + return nil, status.Error(codes.Unimplemented, "method ComposeUserGlobalBoard not implemented") } func (UnimplementedUserServiceServer) CheckUserOTPWithUsername(context.Context, *CheckUserOTPWithUsernameRequest) (*CheckUserOTPWithUsernameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckUserOTPWithUsername not implemented") + return nil, status.Error(codes.Unimplemented, "method CheckUserOTPWithUsername not implemented") } func (UnimplementedUserServiceServer) FindUserPriceInfo(context.Context, *FindUserPriceInfoRequest) (*FindUserPriceInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindUserPriceInfo not implemented") + return nil, status.Error(codes.Unimplemented, "method FindUserPriceInfo not implemented") } func (UnimplementedUserServiceServer) UpdateUserPriceType(context.Context, *UpdateUserPriceTypeRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPriceType not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateUserPriceType not implemented") } func (UnimplementedUserServiceServer) UpdateUserPricePeriod(context.Context, *UpdateUserPricePeriodRequest) (*RPCSuccess, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPricePeriod not implemented") + return nil, status.Error(codes.Unimplemented, "method UpdateUserPricePeriod not implemented") } func (UnimplementedUserServiceServer) CheckUserServersState(context.Context, *CheckUserServersStateRequest) (*CheckUserServersStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckUserServersState not implemented") + return nil, status.Error(codes.Unimplemented, "method CheckUserServersState not implemented") } func (UnimplementedUserServiceServer) RenewUserServersState(context.Context, *RenewUserServersStateRequest) (*RenewUserServersStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RenewUserServersState not implemented") + return nil, status.Error(codes.Unimplemented, "method RenewUserServersState not implemented") } func (UnimplementedUserServiceServer) CheckUserEmail(context.Context, *CheckUserEmailRequest) (*CheckUserEmailResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckUserEmail not implemented") + return nil, status.Error(codes.Unimplemented, "method CheckUserEmail not implemented") } func (UnimplementedUserServiceServer) CheckUserMobile(context.Context, *CheckUserMobileRequest) (*CheckUserMobileResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckUserMobile not implemented") + return nil, status.Error(codes.Unimplemented, "method CheckUserMobile not implemented") } func (UnimplementedUserServiceServer) FindUserVerifiedEmailWithUsername(context.Context, *FindUserVerifiedEmailWithUsernameRequest) (*FindUserVerifiedEmailWithUsernameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindUserVerifiedEmailWithUsername not implemented") + return nil, status.Error(codes.Unimplemented, "method FindUserVerifiedEmailWithUsername not implemented") } func (UnimplementedUserServiceServer) testEmbeddedByValue() {} @@ -566,7 +566,7 @@ type UnsafeUserServiceServer interface { } func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { - // If the following call pancis, it indicates UnimplementedUserServiceServer was + // If the following call panics, it indicates UnimplementedUserServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/EdgeCommon/pkg/rpc/protos/models/model_httpdns_app.proto b/EdgeCommon/pkg/rpc/protos/models/model_httpdns_app.proto index 3c37338..553ca89 100644 --- a/EdgeCommon/pkg/rpc/protos/models/model_httpdns_app.proto +++ b/EdgeCommon/pkg/rpc/protos/models/model_httpdns_app.proto @@ -8,8 +8,7 @@ message HTTPDNSApp { string name = 2; string appId = 3; bool isOn = 4; - int64 primaryClusterId = 5; - int64 backupClusterId = 6; + reserved 5, 6; // removed: primaryClusterId, backupClusterId string sniMode = 7; bool signEnabled = 8; string signSecret = 9; @@ -17,4 +16,5 @@ message HTTPDNSApp { int64 createdAt = 11; int64 updatedAt = 12; int64 userId = 13; + bytes clusterIdsJSON = 14; } diff --git a/EdgeCommon/pkg/rpc/protos/models/model_httpdns_node.proto b/EdgeCommon/pkg/rpc/protos/models/model_httpdns_node.proto index 1cafade..ecfbe5f 100644 --- a/EdgeCommon/pkg/rpc/protos/models/model_httpdns_node.proto +++ b/EdgeCommon/pkg/rpc/protos/models/model_httpdns_node.proto @@ -3,6 +3,8 @@ option go_package = "./pb"; package pb; +import "models/model_node_login.proto"; + message HTTPDNSNode { int64 id = 1; int64 clusterId = 2; @@ -18,4 +20,5 @@ message HTTPDNSNode { bytes installStatusJSON = 12; int64 createdAt = 13; int64 updatedAt = 14; + NodeLogin nodeLogin = 15; } diff --git a/EdgeCommon/pkg/rpc/protos/models/model_user.proto b/EdgeCommon/pkg/rpc/protos/models/model_user.proto index 16d729d..ac09565 100644 --- a/EdgeCommon/pkg/rpc/protos/models/model_user.proto +++ b/EdgeCommon/pkg/rpc/protos/models/model_user.proto @@ -28,6 +28,7 @@ message User { bool isEnterpriseIdentified = 18; // 是否已通过企业验证 string bandwidthAlgo = 21; // 带宽算法 string lang = 22; // 语言代号 + bytes httpdnsClusterIdsJSON = 24; // HTTPDNS关联集群ID列表 Login otpLogin = 19; // OTP认证 diff --git a/EdgeCommon/pkg/rpc/protos/service_httpdns_app.proto b/EdgeCommon/pkg/rpc/protos/service_httpdns_app.proto index 155bccd..da8b9f9 100644 --- a/EdgeCommon/pkg/rpc/protos/service_httpdns_app.proto +++ b/EdgeCommon/pkg/rpc/protos/service_httpdns_app.proto @@ -20,11 +20,11 @@ service HTTPDNSAppService { message CreateHTTPDNSAppRequest { string name = 1; string appId = 2; - int64 primaryClusterId = 3; - int64 backupClusterId = 4; + reserved 3, 4; // removed: primaryClusterId, backupClusterId bool isOn = 5; bool signEnabled = 6; int64 userId = 7; + bytes clusterIdsJSON = 8; } message CreateHTTPDNSAppResponse { @@ -34,10 +34,10 @@ message CreateHTTPDNSAppResponse { message UpdateHTTPDNSAppRequest { int64 appDbId = 1; string name = 2; - int64 primaryClusterId = 3; - int64 backupClusterId = 4; + reserved 3, 4; // removed: primaryClusterId, backupClusterId bool isOn = 5; int64 userId = 6; + bytes clusterIdsJSON = 7; } message DeleteHTTPDNSAppRequest { diff --git a/EdgeCommon/pkg/rpc/protos/service_httpdns_node.proto b/EdgeCommon/pkg/rpc/protos/service_httpdns_node.proto index 5cfd3e4..97227df 100644 --- a/EdgeCommon/pkg/rpc/protos/service_httpdns_node.proto +++ b/EdgeCommon/pkg/rpc/protos/service_httpdns_node.proto @@ -4,6 +4,7 @@ option go_package = "./pb"; package pb; import "models/model_httpdns_node.proto"; +import "models/model_node_login.proto"; import "models/rpc_messages.proto"; service HTTPDNSNodeService { @@ -13,6 +14,8 @@ service HTTPDNSNodeService { rpc findHTTPDNSNode (FindHTTPDNSNodeRequest) returns (FindHTTPDNSNodeResponse); rpc listHTTPDNSNodes (ListHTTPDNSNodesRequest) returns (ListHTTPDNSNodesResponse); rpc updateHTTPDNSNodeStatus (UpdateHTTPDNSNodeStatusRequest) returns (RPCSuccess); + // 修改HTTPDNS节点登录信息 + rpc updateHTTPDNSNodeLogin (UpdateHTTPDNSNodeLoginRequest) returns (RPCSuccess); } message CreateHTTPDNSNodeRequest { @@ -61,3 +64,9 @@ message UpdateHTTPDNSNodeStatusRequest { bytes statusJSON = 5; bytes installStatusJSON = 6; } + +// 修改HTTPDNS节点登录信息 +message UpdateHTTPDNSNodeLoginRequest { + int64 nodeId = 1; + NodeLogin nodeLogin = 2; +} diff --git a/EdgeCommon/pkg/rpc/protos/service_user.proto b/EdgeCommon/pkg/rpc/protos/service_user.proto index 940acac..a490de1 100644 --- a/EdgeCommon/pkg/rpc/protos/service_user.proto +++ b/EdgeCommon/pkg/rpc/protos/service_user.proto @@ -148,6 +148,7 @@ message UpdateUserRequest { bool isOn = 9; int64 nodeClusterId = 10; string bandwidthAlgo = 11; + bytes httpdnsClusterIdsJSON = 12; // HTTPDNS关联集群ID列表 } // 删除用户 diff --git a/EdgeCommon/pkg/userconfigs/user_register_config.go b/EdgeCommon/pkg/userconfigs/user_register_config.go index 052b56d..862c732 100644 --- a/EdgeCommon/pkg/userconfigs/user_register_config.go +++ b/EdgeCommon/pkg/userconfigs/user_register_config.go @@ -53,7 +53,8 @@ type UserRegisterConfig struct { // 开通DNS服务 NSIsOn bool `json:"nsIsOn"` // 是否开启智能DNS服务 // 开通HTTPDNS服务 - HTTPDNSIsOn bool `json:"httpdnsIsOn"` // 是否开启用户端HTTPDNS服务 + HTTPDNSIsOn bool `json:"httpdnsIsOn"` // 是否开启用户端HTTPDNS服务 + HTTPDNSDefaultClusterIds []int64 `json:"httpdnsDefaultClusterIds"` // HTTPDNS默认集群ID列表 // 开通高防服务 ADIsOn bool `json:"adIsOn"` // 是否开启高防服务 diff --git a/EdgeDNS/internal/firewalls/ddos_protection.go b/EdgeDNS/internal/firewalls/ddos_protection.go index c852a08..45b38fa 100644 --- a/EdgeDNS/internal/firewalls/ddos_protection.go +++ b/EdgeDNS/internal/firewalls/ddos_protection.go @@ -173,6 +173,10 @@ func (this *DDoSProtectionManager) addTCPRules(tcpConfig *ddosconfigs.TCPConfig) var ports = []int32{} for _, portConfig := range tcpConfig.Ports { + // 校验端口范围 + if portConfig.Port <= 0 || portConfig.Port > 65535 { + continue + } if !lists.ContainsInt32(ports, portConfig.Port) { ports = append(ports, portConfig.Port) } @@ -367,7 +371,19 @@ func (this *DDoSProtectionManager) encodeUserData(attrs []string) string { return "" } - return "ZZ" + strings.Join(attrs, "_") + "ZZ" + // 清洗每个属性值,只保留字母、数字和横杠 + var safeAttrs = make([]string, len(attrs)) + for i, attr := range attrs { + var safe strings.Builder + for _, c := range attr { + if (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' { + safe.WriteRune(c) + } + } + safeAttrs[i] = safe.String() + } + + return "ZZ" + strings.Join(safeAttrs, "_") + "ZZ" } // 解码user data diff --git a/EdgeDNS/internal/nodes/dns_node.go b/EdgeDNS/internal/nodes/dns_node.go index 5c5d15c..a2c7d11 100644 --- a/EdgeDNS/internal/nodes/dns_node.go +++ b/EdgeDNS/internal/nodes/dns_node.go @@ -31,6 +31,7 @@ import ( "os" "os/exec" "os/signal" + "regexp" "runtime" "runtime/debug" "syscall" @@ -328,6 +329,13 @@ func (this *DNSNode) start() { apiConfig.NumberId = config.Id } + // 验证 NodeId 防止路径遍历 + var nodeIdRegexp = regexp.MustCompile(`^[a-zA-Z0-9_\-]+$`) + if !nodeIdRegexp.MatchString(config.NodeId) { + remotelogs.Error("NODE", "invalid NodeId: contains illegal characters") + return + } + var db = dbs.NewDB(Tea.Root + "/data/data-" + types.String(config.Id) + "-" + config.NodeId + "-v0.1.0.db") err = db.Init() if err != nil { diff --git a/EdgeDNS/internal/nodes/server.go b/EdgeDNS/internal/nodes/server.go index 2ebab02..e4f3630 100644 --- a/EdgeDNS/internal/nodes/server.go +++ b/EdgeDNS/internal/nodes/server.go @@ -247,6 +247,15 @@ func (this *Server) parseAction(questionName string, remoteAddr *string) (string return "", errors.New("decode question option failed: " + err.Error()) } else { var ip = m.GetString("ip") + // 验证 IP 地址合法性,防止 IP 欺骗 + parsedIP := net.ParseIP(ip) + if parsedIP == nil { + return "", errors.New("invalid IP address in setRemoteAddr: " + ip) + } + // 拒绝回环地址和未指定地址 + if parsedIP.IsLoopback() || parsedIP.IsUnspecified() { + return "", errors.New("disallowed IP address in setRemoteAddr: " + ip) + } *remoteAddr = ip } } diff --git a/EdgeHttpDNS/bin/edge-httpdns.exe b/EdgeHttpDNS/bin/edge-httpdns.exe index 7e779b7..d41c3e3 100644 Binary files a/EdgeHttpDNS/bin/edge-httpdns.exe and b/EdgeHttpDNS/bin/edge-httpdns.exe differ diff --git a/EdgeHttpDNS/edge-httpdns.exe b/EdgeHttpDNS/edge-httpdns.exe index b74e982..0311351 100644 Binary files a/EdgeHttpDNS/edge-httpdns.exe and b/EdgeHttpDNS/edge-httpdns.exe differ diff --git a/EdgeHttpDNS/go.mod b/EdgeHttpDNS/go.mod index 5798a01..fec8371 100644 --- a/EdgeHttpDNS/go.mod +++ b/EdgeHttpDNS/go.mod @@ -24,4 +24,5 @@ require ( golang.org/x/tools v0.40.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda // indirect google.golang.org/protobuf v1.36.10 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/EdgeHttpDNS/go.sum b/EdgeHttpDNS/go.sum index 6ee1098..fe5cf68 100644 --- a/EdgeHttpDNS/go.sum +++ b/EdgeHttpDNS/go.sum @@ -63,5 +63,7 @@ google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/EdgeHttpDNS/internal/accesslogs/httpdns_file_writer.go b/EdgeHttpDNS/internal/accesslogs/httpdns_file_writer.go new file mode 100644 index 0000000..a6c66dd --- /dev/null +++ b/EdgeHttpDNS/internal/accesslogs/httpdns_file_writer.go @@ -0,0 +1,172 @@ +package accesslogs + +import ( + "encoding/json" + "fmt" + "log" + "os" + "path/filepath" + "strings" + "sync" + + "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" + "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" + "gopkg.in/natefinch/lumberjack.v2" +) + +const ( + defaultHTTPDNSLogDir = "/var/log/edge/edge-httpdns" + envHTTPDNSLogDir = "EDGE_HTTPDNS_LOG_DIR" +) + +var ( + sharedHTTPDNSFileWriter *HTTPDNSFileWriter + sharedHTTPDNSFileWriterOnce sync.Once +) + +// SharedHTTPDNSFileWriter 返回 HTTPDNS 本地日志写入器(单例). +func SharedHTTPDNSFileWriter() *HTTPDNSFileWriter { + sharedHTTPDNSFileWriterOnce.Do(func() { + sharedHTTPDNSFileWriter = NewHTTPDNSFileWriter() + }) + return sharedHTTPDNSFileWriter +} + +// HTTPDNSFileWriter 将 HTTPDNS 访问日志以 JSON Lines 写入本地文件,供 Fluent Bit 采集。 +type HTTPDNSFileWriter struct { + dir string + mu sync.Mutex + file *lumberjack.Logger + rotateConfig *serverconfigs.AccessLogRotateConfig + inited bool +} + +// NewHTTPDNSFileWriter 创建 HTTPDNS 本地日志写入器. +func NewHTTPDNSFileWriter() *HTTPDNSFileWriter { + logDir := resolveDefaultHTTPDNSLogDir() + return &HTTPDNSFileWriter{ + dir: logDir, + rotateConfig: serverconfigs.NewDefaultAccessLogRotateConfig(), + } +} + +func resolveDefaultHTTPDNSLogDir() string { + logDir := strings.TrimSpace(os.Getenv(envHTTPDNSLogDir)) + if logDir == "" { + return defaultHTTPDNSLogDir + } + return logDir +} + +// SetDir 更新日志目录并重置文件句柄。 +func (w *HTTPDNSFileWriter) SetDir(dir string) { + if strings.TrimSpace(dir) == "" { + dir = resolveDefaultHTTPDNSLogDir() + } + + w.mu.Lock() + defer w.mu.Unlock() + + if dir == w.dir { + return + } + + if w.file != nil { + _ = w.file.Close() + w.file = nil + } + w.inited = false + w.dir = dir +} + +// Dir 返回当前日志目录. +func (w *HTTPDNSFileWriter) Dir() string { + return w.dir +} + +// EnsureInit 在启动时预创建目录与 access.log. +func (w *HTTPDNSFileWriter) EnsureInit() error { + if w.dir == "" { + return nil + } + return w.init() +} + +func (w *HTTPDNSFileWriter) init() error { + w.mu.Lock() + defer w.mu.Unlock() + + if w.inited && w.file != nil { + return nil + } + + if w.dir == "" { + return nil + } + + if err := os.MkdirAll(w.dir, 0755); err != nil { + log.Println("[HTTPDNS_ACCESS_LOG]mkdir log dir failed:", err.Error()) + return err + } + + rotateConfig := w.rotateConfig.Normalize() + w.file = &lumberjack.Logger{ + Filename: filepath.Join(w.dir, "access.log"), + MaxSize: rotateConfig.MaxSizeMB, + MaxBackups: rotateConfig.MaxBackups, + MaxAge: rotateConfig.MaxAgeDays, + Compress: *rotateConfig.Compress, + LocalTime: *rotateConfig.LocalTime, + } + + w.inited = true + return nil +} + +// WriteBatch 批量写入 HTTPDNS 访问日志. +func (w *HTTPDNSFileWriter) WriteBatch(logs []*pb.HTTPDNSAccessLog) { + if len(logs) == 0 || w.dir == "" { + return + } + if err := w.init(); err != nil { + return + } + + w.mu.Lock() + file := w.file + w.mu.Unlock() + if file == nil { + return + } + + for _, logItem := range logs { + ingestLog := FromPBAccessLog(logItem) + if ingestLog == nil { + continue + } + line, err := json.Marshal(ingestLog) + if err != nil { + continue + } + _, _ = file.Write(append(line, '\n')) + } +} + +// Close 关闭日志文件. +func (w *HTTPDNSFileWriter) Close() error { + w.mu.Lock() + defer w.mu.Unlock() + + if w.file == nil { + return nil + } + + err := w.file.Close() + w.file = nil + w.inited = false + if err != nil { + log.Println(fmt.Sprintf("[HTTPDNS_ACCESS_LOG]close access.log failed: %v", err)) + return err + } + return nil +} diff --git a/EdgeHttpDNS/internal/accesslogs/httpdns_ingest_log.go b/EdgeHttpDNS/internal/accesslogs/httpdns_ingest_log.go new file mode 100644 index 0000000..60ad141 --- /dev/null +++ b/EdgeHttpDNS/internal/accesslogs/httpdns_ingest_log.go @@ -0,0 +1,57 @@ +package accesslogs + +import "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" + +// HTTPDNSIngestLog HTTPDNS 访问日志单行结构(JSONEachRow),字段与 +// ClickHouse httpdns_access_logs_ingest 表一一对应。 +type HTTPDNSIngestLog struct { + Timestamp int64 `json:"timestamp"` + RequestId string `json:"request_id"` + ClusterId int64 `json:"cluster_id"` + NodeId int64 `json:"node_id"` + AppId string `json:"app_id"` + AppName string `json:"app_name"` + Domain string `json:"domain"` + QType string `json:"qtype"` + ClientIP string `json:"client_ip"` + ClientRegion string `json:"client_region"` + Carrier string `json:"carrier"` + SDKVersion string `json:"sdk_version"` + OS string `json:"os"` + ResultIPs string `json:"result_ips"` + Status string `json:"status"` + ErrorCode string `json:"error_code"` + CostMs int32 `json:"cost_ms"` + CreatedAt int64 `json:"created_at"` + Day string `json:"day"` + Summary string `json:"summary"` +} + +// FromPBAccessLog 将 pb.HTTPDNSAccessLog 转为本地 ingest 结构。 +func FromPBAccessLog(log *pb.HTTPDNSAccessLog) *HTTPDNSIngestLog { + if log == nil { + return nil + } + return &HTTPDNSIngestLog{ + Timestamp: log.GetCreatedAt(), + RequestId: log.GetRequestId(), + ClusterId: log.GetClusterId(), + NodeId: log.GetNodeId(), + AppId: log.GetAppId(), + AppName: log.GetAppName(), + Domain: log.GetDomain(), + QType: log.GetQtype(), + ClientIP: log.GetClientIP(), + ClientRegion: log.GetClientRegion(), + Carrier: log.GetCarrier(), + SDKVersion: log.GetSdkVersion(), + OS: log.GetOs(), + ResultIPs: log.GetResultIPs(), + Status: log.GetStatus(), + ErrorCode: log.GetErrorCode(), + CostMs: log.GetCostMs(), + CreatedAt: log.GetCreatedAt(), + Day: log.GetDay(), + Summary: log.GetSummary(), + } +} diff --git a/EdgeHttpDNS/internal/nodes/resolve_server.go b/EdgeHttpDNS/internal/nodes/resolve_server.go index 31bdc89..0b7f30d 100644 --- a/EdgeHttpDNS/internal/nodes/resolve_server.go +++ b/EdgeHttpDNS/internal/nodes/resolve_server.go @@ -13,14 +13,18 @@ import ( "net" "net/http" "net/url" + "sort" "strconv" "strings" + "sync" "time" "github.com/TeaOSLab/EdgeCommon/pkg/iplibrary" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" + "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" + "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/sslconfigs" + "github.com/TeaOSLab/EdgeHttpDNS/internal/accesslogs" "github.com/TeaOSLab/EdgeHttpDNS/internal/configs" - "github.com/TeaOSLab/EdgeHttpDNS/internal/rpc" "github.com/iwind/TeaGo/rands" "github.com/miekg/dns" ) @@ -83,61 +87,79 @@ type clientRouteProfile struct { RegionText string } -type ResolveServer struct { - quitCh <-chan struct{} +type tlsListener struct { + addr string // e.g. ":443" + listener net.Listener + server *http.Server +} +type ResolveServer struct { + quitCh <-chan struct{} snapshotManager *SnapshotManager - listenAddr string - certFile string - keyFile string - server *http.Server + // Local config fallback + fallbackAddr string + certFile string + keyFile string - logQueue chan *pb.HTTPDNSAccessLog + handler http.Handler // shared mux + tlsConfig *tls.Config // shared TLS config (with GetCertificate) + + logWriter *accesslogs.HTTPDNSFileWriter + logQueue chan *pb.HTTPDNSAccessLog + + // TLS certificate hot-reload + certMu sync.RWMutex + currentCert *tls.Certificate + certSnapshotAt int64 + + // Listener hot-reload + listenerMu sync.Mutex + listeners map[string]*tlsListener // key: addr (e.g. ":443") } func NewResolveServer(quitCh <-chan struct{}, snapshotManager *SnapshotManager) *ResolveServer { - listenAddr := ":443" + fallbackAddr := ":443" certFile := "" keyFile := "" if apiConfig, err := configs.SharedAPIConfig(); err == nil && apiConfig != nil { if len(apiConfig.HTTPSListenAddr) > 0 { - listenAddr = apiConfig.HTTPSListenAddr + fallbackAddr = apiConfig.HTTPSListenAddr } certFile = apiConfig.HTTPSCert keyFile = apiConfig.HTTPSKey } + logWriter := accesslogs.SharedHTTPDNSFileWriter() + if apiConfig, err := configs.SharedAPIConfig(); err == nil && apiConfig != nil { + if len(strings.TrimSpace(apiConfig.LogDir)) > 0 { + logWriter.SetDir(strings.TrimSpace(apiConfig.LogDir)) + } + } + if err := logWriter.EnsureInit(); err != nil { + log.Println("[HTTPDNS_NODE][resolve]init access log file writer failed:", err.Error()) + } + instance := &ResolveServer{ quitCh: quitCh, snapshotManager: snapshotManager, - listenAddr: listenAddr, + fallbackAddr: fallbackAddr, certFile: certFile, keyFile: keyFile, + logWriter: logWriter, logQueue: make(chan *pb.HTTPDNSAccessLog, 8192), + listeners: make(map[string]*tlsListener), } mux := http.NewServeMux() mux.HandleFunc("/resolve", instance.handleResolve) mux.HandleFunc("/healthz", instance.handleHealth) + instance.handler = mux - instance.server = &http.Server{ - Addr: instance.listenAddr, - Handler: mux, - ReadTimeout: 5 * time.Second, - ReadHeaderTimeout: 3 * time.Second, - WriteTimeout: 5 * time.Second, - IdleTimeout: 75 * time.Second, - MaxHeaderBytes: 8 * 1024, - TLSConfig: &tls.Config{ - MinVersion: tls.VersionTLS11, - // /resolve is a small JSON API; pin to HTTP/1.1 to avoid ALPN/h2 handshake variance - // across some clients and middleboxes. - NextProtos: []string{"http/1.1"}, - }, - // Disable automatic HTTP/2 upgrade on TLS listeners. This keeps handshake behavior - // deterministic for SDK resolve calls. - TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){}, + instance.tlsConfig = &tls.Config{ + MinVersion: tls.VersionTLS11, + NextProtos: []string{"http/1.1"}, + GetCertificate: instance.getCertificate, } return instance @@ -145,19 +167,240 @@ func NewResolveServer(quitCh <-chan struct{}, snapshotManager *SnapshotManager) func (s *ResolveServer) Start() { go s.startAccessLogFlusher() - go s.waitForShutdown() - log.Println("[HTTPDNS_NODE][resolve]listening HTTPS on", s.listenAddr) - if err := s.server.ListenAndServeTLS(s.certFile, s.keyFile); err != nil && !errors.Is(err, http.ErrServerClosed) { - log.Println("[HTTPDNS_NODE][resolve]listen failed:", err.Error()) + // 1. Load initial certificate from file (fallback) + if len(s.certFile) > 0 && len(s.keyFile) > 0 { + cert, err := tls.LoadX509KeyPair(s.certFile, s.keyFile) + if err != nil { + log.Println("[HTTPDNS_NODE][resolve]load cert file failed:", err.Error()) + } else { + s.currentCert = &cert + log.Println("[HTTPDNS_NODE][resolve]loaded initial TLS cert from file") + } + } + + // 2. Try loading certificate from cluster snapshot (takes priority over file) + if snapshot := s.snapshotManager.Current(); snapshot != nil { + s.reloadCertFromSnapshot(snapshot) + } + + if s.currentCert == nil { + log.Println("[HTTPDNS_NODE][resolve]WARNING: no TLS certificate available, HTTPS will fail") + } + + // 3. Parse initial listen addresses and start listeners + if snapshot := s.snapshotManager.Current(); snapshot != nil { + addrs := s.desiredAddrs(snapshot) + s.syncListeners(addrs) + } else { + s.syncListeners([]string{s.fallbackAddr}) + } + + // 4. Watch for changes (blocks until quit) + s.watchLoop() +} + +func (s *ResolveServer) getCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error) { + s.certMu.RLock() + cert := s.currentCert + s.certMu.RUnlock() + if cert != nil { + return cert, nil + } + return nil, errors.New("no TLS certificate available") +} + +type snapshotTLSConfig struct { + Listen []*serverconfigs.NetworkAddressConfig `json:"listen"` + SSLPolicy *sslconfigs.SSLPolicy `json:"sslPolicy"` +} + +func (s *ResolveServer) parseTLSConfig(snapshot *LoadedSnapshot) *snapshotTLSConfig { + if snapshot.ClusterID <= 0 { + return nil + } + cluster := snapshot.Clusters[snapshot.ClusterID] + if cluster == nil { + return nil + } + raw := cluster.GetTlsPolicyJSON() + if len(raw) == 0 { + return nil + } + + var cfg snapshotTLSConfig + if err := json.Unmarshal(raw, &cfg); err != nil { + log.Println("[HTTPDNS_NODE][resolve]parse tlsPolicyJSON failed:", err.Error()) + return nil + } + return &cfg +} + +func (s *ResolveServer) desiredAddrs(snapshot *LoadedSnapshot) []string { + cfg := s.parseTLSConfig(snapshot) + if cfg == nil || len(cfg.Listen) == 0 { + return []string{s.fallbackAddr} + } + + seen := make(map[string]struct{}) + var addrs []string + for _, listenCfg := range cfg.Listen { + if listenCfg == nil { + continue + } + if err := listenCfg.Init(); err != nil { + log.Println("[HTTPDNS_NODE][resolve]init listen config failed:", err.Error()) + continue + } + for _, addr := range listenCfg.Addresses() { + if _, ok := seen[addr]; !ok { + seen[addr] = struct{}{} + addrs = append(addrs, addr) + } + } + } + + if len(addrs) == 0 { + return []string{s.fallbackAddr} + } + sort.Strings(addrs) + return addrs +} + +func (s *ResolveServer) reloadCertFromSnapshot(snapshot *LoadedSnapshot) { + cfg := s.parseTLSConfig(snapshot) + if cfg == nil || cfg.SSLPolicy == nil || len(cfg.SSLPolicy.Certs) == 0 { + s.certMu.Lock() + s.certSnapshotAt = snapshot.LoadedAt + s.certMu.Unlock() + return + } + if err := cfg.SSLPolicy.Init(context.Background()); err != nil { + log.Println("[HTTPDNS_NODE][resolve]init SSLPolicy failed:", err.Error()) + s.certMu.Lock() + s.certSnapshotAt = snapshot.LoadedAt + s.certMu.Unlock() + return + } + cert := cfg.SSLPolicy.FirstCert() + if cert == nil { + s.certMu.Lock() + s.certSnapshotAt = snapshot.LoadedAt + s.certMu.Unlock() + return + } + + s.certMu.Lock() + s.currentCert = cert + s.certSnapshotAt = snapshot.LoadedAt + s.certMu.Unlock() + log.Println("[HTTPDNS_NODE][resolve]TLS certificate reloaded from snapshot") +} + +func (s *ResolveServer) startListener(addr string) error { + ln, err := net.Listen("tcp", addr) + if err != nil { + return fmt.Errorf("listen on %s: %w", addr, err) + } + tlsLn := tls.NewListener(ln, s.tlsConfig) + + srv := &http.Server{ + Handler: s.handler, + ReadTimeout: 5 * time.Second, + ReadHeaderTimeout: 3 * time.Second, + WriteTimeout: 5 * time.Second, + IdleTimeout: 75 * time.Second, + MaxHeaderBytes: 8 * 1024, + TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){}, + } + + s.listeners[addr] = &tlsListener{ + addr: addr, + listener: tlsLn, + server: srv, + } + + go func() { + if err := srv.Serve(tlsLn); err != nil && !errors.Is(err, http.ErrServerClosed) { + log.Println("[HTTPDNS_NODE][resolve]serve failed on", addr, ":", err.Error()) + } + }() + + log.Println("[HTTPDNS_NODE][resolve]listening HTTPS on", addr) + return nil +} + +func (s *ResolveServer) stopListener(addr string) { + tl, ok := s.listeners[addr] + if !ok { + return + } + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + defer cancel() + _ = tl.server.Shutdown(ctx) + delete(s.listeners, addr) + log.Println("[HTTPDNS_NODE][resolve]stopped listener on", addr) +} + +func (s *ResolveServer) syncListeners(desired []string) { + s.listenerMu.Lock() + defer s.listenerMu.Unlock() + + desiredSet := make(map[string]struct{}, len(desired)) + for _, addr := range desired { + desiredSet[addr] = struct{}{} + } + + // Stop listeners that are no longer desired + for addr := range s.listeners { + if _, ok := desiredSet[addr]; !ok { + s.stopListener(addr) + } + } + + // Start new listeners + for _, addr := range desired { + if _, ok := s.listeners[addr]; !ok { + if err := s.startListener(addr); err != nil { + log.Println("[HTTPDNS_NODE][resolve]start listener failed:", err.Error()) + } + } } } -func (s *ResolveServer) waitForShutdown() { - <-s.quitCh - ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) - defer cancel() - _ = s.server.Shutdown(ctx) +func (s *ResolveServer) watchLoop() { + ticker := time.NewTicker(5 * time.Second) + defer ticker.Stop() + for { + select { + case <-ticker.C: + snapshot := s.snapshotManager.Current() + if snapshot == nil { + continue + } + s.certMu.RLock() + lastAt := s.certSnapshotAt + s.certMu.RUnlock() + if snapshot.LoadedAt == lastAt { + continue + } + // Snapshot changed — sync listeners and reload cert + addrs := s.desiredAddrs(snapshot) + s.syncListeners(addrs) + s.reloadCertFromSnapshot(snapshot) + case <-s.quitCh: + s.shutdownAll() + return + } + } +} + +func (s *ResolveServer) shutdownAll() { + s.listenerMu.Lock() + defer s.listenerMu.Unlock() + for addr := range s.listeners { + s.stopListener(addr) + } } func (s *ResolveServer) handleHealth(writer http.ResponseWriter, _ *http.Request) { @@ -219,11 +462,22 @@ func (s *ResolveServer) handleResolve(writer http.ResponseWriter, request *http. return } - if snapshot.ClusterID > 0 && - loadedApp.App.GetPrimaryClusterId() != snapshot.ClusterID && - loadedApp.App.GetBackupClusterId() != snapshot.ClusterID { - s.writeFailedResolve(writer, requestID, snapshot, loadedApp.App, domain, qtype, httpdnsCodeAppInvalid, "当前应用未绑定到该解析集群", startAt, request, query) - return + if snapshot.ClusterID > 0 { + var appClusterIds []int64 + if len(loadedApp.App.GetClusterIdsJSON()) > 0 { + _ = json.Unmarshal(loadedApp.App.GetClusterIdsJSON(), &appClusterIds) + } + var clusterBound bool + for _, cid := range appClusterIds { + if cid == snapshot.ClusterID { + clusterBound = true + break + } + } + if !clusterBound { + s.writeFailedResolve(writer, requestID, snapshot, loadedApp.App, domain, qtype, httpdnsCodeAppInvalid, "当前应用未绑定到该解析集群", startAt, request, query) + return + } } loadedDomain := loadedApp.Domains[domain] @@ -341,11 +595,14 @@ func pickDefaultTTL(snapshot *LoadedSnapshot, app *pb.HTTPDNSApp) int32 { } } if app != nil { - if cluster := snapshot.Clusters[app.GetPrimaryClusterId()]; cluster != nil && cluster.GetDefaultTTL() > 0 { - return cluster.GetDefaultTTL() + var appClusterIds []int64 + if len(app.GetClusterIdsJSON()) > 0 { + _ = json.Unmarshal(app.GetClusterIdsJSON(), &appClusterIds) } - if cluster := snapshot.Clusters[app.GetBackupClusterId()]; cluster != nil && cluster.GetDefaultTTL() > 0 { - return cluster.GetDefaultTTL() + for _, cid := range appClusterIds { + if cluster := snapshot.Clusters[cid]; cluster != nil && cluster.GetDefaultTTL() > 0 { + return cluster.GetDefaultTTL() + } } } return 30 @@ -591,15 +848,19 @@ func normalizeChinaRegion(province string) string { func normalizeContinent(country string) string { switch normalizeCountryName(country) { - case "中国", "中国香港", "中国澳门", "中国台湾", "日本", "韩国", "新加坡", "印度", "泰国", "越南": + case "中国", "中国香港", "中国澳门", "中国台湾", "日本", "韩国", "新加坡", "印度", "泰国", "越南", + "印度尼西亚", "马来西亚", "菲律宾", "柬埔寨", "缅甸", "老挝", "斯里兰卡", "孟加拉国", "巴基斯坦", "尼泊尔", + "阿联酋", "沙特阿拉伯", "土耳其", "以色列", "伊朗", "伊拉克", "卡塔尔", "科威特", "蒙古": return "亚洲" - case "美国", "加拿大", "墨西哥": + case "美国", "加拿大", "墨西哥", "巴拿马", "哥斯达黎加", "古巴": return "北美洲" - case "巴西", "阿根廷", "智利", "哥伦比亚": + case "巴西", "阿根廷", "智利", "哥伦比亚", "秘鲁", "委内瑞拉", "厄瓜多尔": return "南美洲" - case "德国", "英国", "法国", "荷兰", "西班牙", "意大利", "俄罗斯": + case "德国", "英国", "法国", "荷兰", "西班牙", "意大利", "俄罗斯", + "波兰", "瑞典", "瑞士", "挪威", "芬兰", "丹麦", "葡萄牙", "爱尔兰", "比利时", "奥地利", + "乌克兰", "捷克", "罗马尼亚", "匈牙利", "希腊": return "欧洲" - case "南非", "埃及", "尼日利亚", "肯尼亚", "摩洛哥": + case "南非", "埃及", "尼日利亚", "肯尼亚", "摩洛哥", "阿尔及利亚", "坦桑尼亚", "埃塞俄比亚", "加纳", "突尼斯": return "非洲" case "澳大利亚", "新西兰": return "大洋洲" @@ -639,8 +900,8 @@ func pickRuleRecords(rules []*pb.HTTPDNSCustomRule, qtype string, profile *clien Type: qtype, IP: value, Weight: item.GetWeight(), - Line: ruleLineSummary(rule), - Region: ruleRegionSummary(rule), + Line: lookupIPLineLabel(value), + Region: lookupIPRegionSummary(value), }) } if len(records) == 0 { @@ -969,6 +1230,91 @@ func normalizeCountryName(country string) string { return "智利" case "哥伦比亚", "colombia": return "哥伦比亚" + // --- 亚洲(新增)--- + case "印度尼西亚", "indonesia": + return "印度尼西亚" + case "马来西亚", "malaysia": + return "马来西亚" + case "菲律宾", "philippines": + return "菲律宾" + case "柬埔寨", "cambodia": + return "柬埔寨" + case "缅甸", "myanmar", "burma": + return "缅甸" + case "老挝", "laos": + return "老挝" + case "斯里兰卡", "srilanka": + return "斯里兰卡" + case "孟加拉国", "孟加拉", "bangladesh": + return "孟加拉国" + case "巴基斯坦", "pakistan": + return "巴基斯坦" + case "尼泊尔", "nepal": + return "尼泊尔" + case "阿联酋", "阿拉伯联合酋长国", "uae", "unitedarabemirates": + return "阿联酋" + case "沙特阿拉伯", "沙特", "saudiarabia", "saudi": + return "沙特阿拉伯" + case "土耳其", "turkey", "türkiye", "turkiye": + return "土耳其" + case "以色列", "israel": + return "以色列" + case "伊朗", "iran": + return "伊朗" + case "伊拉克", "iraq": + return "伊拉克" + case "卡塔尔", "qatar": + return "卡塔尔" + case "科威特", "kuwait": + return "科威特" + case "蒙古", "mongolia": + return "蒙古" + // --- 欧洲(新增)--- + case "波兰", "poland": + return "波兰" + case "瑞典", "sweden": + return "瑞典" + case "瑞士", "switzerland": + return "瑞士" + case "挪威", "norway": + return "挪威" + case "芬兰", "finland": + return "芬兰" + case "丹麦", "denmark": + return "丹麦" + case "葡萄牙", "portugal": + return "葡萄牙" + case "爱尔兰", "ireland": + return "爱尔兰" + case "比利时", "belgium": + return "比利时" + case "奥地利", "austria": + return "奥地利" + case "乌克兰", "ukraine": + return "乌克兰" + case "捷克", "czech", "czechrepublic", "czechia": + return "捷克" + case "罗马尼亚", "romania": + return "罗马尼亚" + case "匈牙利", "hungary": + return "匈牙利" + case "希腊", "greece": + return "希腊" + // --- 北美洲(新增)--- + case "巴拿马", "panama": + return "巴拿马" + case "哥斯达黎加", "costarica": + return "哥斯达黎加" + case "古巴", "cuba": + return "古巴" + // --- 南美洲(新增)--- + case "秘鲁", "peru": + return "秘鲁" + case "委内瑞拉", "venezuela": + return "委内瑞拉" + case "厄瓜多尔", "ecuador": + return "厄瓜多尔" + // --- 非洲 --- case "南非", "southafrica": return "南非" case "埃及", "egypt": @@ -979,6 +1325,17 @@ func normalizeCountryName(country string) string { return "肯尼亚" case "摩洛哥", "morocco": return "摩洛哥" + case "阿尔及利亚", "algeria": + return "阿尔及利亚" + case "坦桑尼亚", "tanzania": + return "坦桑尼亚" + case "埃塞俄比亚", "ethiopia": + return "埃塞俄比亚" + case "加纳", "ghana": + return "加纳" + case "突尼斯", "tunisia": + return "突尼斯" + // --- 大洋洲 --- case "澳大利亚", "australia": return "澳大利亚" case "新西兰", "newzealand": @@ -1087,18 +1444,7 @@ func (s *ResolveServer) startAccessLogFlusher() { if len(batch) == 0 { return } - rpcClient, err := rpc.SharedRPC() - if err != nil { - log.Println("[HTTPDNS_NODE][resolve]access-log rpc unavailable:", err.Error()) - return - } - _, err = rpcClient.HTTPDNSAccessLogRPC.CreateHTTPDNSAccessLogs(rpcClient.Context(), &pb.CreateHTTPDNSAccessLogsRequest{ - Logs: batch, - }) - if err != nil { - log.Println("[HTTPDNS_NODE][resolve]flush access logs failed:", err.Error()) - return - } + s.logWriter.WriteBatch(batch) batch = batch[:0] } @@ -1119,6 +1465,7 @@ func (s *ResolveServer) startAccessLogFlusher() { flush() case <-s.quitCh: flush() + _ = s.logWriter.Close() return } } diff --git a/EdgeHttpDNS/internal/utils/exec/cmd.go b/EdgeHttpDNS/internal/utils/exec/cmd.go new file mode 100644 index 0000000..f1a4178 --- /dev/null +++ b/EdgeHttpDNS/internal/utils/exec/cmd.go @@ -0,0 +1,160 @@ +package executils + +import ( + "bytes" + "context" + "os" + "os/exec" + "strings" + "time" +) + +type Cmd struct { + name string + args []string + env []string + dir string + + ctx context.Context + timeout time.Duration + cancelFunc func() + + captureStdout bool + captureStderr bool + + stdout *bytes.Buffer + stderr *bytes.Buffer + + rawCmd *exec.Cmd +} + +func NewCmd(name string, args ...string) *Cmd { + return &Cmd{ + name: name, + args: args, + } +} + +func NewTimeoutCmd(timeout time.Duration, name string, args ...string) *Cmd { + return (&Cmd{ + name: name, + args: args, + }).WithTimeout(timeout) +} + +func (this *Cmd) WithTimeout(timeout time.Duration) *Cmd { + this.timeout = timeout + + ctx, cancelFunc := context.WithTimeout(context.Background(), timeout) + this.ctx = ctx + this.cancelFunc = cancelFunc + + return this +} + +func (this *Cmd) WithStdout() *Cmd { + this.captureStdout = true + return this +} + +func (this *Cmd) WithStderr() *Cmd { + this.captureStderr = true + return this +} + +func (this *Cmd) WithEnv(env []string) *Cmd { + this.env = env + return this +} + +func (this *Cmd) WithDir(dir string) *Cmd { + this.dir = dir + return this +} + +func (this *Cmd) Start() error { + var cmd = this.compose() + return cmd.Start() +} + +func (this *Cmd) Wait() error { + var cmd = this.compose() + return cmd.Wait() +} + +func (this *Cmd) Run() error { + if this.cancelFunc != nil { + defer this.cancelFunc() + } + + var cmd = this.compose() + return cmd.Run() +} + +func (this *Cmd) RawStdout() string { + if this.stdout != nil { + return this.stdout.String() + } + return "" +} + +func (this *Cmd) Stdout() string { + return strings.TrimSpace(this.RawStdout()) +} + +func (this *Cmd) RawStderr() string { + if this.stderr != nil { + return this.stderr.String() + } + return "" +} + +func (this *Cmd) Stderr() string { + return strings.TrimSpace(this.RawStderr()) +} + +func (this *Cmd) String() string { + if this.rawCmd != nil { + return this.rawCmd.String() + } + var newCmd = exec.Command(this.name, this.args...) + return newCmd.String() +} + +func (this *Cmd) Process() *os.Process { + if this.rawCmd != nil { + return this.rawCmd.Process + } + return nil +} + +func (this *Cmd) compose() *exec.Cmd { + if this.rawCmd != nil { + return this.rawCmd + } + + if this.ctx != nil { + this.rawCmd = exec.CommandContext(this.ctx, this.name, this.args...) + } else { + this.rawCmd = exec.Command(this.name, this.args...) + } + + if this.env != nil { + this.rawCmd.Env = this.env + } + + if len(this.dir) > 0 { + this.rawCmd.Dir = this.dir + } + + if this.captureStdout { + this.stdout = &bytes.Buffer{} + this.rawCmd.Stdout = this.stdout + } + if this.captureStderr { + this.stderr = &bytes.Buffer{} + this.rawCmd.Stderr = this.stderr + } + + return this.rawCmd +} diff --git a/EdgeHttpDNS/internal/utils/exec/look_linux.go b/EdgeHttpDNS/internal/utils/exec/look_linux.go new file mode 100644 index 0000000..e65cb42 --- /dev/null +++ b/EdgeHttpDNS/internal/utils/exec/look_linux.go @@ -0,0 +1,57 @@ +//go:build linux + +package executils + +import ( + "golang.org/x/sys/unix" + "io/fs" + "os" + "os/exec" + "syscall" +) + +// LookPath customize our LookPath() function, to work in broken $PATH environment variable +func LookPath(file string) (string, error) { + result, err := exec.LookPath(file) + if err == nil && len(result) > 0 { + return result, nil + } + + // add common dirs contains executable files these may be excluded in $PATH environment variable + var binPaths = []string{ + "/usr/sbin", + "/usr/bin", + "/usr/local/sbin", + "/usr/local/bin", + } + + for _, binPath := range binPaths { + var fullPath = binPath + string(os.PathSeparator) + file + + stat, err := os.Stat(fullPath) + if err != nil { + continue + } + if stat.IsDir() { + return "", syscall.EISDIR + } + + var mode = stat.Mode() + if mode.IsDir() { + return "", syscall.EISDIR + } + err = syscall.Faccessat(unix.AT_FDCWD, fullPath, unix.X_OK, unix.AT_EACCESS) + if err == nil || (err != syscall.ENOSYS && err != syscall.EPERM) { + return fullPath, err + } + if mode&0111 != 0 { + return fullPath, nil + } + return "", fs.ErrPermission + } + + return "", &exec.Error{ + Name: file, + Err: exec.ErrNotFound, + } +} diff --git a/EdgeHttpDNS/internal/utils/exec/look_others.go b/EdgeHttpDNS/internal/utils/exec/look_others.go new file mode 100644 index 0000000..17132a0 --- /dev/null +++ b/EdgeHttpDNS/internal/utils/exec/look_others.go @@ -0,0 +1,9 @@ +//go:build !linux + +package executils + +import "os/exec" + +func LookPath(file string) (string, error) { + return exec.LookPath(file) +} diff --git a/EdgeHttpDNS/internal/utils/service_linux.go b/EdgeHttpDNS/internal/utils/service_linux.go index 3b08e92..3a392a4 100644 --- a/EdgeHttpDNS/internal/utils/service_linux.go +++ b/EdgeHttpDNS/internal/utils/service_linux.go @@ -6,25 +6,107 @@ package utils import ( "errors" "os" - "os/exec" + "time" teaconst "github.com/TeaOSLab/EdgeHttpDNS/internal/const" + executils "github.com/TeaOSLab/EdgeHttpDNS/internal/utils/exec" + "github.com/iwind/TeaGo/Tea" ) var systemdServiceFile = "/etc/systemd/system/" + teaconst.SystemdServiceName + ".service" +var initServiceFile = "/etc/init.d/" + teaconst.SystemdServiceName +// Install 安装系统服务 func (m *ServiceManager) Install(exePath string, args []string) error { if os.Getgid() != 0 { return errors.New("only root users can install the service") } - systemd, err := exec.LookPath("systemctl") + systemd, err := executils.LookPath("systemctl") if err != nil { - return err + // systemd 不可用,降级到 init.d + return m.installInitService(exePath, args) } - desc := `[Unit] -Description=GoEdge HTTPDNS Node Service + return m.installSystemdService(systemd, exePath, args) +} + +// Start 启动服务 +func (m *ServiceManager) Start() error { + if os.Getgid() != 0 { + return errors.New("only root users can start the service") + } + + // 优先检查 systemd + if fileExists(systemdServiceFile) { + systemd, err := executils.LookPath("systemctl") + if err != nil { + return err + } + return executils.NewTimeoutCmd(10*time.Second, systemd, "start", teaconst.SystemdServiceName+".service").Start() + } + + // 降级到 init.d + if fileExists(initServiceFile) { + return executils.NewTimeoutCmd(10*time.Second, "service", teaconst.ProcessName, "start").Start() + } + + return errors.New("no service file found, please install the service first") +} + +// Uninstall 删除服务 +func (m *ServiceManager) Uninstall() error { + if os.Getgid() != 0 { + return errors.New("only root users can uninstall the service") + } + + // systemd + if fileExists(systemdServiceFile) { + systemd, err := executils.LookPath("systemctl") + if err == nil { + _ = executils.NewTimeoutCmd(10*time.Second, systemd, "stop", teaconst.SystemdServiceName+".service").Run() + _ = executils.NewTimeoutCmd(10*time.Second, systemd, "disable", teaconst.SystemdServiceName+".service").Run() + _ = executils.NewTimeoutCmd(10*time.Second, systemd, "daemon-reload").Run() + } + return os.Remove(systemdServiceFile) + } + + // init.d + if fileExists(initServiceFile) { + _ = executils.NewTimeoutCmd(10*time.Second, "service", teaconst.ProcessName, "stop").Run() + chkCmd, err := executils.LookPath("chkconfig") + if err == nil { + _ = executils.NewTimeoutCmd(10*time.Second, chkCmd, "--del", teaconst.ProcessName).Run() + } + return os.Remove(initServiceFile) + } + + return nil +} + +// installSystemdService 安装 systemd 服务 +func (m *ServiceManager) installSystemdService(systemd, exePath string, args []string) error { + shortName := teaconst.SystemdServiceName + longName := "GoEdge HTTPDNS" + + // 用 bash 包装启动命令,兼容路径含空格的场景 + var startCmd = exePath + " daemon" + bashPath, _ := executils.LookPath("bash") + if len(bashPath) > 0 { + startCmd = bashPath + " -c \"" + startCmd + "\"" + } + + desc := `### BEGIN INIT INFO +# Provides: ` + shortName + ` +# Required-Start: $all +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: ` + longName + ` Service +### END INIT INFO + +[Unit] +Description=` + longName + ` Node Service Before=shutdown.target After=network-online.target @@ -32,34 +114,102 @@ After=network-online.target Type=simple Restart=always RestartSec=1s -ExecStart=` + exePath + ` daemon +ExecStart=` + startCmd + ` ExecStop=` + exePath + ` stop ExecReload=` + exePath + ` restart [Install] WantedBy=multi-user.target` - err = os.WriteFile(systemdServiceFile, []byte(desc), 0777) + // 权限 0644,systemd 单元文件不需要执行权限 + err := os.WriteFile(systemdServiceFile, []byte(desc), 0644) if err != nil { return err } - _ = exec.Command(systemd, "stop", teaconst.SystemdServiceName+".service").Run() - _ = exec.Command(systemd, "daemon-reload").Run() - return exec.Command(systemd, "enable", teaconst.SystemdServiceName+".service").Run() + // 停止已有服务 + _ = executils.NewTimeoutCmd(10*time.Second, systemd, "stop", shortName+".service").Run() + + // 重新加载 + _ = executils.NewTimeoutCmd(10*time.Second, systemd, "daemon-reload").Run() + + // 启用开机自启 + return executils.NewTimeoutCmd(10*time.Second, systemd, "enable", shortName+".service").Run() } -func (m *ServiceManager) Uninstall() error { - if os.Getgid() != 0 { - return errors.New("only root users can uninstall the service") - } +// installInitService 安装 init.d 服务(降级方案,适用于无 systemd 的旧系统) +func (m *ServiceManager) installInitService(exePath string, args []string) error { + shortName := teaconst.SystemdServiceName + longName := "GoEdge HTTPDNS" - systemd, err := exec.LookPath("systemctl") + // 生成 init.d 脚本 + script := `#!/bin/bash +### BEGIN INIT INFO +# Provides: ` + shortName + ` +# Required-Start: $all +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: ` + longName + ` Service +### END INIT INFO + +INSTALL_DIR=` + Tea.Root + ` + +case "$1" in +start) + cd "${INSTALL_DIR}" + ` + exePath + ` daemon & + echo "` + longName + ` started" + ;; +stop) + cd "${INSTALL_DIR}" + ` + exePath + ` stop + echo "` + longName + ` stopped" + ;; +restart) + cd "${INSTALL_DIR}" + ` + exePath + ` stop + sleep 1 + ` + exePath + ` daemon & + echo "` + longName + ` restarted" + ;; +status) + cd "${INSTALL_DIR}" + ` + exePath + ` status + ;; +*) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac +exit 0 +` + + // init.d 脚本需要执行权限 + err := os.WriteFile(initServiceFile, []byte(script), 0755) if err != nil { return err } - _ = exec.Command(systemd, "disable", teaconst.SystemdServiceName+".service").Run() - _ = exec.Command(systemd, "daemon-reload").Run() - return os.Remove(systemdServiceFile) + // 尝试用 chkconfig 注册(CentOS/RHEL) + chkCmd, err := executils.LookPath("chkconfig") + if err == nil { + _ = executils.NewTimeoutCmd(10*time.Second, chkCmd, "--add", teaconst.ProcessName).Run() + return nil + } + + // 尝试用 update-rc.d 注册(Debian/Ubuntu) + updateRcCmd, err := executils.LookPath("update-rc.d") + if err == nil { + _ = executils.NewTimeoutCmd(10*time.Second, updateRcCmd, teaconst.ProcessName, "defaults").Run() + return nil + } + + return nil +} + +// fileExists 检查文件是否存在 +func fileExists(path string) bool { + _, err := os.Stat(path) + return err == nil } diff --git a/EdgeHttpDNS/sdk/android/app/build.gradle b/EdgeHttpDNS/sdk/android/app/build.gradle index a50f3cb..4994cf4 100644 --- a/EdgeHttpDNS/sdk/android/app/build.gradle +++ b/EdgeHttpDNS/sdk/android/app/build.gradle @@ -3,11 +3,11 @@ plugins { } android { - namespace 'com.aliyun.ams.httpdns.demo' + namespace 'com.newsdk.ams.httpdns.demo' compileSdkVersion 34 buildToolsVersion "30.0.2" defaultConfig { - applicationId "com.aliyun.ams.httpdns.demo2" + applicationId "com.newsdk.ams.httpdns.demo2" minSdkVersion 19 targetSdkVersion 34 versionCode 1 diff --git a/EdgeHttpDNS/sdk/android/app/proguard-rules.pro b/EdgeHttpDNS/sdk/android/app/proguard-rules.pro index cd5518a..b79bbd9 100644 --- a/EdgeHttpDNS/sdk/android/app/proguard-rules.pro +++ b/EdgeHttpDNS/sdk/android/app/proguard-rules.pro @@ -25,6 +25,6 @@ #-renamesourcefileattribute SourceFile -dontwarn okhttp3.** -dontwarn okio.** --dontwarn com.alibaba.sdk.android.httpdns.test.** --dontwarn com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector +-dontwarn com.newsdk.sdk.android.httpdns.test.** +-dontwarn com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector -keep class com.aliyun.ams.ipdetector.Inet64Util{*;} diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/HttpDnsActivity.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/HttpDnsActivity.java deleted file mode 100644 index 9afe155..0000000 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/HttpDnsActivity.java +++ /dev/null @@ -1,357 +0,0 @@ -package com.aliyun.ams.httpdns.demo; - -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.widget.ArrayAdapter; -import android.widget.AutoCompleteTextView; -import android.widget.Button; -import android.widget.EditText; - -import com.alibaba.sdk.android.httpdns.DegradationFilter; -import com.alibaba.sdk.android.httpdns.NetType; -import com.alibaba.sdk.android.httpdns.RequestIpType; -import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector; -import com.alibaba.sdk.android.httpdns.ranking.IPRankingBean; -import com.aliyun.ams.httpdns.demo.base.BaseActivity; -import com.aliyun.ams.httpdns.demo.http.HttpUrlConnectionRequest; -import com.aliyun.ams.httpdns.demo.okhttp.OkHttpRequest; -import com.aliyun.ams.httpdns.demo.utils.ThreadUtil; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -/** - * @author zonglin.nzl - * @date 8/30/22 - */ -public class HttpDnsActivity extends BaseActivity { - - public static final String SCHEMA_HTTPS = "https://"; - public static final String SCHEMA_HTTP = "http://"; - - public static final String TAOBAO_URL = "www.taobao.com"; - public static final String Aliyun_URL = "www.Aliyun.com"; - - public static final String[] hosts = new String[]{ - TAOBAO_URL, Aliyun_URL - }; - - public static String getUrl(String schema, String host) { - return schema + host; - } - - /** - * 瑕佽姹傜殑schema - */ - private String schema = SCHEMA_HTTPS; - /** - * 瑕佽姹傜殑鍩熷悕 - */ - private String host = Aliyun_URL; - /** - * 瑕佽В鏋愮殑ip绫诲瀷 - */ - private RequestIpType requestIpType = RequestIpType.v4; - - private HttpUrlConnectionRequest httpUrlConnectionRequest; - private OkHttpRequest okHttpRequest; - private NetworkRequest networkRequest = httpUrlConnectionRequest; - - private ExecutorService worker = Executors.newSingleThreadExecutor(); - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - httpUrlConnectionRequest = new HttpUrlConnectionRequest(this); - okHttpRequest = new OkHttpRequest(this); - networkRequest = httpUrlConnectionRequest; - - addFourButton("鍒囨崲瀹炰緥", v -> { - MyApp.getInstance().changeHolder(); - sendLog("httpdns瀹炰緥宸插垏鎹?); - }, "鑾峰彇閰嶇疆", v -> { - sendLog(MyApp.getInstance().getCurrentHolder().getCurrentConfig()); - sendLog("瑕佽В鏋愮殑鍩熷悕鏄? + host); - sendLog("瑕佽В鏋愮殑ip绫诲瀷鏄? + requestIpType.name()); - sendLog("瑕佹ā鎷熻姹傜殑url鏄? + getUrl(schema, host)); - sendLog("妯℃嫙璇锋眰鐨勭綉缁滄鏋舵槸" + (networkRequest == httpUrlConnectionRequest ? " HttpUrlConnection" : "OkHttp")); - }, "娓呴櫎閰嶇疆缂撳瓨", v -> { - MyApp.getInstance().getCurrentHolder().cleanSp(); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "閰嶇疆缂撳瓨娓呴櫎, 閲嶅惎鐢熸晥"); - }, "娓呴櫎鏃ュ織", v -> cleanLog()); - - addTwoButton("寮€鍚痟ttps", v -> { - MyApp.getInstance().getCurrentHolder().setEnableHttps(true); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "寮€鍚痟ttps"); - }, "鍏抽棴https", v -> { - MyApp.getInstance().getCurrentHolder().setEnableHttps(false); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍏抽棴https"); - }); - - addTwoButton("鍏佽杩囨湡IP", v -> { - MyApp.getInstance().getCurrentHolder().setEnableExpiredIp(true); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍏佽杩囨湡IP"); - }, "涓嶅厑璁歌繃鏈烮P", v -> { - MyApp.getInstance().getCurrentHolder().setEnableExpiredIp(false); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "涓嶅厑璁歌繃鏈烮P"); - }); - - - addTwoButton("鍏佽鎸佷箙鍖栫紦瀛?, v -> { - MyApp.getInstance().getCurrentHolder().setEnableCacheIp(true); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍏佽鎸佷箙鍖栫紦瀛?); - }, "涓嶅厑璁告寔涔呭寲缂撳瓨", v -> { - MyApp.getInstance().getCurrentHolder().setEnableCacheIp(false); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "涓嶅厑璁告寔涔呭寲缂撳瓨"); - }); - - addThreeButton("璁剧疆涓浗澶ч檰", v -> { - MyApp.getInstance().getCurrentHolder().setRegion(null); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍒囨崲鍒颁腑鍥藉ぇ闄?); - }, "璁剧疆涓浗棣欐腐", v -> { - MyApp.getInstance().getCurrentHolder().setRegion("hk"); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍒囨崲鍒颁腑鍥介娓?); - }, "璁剧疆鏂板姞鍧?, v -> { - MyApp.getInstance().getCurrentHolder().setRegion("sg"); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "鍒囨崲鍒版柊鍔犲潯"); - }); - - addEditTextButton("瓒呮椂鏃堕暱 ms", "璁剧疆瓒呮椂ms", view -> { - EditText et = (EditText) view; - int timeout = Integer.parseInt(et.getEditableText().toString()); - MyApp.getInstance().getCurrentHolder().setTimeout(timeout); - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "璁剧疆瓒呮椂 " + timeout); - }); - - addTwoButton("寮€鍚檷绾?, v -> { - // 娉ㄦ剰锛氶檷绾ц繃婊ゅ櫒鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁? - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "闄嶇骇鍔熻兘闇€瑕侀€氳繃InitConfig閰嶇疆"); - }, "鍏抽棴闄嶇骇", v -> { - // 娉ㄦ剰锛氶檷绾ц繃婊ゅ櫒鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁? - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "闄嶇骇鍔熻兘闇€瑕侀€氳繃InitConfig閰嶇疆"); - }); - - addTwoButton("寮€鍚綉缁滃彉鍖栧悗棰勮В鏋?, v -> { - // 娉ㄦ剰锛氭鍔熻兘鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁? - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "缃戠粶鍙樺寲鍚庨瑙f瀽闇€瑕侀€氳繃InitConfig閰嶇疆"); - }, "鍏抽棴缃戠粶鍙樺寲鍚庨瑙f瀽", v -> { - // 娉ㄦ剰锛氭鍔熻兘鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁? - sendLog(MyApp.getInstance().getCurrentHolder().getAccountId() + "缃戠粶鍙樺寲鍚庨瑙f瀽闇€瑕侀€氳繃InitConfig閰嶇疆"); - }); - - addView(R.layout.item_autocomplete_edittext_button, view -> { - final AutoCompleteTextView actvOne = view.findViewById(R.id.actvOne); - final EditText etOne = view.findViewById(R.id.etOne); - Button btnOne = view.findViewById(R.id.btnOne); - - actvOne.setHint("璇疯緭鍏ュ煙鍚?); - ArrayAdapter adapter = new ArrayAdapter(getApplicationContext(), - android.R.layout.simple_dropdown_item_1line, hosts); - actvOne.setAdapter(adapter); - - etOne.setHint("璇疯緭鍏ヨ嚜瀹氫箟ttl"); - - btnOne.setText("鎸囧畾鍩熷悕ttl s"); - btnOne.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - String host = actvOne.getEditableText().toString(); - int ttl = Integer.parseInt(etOne.getEditableText().toString()); - MyApp.getInstance().getCurrentHolder().setHostTtl(host, ttl); - sendLog("鎸囧畾鍩熷悕" + host + "鐨則tl涓? + ttl + "绉?); - } - }); - }); - - addView(R.layout.item_autocomplete_edittext_button, view -> { - final AutoCompleteTextView actvOne = view.findViewById(R.id.actvOne); - final EditText etOne = view.findViewById(R.id.etOne); - Button btnOne = view.findViewById(R.id.btnOne); - - actvOne.setHint("鍩熷悕"); - ArrayAdapter adapter = new ArrayAdapter<>(getApplicationContext(), - android.R.layout.simple_dropdown_item_1line, hosts); - actvOne.setAdapter(adapter); - - etOne.setHint("璇疯緭鍏ョ鍙?); - - btnOne.setText("娣诲姞ipRanking閰嶇疆"); - btnOne.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - String host = actvOne.getEditableText().toString(); - int port = Integer.parseInt(etOne.getEditableText().toString()); - MyApp.getInstance().getCurrentHolder().addIpProbeItem(new IPRankingBean(host, port)); - sendLog("娣诲姞鍩熷悕" + host + " 鎺㈡祴"); - } - }); - }); - - addAutoCompleteTextViewButton(hosts, "涓荤珯鍩熷悕", "娣诲姞涓荤珯鍩熷悕", view -> { - AutoCompleteTextView actvOne = (AutoCompleteTextView) view; - String host = actvOne.getEditableText().toString(); - MyApp.getInstance().getCurrentHolder().addHostWithFixedIp(host); - sendLog("娣诲姞涓荤珯鍩熷悕" + host); - }); - - addAutoCompleteTextViewButton(hosts, "鍩熷悕", "鍒犻櫎鎸囧畾鍩熷悕鐨勭紦瀛?, view -> { - AutoCompleteTextView actvOne = (AutoCompleteTextView) view; - String host = actvOne.getEditableText().toString(); - ArrayList list = new ArrayList<>(); - list.add(host); - MyApp.getInstance().getService().cleanHostCache(list); - sendLog("娓呴櫎鎸囧畾host鐨勭紦瀛? + host); - }); - - addOneButton("娓呴櫎鎵€鏈夌紦瀛?, v -> { - MyApp.getInstance().getService().cleanHostCache(null); - sendLog("娓呴櫎鎵€鏈夌紦瀛?); - }); - - addFourButton("鑾峰彇褰撳墠缃戠粶鐘舵€?, v -> { - NetType type = HttpDnsNetworkDetector.getInstance().getNetType(getApplicationContext()); - sendLog("鑾峰彇缃戠粶鐘舵€?" + type.name()); - }, "绂佺敤缃戠粶鐘舵€佺紦瀛?, v -> { - HttpDnsNetworkDetector.getInstance().disableCache(true); - sendLog("缃戠粶鐘舵€?绂佺敤缂撳瓨 "); - }, "寮€鍚綉缁滅姸鎬佺紦瀛?, v -> { - HttpDnsNetworkDetector.getInstance().disableCache(false); - sendLog("缃戠粶鐘舵€?寮€鍚紦瀛?"); - }, "娓呴櫎缃戠粶鐘舵€佺紦瀛?, v -> { - HttpDnsNetworkDetector.getInstance().cleanCache(false); - sendLog("缃戠粶鐘舵€佹竻闄ょ紦瀛?"); - }); - - addTwoButton("绂佹璇诲彇IP", v -> { - HttpDnsNetworkDetector.getInstance().setCheckInterface(false); - sendLog("鏌ヨ缃戠粶鐘舵€佹椂 绂佹璇诲彇IP"); - }, "鍏佽璇诲彇IP", v -> { - HttpDnsNetworkDetector.getInstance().setCheckInterface(true); - sendLog("鏌ヨ缃戠粶鐘舵€佹椂 鍏佽璇诲彇IP"); - }); - - addAutoCompleteTextViewButton(hosts, "鍩熷悕", "璁剧疆妫€娴嬬綉缁滀娇鐢ㄧ殑鍩熷悕", view -> { - AutoCompleteTextView actvOne = (AutoCompleteTextView) view; - String host = actvOne.getEditableText().toString(); - HttpDnsNetworkDetector.getInstance().setHostToCheckNetType(host); - sendLog("璁剧疆妫€娴嬬綉缁滅姸鎬佷娇鐢ㄧ殑鍩熷悕涓? + host); - }); - - addTwoButton("妯℃嫙璇锋眰浣跨敤https璇锋眰", v -> { - schema = SCHEMA_HTTPS; - sendLog("娴嬭瘯url浣跨敤https"); - }, "妯℃嫙璇锋眰浣跨敤http璇锋眰", v -> { - schema = SCHEMA_HTTP; - sendLog("娴嬭瘯url浣跨敤http"); - }); - - addTwoButton("HttpUrlConnection", v -> { - networkRequest = httpUrlConnectionRequest; - sendLog("鎸囧畾缃戠粶瀹炵幇鏂瑰紡涓篐ttpUrlConnection"); - }, "Okhttp", v -> { - networkRequest = okHttpRequest; - sendLog("鎸囧畾缃戠粶瀹炵幇鏂瑰紡涓簅khttp"); - }); - - - addFourButton("鎸囧畾v4", v -> { - requestIpType = RequestIpType.v4; - sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv4"); - }, "鎸囧畾v6", v -> { - requestIpType = RequestIpType.v6; - sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv6"); - }, "閮借В鏋?, v -> { - requestIpType = RequestIpType.both; - sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv4鍜宨pv6"); - }, "鑷姩鍒ゆ柇", v -> { - requestIpType = RequestIpType.auto; - sendLog("瑕佽В鏋愮殑IP绫诲瀷鏍规嵁缃戠粶鎯呭喌鑷姩鍒ゆ柇"); - }); - - addAutoCompleteTextViewButton(hosts, "鍩熷悕", "鎸囧畾瑕佽В鏋愮殑鍩熷悕", new OnButtonClick() { - @Override - public void onBtnClick(View view) { - AutoCompleteTextView actvOne = (AutoCompleteTextView) view; - host = actvOne.getEditableText().toString(); - sendLog("瑕佽В鏋愮殑鍩熷悕" + host); - } - }); - - addTwoButton("寮傛瑙f瀽", v -> worker.execute(new Runnable() { - @Override - public void run() { - sendLog("寮€濮嬪彂璧风綉缁滆姹?); - sendLog("缃戠粶瀹炵幇鏂瑰紡涓? + (networkRequest == httpUrlConnectionRequest ? "HttpUrlConnection" : "okhttp")); - String url = getUrl(schema, host); - sendLog("url is " + url); - sendLog("httpdns 浣跨敤 寮傛瑙f瀽api"); - sendLog("鎸囧畾瑙f瀽ip绫诲瀷涓? + requestIpType.name()); - networkRequest.updateHttpDnsConfig(true, requestIpType); - try { - String response = networkRequest.httpGet(url); - if (response != null && response.length() > 30) { - response = response.trim(); - if (response.length() > 30) { - response = response.substring(0, 30) + "..."; - } - } - sendLog("璇锋眰缁撴潫 response is " + response + " 瀹屾暣璁板綍璇风湅logcat鏃ュ織"); - } catch (Exception e) { - e.printStackTrace(); - sendLog("璇锋眰缁撴潫 鍙戠敓寮傚父 " + e.getClass().getName() + e.getMessage() + " 瀹屾暣璁板綍璇风湅logcat鏃ュ織"); - } - - } - }), "鍚屾瑙f瀽", v -> worker.execute(() -> { - sendLog("寮€濮嬪彂璧风綉缁滆姹?); - sendLog("缃戠粶瀹炵幇鏂瑰紡涓? + (networkRequest == httpUrlConnectionRequest ? "HttpUrlConnection" : "okhttp")); - String url = getUrl(schema, host); - sendLog("url is " + url); - sendLog("httpdns 浣跨敤 鍚屾瑙f瀽api"); - sendLog("鎸囧畾瑙f瀽ip绫诲瀷涓? + requestIpType.name()); - networkRequest.updateHttpDnsConfig(false, requestIpType); - try { - String response = networkRequest.httpGet(url); - if (response != null && response.length() > 30) { - response = response.substring(0, 30) + "..."; - } - sendLog("璇锋眰缁撴潫 response is " + response + " 瀹屾暣璁板綍璇风湅logcat鏃ュ織"); - } catch (Exception e) { - e.printStackTrace(); - sendLog("璇锋眰缁撴潫 鍙戠敓寮傚父 " + e.getClass().getName() + e.getMessage() + " 瀹屾暣璁板綍璇风湅logcat鏃ュ織"); - } - })); - - addThreeButton("鍙戣捣棰勮В鏋?, v -> worker.execute(() -> { - ArrayList tmp = new ArrayList<>(); - Collections.addAll(tmp, hosts); - MyApp.getInstance().getService().setPreResolveHosts(tmp, requestIpType); - sendLog("宸插彂璧烽瑙f瀽璇锋眰"); - }), "璺宠浆SDNS娴嬭瘯鐣岄潰", - v -> startActivity(new Intent(HttpDnsActivity.this, SDNSActivity.class)), "璺宠浆Webview娴嬭瘯鐣岄潰", new View.OnClickListener() { - @Override - public void onClick(View v) { - startActivity(new Intent(HttpDnsActivity.this, WebViewActivity.class)); - } - }); - - - final String[] validHosts = new String[]{ - "www.Aliyun.com", - "www.taobao.com" - }; - - addTwoButton("骞跺彂寮傛璇锋眰", v -> { - ThreadUtil.multiThreadTest(validHosts, 100, 20, 10 * 60 * 1000, true, requestIpType); - sendLog("寮傛api骞跺彂娴嬭瘯寮€濮嬶紝澶х害鑰楁椂10鍒嗛挓锛岃鏈€鍚庢煡鐪媗ogcat鏃ュ織锛岀‘璁ょ粨鏋滐紝寤鸿鍏抽棴httpdns鏃ュ織锛岄伩鍏嶆棩蹇楅噺杩囧ぇ"); - }, "骞跺彂鍚屾璇锋眰", v -> { - ThreadUtil.multiThreadTest(validHosts, 100, 20, 10 * 60 * 1000, false, requestIpType); - sendLog("鍚屾api骞跺彂娴嬭瘯寮€濮嬶紝澶х害鑰楁椂10鍒嗛挓锛岃鏈€鍚庢煡鐪媗ogcat鏃ュ織锛岀‘璁ょ粨鏋滐紝寤鸿鍏抽棴httpdns鏃ュ織锛岄伩鍏嶆棩蹇楅噺杩囧ぇ"); - }); - - } -} - diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/SDNSActivity.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/SDNSActivity.java deleted file mode 100644 index 296f7ba..0000000 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/SDNSActivity.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.aliyun.ams.httpdns.demo; - -import android.os.Bundle; -import android.view.View; -import android.widget.AutoCompleteTextView; -import android.widget.EditText; - -import com.alibaba.sdk.android.httpdns.HTTPDNSResult; -import com.alibaba.sdk.android.httpdns.RequestIpType; -import com.aliyun.ams.httpdns.demo.base.BaseActivity; - -import java.util.HashMap; - -import static com.aliyun.ams.httpdns.demo.HttpDnsActivity.Aliyun_URL; - -public class SDNSActivity extends BaseActivity { - - private final HashMap globalParams = new HashMap<>(); - /** - * 瑕佽姹傜殑鍩熷悕 - */ - private String host = HttpDnsActivity.Aliyun_URL; - /** - * 瑕佽В鏋愮殑ip绫诲瀷 - */ - private RequestIpType requestIpType = RequestIpType.v4; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - addEditTextEditTextButton("key", "value", "娣诲姞鍏ㄥ眬閰嶇疆", new OnButtonClickMoreView() { - @Override - public void onBtnClick(View[] views) { - EditText etOne = (EditText) views[0]; - EditText etTwo = (EditText) views[1]; - - String key = etOne.getEditableText().toString(); - String value = etTwo.getEditableText().toString(); - - globalParams.put(key, value); - - // 娉ㄦ剰锛歋DNS鍏ㄥ眬鍙傛暟鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁? - sendLog("娣诲姞鍏ㄥ眬鍙傛暟 " + key + " : " + value); - } - }); - - addOneButton("娓呴櫎鍏ㄥ眬閰嶇疆", new View.OnClickListener() { - @Override - public void onClick(View v) { - globalParams.clear(); - // 娉ㄦ剰锛歋DNS鍏ㄥ眬鍙傛暟鐜板湪闇€瑕侀€氳繃InitConfig璁剧疆锛岄噸鍚簲鐢ㄧ敓鏁? - sendLog("娓呴櫎鍏ㄥ眬鍙傛暟"); - } - }); - - addFourButton("鎸囧畾v4", new View.OnClickListener() { - @Override - public void onClick(View v) { - requestIpType = RequestIpType.v4; - sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv4"); - } - }, "鎸囧畾v6", new View.OnClickListener() { - @Override - public void onClick(View v) { - requestIpType = RequestIpType.v6; - sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv6"); - } - }, "閮借В鏋?, new View.OnClickListener() { - @Override - public void onClick(View v) { - requestIpType = RequestIpType.both; - sendLog("瑕佽В鏋愮殑IP绫诲瀷鎸囧畾涓篿pv4鍜宨pv6"); - } - }, "鑷姩鍒ゆ柇", new View.OnClickListener() { - @Override - public void onClick(View v) { - requestIpType = RequestIpType.auto; - sendLog("瑕佽В鏋愮殑IP绫诲瀷鏍规嵁缃戠粶鎯呭喌鑷姩鍒ゆ柇"); - } - }); - - addAutoCompleteTextViewButton(HttpDnsActivity.hosts, "鍩熷悕", "鎸囧畾瑕佽В鏋愮殑鍩熷悕", new OnButtonClick() { - @Override - public void onBtnClick(View view) { - AutoCompleteTextView actvOne = (AutoCompleteTextView) view; - host = actvOne.getEditableText().toString(); - sendLog("瑕佽В鏋愮殑鍩熷悕" + host); - } - }); - - addEditTextEditTextButton("key", "value", "鍙戣捣璇锋眰", new OnButtonClickMoreView() { - @Override - public void onBtnClick(View[] views) { - EditText etOne = (EditText) views[0]; - EditText etTwo = (EditText) views[1]; - - String key = etOne.getEditableText().toString(); - String value = etTwo.getEditableText().toString(); - - HashMap map = new HashMap<>(); - - map.put(key, value); - - sendLog("鍙戣捣SDNS璇锋眰 requestIpType is " + requestIpType.name()); - HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(host, requestIpType, map, "娴嬭瘯SDNS"); - sendLog("缁撴灉 " + result); - } - }); - - addTwoButton("scale1鍙傛暟璇锋眰", new View.OnClickListener() { - @Override - public void onClick(View v) { - HashMap map = new HashMap<>(); - map.put("scale", "scale1"); - sendLog("鍙戣捣SDNS璇锋眰 requestIpType is " + requestIpType.name() + " scale : scale1"); - HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(host, requestIpType, map, "娴嬭瘯1"); - sendLog("缁撴灉 " + result); - } - }, "scale2鍙傛暟璇锋眰", new View.OnClickListener() { - @Override - public void onClick(View v) { - HashMap map = new HashMap<>(); - map.put("scale", "scale2"); - sendLog("鍙戣捣SDNS璇锋眰 requestIpType is " + requestIpType.name() + " scale : scale2"); - HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync(host, requestIpType, map, "娴嬭瘯2"); - sendLog("缁撴灉 " + result); - } - }); - - } -} - diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/ThreadUtil.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/ThreadUtil.java deleted file mode 100644 index f16c805..0000000 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/ThreadUtil.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.aliyun.ams.httpdns.demo.utils; - -import android.util.Log; - -import com.alibaba.sdk.android.httpdns.HTTPDNSResult; -import com.alibaba.sdk.android.httpdns.RequestIpType; -import com.alibaba.sdk.android.httpdns.SyncService; - -import com.aliyun.ams.httpdns.demo.MyApp; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Random; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class ThreadUtil { - - public static void multiThreadTest(final String[] validHosts, final int hostCount, - final int threadCount, final int executeTime, - final boolean async, final RequestIpType type) { - int validCount = validHosts.length; - if (validCount > hostCount) { - validCount = hostCount; - } - final int tmpValidCount = validCount; - Log.d(MyApp.TAG, - threadCount + "绾跨▼骞跺彂锛屾墽琛? + executeTime + ", 鎬诲煙鍚? + hostCount + "涓紝鏈夋晥" - + validCount + "涓?); - new Thread(new Runnable() { - @Override - public void run() { - final ArrayList hosts = new ArrayList<>(hostCount); - for (int i = 0; i < hostCount - tmpValidCount; i++) { - hosts.add("test" + i + ".Aliyun.com"); - } - hosts.addAll(Arrays.asList(validHosts).subList(0, tmpValidCount)); - - final CountDownLatch testLatch = new CountDownLatch(threadCount); - ExecutorService service = Executors.newFixedThreadPool(threadCount); - final CountDownLatch countDownLatch = new CountDownLatch(threadCount); - for (int i = 0; i < threadCount; i++) { - service.execute(new Runnable() { - @Override - public void run() { - countDownLatch.countDown(); - try { - countDownLatch.await(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - Random random = new Random(Thread.currentThread().getId()); - int allRequestCount = 0; - int slowRequestCount = 0; - int emptyResponseCount = 0; - long maxSlowRequestTime = 0; - long subSlowRequestTime = 0; - int taobaoCount = 0; - int taobaoSuccessCount = 0; - long firstTaobaoTime = 0; - long firstTaobaoSuccessTime = 0; - long begin = System.currentTimeMillis(); - while (System.currentTimeMillis() - begin < executeTime) { - String host = hosts.get(random.nextInt(hostCount)); - long startRequestTime = System.currentTimeMillis(); - HTTPDNSResult ips = null; - if (async) { - ips = MyApp.getInstance().getService().getIpsByHostAsync(host, - type); - } else { - ips = - ((SyncService)MyApp.getInstance().getService()).getByHost( - host, type); - } - long endRequestTime = System.currentTimeMillis(); - if (host.equals("www.taobao.com")) { - if (taobaoCount == 0) { - firstTaobaoTime = System.currentTimeMillis(); - } - taobaoCount++; - if (ips.getIps() != null && ips.getIps().length > 0) { - if (taobaoSuccessCount == 0) { - firstTaobaoSuccessTime = System.currentTimeMillis(); - } - taobaoSuccessCount++; - } - } - if (endRequestTime - startRequestTime > 100) { - slowRequestCount++; - subSlowRequestTime += endRequestTime - startRequestTime; - if (maxSlowRequestTime < endRequestTime - startRequestTime) { - maxSlowRequestTime = endRequestTime - startRequestTime; - } - } - if (ips == null || ips.getIps() == null - || ips.getIps().length == 0) { - emptyResponseCount++; - } - allRequestCount++; - } - - String msg = Thread.currentThread().getId() + " allRequestCount: " - + allRequestCount + ", slowRequestCount: " + slowRequestCount - + ", emptyResponseCount: " + emptyResponseCount - + ", maxSlowRequestTime : " + maxSlowRequestTime - + ", avgSlowRequestTime: " + (slowRequestCount == 0 ? 0 - : subSlowRequestTime / slowRequestCount) - + ", taoRequestCount: " + taobaoCount + ", " - + "taoSuccessRequestCount: " - + taobaoSuccessCount + ", firstTaoRequestTime: " + (firstTaobaoTime - - begin) + ", firstSuccessTaoRequestTime: " + ( - firstTaobaoSuccessTime - begin); - Log.w(MyApp.TAG, "asyncMulti " + msg); - testLatch.countDown(); - } - }); - } - - try { - testLatch.await(); - } catch (InterruptedException e) { - } - } - }).start(); - } -} - diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/HttpDnsActivity.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/HttpDnsActivity.java new file mode 100644 index 0000000..dda4a37 --- /dev/null +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/HttpDnsActivity.java @@ -0,0 +1,159 @@ +package com.newsdk.ams.httpdns.demo; + +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.AutoCompleteTextView; + +import com.newsdk.sdk.android.httpdns.RequestIpType; +import com.newsdk.ams.httpdns.demo.base.BaseActivity; +import com.newsdk.ams.httpdns.demo.http.HttpUrlConnectionRequest; +import com.newsdk.ams.httpdns.demo.okhttp.OkHttpRequest; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +public class HttpDnsActivity extends BaseActivity { + + private static final String SCHEMA_HTTPS = "https://"; + private static final String SCHEMA_HTTP = "http://"; + + private static final String[] HOSTS = new String[] { + "www.taobao.com", + "www.Aliyun.com" + }; + + private String schema = SCHEMA_HTTPS; + private String host = HOSTS[0]; + private RequestIpType requestIpType = RequestIpType.v4; + + private HttpUrlConnectionRequest httpUrlConnectionRequest; + private OkHttpRequest okHttpRequest; + private NetworkRequest networkRequest; + + private final ExecutorService worker = Executors.newSingleThreadExecutor(); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + httpUrlConnectionRequest = new HttpUrlConnectionRequest(this); + okHttpRequest = new OkHttpRequest(this); + networkRequest = httpUrlConnectionRequest; + + addFourButton( + "Switch instance", + v -> { + MyApp.getInstance().changeHolder(); + sendLog("Instance switched."); + }, + "Show config", + v -> sendLog(MyApp.getInstance().getCurrentHolder().getCurrentConfig()), + "Clear holder cache", + v -> { + MyApp.getInstance().getCurrentHolder().cleanSp(); + sendLog("Holder cache cleared."); + }, + "Clear log", + v -> cleanLog() + ); + + addAutoCompleteTextViewButton(HOSTS, "Host", "Set host", view -> { + AutoCompleteTextView actv = (AutoCompleteTextView) view; + host = actv.getEditableText().toString(); + sendLog("Host set to: " + host); + }); + + addTwoButton( + "Use HTTPS", + v -> { + schema = SCHEMA_HTTPS; + sendLog("Schema set to HTTPS."); + }, + "Use HTTP", + v -> { + schema = SCHEMA_HTTP; + sendLog("Schema set to HTTP."); + } + ); + + addFourButton( + "IP type v4", + v -> { + requestIpType = RequestIpType.v4; + sendLog("Request IP type: v4"); + }, + "IP type v6", + v -> { + requestIpType = RequestIpType.v6; + sendLog("Request IP type: v6"); + }, + "IP type both", + v -> { + requestIpType = RequestIpType.both; + sendLog("Request IP type: both"); + }, + "IP type auto", + v -> { + requestIpType = RequestIpType.auto; + sendLog("Request IP type: auto"); + } + ); + + addTwoButton( + "HttpUrlConnection", + v -> { + networkRequest = httpUrlConnectionRequest; + sendLog("Network stack: HttpUrlConnection"); + }, + "OkHttp", + v -> { + networkRequest = okHttpRequest; + sendLog("Network stack: OkHttp"); + } + ); + + addTwoButton( + "Resolve sync", + v -> worker.execute(() -> executeResolve(false)), + "Resolve async", + v -> worker.execute(() -> executeResolve(true)) + ); + + addTwoButton( + "Open SDNS page", + v -> startActivity(new Intent(HttpDnsActivity.this, SDNSActivity.class)), + "Open WebView page", + new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(new Intent(HttpDnsActivity.this, WebViewActivity.class)); + } + } + ); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + worker.shutdownNow(); + } + + private void executeResolve(boolean async) { + String url = schema + host; + sendLog("Request URL: " + url); + sendLog("Request IP type: " + requestIpType.name()); + sendLog("Async mode: " + async); + sendLog("Stack: " + (networkRequest == httpUrlConnectionRequest ? "HttpUrlConnection" : "OkHttp")); + try { + networkRequest.updateHttpDnsConfig(async, requestIpType); + String response = networkRequest.httpGet(url); + if (response != null && response.length() > 120) { + response = response.substring(0, 120) + "..."; + } + sendLog("Response: " + response); + } catch (Exception e) { + sendLog("Request failed: " + e.getClass().getSimpleName() + " " + e.getMessage()); + } + } +} diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/HttpDnsHolder.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/HttpDnsHolder.java similarity index 96% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/HttpDnsHolder.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/HttpDnsHolder.java index 89d50fc..1bb2c63 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/HttpDnsHolder.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/HttpDnsHolder.java @@ -1,15 +1,15 @@ -package com.aliyun.ams.httpdns.demo; +package com.newsdk.ams.httpdns.demo; import android.content.Context; import android.content.SharedPreferences; -import com.alibaba.sdk.android.httpdns.CacheTtlChanger; -import com.alibaba.sdk.android.httpdns.HttpDns; -import com.alibaba.sdk.android.httpdns.HttpDnsService; -import com.alibaba.sdk.android.httpdns.InitConfig; -import com.alibaba.sdk.android.httpdns.RequestIpType; -import com.alibaba.sdk.android.httpdns.ranking.IPRankingBean; -import com.aliyun.ams.httpdns.demo.utils.SpUtil; +import com.newsdk.sdk.android.httpdns.CacheTtlChanger; +import com.newsdk.sdk.android.httpdns.HttpDns; +import com.newsdk.sdk.android.httpdns.HttpDnsService; +import com.newsdk.sdk.android.httpdns.InitConfig; +import com.newsdk.sdk.android.httpdns.RequestIpType; +import com.newsdk.sdk.android.httpdns.ranking.IPRankingBean; +import com.newsdk.ams.httpdns.demo.utils.SpUtil; import org.json.JSONArray; import org.json.JSONException; diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/MyApp.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/MyApp.java similarity index 92% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/MyApp.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/MyApp.java index 7936ae9..2addff8 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/MyApp.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/MyApp.java @@ -1,13 +1,13 @@ -package com.aliyun.ams.httpdns.demo; +package com.newsdk.ams.httpdns.demo; import android.app.Application; import android.content.SharedPreferences; import android.util.Log; -import com.alibaba.sdk.android.httpdns.HttpDnsService; -import com.alibaba.sdk.android.httpdns.ILogger; -import com.alibaba.sdk.android.httpdns.log.HttpDnsLog; -import com.aliyun.ams.httpdns.demo.utils.SpUtil; +import com.newsdk.sdk.android.httpdns.HttpDnsService; +import com.newsdk.sdk.android.httpdns.ILogger; +import com.newsdk.sdk.android.httpdns.log.HttpDnsLog; +import com.newsdk.ams.httpdns.demo.utils.SpUtil; public class MyApp extends Application { diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/NetworkRequest.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/NetworkRequest.java similarity index 76% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/NetworkRequest.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/NetworkRequest.java index fc54dde..b41f0f1 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/NetworkRequest.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/NetworkRequest.java @@ -1,6 +1,6 @@ -package com.aliyun.ams.httpdns.demo; +package com.newsdk.ams.httpdns.demo; -import com.alibaba.sdk.android.httpdns.RequestIpType; +import com.newsdk.sdk.android.httpdns.RequestIpType; public interface NetworkRequest { diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/SDNSActivity.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/SDNSActivity.java new file mode 100644 index 0000000..201b1f4 --- /dev/null +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/SDNSActivity.java @@ -0,0 +1,126 @@ +package com.newsdk.ams.httpdns.demo; + +import android.os.Bundle; +import android.view.View; +import android.widget.AutoCompleteTextView; +import android.widget.EditText; + +import com.newsdk.sdk.android.httpdns.HTTPDNSResult; +import com.newsdk.sdk.android.httpdns.RequestIpType; +import com.newsdk.ams.httpdns.demo.base.BaseActivity; + +import java.util.HashMap; + +public class SDNSActivity extends BaseActivity { + + private static final String[] HOSTS = new String[] { + "www.Aliyun.com", + "www.taobao.com" + }; + + private final HashMap globalParams = new HashMap<>(); + private String host = HOSTS[0]; + private RequestIpType requestIpType = RequestIpType.v4; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + addEditTextEditTextButton("key", "value", "Add global param", new OnButtonClickMoreView() { + @Override + public void onBtnClick(View[] views) { + EditText keyView = (EditText) views[0]; + EditText valueView = (EditText) views[1]; + String key = keyView.getEditableText().toString(); + String value = valueView.getEditableText().toString(); + globalParams.put(key, value); + sendLog("Global param added: " + key + "=" + value); + } + }); + + addOneButton("Clear global params", new View.OnClickListener() { + @Override + public void onClick(View v) { + globalParams.clear(); + sendLog("Global params cleared."); + } + }); + + addFourButton( + "IP type v4", + new View.OnClickListener() { + @Override + public void onClick(View v) { + requestIpType = RequestIpType.v4; + sendLog("Request IP type: v4"); + } + }, + "IP type v6", + new View.OnClickListener() { + @Override + public void onClick(View v) { + requestIpType = RequestIpType.v6; + sendLog("Request IP type: v6"); + } + }, + "IP type both", + new View.OnClickListener() { + @Override + public void onClick(View v) { + requestIpType = RequestIpType.both; + sendLog("Request IP type: both"); + } + }, + "IP type auto", + new View.OnClickListener() { + @Override + public void onClick(View v) { + requestIpType = RequestIpType.auto; + sendLog("Request IP type: auto"); + } + } + ); + + addAutoCompleteTextViewButton(HOSTS, "Host", "Set host", new OnButtonClick() { + @Override + public void onBtnClick(View view) { + AutoCompleteTextView hostView = (AutoCompleteTextView) view; + host = hostView.getEditableText().toString(); + sendLog("Host set to: " + host); + } + }); + + addEditTextEditTextButton("key", "value", "Resolve with param", new OnButtonClickMoreView() { + @Override + public void onBtnClick(View[] views) { + EditText keyView = (EditText) views[0]; + EditText valueView = (EditText) views[1]; + HashMap params = new HashMap<>(globalParams); + params.put(keyView.getEditableText().toString(), valueView.getEditableText().toString()); + HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync( + host, requestIpType, params, "sdns-demo"); + sendLog("SDNS result: " + result); + } + }); + + addTwoButton("Resolve scale1", new View.OnClickListener() { + @Override + public void onClick(View v) { + HashMap params = new HashMap<>(globalParams); + params.put("scale", "scale1"); + HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync( + host, requestIpType, params, "sdns-demo"); + sendLog("scale1 result: " + result); + } + }, "Resolve scale2", new View.OnClickListener() { + @Override + public void onClick(View v) { + HashMap params = new HashMap<>(globalParams); + params.put("scale", "scale2"); + HTTPDNSResult result = MyApp.getInstance().getService().getIpsByHostAsync( + host, requestIpType, params, "sdns-demo"); + sendLog("scale2 result: " + result); + } + }); + } +} diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/WebViewActivity.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/WebViewActivity.java similarity index 99% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/WebViewActivity.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/WebViewActivity.java index 2341bf4..9381c5a 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/WebViewActivity.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/WebViewActivity.java @@ -1,4 +1,4 @@ -package com.aliyun.ams.httpdns.demo; +package com.newsdk.ams.httpdns.demo; import android.annotation.SuppressLint; import android.app.Activity; diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/base/BaseActivity.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/base/BaseActivity.java similarity index 98% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/base/BaseActivity.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/base/BaseActivity.java index 330455f..c30381d 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/base/BaseActivity.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/base/BaseActivity.java @@ -1,4 +1,4 @@ -package com.aliyun.ams.httpdns.demo.base; +package com.newsdk.ams.httpdns.demo.base; import android.app.Activity; import android.os.Bundle; @@ -17,8 +17,8 @@ import android.widget.LinearLayout; import android.widget.ScrollView; import android.widget.TextView; -import com.aliyun.ams.httpdns.demo.MyApp; -import com.aliyun.ams.httpdns.demo.R; +import com.newsdk.ams.httpdns.demo.MyApp; +import com.newsdk.ams.httpdns.demo.R; public class BaseActivity extends Activity { diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/http/HttpUrlConnectionRequest.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/http/HttpUrlConnectionRequest.java similarity index 95% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/http/HttpUrlConnectionRequest.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/http/HttpUrlConnectionRequest.java index 4b71ba7..77f3dc3 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/http/HttpUrlConnectionRequest.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/http/HttpUrlConnectionRequest.java @@ -1,4 +1,4 @@ -package com.aliyun.ams.httpdns.demo.http; +package com.newsdk.ams.httpdns.demo.http; import android.content.Context; @@ -6,14 +6,14 @@ import android.net.SSLCertificateSocketFactory; import android.os.Build; import android.util.Log; -import com.alibaba.sdk.android.httpdns.HTTPDNSResult; -import com.alibaba.sdk.android.httpdns.NetType; -import com.alibaba.sdk.android.httpdns.RequestIpType; -import com.alibaba.sdk.android.httpdns.SyncService; -import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector; -import com.aliyun.ams.httpdns.demo.MyApp; -import com.aliyun.ams.httpdns.demo.NetworkRequest; -import com.aliyun.ams.httpdns.demo.utils.Util; +import com.newsdk.sdk.android.httpdns.HTTPDNSResult; +import com.newsdk.sdk.android.httpdns.NetType; +import com.newsdk.sdk.android.httpdns.RequestIpType; +import com.newsdk.sdk.android.httpdns.SyncService; +import com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector; +import com.newsdk.ams.httpdns.demo.MyApp; +import com.newsdk.ams.httpdns.demo.NetworkRequest; +import com.newsdk.ams.httpdns.demo.utils.Util; import java.io.BufferedReader; import java.io.IOException; diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/okhttp/OkHttpRequest.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/okhttp/OkHttpRequest.java similarity index 90% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/okhttp/OkHttpRequest.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/okhttp/OkHttpRequest.java index 75b9b95..f502dc6 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/okhttp/OkHttpRequest.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/okhttp/OkHttpRequest.java @@ -1,16 +1,16 @@ -package com.aliyun.ams.httpdns.demo.okhttp; +package com.newsdk.ams.httpdns.demo.okhttp; import android.content.Context; import android.util.Log; -import com.alibaba.sdk.android.httpdns.HTTPDNSResult; -import com.alibaba.sdk.android.httpdns.NetType; -import com.alibaba.sdk.android.httpdns.RequestIpType; -import com.alibaba.sdk.android.httpdns.SyncService; -import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector; -import com.aliyun.ams.httpdns.demo.MyApp; -import com.aliyun.ams.httpdns.demo.NetworkRequest; -import com.aliyun.ams.httpdns.demo.utils.Util; +import com.newsdk.sdk.android.httpdns.HTTPDNSResult; +import com.newsdk.sdk.android.httpdns.NetType; +import com.newsdk.sdk.android.httpdns.RequestIpType; +import com.newsdk.sdk.android.httpdns.SyncService; +import com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector; +import com.newsdk.ams.httpdns.demo.MyApp; +import com.newsdk.ams.httpdns.demo.NetworkRequest; +import com.newsdk.ams.httpdns.demo.utils.Util; import java.net.HttpURLConnection; import java.net.InetAddress; diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/SpUtil.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/SpUtil.java similarity index 94% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/SpUtil.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/SpUtil.java index e2843e0..2ab142a 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/SpUtil.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/SpUtil.java @@ -1,4 +1,4 @@ -package com.aliyun.ams.httpdns.demo.utils; +package com.newsdk.ams.httpdns.demo.utils; import android.content.Context; import android.content.SharedPreferences; diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/ThreadUtil.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/ThreadUtil.java new file mode 100644 index 0000000..1a50385 --- /dev/null +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/ThreadUtil.java @@ -0,0 +1,94 @@ +package com.newsdk.ams.httpdns.demo.utils; + +import android.util.Log; + +import com.newsdk.sdk.android.httpdns.HTTPDNSResult; +import com.newsdk.sdk.android.httpdns.RequestIpType; +import com.newsdk.sdk.android.httpdns.SyncService; +import com.newsdk.ams.httpdns.demo.MyApp; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +public class ThreadUtil { + + public static void multiThreadTest( + final String[] validHosts, + final int hostCount, + final int threadCount, + final int executeTime, + final boolean async, + final RequestIpType type + ) { + new Thread(() -> runMultiThreadTest(validHosts, hostCount, threadCount, executeTime, async, type)).start(); + } + + private static void runMultiThreadTest( + String[] validHosts, + int hostCount, + int threadCount, + int executeTime, + boolean async, + RequestIpType type + ) { + int validCount = Math.min(validHosts.length, hostCount); + Log.d(MyApp.TAG, "Start multiThreadTest, threads=" + threadCount + + ", executeTimeMs=" + executeTime + + ", hostCount=" + hostCount + + ", validHostCount=" + validCount + + ", async=" + async + + ", ipType=" + type.name()); + + ArrayList hosts = new ArrayList<>(hostCount); + for (int i = 0; i < hostCount - validCount; i++) { + hosts.add("test" + i + ".Aliyun.com"); + } + hosts.addAll(Arrays.asList(validHosts).subList(0, validCount)); + + ExecutorService pool = Executors.newFixedThreadPool(threadCount); + CountDownLatch done = new CountDownLatch(threadCount); + + for (int i = 0; i < threadCount; i++) { + pool.execute(() -> { + Random random = new Random(Thread.currentThread().getId()); + long begin = System.currentTimeMillis(); + int requestCount = 0; + int successCount = 0; + + while (System.currentTimeMillis() - begin < executeTime) { + String host = hosts.get(random.nextInt(hosts.size())); + try { + HTTPDNSResult result; + if (async) { + result = MyApp.getInstance().getService().getIpsByHostAsync(host, type); + } else { + result = ((SyncService) MyApp.getInstance().getService()).getByHost(host, type); + } + if (result != null && result.getIps() != null && result.getIps().length > 0) { + successCount++; + } + } catch (Throwable t) { + Log.w(MyApp.TAG, "multiThreadTest request failed: " + t.getMessage()); + } + requestCount++; + } + + Log.w(MyApp.TAG, "multiThreadTest thread=" + Thread.currentThread().getId() + + ", requestCount=" + requestCount + + ", successCount=" + successCount); + done.countDown(); + }); + } + + try { + done.await(); + } catch (InterruptedException ignored) { + } finally { + pool.shutdownNow(); + } + } +} diff --git a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/Util.java b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/Util.java similarity index 85% rename from EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/Util.java rename to EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/Util.java index 3dd49f2..65b4281 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/java/com/aliyun/ams/httpdns/demo/utils/Util.java +++ b/EdgeHttpDNS/sdk/android/app/src/main/java/com/newsdk/ams/httpdns/demo/utils/Util.java @@ -1,6 +1,6 @@ -package com.aliyun.ams.httpdns.demo.utils; +package com.newsdk.ams.httpdns.demo.utils; -import com.alibaba.sdk.android.httpdns.HTTPDNSResult; +import com.newsdk.sdk.android.httpdns.HTTPDNSResult; import java.lang.reflect.Field; diff --git a/EdgeHttpDNS/sdk/android/app/src/main/res/drawable/aliyun_bg.9.png b/EdgeHttpDNS/sdk/android/app/src/main/res/drawable/new_bg.9.png similarity index 100% rename from EdgeHttpDNS/sdk/android/app/src/main/res/drawable/aliyun_bg.9.png rename to EdgeHttpDNS/sdk/android/app/src/main/res/drawable/new_bg.9.png diff --git a/EdgeHttpDNS/sdk/android/app/src/main/res/layout/activity_base.xml b/EdgeHttpDNS/sdk/android/app/src/main/res/layout/activity_base.xml index a37750e..4ec412c 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/res/layout/activity_base.xml +++ b/EdgeHttpDNS/sdk/android/app/src/main/res/layout/activity_base.xml @@ -11,7 +11,7 @@ + android:background="@drawable/new_bg" /> - 銆愰樋閲屼簯HttpDns銆慏emo绋嬪簭 + + 閵嗘劙妯嬮柌灞肩隘HttpDns閵嗘厪emo缁嬪绨 Settings - 鏅€氳В鏋?/string> - 瑙f瀽娣樺疂鍩熷悕 - 瑙f瀽apple鍩熷悕 - 瑙f瀽璞嗙摚鍩熷悕 - HTTPS寮€鍏?/string> - 璁剧疆瓒呮椂 - 鍏佽杩囨湡鍩熷悕 - 寮€鍚寔涔呭寲缂撳瓨 - 闄嶇骇绛栫暐 - 棰勮В鏋?/string> + 閺咁噣鈧俺袙閺 + 鐟欙絾鐎藉ǎ妯虹杺閸╃喎鎮 + 鐟欙絾鐎絘pple閸╃喎鎮 + 鐟欙絾鐎界挒鍡欐憵閸╃喎鎮 + HTTPS瀵偓閸 + 鐠佸墽鐤嗙搾鍛 + 閸忎浇顔忔潻鍥ㄦ埂閸╃喎鎮 + 瀵偓閸氼垱瀵旀稊鍛缂傛挸鐡 + 闂勫秶楠囩粵鏍殣 + 妫板嫯袙閺 region - 鍚屾瑙f瀽 - 鍚屾瑙f瀽骞跺彂 - 骞跺彂瑙f瀽 + 閸氬本顒炵憴锝嗙€ + 閸氬本顒炵憴锝嗙€介獮璺哄絺 + 楠炶泛褰傜憴锝嗙€ - 鍏充簬鎴戜滑 - 甯姪涓績 - 娓呴櫎褰撳墠娑堟伅 + 閸忓厖绨幋鎴滄粦 + 鐢喖濮稉顓炵妇 + 濞撳懘娅庤ぐ鎾冲濞戝牊浼 - All Rights Reserved. - 闃块噷浜?杞欢)鏈夐檺鍏徃鐗堟潈鎵€鏈?/string> - Copyright 漏 2009 - 2016 Aliyun.com + 闂冨潡鍣锋禍?鏉烆垯娆?閺堝妾洪崗顒€寰冮悧鍫熸綀閹碘偓閺 + Copyright 婕?2009 - 2016 Aliyun.com 1.1.3 - - Q : 浠€涔堟槸鐢ㄦ埛浣撻獙Demo锛焅nA : 鐢ㄦ埛浣撻獙Demo灏辨槸闃块噷浜戝钩鍙颁负鎮ㄨ嚜鍔ㄥ垱寤虹殑銆佺敤鏉ヤ綋楠孒ttpDns鏈嶅姟鍜屽弽棣堝缓璁敤鐨勪竴涓皬Demo锛岃鎮ㄤ綋楠屼究鎹枫€侀珮鏁堢殑HttpDns鏈嶅姟銆俓n\nQ : 濡備綍鑱旂郴鎴戜滑锛焅nA : App Demo鐩稿叧闂锛岃鎼滅储閽夐拤缇ゅ彿锛?1777313 + Q : 娴犫偓娑斿牊妲搁悽銊﹀煕娴f捇鐛橠emo閿涚剠nA : 閻劍鍩涙担鎾荤崣Demo鐏忚鲸妲搁梼鍧楀櫡娴滄垵閽╅崣棰佽礋閹劏鍤滈崝銊ュ灡瀵よ櫣娈戦妴浣烘暏閺夈儰缍嬫瀛抰tpDns閺堝秴濮熼崪灞藉冀妫e牆缂撶拋顔炬暏閻ㄥ嫪绔存稉顏勭毈Demo閿涘矁顔€閹劋缍嬫灞肩┒閹规灚鈧線鐝弫鍫㈡畱HttpDns閺堝秴濮熼妴淇搉\nQ : 婵″倷缍嶉懕鏃傞兇閹存垳婊戦敍鐒卬A : App Demo閻╃鍙ч梻顕€顣介敍宀冾嚞閹兼粎鍌ㄩ柦澶愭嫟缂囥倕褰块敍?1777313 + diff --git a/EdgeHttpDNS/sdk/android/app/src/main/res/xml/network_security_config.xml b/EdgeHttpDNS/sdk/android/app/src/main/res/xml/network_security_config.xml index 178cbdf..f904668 100644 --- a/EdgeHttpDNS/sdk/android/app/src/main/res/xml/network_security_config.xml +++ b/EdgeHttpDNS/sdk/android/app/src/main/res/xml/network_security_config.xml @@ -1,8 +1,8 @@ - + - + diff --git a/EdgeHttpDNS/sdk/android/demo/build.gradle b/EdgeHttpDNS/sdk/android/demo/build.gradle index 7555499..fe7a3db 100644 --- a/EdgeHttpDNS/sdk/android/demo/build.gradle +++ b/EdgeHttpDNS/sdk/android/demo/build.gradle @@ -9,11 +9,11 @@ gradle.ext { } android { - namespace 'com.aliyun.ams.httpdns.demo' + namespace 'com.newsdk.ams.httpdns.demo' compileSdk 34 defaultConfig { - applicationId "com.aliyun.ams.httpdns.demo" + applicationId "com.newsdk.ams.httpdns.demo" minSdkVersion 26 targetSdkVersion 34 versionCode 1 @@ -111,18 +111,17 @@ dependencies { implementation("com.squareup.okhttp3:okhttp:4.10.0") implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' -// implementation project(path: ':httpdns-sdk') - implementation 'com.aliyun.ams:alicloud-android-httpdns:2.6.6' + implementation project(path: ':httpdns-sdk') - implementation('com.alibaba:fastjson:1.1.73.android@jar') + implementation('com.newsdk:fastjson:1.1.73.android@jar') // implementation('com.emas.hybrid:emas-hybrid-android:1.1.0.4-public-SNAPSHOT') { // exclude group: 'com.android.support', module: 'appcompat-v7' // exclude group: 'com.taobao.android', module: 'thin_so_release' // } - implementation 'com.aliyun.ams:alicloud-android-tool:1.1.0' + implementation 'com.newsdk.ams:new-android-tool:1.1.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' -} \ No newline at end of file +} diff --git a/EdgeHttpDNS/sdk/android/demo/proguard-rules.pro b/EdgeHttpDNS/sdk/android/demo/proguard-rules.pro index 399065f..e482c46 100644 --- a/EdgeHttpDNS/sdk/android/demo/proguard-rules.pro +++ b/EdgeHttpDNS/sdk/android/demo/proguard-rules.pro @@ -19,4 +19,4 @@ # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile --keep class com.alibaba.sdk.android.httpdns.**{*;} \ No newline at end of file +-keep class com.newsdk.sdk.android.httpdns.**{*;} \ No newline at end of file diff --git a/EdgeHttpDNS/sdk/android/demo/src/androidTest/java/com/alibaba/ams/emas/demo/ExampleInstrumentedTest.kt b/EdgeHttpDNS/sdk/android/demo/src/androidTest/java/com/newsdk/ams/emas/demo/ExampleInstrumentedTest.kt similarity index 83% rename from EdgeHttpDNS/sdk/android/demo/src/androidTest/java/com/alibaba/ams/emas/demo/ExampleInstrumentedTest.kt rename to EdgeHttpDNS/sdk/android/demo/src/androidTest/java/com/newsdk/ams/emas/demo/ExampleInstrumentedTest.kt index 7c658d9..c9df783 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/androidTest/java/com/alibaba/ams/emas/demo/ExampleInstrumentedTest.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/androidTest/java/com/newsdk/ams/emas/demo/ExampleInstrumentedTest.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo import android.support.test.InstrumentationRegistry import android.support.test.runner.AndroidJUnit4 @@ -19,7 +19,7 @@ class ExampleInstrumentedTest { fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.alibaba.ams.emas.demo", appContext.packageName) + assertEquals("com.newsdk.ams.emas.demo", appContext.packageName) } } diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/AndroidManifest.xml b/EdgeHttpDNS/sdk/android/demo/src/main/AndroidManifest.xml index 52cfb9a..8a5c7c6 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/AndroidManifest.xml +++ b/EdgeHttpDNS/sdk/android/demo/src/main/AndroidManifest.xml @@ -6,7 +6,7 @@ + android:theme="@style/Theme.NewHttpDnsDemo.NoActionBar"> + android:theme="@style/Theme.NewHttpDnsDemo.NoActionBar"> @@ -47,9 +47,9 @@ android:name="android.app.lib_name" android:value="" /> - + android:theme="@style/Theme.NewHttpDnsDemo.NoActionBar" > diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/BatchResolveCacheHolder.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/BatchResolveCacheHolder.kt similarity index 99% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/BatchResolveCacheHolder.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/BatchResolveCacheHolder.kt index 2828b3c..e4079c9 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/BatchResolveCacheHolder.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/BatchResolveCacheHolder.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/HttpDnsApplication.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/HttpDnsApplication.kt similarity index 84% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/HttpDnsApplication.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/HttpDnsApplication.kt index b6ecabe..2af75b0 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/HttpDnsApplication.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/HttpDnsApplication.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo import android.app.Application diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/HttpDnsServiceHolder.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/HttpDnsServiceHolder.kt similarity index 76% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/HttpDnsServiceHolder.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/HttpDnsServiceHolder.kt index 0c1d46d..dafec0f 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/HttpDnsServiceHolder.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/HttpDnsServiceHolder.kt @@ -1,12 +1,12 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo import android.content.Context import android.text.TextUtils -import com.alibaba.ams.emas.demo.constant.KEY_ENABLE_AUTH_MODE -import com.alibaba.ams.emas.demo.constant.KEY_SECRET_KEY_SET_BY_CONFIG -import com.alibaba.sdk.android.httpdns.HttpDns -import com.alibaba.sdk.android.httpdns.HttpDnsService -import com.aliyun.ams.httpdns.demo.BuildConfig +import com.newsdk.ams.emas.demo.constant.KEY_ENABLE_AUTH_MODE +import com.newsdk.ams.emas.demo.constant.KEY_SECRET_KEY_SET_BY_CONFIG +import com.newsdk.sdk.android.httpdns.HttpDns +import com.newsdk.sdk.android.httpdns.HttpDnsService +import com.newsdk.ams.httpdns.demo.BuildConfig /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/MainActivity.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/MainActivity.kt similarity index 92% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/MainActivity.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/MainActivity.kt index 80dc162..2ac302b 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/MainActivity.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/MainActivity.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo import android.os.Bundle import android.widget.Toast @@ -6,8 +6,8 @@ import androidx.appcompat.app.AppCompatActivity import androidx.navigation.findNavController import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.setupActionBarWithNavController -import com.aliyun.ams.httpdns.demo.R -import com.aliyun.ams.httpdns.demo.databinding.ActivityMainBinding +import com.newsdk.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.databinding.ActivityMainBinding import com.google.android.material.bottomnavigation.BottomNavigationView class MainActivity : AppCompatActivity() { diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/PreResolveCacheHolder.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/PreResolveCacheHolder.kt similarity index 98% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/PreResolveCacheHolder.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/PreResolveCacheHolder.kt index 76e99cb..c194f0f 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/PreResolveCacheHolder.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/PreResolveCacheHolder.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo import org.json.JSONArray import org.json.JSONException diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/SingleLiveData.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/SingleLiveData.kt similarity index 97% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/SingleLiveData.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/SingleLiveData.kt index db7f81b..5f63f7d 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/SingleLiveData.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/SingleLiveData.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo import android.util.Log import androidx.annotation.MainThread diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/TtlCacheHolder.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/TtlCacheHolder.kt similarity index 92% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/TtlCacheHolder.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/TtlCacheHolder.kt index 3d11333..89f8965 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/TtlCacheHolder.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/TtlCacheHolder.kt @@ -1,6 +1,6 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo -import com.alibaba.sdk.android.httpdns.CacheTtlChanger +import com.newsdk.sdk.android.httpdns.CacheTtlChanger import org.json.JSONException import org.json.JSONObject diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/Util.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/Util.kt similarity index 94% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/Util.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/Util.kt index b04129f..8007e2e 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/Util.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/Util.kt @@ -1,9 +1,9 @@ -package com.alibaba.ams.emas.demo +package com.newsdk.ams.emas.demo import android.content.Context import android.content.SharedPreferences -import com.alibaba.sdk.android.httpdns.ranking.IPRankingBean -import com.aliyun.ams.httpdns.demo.BuildConfig +import com.newsdk.sdk.android.httpdns.ranking.IPRankingBean +import com.newsdk.ams.httpdns.demo.BuildConfig import org.json.JSONArray import org.json.JSONException import org.json.JSONObject @@ -113,7 +113,7 @@ fun String?.toBlackList(): MutableList? { fun getAccountPreference(context: Context): SharedPreferences { return context.getSharedPreferences( - "Aliyun_httpdns_${BuildConfig.ACCOUNT_ID}", + "New_httpdns_${BuildConfig.ACCOUNT_ID}", Context.MODE_PRIVATE ) } diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/constant/Constant.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/constant/Constant.kt similarity index 96% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/constant/Constant.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/constant/Constant.kt index bb0b22c..dd1f11b 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/constant/Constant.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/constant/Constant.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.constant +package com.newsdk.ams.emas.demo.constant /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/HttpURLConnectionRequest.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/HttpURLConnectionRequest.kt similarity index 92% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/HttpURLConnectionRequest.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/HttpURLConnectionRequest.kt index e0e8c42..02682b7 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/HttpURLConnectionRequest.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/HttpURLConnectionRequest.kt @@ -1,15 +1,15 @@ -package com.alibaba.ams.emas.demo.net +package com.newsdk.ams.emas.demo.net import android.content.Context import android.util.Log -import com.alibaba.ams.emas.demo.HttpDnsServiceHolder -import com.alibaba.ams.emas.demo.readStringFrom -import com.alibaba.ams.emas.demo.ui.resolve.Response -import com.alibaba.sdk.android.httpdns.HTTPDNSResult -import com.alibaba.sdk.android.httpdns.HttpDnsCallback -import com.alibaba.sdk.android.httpdns.NetType -import com.alibaba.sdk.android.httpdns.RequestIpType -import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector +import com.newsdk.ams.emas.demo.HttpDnsServiceHolder +import com.newsdk.ams.emas.demo.readStringFrom +import com.newsdk.ams.emas.demo.ui.resolve.Response +import com.newsdk.sdk.android.httpdns.HTTPDNSResult +import com.newsdk.sdk.android.httpdns.HttpDnsCallback +import com.newsdk.sdk.android.httpdns.NetType +import com.newsdk.sdk.android.httpdns.RequestIpType +import com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector import java.io.BufferedReader import java.io.InputStream import java.io.InputStreamReader diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/IRequest.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/IRequest.kt similarity index 54% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/IRequest.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/IRequest.kt index 1c78dfb..8bfbb3d 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/IRequest.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/IRequest.kt @@ -1,6 +1,6 @@ -package com.alibaba.ams.emas.demo.net +package com.newsdk.ams.emas.demo.net -import com.alibaba.ams.emas.demo.ui.resolve.Response +import com.newsdk.ams.emas.demo.ui.resolve.Response /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpClientSingleton.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpClientSingleton.kt similarity index 94% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpClientSingleton.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpClientSingleton.kt index 1ff338e..ad30ce4 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpClientSingleton.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpClientSingleton.kt @@ -1,13 +1,13 @@ -package com.alibaba.ams.emas.demo.net +package com.newsdk.ams.emas.demo.net import android.content.Context import android.util.Log -import com.alibaba.ams.emas.demo.HttpDnsServiceHolder -import com.alibaba.sdk.android.httpdns.HTTPDNSResult -import com.alibaba.sdk.android.httpdns.HttpDnsCallback -import com.alibaba.sdk.android.httpdns.NetType -import com.alibaba.sdk.android.httpdns.RequestIpType -import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector +import com.newsdk.ams.emas.demo.HttpDnsServiceHolder +import com.newsdk.sdk.android.httpdns.HTTPDNSResult +import com.newsdk.sdk.android.httpdns.HttpDnsCallback +import com.newsdk.sdk.android.httpdns.NetType +import com.newsdk.sdk.android.httpdns.RequestIpType +import com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector import okhttp3.ConnectionPool import okhttp3.Dns import okhttp3.OkHttpClient diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpLog.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpLog.kt similarity index 84% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpLog.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpLog.kt index adb4c2c..7326906 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpLog.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpLog.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.net +package com.newsdk.ams.emas.demo.net import android.util.Log import okhttp3.logging.HttpLoggingInterceptor diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpRequest.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpRequest.kt similarity index 83% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpRequest.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpRequest.kt index 3144bf2..269e5e3 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/OkHttpRequest.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/OkHttpRequest.kt @@ -1,8 +1,8 @@ -package com.alibaba.ams.emas.demo.net +package com.newsdk.ams.emas.demo.net import android.content.Context -import com.alibaba.ams.emas.demo.ui.resolve.Response -import com.alibaba.sdk.android.httpdns.RequestIpType +import com.newsdk.ams.emas.demo.ui.resolve.Response +import com.newsdk.sdk.android.httpdns.RequestIpType /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/TLSSNISocketFactory.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/TLSSNISocketFactory.kt similarity index 98% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/TLSSNISocketFactory.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/TLSSNISocketFactory.kt index 5d74453..2a8e9e9 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/net/TLSSNISocketFactory.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/net/TLSSNISocketFactory.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.net +package com.newsdk.ams.emas.demo.net import android.net.SSLCertificateSocketFactory import android.os.Build diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/BasicSettingFragment.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/BasicSettingFragment.kt similarity index 94% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/BasicSettingFragment.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/BasicSettingFragment.kt index 14732ca..58c9b68 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/BasicSettingFragment.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/BasicSettingFragment.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.basic +package com.newsdk.ams.emas.demo.ui.basic import android.content.Intent import android.os.Bundle @@ -11,12 +11,12 @@ import androidx.appcompat.app.AlertDialog import androidx.appcompat.widget.AppCompatEditText import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import com.alibaba.ams.emas.demo.constant.KEY_REGION -import com.alibaba.ams.emas.demo.getAccountPreference -import com.alibaba.ams.emas.demo.ui.info.list.ListActivity -import com.alibaba.ams.emas.demo.ui.info.list.kListItemTag -import com.aliyun.ams.httpdns.demo.R -import com.aliyun.ams.httpdns.demo.databinding.FragmentBasicSettingBinding +import com.newsdk.ams.emas.demo.constant.KEY_REGION +import com.newsdk.ams.emas.demo.getAccountPreference +import com.newsdk.ams.emas.demo.ui.info.list.ListActivity +import com.newsdk.ams.emas.demo.ui.info.list.kListItemTag +import com.newsdk.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.databinding.FragmentBasicSettingBinding class BasicSettingFragment : Fragment(), IBasicShowDialog { diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/BasicSettingViewModel.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/BasicSettingViewModel.kt similarity index 96% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/BasicSettingViewModel.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/BasicSettingViewModel.kt index 438d6fe..7bb2b68 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/BasicSettingViewModel.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/BasicSettingViewModel.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.basic +package com.newsdk.ams.emas.demo.ui.basic import android.app.Application import android.text.TextUtils @@ -6,16 +6,16 @@ import android.util.Log import android.widget.CompoundButton import android.widget.Toast import androidx.lifecycle.AndroidViewModel -import com.alibaba.ams.emas.demo.* -import com.alibaba.ams.emas.demo.constant.* -import com.alibaba.sdk.android.httpdns.HttpDns -import com.alibaba.sdk.android.httpdns.HttpDnsService -import com.alibaba.sdk.android.httpdns.InitConfig -import com.alibaba.sdk.android.httpdns.NotUseHttpDnsFilter -import com.alibaba.sdk.android.httpdns.RequestIpType -import com.alibaba.sdk.android.httpdns.log.HttpDnsLog -import com.aliyun.ams.httpdns.demo.BuildConfig -import com.aliyun.ams.httpdns.demo.R +import com.newsdk.ams.emas.demo.* +import com.newsdk.ams.emas.demo.constant.* +import com.newsdk.sdk.android.httpdns.HttpDns +import com.newsdk.sdk.android.httpdns.HttpDnsService +import com.newsdk.sdk.android.httpdns.InitConfig +import com.newsdk.sdk.android.httpdns.NotUseHttpDnsFilter +import com.newsdk.sdk.android.httpdns.RequestIpType +import com.newsdk.sdk.android.httpdns.log.HttpDnsLog +import com.newsdk.ams.httpdns.demo.BuildConfig +import com.newsdk.ams.httpdns.demo.R import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/IBasicShowDialog.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/IBasicShowDialog.kt similarity index 84% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/IBasicShowDialog.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/IBasicShowDialog.kt index 47a7af7..ceb234d 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/basic/IBasicShowDialog.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/basic/IBasicShowDialog.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.basic +package com.newsdk.ams.emas.demo.ui.basic /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/InfoFragment.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/InfoFragment.kt similarity index 93% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/InfoFragment.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/InfoFragment.kt index 8918f99..1a91215 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/InfoFragment.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/InfoFragment.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.info +package com.newsdk.ams.emas.demo.ui.info import android.content.Intent import android.os.Bundle @@ -8,9 +8,9 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import com.alibaba.ams.emas.demo.ui.info.list.* -import com.aliyun.ams.httpdns.demo.BuildConfig -import com.aliyun.ams.httpdns.demo.databinding.FragmentInfoBinding +import com.newsdk.ams.emas.demo.ui.info.list.* +import com.newsdk.ams.httpdns.demo.BuildConfig +import com.newsdk.ams.httpdns.demo.databinding.FragmentInfoBinding class InfoFragment : Fragment() { diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/InfoViewModel.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/InfoViewModel.kt similarity index 75% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/InfoViewModel.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/InfoViewModel.kt index b813ebe..333ba9a 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/InfoViewModel.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/InfoViewModel.kt @@ -1,16 +1,16 @@ -package com.alibaba.ams.emas.demo.ui.info +package com.newsdk.ams.emas.demo.ui.info import android.app.Application import android.widget.Toast import androidx.lifecycle.AndroidViewModel -import com.alibaba.ams.emas.demo.HttpDnsApplication -import com.alibaba.ams.emas.demo.HttpDnsServiceHolder -import com.alibaba.ams.emas.demo.SingleLiveData -import com.alibaba.ams.emas.demo.getAccountPreference -import com.alibaba.sdk.android.httpdns.NetType -import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector -import com.aliyun.ams.httpdns.demo.BuildConfig -import com.aliyun.ams.httpdns.demo.R +import com.newsdk.ams.emas.demo.HttpDnsApplication +import com.newsdk.ams.emas.demo.HttpDnsServiceHolder +import com.newsdk.ams.emas.demo.SingleLiveData +import com.newsdk.ams.emas.demo.getAccountPreference +import com.newsdk.sdk.android.httpdns.NetType +import com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector +import com.newsdk.ams.httpdns.demo.BuildConfig +import com.newsdk.ams.httpdns.demo.R class InfoViewModel(application: Application) : AndroidViewModel(application) { diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/SdnsGlobalSettingActivity.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/SdnsGlobalSettingActivity.kt similarity index 85% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/SdnsGlobalSettingActivity.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/SdnsGlobalSettingActivity.kt index c52d02a..b7099b4 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/SdnsGlobalSettingActivity.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/SdnsGlobalSettingActivity.kt @@ -1,12 +1,12 @@ -package com.alibaba.ams.emas.demo.ui.info +package com.newsdk.ams.emas.demo.ui.info import android.os.Bundle import android.text.TextUtils import androidx.appcompat.app.AppCompatActivity -import com.alibaba.ams.emas.demo.constant.KEY_SDNS_GLOBAL_PARAMS -import com.alibaba.ams.emas.demo.getAccountPreference -import com.aliyun.ams.httpdns.demo.R -import com.aliyun.ams.httpdns.demo.databinding.ActivitySdnsGlobalSettingBinding +import com.newsdk.ams.emas.demo.constant.KEY_SDNS_GLOBAL_PARAMS +import com.newsdk.ams.emas.demo.getAccountPreference +import com.newsdk.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.databinding.ActivitySdnsGlobalSettingBinding import org.json.JSONException import org.json.JSONObject diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListActivity.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListActivity.kt similarity index 99% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListActivity.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListActivity.kt index 367c8c0..e0cf1ed 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListActivity.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListActivity.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.info.list +package com.newsdk.ams.emas.demo.ui.info.list import android.content.Context import android.os.Bundle @@ -16,8 +16,8 @@ import androidx.appcompat.widget.AppCompatEditText import androidx.lifecycle.ViewModelProvider import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import com.aliyun.ams.httpdns.demo.R -import com.aliyun.ams.httpdns.demo.databinding.ActivityListBinding +import com.newsdk.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.databinding.ActivityListBinding class ListActivity : AppCompatActivity(), ListAdapter.OnDeleteListener { diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListAdapter.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListAdapter.kt similarity index 97% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListAdapter.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListAdapter.kt index 46beaf9..d88e383 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListAdapter.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListAdapter.kt @@ -1,12 +1,12 @@ -package com.alibaba.ams.emas.demo.ui.info.list +package com.newsdk.ams.emas.demo.ui.info.list import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import com.aliyun.ams.httpdns.demo.R -import com.aliyun.ams.httpdns.demo.databinding.InfoListItemBinding; +import com.newsdk.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.databinding.InfoListItemBinding; /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListItem.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListItem.kt similarity index 72% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListItem.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListItem.kt index 03f3f62..3ddb54d 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListItem.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListItem.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.info.list +package com.newsdk.ams.emas.demo.ui.info.list /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListItemType.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListItemType.kt similarity index 87% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListItemType.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListItemType.kt index 75f518a..e213255 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListItemType.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListItemType.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.info.list +package com.newsdk.ams.emas.demo.ui.info.list /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListViewModel.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListViewModel.kt similarity index 95% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListViewModel.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListViewModel.kt index 9793530..f9b3fe1 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/info/list/ListViewModel.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/info/list/ListViewModel.kt @@ -1,21 +1,21 @@ -package com.alibaba.ams.emas.demo.ui.info.list +package com.newsdk.ams.emas.demo.ui.info.list import android.app.Application import android.content.SharedPreferences import android.widget.Toast import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope -import com.alibaba.ams.emas.demo.* -import com.alibaba.ams.emas.demo.TtlCacheHolder.toJsonString -import com.alibaba.ams.emas.demo.constant.KEY_BATCH_RESOLVE_HOST_LIST -import com.alibaba.ams.emas.demo.constant.KEY_HOST_BLACK_LIST -import com.alibaba.ams.emas.demo.constant.KEY_HOST_WITH_FIXED_IP -import com.alibaba.ams.emas.demo.constant.KEY_IP_RANKING_ITEMS -import com.alibaba.ams.emas.demo.constant.KEY_PRE_RESOLVE_HOST_LIST -import com.alibaba.ams.emas.demo.constant.KEY_TAGS -import com.alibaba.ams.emas.demo.constant.KEY_TTL_CHANGER -import com.alibaba.sdk.android.httpdns.ranking.IPRankingBean -import com.aliyun.ams.httpdns.demo.R +import com.newsdk.ams.emas.demo.* +import com.newsdk.ams.emas.demo.TtlCacheHolder.toJsonString +import com.newsdk.ams.emas.demo.constant.KEY_BATCH_RESOLVE_HOST_LIST +import com.newsdk.ams.emas.demo.constant.KEY_HOST_BLACK_LIST +import com.newsdk.ams.emas.demo.constant.KEY_HOST_WITH_FIXED_IP +import com.newsdk.ams.emas.demo.constant.KEY_IP_RANKING_ITEMS +import com.newsdk.ams.emas.demo.constant.KEY_PRE_RESOLVE_HOST_LIST +import com.newsdk.ams.emas.demo.constant.KEY_TAGS +import com.newsdk.ams.emas.demo.constant.KEY_TTL_CHANGER +import com.newsdk.sdk.android.httpdns.ranking.IPRankingBean +import com.newsdk.ams.httpdns.demo.R import kotlinx.coroutines.launch import org.json.JSONArray import org.json.JSONException diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/BestPracticeFragment.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/BestPracticeFragment.kt similarity index 93% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/BestPracticeFragment.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/BestPracticeFragment.kt index 6d663e4..36a287a 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/BestPracticeFragment.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/BestPracticeFragment.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.practice +package com.newsdk.ams.emas.demo.ui.practice import android.content.Intent import android.os.Bundle @@ -8,8 +8,8 @@ import android.view.ViewGroup import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import com.aliyun.ams.httpdns.demo.R -import com.aliyun.ams.httpdns.demo.databinding.FragmentBestPracticeBinding +import com.newsdk.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.databinding.FragmentBestPracticeBinding /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/BestPracticeViewModel.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/BestPracticeViewModel.kt similarity index 91% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/BestPracticeViewModel.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/BestPracticeViewModel.kt index 25a926f..d7b25ea 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/BestPracticeViewModel.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/BestPracticeViewModel.kt @@ -1,16 +1,16 @@ -package com.alibaba.ams.emas.demo.ui.practice +package com.newsdk.ams.emas.demo.ui.practice import android.app.Application import android.util.Log import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope -import com.alibaba.ams.emas.demo.HttpDnsServiceHolder -import com.alibaba.ams.emas.demo.net.TLSSNISocketFactory -import com.alibaba.ams.emas.demo.readStringFrom -import com.alibaba.sdk.android.httpdns.NetType -import com.alibaba.sdk.android.httpdns.RequestIpType -import com.alibaba.sdk.android.httpdns.net.HttpDnsNetworkDetector -import com.Alibaba.sdk.android.tool.NetworkUtils +import com.newsdk.ams.emas.demo.HttpDnsServiceHolder +import com.newsdk.ams.emas.demo.net.TLSSNISocketFactory +import com.newsdk.ams.emas.demo.readStringFrom +import com.newsdk.sdk.android.httpdns.NetType +import com.newsdk.sdk.android.httpdns.RequestIpType +import com.newsdk.sdk.android.httpdns.net.HttpDnsNetworkDetector +import com.alibaba.sdk.android.tool.NetworkUtils import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/HttpDnsWebviewGetActivity.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/HttpDnsWebviewGetActivity.kt similarity index 97% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/HttpDnsWebviewGetActivity.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/HttpDnsWebviewGetActivity.kt index 2de146f..3136d98 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/HttpDnsWebviewGetActivity.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/HttpDnsWebviewGetActivity.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.practice +package com.newsdk.ams.emas.demo.ui.practice import android.os.Bundle import android.text.TextUtils @@ -6,9 +6,9 @@ import android.util.Log import android.view.MenuItem import android.webkit.* import androidx.appcompat.app.AppCompatActivity -import com.alibaba.ams.emas.demo.HttpDnsServiceHolder -import com.aliyun.ams.httpdns.demo.R -import com.aliyun.ams.httpdns.demo.databinding.ActivityHttpDnsWebviewBinding +import com.newsdk.ams.emas.demo.HttpDnsServiceHolder +import com.newsdk.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.databinding.ActivityHttpDnsWebviewBinding import java.io.IOException import java.net.* import javax.net.ssl.* diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/IBestPracticeShowDialog.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/IBestPracticeShowDialog.kt similarity index 77% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/IBestPracticeShowDialog.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/IBestPracticeShowDialog.kt index 9cb9bae..e065376 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/IBestPracticeShowDialog.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/IBestPracticeShowDialog.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.practice +package com.newsdk.ams.emas.demo.ui.practice /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/SNISocketFactory.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/SNISocketFactory.kt similarity index 97% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/SNISocketFactory.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/SNISocketFactory.kt index 78a914e..a83c196 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/practice/SNISocketFactory.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/practice/SNISocketFactory.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.practice +package com.newsdk.ams.emas.demo.ui.practice import android.net.SSLCertificateSocketFactory import java.net.InetAddress diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/IResolveShowDialog.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/IResolveShowDialog.kt similarity index 86% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/IResolveShowDialog.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/IResolveShowDialog.kt index e1b23b2..d7a314c 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/IResolveShowDialog.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/IResolveShowDialog.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.resolve +package com.newsdk.ams.emas.demo.ui.resolve /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/NetRequestType.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/NetRequestType.kt similarity index 72% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/NetRequestType.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/NetRequestType.kt index d249eec..8f3bdbb 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/NetRequestType.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/NetRequestType.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.resolve +package com.newsdk.ams.emas.demo.ui.resolve /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/ResolveFragment.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/ResolveFragment.kt similarity index 95% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/ResolveFragment.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/ResolveFragment.kt index c519506..3f53771 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/ResolveFragment.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/ResolveFragment.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.resolve +package com.newsdk.ams.emas.demo.ui.resolve import android.os.Bundle import android.text.TextUtils @@ -8,11 +8,11 @@ import android.view.ViewGroup import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import com.alibaba.ams.emas.demo.constant.KEY_RESOLVE_IP_TYPE -import com.alibaba.ams.emas.demo.constant.KEY_RESOLVE_METHOD -import com.alibaba.ams.emas.demo.getAccountPreference -import com.aliyun.ams.httpdns.demo.R -import com.aliyun.ams.httpdns.demo.databinding.FragmentResolveBinding +import com.newsdk.ams.emas.demo.constant.KEY_RESOLVE_IP_TYPE +import com.newsdk.ams.emas.demo.constant.KEY_RESOLVE_METHOD +import com.newsdk.ams.emas.demo.getAccountPreference +import com.newsdk.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.databinding.FragmentResolveBinding import org.json.JSONException import org.json.JSONObject @@ -177,7 +177,7 @@ class ResolveFragment : Fragment(), IResolveShowDialog { val builder = activity?.let { act -> AlertDialog.Builder(act) } builder?.apply { setTitle(R.string.select_resolve_method) - val items = arrayOf("鍚屾鏂规硶", "寮傛鏂规硶", "鍚屾闈為樆濉炴柟娉?) + val items = arrayOf("Sync", "Async", "Sync NonBlocking") val preferences = activity?.let { getAccountPreference(it) } var resolvedMethod = preferences?.getString(KEY_RESOLVE_METHOD, "getHttpDnsResultForHostSync(String host, RequestIpType type)").toString() diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/ResolveViewModel.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/ResolveViewModel.kt similarity index 88% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/ResolveViewModel.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/ResolveViewModel.kt index c4b1719..fc19c5e 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/ResolveViewModel.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/ResolveViewModel.kt @@ -1,20 +1,20 @@ -package com.alibaba.ams.emas.demo.ui.resolve +package com.newsdk.ams.emas.demo.ui.resolve import android.app.Application import android.util.Log import android.widget.RadioGroup import androidx.lifecycle.AndroidViewModel import androidx.lifecycle.viewModelScope -import com.alibaba.ams.emas.demo.HttpDnsApplication -import com.alibaba.ams.emas.demo.SingleLiveData -import com.alibaba.ams.emas.demo.constant.KEY_RESOLVE_IP_TYPE -import com.alibaba.ams.emas.demo.constant.KEY_RESOLVE_METHOD -import com.alibaba.ams.emas.demo.constant.KEY_SDNS_RESOLVE -import com.alibaba.ams.emas.demo.getAccountPreference -import com.alibaba.ams.emas.demo.net.HttpURLConnectionRequest -import com.alibaba.ams.emas.demo.net.OkHttpRequest -import com.alibaba.sdk.android.httpdns.RequestIpType -import com.aliyun.ams.httpdns.demo.R +import com.newsdk.ams.emas.demo.HttpDnsApplication +import com.newsdk.ams.emas.demo.SingleLiveData +import com.newsdk.ams.emas.demo.constant.KEY_RESOLVE_IP_TYPE +import com.newsdk.ams.emas.demo.constant.KEY_RESOLVE_METHOD +import com.newsdk.ams.emas.demo.constant.KEY_SDNS_RESOLVE +import com.newsdk.ams.emas.demo.getAccountPreference +import com.newsdk.ams.emas.demo.net.HttpURLConnectionRequest +import com.newsdk.ams.emas.demo.net.OkHttpRequest +import com.newsdk.sdk.android.httpdns.RequestIpType +import com.newsdk.ams.httpdns.demo.R import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/Response.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/Response.kt similarity index 69% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/Response.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/Response.kt index 76d1bd0..b8b3026 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/Response.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/Response.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.resolve +package com.newsdk.ams.emas.demo.ui.resolve /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/SchemaType.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/SchemaType.kt similarity index 67% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/SchemaType.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/SchemaType.kt index 2043c35..766cfa7 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/ui/resolve/SchemaType.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/ui/resolve/SchemaType.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.ui.resolve +package com.newsdk.ams.emas.demo.ui.resolve /** * @author allen.wy diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/widget/SwipeLayout.kt b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/widget/SwipeLayout.kt similarity index 99% rename from EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/widget/SwipeLayout.kt rename to EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/widget/SwipeLayout.kt index cb5c2c9..f0917de 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/java/com/alibaba/ams/emas/demo/widget/SwipeLayout.kt +++ b/EdgeHttpDNS/sdk/android/demo/src/main/java/com/newsdk/ams/emas/demo/widget/SwipeLayout.kt @@ -1,4 +1,4 @@ -package com.alibaba.ams.emas.demo.widget +package com.newsdk.ams.emas.demo.widget import android.content.Context import android.graphics.PointF @@ -9,7 +9,7 @@ import android.view.ViewConfiguration import android.view.ViewGroup import android.widget.FrameLayout import android.widget.Scroller -import com.aliyun.ams.httpdns.demo.R +import com.newsdk.ams.httpdns.demo.R import java.lang.ref.WeakReference import kotlin.math.abs diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_http_dns_webview.xml b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_http_dns_webview.xml index ecfca0c..880dea8 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_http_dns_webview.xml +++ b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_http_dns_webview.xml @@ -9,14 +9,14 @@ + android:theme="@style/Theme.NewHttpDnsDemo.AppBarOverlay"> diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_list.xml b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_list.xml index 0f0f3ea..d60a58b 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_list.xml +++ b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_list.xml @@ -4,19 +4,19 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="com.alibaba.ams.emas.demo.ui.info.list.ListActivity"> + tools:context="com.newsdk.ams.emas.demo.ui.info.list.ListActivity"> + android:theme="@style/Theme.NewHttpDnsDemo.AppBarOverlay"> diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_sdns_global_setting.xml b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_sdns_global_setting.xml index 9d24b0b..44defbd 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_sdns_global_setting.xml +++ b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/activity_sdns_global_setting.xml @@ -9,7 +9,7 @@ android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:theme="@style/Theme.AlicloudHttpDnsDemo.AppBarOverlay" + android:theme="@style/Theme.NewHttpDnsDemo.AppBarOverlay" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent"> @@ -19,7 +19,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" - app:popupTheme="@style/Theme.AlicloudHttpDnsDemo.PopupOverlay" + app:popupTheme="@style/Theme.NewHttpDnsDemo.PopupOverlay" app:titleTextColor="@color/white" app:navigationIcon="@drawable/ic_back"/> diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/fragment_basic_setting.xml b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/fragment_basic_setting.xml index b7bab2b..f5d47ba 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/fragment_basic_setting.xml +++ b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/fragment_basic_setting.xml @@ -5,11 +5,11 @@ - + + type="com.newsdk.ams.emas.demo.ui.basic.BasicSettingViewModel" /> + type="com.newsdk.ams.emas.demo.ui.practice.BestPracticeViewModel" /> - + + type="com.newsdk.ams.emas.demo.ui.info.InfoViewModel" /> + tools:text="com.newsdk.ams.httpdns.demo" /> diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/fragment_resolve.xml b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/fragment_resolve.xml index 9afbc49..04950c0 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/fragment_resolve.xml +++ b/EdgeHttpDNS/sdk/android/demo/src/main/res/layout/fragment_resolve.xml @@ -7,7 +7,7 @@ + type="com.newsdk.ams.emas.demo.ui.resolve.ResolveViewModel" /> - - + - - + \ No newline at end of file diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/res/navigation/mobile_navigation.xml b/EdgeHttpDNS/sdk/android/demo/src/main/res/navigation/mobile_navigation.xml index 5f47f47..8cdd575 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/res/navigation/mobile_navigation.xml +++ b/EdgeHttpDNS/sdk/android/demo/src/main/res/navigation/mobile_navigation.xml @@ -7,25 +7,25 @@ \ No newline at end of file diff --git a/EdgeHttpDNS/sdk/android/demo/src/main/res/values-night/themes.xml b/EdgeHttpDNS/sdk/android/demo/src/main/res/values-night/themes.xml index 377db03..8e73a51 100644 --- a/EdgeHttpDNS/sdk/android/demo/src/main/res/values-night/themes.xml +++ b/EdgeHttpDNS/sdk/android/demo/src/main/res/values-night/themes.xml @@ -1,6 +1,6 @@ - - -