删除一直未实现的Unix协议相关内容

This commit is contained in:
刘祥超
2024-04-14 17:11:58 +08:00
parent dc894828e0
commit 8e4c00ef31
2 changed files with 3 additions and 44 deletions

View File

@@ -158,7 +158,6 @@ func (this *ServerDAO) CreateServer(tx *dbs.Tx,
httpsJSON []byte, httpsJSON []byte,
tcpJSON []byte, tcpJSON []byte,
tlsJSON []byte, tlsJSON []byte,
unixJSON []byte,
udpJSON []byte, udpJSON []byte,
webId int64, webId int64,
reverseProxyJSON []byte, reverseProxyJSON []byte,
@@ -206,9 +205,6 @@ func (this *ServerDAO) CreateServer(tx *dbs.Tx,
if IsNotNull(tlsJSON) { if IsNotNull(tlsJSON) {
op.Tls = tlsJSON op.Tls = tlsJSON
} }
if IsNotNull(unixJSON) {
op.Unix = unixJSON
}
if IsNotNull(udpJSON) { if IsNotNull(udpJSON) {
op.Udp = udpJSON op.Udp = udpJSON
} }
@@ -1236,18 +1232,6 @@ func (this *ServerDAO) ComposeServerConfig(tx *dbs.Tx, server *Server, ignoreCer
} }
} }
// Unix
if IsNotNull(server.Unix) {
var unixConfig = &serverconfigs.UnixProtocolConfig{}
err := json.Unmarshal(server.Unix, unixConfig)
if err != nil {
return nil, err
}
if !forNode || unixConfig.IsOn {
config.Unix = unixConfig
}
}
// UDP // UDP
if IsNotNull(server.Udp) { if IsNotNull(server.Udp) {
var udpConfig = &serverconfigs.UDPProtocolConfig{} var udpConfig = &serverconfigs.UDPProtocolConfig{}

View File

@@ -181,7 +181,7 @@ func (this *ServerService) CreateServer(ctx context.Context, req *pb.CreateServe
} }
} }
serverId, err := models.SharedServerDAO.CreateServer(tx, req.AdminId, req.UserId, req.Type, req.Name, req.Description, serverNamesJSON, isAuditing, auditingServerNamesJSON, req.HttpJSON, req.HttpsJSON, req.TcpJSON, req.TlsJSON, req.UnixJSON, req.UdpJSON, req.WebId, req.ReverseProxyJSON, req.NodeClusterId, req.IncludeNodesJSON, req.ExcludeNodesJSON, req.ServerGroupIds, req.UserPlanId) serverId, err := models.SharedServerDAO.CreateServer(tx, req.AdminId, req.UserId, req.Type, req.Name, req.Description, serverNamesJSON, isAuditing, auditingServerNamesJSON, req.HttpJSON, req.HttpsJSON, req.TcpJSON, req.TlsJSON, req.UdpJSON, req.WebId, req.ReverseProxyJSON, req.NodeClusterId, req.IncludeNodesJSON, req.ExcludeNodesJSON, req.ServerGroupIds, req.UserPlanId)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -451,7 +451,7 @@ func (this *ServerService) CreateBasicHTTPServer(ctx context.Context, req *pb.Cr
} }
// finally, we create ... // finally, we create ...
serverId, err := models.SharedServerDAO.CreateServer(tx, adminId, req.UserId, serverconfigs.ServerTypeHTTPProxy, req.Domains[0], "", serverNamesJSON, isAuditing, auditingServerNamesJSON, httpJSON, httpsJSON, nil, nil, nil, nil, webId, reverseProxyJSON, req.NodeClusterId, nil, nil, nil, 0) serverId, err := models.SharedServerDAO.CreateServer(tx, adminId, req.UserId, serverconfigs.ServerTypeHTTPProxy, req.Domains[0], "", serverNamesJSON, isAuditing, auditingServerNamesJSON, httpJSON, httpsJSON, nil, nil, nil, webId, reverseProxyJSON, req.NodeClusterId, nil, nil, nil, 0)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -687,7 +687,7 @@ func (this *ServerService) CreateBasicTCPServer(ctx context.Context, req *pb.Cre
} }
// finally, we create ... // finally, we create ...
serverId, err := models.SharedServerDAO.CreateServer(tx, adminId, req.UserId, serverconfigs.ServerTypeTCPProxy, "TCP Service", "", nil, false, nil, nil, nil, tcpJSON, tlsJSON, nil, nil, 0, reverseProxyJSON, req.NodeClusterId, nil, nil, nil, 0) serverId, err := models.SharedServerDAO.CreateServer(tx, adminId, req.UserId, serverconfigs.ServerTypeTCPProxy, "TCP Service", "", nil, false, nil, nil, nil, tcpJSON, tlsJSON, nil, 0, reverseProxyJSON, req.NodeClusterId, nil, nil, nil, 0)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -1116,29 +1116,6 @@ func (this *ServerService) UpdateServerTLS(ctx context.Context, req *pb.UpdateSe
return this.Success() return this.Success()
} }
// UpdateServerUnix 修改Unix服务
func (this *ServerService) UpdateServerUnix(ctx context.Context, req *pb.UpdateServerUnixRequest) (*pb.RPCSuccess, error) {
// 校验请求
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
if req.ServerId <= 0 {
return nil, errors.New("invalid serverId")
}
var tx = this.NullTx()
// 修改配置
err = models.SharedServerDAO.UpdateServerUnix(tx, req.ServerId, req.UnixJSON)
if err != nil {
return nil, err
}
return this.Success()
}
// UpdateServerUDP 修改UDP服务 // UpdateServerUDP 修改UDP服务
func (this *ServerService) UpdateServerUDP(ctx context.Context, req *pb.UpdateServerUDPRequest) (*pb.RPCSuccess, error) { func (this *ServerService) UpdateServerUDP(ctx context.Context, req *pb.UpdateServerUDPRequest) (*pb.RPCSuccess, error) {
// 校验请求 // 校验请求
@@ -1645,7 +1622,6 @@ func (this *ServerService) ListEnabledServersMatch(ctx context.Context, req *pb.
HttpsJSON: server.Https, HttpsJSON: server.Https,
TcpJSON: server.Tcp, TcpJSON: server.Tcp,
TlsJSON: server.Tls, TlsJSON: server.Tls,
UnixJSON: server.Unix,
UdpJSON: server.Udp, UdpJSON: server.Udp,
IncludeNodes: server.IncludeNodes, IncludeNodes: server.IncludeNodes,
ExcludeNodes: server.ExcludeNodes, ExcludeNodes: server.ExcludeNodes,
@@ -1830,7 +1806,6 @@ func (this *ServerService) FindEnabledServer(ctx context.Context, req *pb.FindEn
HttpsJSON: server.Https, HttpsJSON: server.Https,
TcpJSON: server.Tcp, TcpJSON: server.Tcp,
TlsJSON: server.Tls, TlsJSON: server.Tls,
UnixJSON: server.Unix,
UdpJSON: server.Udp, UdpJSON: server.Udp,
WebId: int64(server.WebId), WebId: int64(server.WebId),
ReverseProxyJSON: server.ReverseProxy, ReverseProxyJSON: server.ReverseProxy,