diff --git a/internal/db/models/node_cluster_dao.go b/internal/db/models/node_cluster_dao.go index 94b216df..0b999d03 100644 --- a/internal/db/models/node_cluster_dao.go +++ b/internal/db/models/node_cluster_dao.go @@ -1030,7 +1030,7 @@ func (this *NodeClusterDAO) FindClusterBasicInfo(tx *dbs.Tx, clusterId int64, ca cluster, err := this.Query(tx). Pk(clusterId). State(NodeClusterStateEnabled). - Result("id", "name", "timeZone", "nodeMaxThreads", "cachePolicyId", "httpFirewallPolicyId", "autoOpenPorts", "webp", "uam", "cc", "httpPages", "http3", "isOn", "ddosProtection", "clock", "globalServerConfig", "autoInstallNftables", "autoSystemTuning", "networkSecurity", "autoTrimDisks"). + Result("id", "name", "timeZone", "nodeMaxThreads", "cachePolicyId", "httpFirewallPolicyId", "autoOpenPorts", "webp", "uam", "cc", "httpPages", "http3", "isOn", "ddosProtection", "clock", "globalServerConfig", "autoInstallNftables", "autoSystemTuning", "networkSecurity", "autoTrimDisks", "secret"). Find() if err != nil || cluster == nil { return nil, err diff --git a/internal/db/models/node_dao.go b/internal/db/models/node_dao.go index e2814e6e..3d1433e8 100644 --- a/internal/db/models/node_dao.go +++ b/internal/db/models/node_dao.go @@ -1105,6 +1105,11 @@ func (this *NodeDAO) ComposeNodeConfig(tx *dbs.Tx, nodeId int64, dataMap *shared continue } + // 集群密钥 + if len(config.ClusterSecret) == 0 { + config.ClusterSecret = nodeCluster.Secret + } + // 所有节点IP地址 nodeIPAddresses, err := SharedNodeIPAddressDAO.FindAllAccessibleIPAddressesWithClusterId(tx, nodeconfigs.NodeRoleNode, clusterId, cacheMap) if err != nil {