Add SSH inbound, log level. Update MTPROXY. Fixes

This commit is contained in:
Shtorm
2026-06-07 07:59:43 +03:00
parent 6f6af8e902
commit 9f5ccf43d4
115 changed files with 2742 additions and 527 deletions

View File

@@ -281,15 +281,16 @@ func (s *APIClient) handler(node CM.ConnectedNode, stream grpc.ServerStreamingCl
func (s *APIClient) convertUser(user *pb.User) CM.User {
return CM.User{
ID: int(user.Id),
Username: user.Username,
Inbound: user.Inbound,
Type: user.Type,
UUID: user.Uuid,
Password: user.Password,
Secret: user.Secret,
Flow: user.Flow,
AlterID: int(user.AlterId),
ID: int(user.Id),
Username: user.Username,
Inbound: user.Inbound,
Type: user.Type,
UUID: user.Uuid,
Password: user.Password,
Secret: user.Secret,
AuthorizedKeys: user.AuthorizedKeys,
Flow: user.Flow,
AlterID: int(user.AlterId),
}
}
@@ -301,7 +302,7 @@ func (s *APIClient) convertBandwidthLimiter(limiter *pb.BandwidthLimiter) CM.Ban
Strategy: limiter.Strategy,
ConnectionType: limiter.ConnectionType,
Mode: limiter.Mode,
FlowKeys: limiter.FlowKeys,
FlowKeys: limiter.FlowKeys,
Speed: limiter.Speed,
RawSpeed: limiter.RawSpeed,
}

View File

@@ -151,18 +151,19 @@ func (x *Node) GetUuid() string {
}
type User struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
Inbound string `protobuf:"bytes,3,opt,name=inbound,proto3" json:"inbound,omitempty"`
Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
Uuid string `protobuf:"bytes,5,opt,name=uuid,proto3" json:"uuid,omitempty"`
Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"`
Secret string `protobuf:"bytes,7,opt,name=secret,proto3" json:"secret,omitempty"`
Flow string `protobuf:"bytes,8,opt,name=flow,proto3" json:"flow,omitempty"`
AlterId int32 `protobuf:"varint,9,opt,name=alter_id,json=alterId,proto3" json:"alter_id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
Inbound string `protobuf:"bytes,3,opt,name=inbound,proto3" json:"inbound,omitempty"`
Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
Uuid string `protobuf:"bytes,5,opt,name=uuid,proto3" json:"uuid,omitempty"`
Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"`
Secret string `protobuf:"bytes,7,opt,name=secret,proto3" json:"secret,omitempty"`
Flow string `protobuf:"bytes,8,opt,name=flow,proto3" json:"flow,omitempty"`
AlterId int32 `protobuf:"varint,9,opt,name=alter_id,json=alterId,proto3" json:"alter_id,omitempty"`
AuthorizedKeys []string `protobuf:"bytes,10,rep,name=authorized_keys,json=authorizedKeys,proto3" json:"authorized_keys,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *User) Reset() {
@@ -258,6 +259,13 @@ func (x *User) GetAlterId() int32 {
return 0
}
func (x *User) GetAuthorizedKeys() []string {
if x != nil {
return x.AuthorizedKeys
}
return nil
}
type UserList struct {
state protoimpl.MessageState `protogen:"open.v1"`
Values []*User `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
@@ -1338,7 +1346,7 @@ const file_service_node_manager_api_manager_manager_proto_rawDesc = "" +
"\n" +
".service/node_manager_api/manager/manager.proto\x12\x13node_manager_api.v1\"\x1a\n" +
"\x04Node\x12\x12\n" +
"\x04uuid\x18\x01 \x01(\tR\x04uuid\"\xd7\x01\n" +
"\x04uuid\x18\x01 \x01(\tR\x04uuid\"\x80\x02\n" +
"\x04User\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x1a\n" +
"\busername\x18\x02 \x01(\tR\busername\x12\x18\n" +
@@ -1348,7 +1356,9 @@ const file_service_node_manager_api_manager_manager_proto_rawDesc = "" +
"\bpassword\x18\x06 \x01(\tR\bpassword\x12\x16\n" +
"\x06secret\x18\a \x01(\tR\x06secret\x12\x12\n" +
"\x04flow\x18\b \x01(\tR\x04flow\x12\x19\n" +
"\balter_id\x18\t \x01(\x05R\aalterId\"=\n" +
"\balter_id\x18\t \x01(\x05R\aalterId\x12'\n" +
"\x0fauthorized_keys\x18\n" +
" \x03(\tR\x0eauthorizedKeys\"=\n" +
"\bUserList\x121\n" +
"\x06values\x18\x01 \x03(\v2\x19.node_manager_api.v1.UserR\x06values\"\x83\x02\n" +
"\x10BandwidthLimiter\x12\x0e\n" +

View File

@@ -48,6 +48,7 @@ message User {
string secret = 7;
string flow = 8;
int32 alter_id = 9;
repeated string authorized_keys = 10;
}
message UserList {

View File

@@ -239,15 +239,16 @@ func (s *RemoteNode) close(err error) {
func (s *RemoteNode) convertUser(user CS.User) *pb.User {
return &pb.User{
Id: int32(user.ID),
Username: user.Username,
Inbound: user.Inbound,
Type: user.Type,
Uuid: user.UUID,
Password: user.Password,
Secret: user.Secret,
Flow: user.Flow,
AlterId: int32(user.AlterID),
Id: int32(user.ID),
Username: user.Username,
Inbound: user.Inbound,
Type: user.Type,
Uuid: user.UUID,
Password: user.Password,
Secret: user.Secret,
AuthorizedKeys: user.AuthorizedKeys,
Flow: user.Flow,
AlterId: int32(user.AlterID),
}
}