fix: Fix Geo assets path

This commit is contained in:
Nova 2024-10-24 20:54:47 +03:30
parent 6d17aa06b1
commit afd381aab3
No known key found for this signature in database
GPG Key ID: 389787EC83F5D73A
17 changed files with 264 additions and 164 deletions

View File

@ -633,7 +633,7 @@ namespace NekoGui {
};
if (QFile(QString(RULE_SETS_DIR + "/%1.srs").arg(item)).exists()) continue;
bool ok;
auto err = NekoGui_rpc::defaultClient->CompileGeoSet(&ok, item.contains("_IP") ? NekoGui_rpc::GeoRuleSetType::ip : NekoGui_rpc::GeoRuleSetType::site, item.toStdString());
auto err = NekoGui_rpc::defaultClient->CompileGeoSet(&ok, item.contains("_IP") ? NekoGui_rpc::GeoRuleSetType::ip : NekoGui_rpc::GeoRuleSetType::site, item.toStdString(), GetBasePath());
if (!ok) {
MW_show_log("Failed to generate rule set asset for " + item);
status->result->error = err;

View File

@ -7,6 +7,7 @@ import (
"github.com/sagernet/sing-box/common/settings"
"github.com/sagernet/sing/common/metadata"
"nekobox_core/internal/boxbox"
"os"
"strings"
"time"
@ -165,8 +166,8 @@ func (s *server) ListConnections(ctx context.Context, in *gen.EmptyReq) (*gen.Li
return out, nil
}
func (s *server) GetGeoIPList(ctx context.Context, in *gen.EmptyReq) (*gen.GetGeoIPListResponse, error) {
resp, err := boxmain.ListGeoip()
func (s *server) GetGeoIPList(ctx context.Context, in *gen.GeoListRequest) (*gen.GetGeoIPListResponse, error) {
resp, err := boxmain.ListGeoip(in.Path + string(os.PathSeparator) + "geoip.db")
if err != nil {
return nil, err
}
@ -180,8 +181,8 @@ func (s *server) GetGeoIPList(ctx context.Context, in *gen.EmptyReq) (*gen.GetGe
return &gen.GetGeoIPListResponse{Items: res}, nil
}
func (s *server) GetGeoSiteList(ctx context.Context, in *gen.EmptyReq) (*gen.GetGeoSiteListResponse, error) {
resp, err := boxmain.GeositeList()
func (s *server) GetGeoSiteList(ctx context.Context, in *gen.GeoListRequest) (*gen.GetGeoSiteListResponse, error) {
resp, err := boxmain.GeositeList(in.Path + string(os.PathSeparator) + "geosite.db")
if err != nil {
return nil, err
}
@ -197,7 +198,7 @@ func (s *server) GetGeoSiteList(ctx context.Context, in *gen.EmptyReq) (*gen.Get
func (s *server) CompileGeoIPToSrs(ctx context.Context, in *gen.CompileGeoIPToSrsRequest) (*gen.EmptyResp, error) {
category := strings.TrimSuffix(in.Item, "_IP")
err := boxmain.CompileRuleSet(category, boxmain.IpRuleSet, "./rule_sets/"+in.Item+".srs")
err := boxmain.CompileRuleSet(in.Path+string(os.PathSeparator)+"geoip.db", category, boxmain.IpRuleSet, "./rule_sets/"+in.Item+".srs")
if err != nil {
return nil, err
}
@ -207,7 +208,7 @@ func (s *server) CompileGeoIPToSrs(ctx context.Context, in *gen.CompileGeoIPToSr
func (s *server) CompileGeoSiteToSrs(ctx context.Context, in *gen.CompileGeoSiteToSrsRequest) (*gen.EmptyResp, error) {
category := strings.TrimSuffix(in.Item, "_SITE")
err := boxmain.CompileRuleSet(category, boxmain.SiteRuleSet, "./rule_sets/"+in.Item+".srs")
err := boxmain.CompileRuleSet(in.Path+string(os.PathSeparator)+"geosite.db", category, boxmain.SiteRuleSet, "./rule_sets/"+in.Item+".srs")
if err != nil {
return nil, err
}

View File

@ -10,8 +10,8 @@ var (
geoipReader *maxminddb.Reader
)
func geoipPreRun() error {
reader, err := maxminddb.Open("../geoip.db") // currentDir is the config folder
func geoipPreRun(path string) error {
reader, err := maxminddb.Open(path)
if err != nil {
return err
}

View File

@ -13,8 +13,8 @@ import (
"github.com/oschwald/maxminddb-golang"
)
func geoipExport(countryCode string) ([]byte, error) {
if err := geoipPreRun(); err != nil {
func geoipExport(path string, countryCode string) ([]byte, error) {
if err := geoipPreRun(path); err != nil {
return nil, err
}

View File

@ -1,7 +1,7 @@
package boxmain
func ListGeoip() ([]string, error) {
if err := geoipPreRun(); err != nil {
func ListGeoip(path string) ([]string, error) {
if err := geoipPreRun(path); err != nil {
return nil, err
}

View File

@ -10,8 +10,8 @@ var (
geositeCodeList []string
)
func geositePreRun() error {
reader, codeList, err := geosite.Open("../geosite.db") // currentDir is the config folder
func geositePreRun(path string) error {
reader, codeList, err := geosite.Open(path)
if err != nil {
return E.Cause(err, "open geosite file ")
}

View File

@ -8,8 +8,8 @@ import (
"github.com/sagernet/sing/common/json"
)
func geositeExport(category string) ([]byte, error) {
if err := geositePreRun(); err != nil {
func geositeExport(path string, category string) ([]byte, error) {
if err := geositePreRun(path); err != nil {
return nil, err
}

View File

@ -1,7 +1,7 @@
package boxmain
func GeositeList() ([]string, error) {
if err := geositePreRun(); err != nil {
func GeositeList(path string) ([]string, error) {
if err := geositePreRun(path); err != nil {
return nil, err
}

View File

@ -14,16 +14,16 @@ const (
SiteRuleSet
)
func CompileRuleSet(category string, ruleSetType RuleSetType, destPath string) error {
func CompileRuleSet(path string, category string, ruleSetType RuleSetType, destPath string) error {
var (
content []byte
err error
)
if ruleSetType == IpRuleSet {
content, err = geoipExport(category)
content, err = geoipExport(path, category)
} else {
content, err = geositeExport(category)
content, err = geositeExport(path, category)
}
if err != nil {
return err

View File

@ -842,18 +842,66 @@ func (x *GetGeoSiteListResponse) GetItems() []string {
return nil
}
type GeoListRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
}
func (x *GeoListRequest) Reset() {
*x = GeoListRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_libcore_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GeoListRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GeoListRequest) ProtoMessage() {}
func (x *GeoListRequest) ProtoReflect() protoreflect.Message {
mi := &file_libcore_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GeoListRequest.ProtoReflect.Descriptor instead.
func (*GeoListRequest) Descriptor() ([]byte, []int) {
return file_libcore_proto_rawDescGZIP(), []int{14}
}
func (x *GeoListRequest) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
type CompileGeoIPToSrsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Item string `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
}
func (x *CompileGeoIPToSrsRequest) Reset() {
*x = CompileGeoIPToSrsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_libcore_proto_msgTypes[14]
mi := &file_libcore_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -866,7 +914,7 @@ func (x *CompileGeoIPToSrsRequest) String() string {
func (*CompileGeoIPToSrsRequest) ProtoMessage() {}
func (x *CompileGeoIPToSrsRequest) ProtoReflect() protoreflect.Message {
mi := &file_libcore_proto_msgTypes[14]
mi := &file_libcore_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -879,7 +927,7 @@ func (x *CompileGeoIPToSrsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CompileGeoIPToSrsRequest.ProtoReflect.Descriptor instead.
func (*CompileGeoIPToSrsRequest) Descriptor() ([]byte, []int) {
return file_libcore_proto_rawDescGZIP(), []int{14}
return file_libcore_proto_rawDescGZIP(), []int{15}
}
func (x *CompileGeoIPToSrsRequest) GetItem() string {
@ -889,18 +937,26 @@ func (x *CompileGeoIPToSrsRequest) GetItem() string {
return ""
}
func (x *CompileGeoIPToSrsRequest) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
type CompileGeoSiteToSrsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Item string `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
}
func (x *CompileGeoSiteToSrsRequest) Reset() {
*x = CompileGeoSiteToSrsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_libcore_proto_msgTypes[15]
mi := &file_libcore_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -913,7 +969,7 @@ func (x *CompileGeoSiteToSrsRequest) String() string {
func (*CompileGeoSiteToSrsRequest) ProtoMessage() {}
func (x *CompileGeoSiteToSrsRequest) ProtoReflect() protoreflect.Message {
mi := &file_libcore_proto_msgTypes[15]
mi := &file_libcore_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -926,7 +982,7 @@ func (x *CompileGeoSiteToSrsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CompileGeoSiteToSrsRequest.ProtoReflect.Descriptor instead.
func (*CompileGeoSiteToSrsRequest) Descriptor() ([]byte, []int) {
return file_libcore_proto_rawDescGZIP(), []int{15}
return file_libcore_proto_rawDescGZIP(), []int{16}
}
func (x *CompileGeoSiteToSrsRequest) GetItem() string {
@ -936,6 +992,13 @@ func (x *CompileGeoSiteToSrsRequest) GetItem() string {
return ""
}
func (x *CompileGeoSiteToSrsRequest) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
type SetSystemProxyRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -948,7 +1011,7 @@ type SetSystemProxyRequest struct {
func (x *SetSystemProxyRequest) Reset() {
*x = SetSystemProxyRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_libcore_proto_msgTypes[16]
mi := &file_libcore_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -961,7 +1024,7 @@ func (x *SetSystemProxyRequest) String() string {
func (*SetSystemProxyRequest) ProtoMessage() {}
func (x *SetSystemProxyRequest) ProtoReflect() protoreflect.Message {
mi := &file_libcore_proto_msgTypes[16]
mi := &file_libcore_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -974,7 +1037,7 @@ func (x *SetSystemProxyRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SetSystemProxyRequest.ProtoReflect.Descriptor instead.
func (*SetSystemProxyRequest) Descriptor() ([]byte, []int) {
return file_libcore_proto_rawDescGZIP(), []int{16}
return file_libcore_proto_rawDescGZIP(), []int{17}
}
func (x *SetSystemProxyRequest) GetEnable() bool {
@ -1004,7 +1067,7 @@ type SetSystemDNSRequest struct {
func (x *SetSystemDNSRequest) Reset() {
*x = SetSystemDNSRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_libcore_proto_msgTypes[17]
mi := &file_libcore_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1017,7 +1080,7 @@ func (x *SetSystemDNSRequest) String() string {
func (*SetSystemDNSRequest) ProtoMessage() {}
func (x *SetSystemDNSRequest) ProtoReflect() protoreflect.Message {
mi := &file_libcore_proto_msgTypes[17]
mi := &file_libcore_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1030,7 +1093,7 @@ func (x *SetSystemDNSRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SetSystemDNSRequest.ProtoReflect.Descriptor instead.
func (*SetSystemDNSRequest) Descriptor() ([]byte, []int) {
return file_libcore_proto_rawDescGZIP(), []int{17}
return file_libcore_proto_rawDescGZIP(), []int{18}
}
func (x *SetSystemDNSRequest) GetClear() bool {
@ -1066,7 +1129,7 @@ type GetSystemDNSResponse struct {
func (x *GetSystemDNSResponse) Reset() {
*x = GetSystemDNSResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_libcore_proto_msgTypes[18]
mi := &file_libcore_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1079,7 +1142,7 @@ func (x *GetSystemDNSResponse) String() string {
func (*GetSystemDNSResponse) ProtoMessage() {}
func (x *GetSystemDNSResponse) ProtoReflect() protoreflect.Message {
mi := &file_libcore_proto_msgTypes[18]
mi := &file_libcore_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1092,7 +1155,7 @@ func (x *GetSystemDNSResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetSystemDNSResponse.ProtoReflect.Descriptor instead.
func (*GetSystemDNSResponse) Descriptor() ([]byte, []int) {
return file_libcore_proto_rawDescGZIP(), []int{18}
return file_libcore_proto_rawDescGZIP(), []int{19}
}
func (x *GetSystemDNSResponse) GetServers() []string {
@ -1190,92 +1253,97 @@ var file_libcore_proto_rawDesc = []byte{
0x22, 0x2e, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74,
0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
0x22, 0x2e, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x49, 0x50,
0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d,
0x22, 0x30, 0x0a, 0x1a, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x53, 0x69,
0x74, 0x65, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x74,
0x65, 0x6d, 0x22, 0x49, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50,
0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65,
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x60, 0x0a,
0x13, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x68, 0x63, 0x70,
0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x65, 0x74, 0x44, 0x68, 0x63, 0x70, 0x22,
0x49, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x73, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x64, 0x68, 0x63, 0x70, 0x18, 0x02, 0x20, 0x01,
0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x44, 0x68, 0x63, 0x70, 0x2a, 0x27, 0x0a, 0x0c, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x68,
0x65, 0x63, 0x6b, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,
0x64, 0x10, 0x01, 0x32, 0xb5, 0x07, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x45, 0x78, 0x69, 0x74, 0x12, 0x11,
0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65,
0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x12, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x05,
0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e,
0x4c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73,
0x70, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x11, 0x2e, 0x6c, 0x69,
0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x12,
0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65,
0x73, 0x70, 0x22, 0x00, 0x12, 0x2d, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x10, 0x2e, 0x6c,
0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11,
0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73,
0x70, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x70, 0x54, 0x65, 0x73, 0x74, 0x12,
0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52,
0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3f, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53,
0x74, 0x61, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x51,
0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6c,
0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74,
0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43,
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x40, 0x0a,
0x0c, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e,
0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x42, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c,
0x65, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x44, 0x0a, 0x1a, 0x43, 0x6f,
0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04,
0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68,
0x22, 0x49, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f,
0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x60, 0x0a, 0x13, 0x53,
0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x68, 0x63, 0x70, 0x18, 0x03,
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x65, 0x74, 0x44, 0x68, 0x63, 0x70, 0x22, 0x49, 0x0a,
0x14, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12,
0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x64, 0x68, 0x63, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
0x52, 0x06, 0x69, 0x73, 0x44, 0x68, 0x63, 0x70, 0x2a, 0x27, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63,
0x6b, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x10,
0x01, 0x32, 0xc1, 0x07, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x45, 0x78, 0x69, 0x74, 0x12, 0x11, 0x2e, 0x6c,
0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a,
0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52,
0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12,
0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x05, 0x53, 0x74,
0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f,
0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69,
0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x22,
0x00, 0x12, 0x2f, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63,
0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c,
0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70,
0x22, 0x00, 0x12, 0x2d, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x10, 0x2e, 0x6c, 0x69, 0x62,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x6c,
0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22,
0x00, 0x12, 0x31, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x70, 0x54, 0x65, 0x73, 0x74, 0x12, 0x11, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71,
0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x65,
0x6f, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x44, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47,
0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65,
0x47, 0x65, 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x6c, 0x69, 0x62,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x49,
0x50, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73,
0x70, 0x12, 0x4e, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x53,
0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x12, 0x23, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f,
0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74,
0x65, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73,
0x70, 0x12, 0x44, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72,
0x6f, 0x78, 0x79, 0x12, 0x1e, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65,
0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x79,
0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x62,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e,
0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x53, 0x65, 0x74,
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x62, 0x63,
0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53,
0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x52, 0x65, 0x73, 0x70, 0x12, 0x3f, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61,
0x74, 0x73, 0x12, 0x16, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x51, 0x75, 0x65,
0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6c, 0x69, 0x62,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52,
0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e,
0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f,
0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x6c, 0x69,
0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0c, 0x47,
0x65, 0x74, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x6c, 0x69,
0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47,
0x65, 0x74, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74,
0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e,
0x47, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f,
0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53,
0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x4a, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x54,
0x6f, 0x53, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43,
0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x42, 0x11, 0x5a, 0x0f, 0x67,
0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x13, 0x43,
0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53,
0x72, 0x73, 0x12, 0x23, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d,
0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x0e, 0x53,
0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x1e, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73,
0x70, 0x12, 0x40, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e,
0x53, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47,
0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
0x44, 0x4e, 0x53, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65,
0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x52, 0x65, 0x73, 0x70, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1291,7 +1359,7 @@ func file_libcore_proto_rawDescGZIP() []byte {
}
var file_libcore_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_libcore_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_libcore_proto_msgTypes = make([]protoimpl.MessageInfo, 20)
var file_libcore_proto_goTypes = []interface{}{
(UpdateAction)(0), // 0: libcore.UpdateAction
(*EmptyReq)(nil), // 1: libcore.EmptyReq
@ -1308,11 +1376,12 @@ var file_libcore_proto_goTypes = []interface{}{
(*ListConnectionsResp)(nil), // 12: libcore.ListConnectionsResp
(*GetGeoIPListResponse)(nil), // 13: libcore.GetGeoIPListResponse
(*GetGeoSiteListResponse)(nil), // 14: libcore.GetGeoSiteListResponse
(*CompileGeoIPToSrsRequest)(nil), // 15: libcore.CompileGeoIPToSrsRequest
(*CompileGeoSiteToSrsRequest)(nil), // 16: libcore.CompileGeoSiteToSrsRequest
(*SetSystemProxyRequest)(nil), // 17: libcore.SetSystemProxyRequest
(*SetSystemDNSRequest)(nil), // 18: libcore.SetSystemDNSRequest
(*GetSystemDNSResponse)(nil), // 19: libcore.GetSystemDNSResponse
(*GeoListRequest)(nil), // 15: libcore.GeoListRequest
(*CompileGeoIPToSrsRequest)(nil), // 16: libcore.CompileGeoIPToSrsRequest
(*CompileGeoSiteToSrsRequest)(nil), // 17: libcore.CompileGeoSiteToSrsRequest
(*SetSystemProxyRequest)(nil), // 18: libcore.SetSystemProxyRequest
(*SetSystemDNSRequest)(nil), // 19: libcore.SetSystemDNSRequest
(*GetSystemDNSResponse)(nil), // 20: libcore.GetSystemDNSResponse
}
var file_libcore_proto_depIdxs = []int32{
5, // 0: libcore.TestResp.results:type_name -> libcore.URLTestResp
@ -1325,13 +1394,13 @@ var file_libcore_proto_depIdxs = []int32{
1, // 7: libcore.LibcoreService.StopTest:input_type -> libcore.EmptyReq
8, // 8: libcore.LibcoreService.QueryStats:input_type -> libcore.QueryStatsReq
1, // 9: libcore.LibcoreService.ListConnections:input_type -> libcore.EmptyReq
1, // 10: libcore.LibcoreService.GetGeoIPList:input_type -> libcore.EmptyReq
1, // 11: libcore.LibcoreService.GetGeoSiteList:input_type -> libcore.EmptyReq
15, // 12: libcore.LibcoreService.CompileGeoIPToSrs:input_type -> libcore.CompileGeoIPToSrsRequest
16, // 13: libcore.LibcoreService.CompileGeoSiteToSrs:input_type -> libcore.CompileGeoSiteToSrsRequest
17, // 14: libcore.LibcoreService.SetSystemProxy:input_type -> libcore.SetSystemProxyRequest
15, // 10: libcore.LibcoreService.GetGeoIPList:input_type -> libcore.GeoListRequest
15, // 11: libcore.LibcoreService.GetGeoSiteList:input_type -> libcore.GeoListRequest
16, // 12: libcore.LibcoreService.CompileGeoIPToSrs:input_type -> libcore.CompileGeoIPToSrsRequest
17, // 13: libcore.LibcoreService.CompileGeoSiteToSrs:input_type -> libcore.CompileGeoSiteToSrsRequest
18, // 14: libcore.LibcoreService.SetSystemProxy:input_type -> libcore.SetSystemProxyRequest
1, // 15: libcore.LibcoreService.GetSystemDNS:input_type -> libcore.EmptyReq
18, // 16: libcore.LibcoreService.SetSystemDNS:input_type -> libcore.SetSystemDNSRequest
19, // 16: libcore.LibcoreService.SetSystemDNS:input_type -> libcore.SetSystemDNSRequest
2, // 17: libcore.LibcoreService.Exit:output_type -> libcore.EmptyResp
11, // 18: libcore.LibcoreService.Update:output_type -> libcore.UpdateResp
3, // 19: libcore.LibcoreService.Start:output_type -> libcore.ErrorResp
@ -1345,7 +1414,7 @@ var file_libcore_proto_depIdxs = []int32{
2, // 27: libcore.LibcoreService.CompileGeoIPToSrs:output_type -> libcore.EmptyResp
2, // 28: libcore.LibcoreService.CompileGeoSiteToSrs:output_type -> libcore.EmptyResp
2, // 29: libcore.LibcoreService.SetSystemProxy:output_type -> libcore.EmptyResp
19, // 30: libcore.LibcoreService.GetSystemDNS:output_type -> libcore.GetSystemDNSResponse
20, // 30: libcore.LibcoreService.GetSystemDNS:output_type -> libcore.GetSystemDNSResponse
2, // 31: libcore.LibcoreService.SetSystemDNS:output_type -> libcore.EmptyResp
17, // [17:32] is the sub-list for method output_type
2, // [2:17] is the sub-list for method input_type
@ -1529,7 +1598,7 @@ func file_libcore_proto_init() {
}
}
file_libcore_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CompileGeoIPToSrsRequest); i {
switch v := v.(*GeoListRequest); i {
case 0:
return &v.state
case 1:
@ -1541,7 +1610,7 @@ func file_libcore_proto_init() {
}
}
file_libcore_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CompileGeoSiteToSrsRequest); i {
switch v := v.(*CompileGeoIPToSrsRequest); i {
case 0:
return &v.state
case 1:
@ -1553,7 +1622,7 @@ func file_libcore_proto_init() {
}
}
file_libcore_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetSystemProxyRequest); i {
switch v := v.(*CompileGeoSiteToSrsRequest); i {
case 0:
return &v.state
case 1:
@ -1565,7 +1634,7 @@ func file_libcore_proto_init() {
}
}
file_libcore_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetSystemDNSRequest); i {
switch v := v.(*SetSystemProxyRequest); i {
case 0:
return &v.state
case 1:
@ -1577,6 +1646,18 @@ func file_libcore_proto_init() {
}
}
file_libcore_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetSystemDNSRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_libcore_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetSystemDNSResponse); i {
case 0:
return &v.state
@ -1595,7 +1676,7 @@ func file_libcore_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_libcore_proto_rawDesc,
NumEnums: 1,
NumMessages: 19,
NumMessages: 20,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -14,8 +14,8 @@ service LibcoreService {
rpc QueryStats(QueryStatsReq) returns (QueryStatsResp) {}
rpc ListConnections(EmptyReq) returns (ListConnectionsResp) {}
//
rpc GetGeoIPList(EmptyReq) returns (GetGeoIPListResponse);
rpc GetGeoSiteList(EmptyReq) returns (GetGeoSiteListResponse);
rpc GetGeoIPList(GeoListRequest) returns (GetGeoIPListResponse);
rpc GetGeoSiteList(GeoListRequest) returns (GetGeoSiteListResponse);
rpc CompileGeoIPToSrs(CompileGeoIPToSrsRequest) returns (EmptyResp);
rpc CompileGeoSiteToSrs(CompileGeoSiteToSrsRequest) returns (EmptyResp);
//
@ -99,12 +99,18 @@ message GetGeoSiteListResponse {
repeated string items = 2;
}
message GeoListRequest {
string path = 1;
}
message CompileGeoIPToSrsRequest {
string item = 1;
string path = 2;
}
message CompileGeoSiteToSrsRequest {
string item = 1;
string path = 2;
}
message SetSystemProxyRequest {

View File

@ -48,8 +48,8 @@ type LibcoreServiceClient interface {
StopTest(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*EmptyResp, error)
QueryStats(ctx context.Context, in *QueryStatsReq, opts ...grpc.CallOption) (*QueryStatsResp, error)
ListConnections(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*ListConnectionsResp, error)
GetGeoIPList(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*GetGeoIPListResponse, error)
GetGeoSiteList(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*GetGeoSiteListResponse, error)
GetGeoIPList(ctx context.Context, in *GeoListRequest, opts ...grpc.CallOption) (*GetGeoIPListResponse, error)
GetGeoSiteList(ctx context.Context, in *GeoListRequest, opts ...grpc.CallOption) (*GetGeoSiteListResponse, error)
CompileGeoIPToSrs(ctx context.Context, in *CompileGeoIPToSrsRequest, opts ...grpc.CallOption) (*EmptyResp, error)
CompileGeoSiteToSrs(ctx context.Context, in *CompileGeoSiteToSrsRequest, opts ...grpc.CallOption) (*EmptyResp, error)
SetSystemProxy(ctx context.Context, in *SetSystemProxyRequest, opts ...grpc.CallOption) (*EmptyResp, error)
@ -145,7 +145,7 @@ func (c *libcoreServiceClient) ListConnections(ctx context.Context, in *EmptyReq
return out, nil
}
func (c *libcoreServiceClient) GetGeoIPList(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*GetGeoIPListResponse, error) {
func (c *libcoreServiceClient) GetGeoIPList(ctx context.Context, in *GeoListRequest, opts ...grpc.CallOption) (*GetGeoIPListResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetGeoIPListResponse)
err := c.cc.Invoke(ctx, LibcoreService_GetGeoIPList_FullMethodName, in, out, cOpts...)
@ -155,7 +155,7 @@ func (c *libcoreServiceClient) GetGeoIPList(ctx context.Context, in *EmptyReq, o
return out, nil
}
func (c *libcoreServiceClient) GetGeoSiteList(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*GetGeoSiteListResponse, error) {
func (c *libcoreServiceClient) GetGeoSiteList(ctx context.Context, in *GeoListRequest, opts ...grpc.CallOption) (*GetGeoSiteListResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetGeoSiteListResponse)
err := c.cc.Invoke(ctx, LibcoreService_GetGeoSiteList_FullMethodName, in, out, cOpts...)
@ -227,8 +227,8 @@ type LibcoreServiceServer interface {
StopTest(context.Context, *EmptyReq) (*EmptyResp, error)
QueryStats(context.Context, *QueryStatsReq) (*QueryStatsResp, error)
ListConnections(context.Context, *EmptyReq) (*ListConnectionsResp, error)
GetGeoIPList(context.Context, *EmptyReq) (*GetGeoIPListResponse, error)
GetGeoSiteList(context.Context, *EmptyReq) (*GetGeoSiteListResponse, error)
GetGeoIPList(context.Context, *GeoListRequest) (*GetGeoIPListResponse, error)
GetGeoSiteList(context.Context, *GeoListRequest) (*GetGeoSiteListResponse, error)
CompileGeoIPToSrs(context.Context, *CompileGeoIPToSrsRequest) (*EmptyResp, error)
CompileGeoSiteToSrs(context.Context, *CompileGeoSiteToSrsRequest) (*EmptyResp, error)
SetSystemProxy(context.Context, *SetSystemProxyRequest) (*EmptyResp, error)
@ -268,10 +268,10 @@ func (UnimplementedLibcoreServiceServer) QueryStats(context.Context, *QueryStats
func (UnimplementedLibcoreServiceServer) ListConnections(context.Context, *EmptyReq) (*ListConnectionsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListConnections not implemented")
}
func (UnimplementedLibcoreServiceServer) GetGeoIPList(context.Context, *EmptyReq) (*GetGeoIPListResponse, error) {
func (UnimplementedLibcoreServiceServer) GetGeoIPList(context.Context, *GeoListRequest) (*GetGeoIPListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetGeoIPList not implemented")
}
func (UnimplementedLibcoreServiceServer) GetGeoSiteList(context.Context, *EmptyReq) (*GetGeoSiteListResponse, error) {
func (UnimplementedLibcoreServiceServer) GetGeoSiteList(context.Context, *GeoListRequest) (*GetGeoSiteListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetGeoSiteList not implemented")
}
func (UnimplementedLibcoreServiceServer) CompileGeoIPToSrs(context.Context, *CompileGeoIPToSrsRequest) (*EmptyResp, error) {
@ -455,7 +455,7 @@ func _LibcoreService_ListConnections_Handler(srv interface{}, ctx context.Contex
}
func _LibcoreService_GetGeoIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyReq)
in := new(GeoListRequest)
if err := dec(in); err != nil {
return nil, err
}
@ -467,13 +467,13 @@ func _LibcoreService_GetGeoIPList_Handler(srv interface{}, ctx context.Context,
FullMethod: LibcoreService_GetGeoIPList_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LibcoreServiceServer).GetGeoIPList(ctx, req.(*EmptyReq))
return srv.(LibcoreServiceServer).GetGeoIPList(ctx, req.(*GeoListRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LibcoreService_GetGeoSiteList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyReq)
in := new(GeoListRequest)
if err := dec(in); err != nil {
return nil, err
}
@ -485,7 +485,7 @@ func _LibcoreService_GetGeoSiteList_Handler(srv interface{}, ctx context.Context
FullMethod: LibcoreService_GetGeoSiteList_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LibcoreServiceServer).GetGeoSiteList(ctx, req.(*EmptyReq))
return srv.(LibcoreServiceServer).GetGeoSiteList(ctx, req.(*GeoListRequest))
}
return interceptor(ctx, in, info, handler)
}

View File

@ -54,9 +54,8 @@ namespace NekoGui_network {
session.SetProxies({{"http", "127.0.0.1:" + QString(Int2String(NekoGui::dataStore->inbound_socks_port)).toStdString()},
{"https", "127.0.0.1:" + QString(Int2String(NekoGui::dataStore->inbound_socks_port)).toStdString()}});
}
auto filePath = qApp->applicationDirPath()+ "/" + fileName;
auto filePath = NekoGui::GetBasePath()+ "/" + fileName;
std::ofstream fout;
QFile::remove(QString(filePath + ".1"));
fout.open(QString(filePath + ".1").toStdString(), std::ios::trunc | std::ios::out | std::ios::binary);
auto r = session.Download(fout);
fout.close();

View File

@ -1,13 +1,14 @@
#include "NekoGui.hpp"
#include "fmt/Preset.hpp"
#include <QFile>
#include <QDir>
#include <QApplication>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QStandardPaths>
#ifdef Q_OS_WIN
#include "sys/windows/guihelper.h"
@ -424,4 +425,10 @@ namespace NekoGui {
return admin;
};
QString GetBasePath() {
if (dataStore->flag_use_appdata) return QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
return qApp->applicationDirPath();
}
} // namespace NekoGui

View File

@ -15,6 +15,8 @@ namespace NekoGui {
QString FindNekoBoxCoreRealPath();
bool IsAdmin();
QString GetBasePath();
} // namespace NekoGui
#define IS_NEKO_BOX (NekoGui::coreType == NekoGui::CoreType::SING_BOX)

View File

@ -291,11 +291,12 @@ namespace NekoGui_rpc {
}
}
QStringList Client::GetGeoList(bool *rpcOK, GeoRuleSetType mode) {
QStringList Client::GetGeoList(bool *rpcOK, GeoRuleSetType mode, const QString& basePath) {
switch (mode) {
case GeoRuleSetType::ip: {
libcore::EmptyReq req;
libcore::GeoListRequest req;
libcore::GetGeoIPListResponse resp;
req.set_path(basePath);
auto status = default_grpc_channel->Call("GetGeoIPList", req, &resp);
if (status == QNetworkReply::NoError) {
@ -311,8 +312,9 @@ namespace NekoGui_rpc {
}
}
case GeoRuleSetType::site: {
libcore::EmptyReq req;
libcore::GeoListRequest req;
libcore::GetGeoSiteListResponse resp;
req.set_path(basePath);
auto status = default_grpc_channel->Call("GetGeoSiteList", req, &resp);
if (status == QNetworkReply::NoError) {
@ -331,12 +333,13 @@ namespace NekoGui_rpc {
return {};
}
QString Client::CompileGeoSet(bool *rpcOK, GeoRuleSetType mode, std::string category) {
QString Client::CompileGeoSet(bool *rpcOK, GeoRuleSetType mode, std::string category, const QString& basePath) {
switch (mode) {
case ip: {
libcore::CompileGeoIPToSrsRequest req;
libcore::EmptyResp resp;
req.set_item(category);
req.set_path(basePath);
auto status = default_grpc_channel->Call("CompileGeoIPToSrs", req, &resp);
if (status == QNetworkReply::NoError) {
@ -351,6 +354,7 @@ namespace NekoGui_rpc {
libcore::CompileGeoSiteToSrsRequest req;
libcore::EmptyResp resp;
req.set_item(category);
req.set_path(basePath);
auto status = default_grpc_channel->Call("CompileGeoSiteToSrs", req, &resp);
if (status == QNetworkReply::NoError) {

View File

@ -32,9 +32,9 @@ namespace NekoGui_rpc {
libcore::UpdateResp Update(bool *rpcOK, const libcore::UpdateReq &request);
QStringList GetGeoList(bool *rpcOK, GeoRuleSetType mode);
QStringList GetGeoList(bool *rpcOK, GeoRuleSetType mode, const QString& basePath);
QString CompileGeoSet(bool *rpcOK, GeoRuleSetType mode, std::string category);
QString CompileGeoSet(bool *rpcOK, GeoRuleSetType mode, std::string category, const QString& basePath);
QString SetSystemProxy(bool *rpcOK, bool enable);