refactor: refactor dns (#218)

* refactor: refactor dns

* refactor: optimize forward dns server

* refactor: add short domain test

* refactor: fix remove nameserver from resolver bug

---------

Co-authored-by: wencaiwulue <895703375@qq.com>
This commit is contained in:
naison
2024-04-13 16:39:26 +08:00
committed by GitHub
parent 52f1d38e56
commit 31d7e4debb
29 changed files with 695 additions and 645 deletions

View File

@@ -2,14 +2,4 @@ FROM naison/kubevpn:latest
WORKDIR /app WORKDIR /app
RUN if [ $(uname -m) = "x86_64" ]; then \
echo "The architecture is AMD64"; \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x kubectl && mv kubectl /usr/local/bin; \
elif [ $(uname -m) = "aarch64" ]; then \
echo "The architecture is ARM64"; \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl" && chmod +x kubectl && mv kubectl /usr/local/bin; \
else \
echo "Unsupported architecture."; \
fi
COPY bin/kubevpn /usr/local/bin/kubevpn COPY bin/kubevpn /usr/local/bin/kubevpn

View File

@@ -23,5 +23,9 @@ spec:
port: {{ .Values.service.port80 }} port: {{ .Values.service.port80 }}
protocol: TCP protocol: TCP
targetPort: 80 targetPort: 80
- name: 53-for-dns
port: {{ .Values.service.port53 }}
protocol: UDP
targetPort: 53
selector: selector:
{{- include "kubevpn.selectorLabels" . | nindent 4 }} {{- include "kubevpn.selectorLabels" . | nindent 4 }}

View File

@@ -55,6 +55,7 @@ service:
port9002: 9002 port9002: 9002
port10800: 10800 port10800: 10800
port80: 80 port80: 80
port53: 53
resources: resources:
limits: limits:

View File

@@ -100,7 +100,6 @@ func CmdClone(f cmdutil.Factory) *cobra.Command {
Headers: options.Headers, Headers: options.Headers,
Workloads: args, Workloads: args,
ExtraRoute: extraRoute.ToRPC(), ExtraRoute: extraRoute.ToRPC(),
UseLocalDNS: options.UseLocalDNS,
OriginKubeconfigPath: util.GetKubeConfigPath(f), OriginKubeconfigPath: util.GetKubeConfigPath(f),
Engine: string(options.Engine), Engine: string(options.Engine),
SshJump: sshConf.ToRPC(), SshJump: sshConf.ToRPC(),
@@ -139,7 +138,6 @@ func CmdClone(f cmdutil.Factory) *cobra.Command {
cmd.Flags().StringVar(&config.Image, "image", config.Image, "Use this image to startup container") cmd.Flags().StringVar(&config.Image, "image", config.Image, "Use this image to startup container")
cmd.Flags().BoolVar(&transferImage, "transfer-image", false, "transfer image to remote registry, it will transfer image "+config.OriginImage+" to flags `--image` special image, default: "+config.Image) cmd.Flags().BoolVar(&transferImage, "transfer-image", false, "transfer image to remote registry, it will transfer image "+config.OriginImage+" to flags `--image` special image, default: "+config.Image)
cmd.Flags().StringVar((*string)(&options.Engine), "engine", string(config.EngineRaw), fmt.Sprintf(`transport engine ("%s"|"%s") %s: use gvisor and raw both (both performance and stable), %s: use raw mode (best stable)`, config.EngineMix, config.EngineRaw, config.EngineMix, config.EngineRaw)) cmd.Flags().StringVar((*string)(&options.Engine), "engine", string(config.EngineRaw), fmt.Sprintf(`transport engine ("%s"|"%s") %s: use gvisor and raw both (both performance and stable), %s: use raw mode (best stable)`, config.EngineMix, config.EngineRaw, config.EngineMix, config.EngineRaw))
cmd.Flags().BoolVar(&options.UseLocalDNS, "use-localdns", false, "if use-lcoaldns is true, kubevpn will start coredns listen at 53 to forward your dns queries. only support on linux now")
cmd.Flags().StringVar(&options.TargetImage, "target-image", "", "Clone container use this image to startup container, if not special, use origin image") cmd.Flags().StringVar(&options.TargetImage, "target-image", "", "Clone container use this image to startup container, if not special, use origin image")
cmd.Flags().StringVar(&options.TargetContainer, "target-container", "", "Clone container use special image to startup this container, if not special, use origin image") cmd.Flags().StringVar(&options.TargetContainer, "target-container", "", "Clone container use special image to startup this container, if not special, use origin image")

View File

@@ -74,7 +74,6 @@ func CmdConnect(f cmdutil.Factory) *cobra.Command {
KubeconfigBytes: string(bytes), KubeconfigBytes: string(bytes),
Namespace: ns, Namespace: ns,
ExtraRoute: extraRoute.ToRPC(), ExtraRoute: extraRoute.ToRPC(),
UseLocalDNS: connect.UseLocalDNS,
Engine: string(connect.Engine), Engine: string(connect.Engine),
OriginKubeconfigPath: util.GetKubeConfigPath(f), OriginKubeconfigPath: util.GetKubeConfigPath(f),
@@ -150,7 +149,6 @@ func CmdConnect(f cmdutil.Factory) *cobra.Command {
cmd.Flags().BoolVar(&config.Debug, "debug", false, "enable debug mode or not, true or false") cmd.Flags().BoolVar(&config.Debug, "debug", false, "enable debug mode or not, true or false")
cmd.Flags().StringVar(&config.Image, "image", config.Image, "use this image to startup container") cmd.Flags().StringVar(&config.Image, "image", config.Image, "use this image to startup container")
cmd.Flags().BoolVar(&transferImage, "transfer-image", false, "transfer image to remote registry, it will transfer image "+config.OriginImage+" to flags `--image` special image, default: "+config.Image) cmd.Flags().BoolVar(&transferImage, "transfer-image", false, "transfer image to remote registry, it will transfer image "+config.OriginImage+" to flags `--image` special image, default: "+config.Image)
cmd.Flags().BoolVar(&connect.UseLocalDNS, "use-localdns", false, "if use-lcoaldns is true, kubevpn will start coredns listen at 53 to forward your dns queries. only support on linux now")
cmd.Flags().StringVar((*string)(&connect.Engine), "engine", string(config.EngineRaw), fmt.Sprintf(`transport engine ("%s"|"%s") %s: use gvisor and raw both (both performance and stable), %s: use raw mode (best stable)`, config.EngineMix, config.EngineRaw, config.EngineMix, config.EngineRaw)) cmd.Flags().StringVar((*string)(&connect.Engine), "engine", string(config.EngineRaw), fmt.Sprintf(`transport engine ("%s"|"%s") %s: use gvisor and raw both (both performance and stable), %s: use raw mode (best stable)`, config.EngineMix, config.EngineRaw, config.EngineMix, config.EngineRaw))
cmd.Flags().BoolVar(&foreground, "foreground", false, "Hang up") cmd.Flags().BoolVar(&foreground, "foreground", false, "Hang up")
cmd.Flags().BoolVar(&lite, "lite", false, "connect to multiple cluster in lite mode, you needs to special this options") cmd.Flags().BoolVar(&lite, "lite", false, "connect to multiple cluster in lite mode, you needs to special this options")

View File

@@ -1,12 +1,18 @@
package cmds package cmds
import ( import (
"context"
"time"
"github.com/docker/docker/libnetwork/resolvconf"
miekgdns "github.com/miekg/dns"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
cmdutil "k8s.io/kubectl/pkg/cmd/util" cmdutil "k8s.io/kubectl/pkg/cmd/util"
"github.com/wencaiwulue/kubevpn/v2/pkg/config" "github.com/wencaiwulue/kubevpn/v2/pkg/config"
"github.com/wencaiwulue/kubevpn/v2/pkg/controlplane" "github.com/wencaiwulue/kubevpn/v2/pkg/controlplane"
"github.com/wencaiwulue/kubevpn/v2/pkg/dns"
"github.com/wencaiwulue/kubevpn/v2/pkg/util" "github.com/wencaiwulue/kubevpn/v2/pkg/util"
) )
@@ -23,6 +29,16 @@ func CmdControlPlane(_ cmdutil.Factory) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
util.InitLoggerForServer(config.Debug) util.InitLoggerForServer(config.Debug)
go util.StartupPProf(0) go util.StartupPProf(0)
go func(ctx context.Context) {
conf, err := miekgdns.ClientConfigFromFile(resolvconf.Path())
if err != nil {
return
}
for ctx.Err() == nil {
dns.ListenAndServe("udp", ":53", conf)
time.Sleep(time.Second * 5)
}
}(cmd.Context())
err := controlplane.Main(cmd.Context(), watchDirectoryFilename, port, log.StandardLogger()) err := controlplane.Main(cmd.Context(), watchDirectoryFilename, port, log.StandardLogger())
return err return err
}, },

View File

@@ -116,7 +116,6 @@ func CmdProxy(f cmdutil.Factory) *cobra.Command {
PortMap: connect.PortMap, PortMap: connect.PortMap,
Workloads: args, Workloads: args,
ExtraRoute: extraRoute.ToRPC(), ExtraRoute: extraRoute.ToRPC(),
UseLocalDNS: connect.UseLocalDNS,
Engine: string(connect.Engine), Engine: string(connect.Engine),
SshJump: sshConf.ToRPC(), SshJump: sshConf.ToRPC(),
TransferImage: transferImage, TransferImage: transferImage,

View File

@@ -29,7 +29,6 @@ func (svr *Server) Clone(req *rpc.CloneRequest, resp rpc.Daemon_CloneServer) err
KubeconfigBytes: req.KubeconfigBytes, KubeconfigBytes: req.KubeconfigBytes,
Namespace: req.Namespace, Namespace: req.Namespace,
ExtraRoute: req.ExtraRoute, ExtraRoute: req.ExtraRoute,
UseLocalDNS: req.UseLocalDNS,
Engine: req.Engine, Engine: req.Engine,
SshJump: req.SshJump, SshJump: req.SshJump,
TransferImage: req.TransferImage, TransferImage: req.TransferImage,
@@ -62,7 +61,6 @@ func (svr *Server) Clone(req *rpc.CloneRequest, resp rpc.Daemon_CloneServer) err
Headers: req.Headers, Headers: req.Headers,
Workloads: req.Workloads, Workloads: req.Workloads,
ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute), ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute),
UseLocalDNS: req.UseLocalDNS,
Engine: config.Engine(req.Engine), Engine: config.Engine(req.Engine),
TargetKubeconfig: req.TargetKubeconfig, TargetKubeconfig: req.TargetKubeconfig,

View File

@@ -35,7 +35,6 @@ func (svr *Server) ConnectFork(req *rpc.ConnectRequest, resp rpc.Daemon_ConnectF
Headers: req.Headers, Headers: req.Headers,
Workloads: req.Workloads, Workloads: req.Workloads,
ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute), ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute),
UseLocalDNS: req.UseLocalDNS,
Engine: config.Engine(req.Engine), Engine: config.Engine(req.Engine),
OriginKubeconfigPath: req.OriginKubeconfigPath, OriginKubeconfigPath: req.OriginKubeconfigPath,
Lock: &svr.Lock, Lock: &svr.Lock,
@@ -106,7 +105,6 @@ func (svr *Server) redirectConnectForkToSudoDaemon(req *rpc.ConnectRequest, resp
Headers: req.Headers, Headers: req.Headers,
Workloads: req.Workloads, Workloads: req.Workloads,
ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute), ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute),
UseLocalDNS: req.UseLocalDNS,
Engine: config.Engine(req.Engine), Engine: config.Engine(req.Engine),
OriginKubeconfigPath: req.OriginKubeconfigPath, OriginKubeconfigPath: req.OriginKubeconfigPath,
} }

View File

@@ -54,7 +54,6 @@ func (svr *Server) Connect(req *rpc.ConnectRequest, resp rpc.Daemon_ConnectServe
PortMap: req.PortMap, PortMap: req.PortMap,
Workloads: req.Workloads, Workloads: req.Workloads,
ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute), ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute),
UseLocalDNS: req.UseLocalDNS,
Engine: config.Engine(req.Engine), Engine: config.Engine(req.Engine),
OriginKubeconfigPath: req.OriginKubeconfigPath, OriginKubeconfigPath: req.OriginKubeconfigPath,
Lock: &svr.Lock, Lock: &svr.Lock,
@@ -126,7 +125,6 @@ func (svr *Server) redirectToSudoDaemon(req *rpc.ConnectRequest, resp rpc.Daemon
PortMap: req.PortMap, PortMap: req.PortMap,
Workloads: req.Workloads, Workloads: req.Workloads,
ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute), ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute),
UseLocalDNS: req.UseLocalDNS,
Engine: config.Engine(req.Engine), Engine: config.Engine(req.Engine),
OriginKubeconfigPath: req.OriginKubeconfigPath, OriginKubeconfigPath: req.OriginKubeconfigPath,
} }

View File

@@ -6,7 +6,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/pflag" "github.com/spf13/pflag"
"k8s.io/utils/pointer" "k8s.io/utils/ptr"
"github.com/wencaiwulue/kubevpn/v2/pkg/config" "github.com/wencaiwulue/kubevpn/v2/pkg/config"
"github.com/wencaiwulue/kubevpn/v2/pkg/daemon/rpc" "github.com/wencaiwulue/kubevpn/v2/pkg/daemon/rpc"
@@ -38,7 +38,6 @@ func (svr *Server) Proxy(req *rpc.ConnectRequest, resp rpc.Daemon_ProxyServer) e
PortMap: req.PortMap, PortMap: req.PortMap,
Workloads: req.Workloads, Workloads: req.Workloads,
ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute), ExtraRouteInfo: *handler.ParseExtraRouteFromRPC(req.ExtraRoute),
UseLocalDNS: req.UseLocalDNS,
Engine: config.Engine(req.Engine), Engine: config.Engine(req.Engine),
OriginKubeconfigPath: req.OriginKubeconfigPath, OriginKubeconfigPath: req.OriginKubeconfigPath,
} }
@@ -84,7 +83,9 @@ func (svr *Server) Proxy(req *rpc.ConnectRequest, resp rpc.Daemon_ProxyServer) e
log.Infof("try to disconnect from another cluster") log.Infof("try to disconnect from another cluster")
var disconnect rpc.Daemon_DisconnectClient var disconnect rpc.Daemon_DisconnectClient
disconnect, err = daemonClient.Disconnect(ctx, &rpc.DisconnectRequest{ disconnect, err = daemonClient.Disconnect(ctx, &rpc.DisconnectRequest{
ID: pointer.Int32(0), KubeconfigBytes: ptr.To(req.KubeconfigBytes),
Namespace: ptr.To(connect.Namespace),
SshJump: sshConf.ToRPC(),
}) })
if err != nil { if err != nil {
return err return err

View File

@@ -2,6 +2,8 @@ package action
import ( import (
"io" "io"
"os"
"path/filepath"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
@@ -36,6 +38,7 @@ func (svr *Server) Quit(req *rpc.QuitRequest, resp rpc.Daemon_QuitServer) error
if svr.IsSudo { if svr.IsSudo {
dns.CleanupHosts() dns.CleanupHosts()
os.RemoveAll(filepath.Join("/", "etc", "resolver"))
} }
// last step is to quit GRPC server // last step is to quit GRPC server

View File

@@ -30,7 +30,6 @@ type ConnectRequest struct {
Headers map[string]string `protobuf:"bytes,3,rep,name=Headers,proto3" json:"Headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Headers map[string]string `protobuf:"bytes,3,rep,name=Headers,proto3" json:"Headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
PortMap []string `protobuf:"bytes,4,rep,name=PortMap,proto3" json:"PortMap,omitempty"` PortMap []string `protobuf:"bytes,4,rep,name=PortMap,proto3" json:"PortMap,omitempty"`
Workloads []string `protobuf:"bytes,5,rep,name=Workloads,proto3" json:"Workloads,omitempty"` Workloads []string `protobuf:"bytes,5,rep,name=Workloads,proto3" json:"Workloads,omitempty"`
UseLocalDNS bool `protobuf:"varint,6,opt,name=UseLocalDNS,proto3" json:"UseLocalDNS,omitempty"`
Engine string `protobuf:"bytes,7,opt,name=Engine,proto3" json:"Engine,omitempty"` Engine string `protobuf:"bytes,7,opt,name=Engine,proto3" json:"Engine,omitempty"`
// extra route table info // extra route table info
ExtraRoute *ExtraRoute `protobuf:"bytes,8,opt,name=ExtraRoute,proto3" json:"ExtraRoute,omitempty"` ExtraRoute *ExtraRoute `protobuf:"bytes,8,opt,name=ExtraRoute,proto3" json:"ExtraRoute,omitempty"`
@@ -113,13 +112,6 @@ func (x *ConnectRequest) GetWorkloads() []string {
return nil return nil
} }
func (x *ConnectRequest) GetUseLocalDNS() bool {
if x != nil {
return x.UseLocalDNS
}
return false
}
func (x *ConnectRequest) GetEngine() string { func (x *ConnectRequest) GetEngine() string {
if x != nil { if x != nil {
return x.Engine return x.Engine
@@ -455,7 +447,6 @@ type CloneRequest struct {
Namespace string `protobuf:"bytes,2,opt,name=Namespace,proto3" json:"Namespace,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=Namespace,proto3" json:"Namespace,omitempty"`
Headers map[string]string `protobuf:"bytes,3,rep,name=Headers,proto3" json:"Headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Headers map[string]string `protobuf:"bytes,3,rep,name=Headers,proto3" json:"Headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Workloads []string `protobuf:"bytes,4,rep,name=Workloads,proto3" json:"Workloads,omitempty"` Workloads []string `protobuf:"bytes,4,rep,name=Workloads,proto3" json:"Workloads,omitempty"`
UseLocalDNS bool `protobuf:"varint,5,opt,name=UseLocalDNS,proto3" json:"UseLocalDNS,omitempty"`
Engine string `protobuf:"bytes,6,opt,name=Engine,proto3" json:"Engine,omitempty"` Engine string `protobuf:"bytes,6,opt,name=Engine,proto3" json:"Engine,omitempty"`
// extra route table info // extra route table info
ExtraRoute *ExtraRoute `protobuf:"bytes,7,opt,name=ExtraRoute,proto3" json:"ExtraRoute,omitempty"` ExtraRoute *ExtraRoute `protobuf:"bytes,7,opt,name=ExtraRoute,proto3" json:"ExtraRoute,omitempty"`
@@ -536,13 +527,6 @@ func (x *CloneRequest) GetWorkloads() []string {
return nil return nil
} }
func (x *CloneRequest) GetUseLocalDNS() bool {
if x != nil {
return x.UseLocalDNS
}
return false
}
func (x *CloneRequest) GetEngine() string { func (x *CloneRequest) GetEngine() string {
if x != nil { if x != nil {
return x.Engine return x.Engine
@@ -2260,7 +2244,7 @@ var File_daemon_proto protoreflect.FileDescriptor
var file_daemon_proto_rawDesc = []byte{ var file_daemon_proto_rawDesc = []byte{
0x0a, 0x0c, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x0a, 0x0c, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03,
0x72, 0x70, 0x63, 0x22, 0xc1, 0x04, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x72, 0x70, 0x63, 0x22, 0x9f, 0x04, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73,
@@ -2273,302 +2257,298 @@ var file_daemon_proto_rawDesc = []byte{
0x72, 0x74, 0x4d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x50, 0x6f, 0x72, 0x72, 0x74, 0x4d, 0x61, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x50, 0x6f, 0x72,
0x74, 0x4d, 0x61, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64,
0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61,
0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x4e, 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x07, 0x20, 0x01,
0x53, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x55, 0x73, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x28, 0x09, 0x52, 0x06, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x45, 0x78,
0x6c, 0x44, 0x4e, 0x53, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x07, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52,
0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x53,
0x32, 0x0f, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72,
0x65, 0x52, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x68, 0x4a,
0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x75, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x49,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x54, 0x72, 0x61, 0x6e,
0x68, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x73, 0x66, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x6d, 0x61,
0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x54, 0x72, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12,
0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x1e, 0x0a, 0x0a, 0x46, 0x6f, 0x72, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x0c, 0x20,
0x6d, 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x46, 0x6f, 0x72, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12,
0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x6f, 0x72, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x46, 0x6f, 0x72, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x32, 0x0a, 0x14, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4b,
0x64, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x18, 0x0e, 0x20,
0x52, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x32, 0x0a, 0x14, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x01, 0x28, 0x09, 0x52, 0x14, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4b, 0x75, 0x62, 0x65, 0x63,
0x6e, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x18, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61,
0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4b, 0x75, 0x62, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2b, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2b, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
0x73, 0x61, 0x67, 0x65, 0x22, 0xea, 0x01, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e,
0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x13, 0x0a, 0x02, 0x49, 0x44,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x02, 0x49, 0x44, 0x88, 0x01, 0x01, 0x12,
0x15, 0x0a, 0x03, 0x41, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x03,
0x41, 0x6c, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48,
0x02, 0x52, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74,
0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x4a,
0x75, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70,
0x42, 0x05, 0x0a, 0x03, 0x5f, 0x49, 0x44, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x41, 0x6c, 0x6c, 0x42,
0x12, 0x0a, 0x10, 0x5f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79,
0x74, 0x65, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
0x65, 0x22, 0x2e, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x22, 0x2c, 0x0a, 0x0c, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1c, 0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x22,
0x29, 0x0a, 0x0d, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x85, 0x06, 0x0a, 0x0c, 0x43,
0x6c, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b,
0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x6e, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x0a,
0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09,
0x52, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x55,
0x73, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x4e, 0x53, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08,
0x52, 0x0b, 0x55, 0x73, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x4e, 0x53, 0x12, 0x16, 0x0a,
0x06, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45,
0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f,
0x75, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x45, 0x78, 0x74, 0x72,
0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d,
0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73,
0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x2a,
0x0a, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, 0x0a, 0x0f, 0x54, 0x61,
0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0a, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73,
0x70, 0x61, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x6f,
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x54,
0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x20,
0x0a, 0x0b, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0c, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65,
0x12, 0x26, 0x0a, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
0x72, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x36, 0x0a, 0x16, 0x49, 0x73, 0x43, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
0x72, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x49, 0x73, 0x43, 0x68, 0x61, 0x6e,
0x67, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
0x12, 0x24, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67,
0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65,
0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18,
0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05,
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x4c, 0x65, 0x76,
0x65, 0x6c, 0x12, 0x32, 0x0a, 0x14, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4b, 0x75, 0x62, 0x65,
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09,
0x52, 0x14, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
0x38, 0x01, 0x22, 0x29, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2d, 0x0a,
0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c,
0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
0x09, 0x52, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x22, 0x2a, 0x0a, 0x0e,
0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18,
0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x51, 0x75, 0x69, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x28, 0x0a, 0x0c, 0x51, 0x75, 0x69, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x22, 0x23, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 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, 0x22, 0x2a, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x67, 0x65, 0x22, 0xea, 0x01, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x75, 0x65, 0x73, 0x74, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x13, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x02, 0x49, 0x44, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a,
0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x03, 0x41, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x03, 0x41, 0x6c,
0x6e, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x64, 0x64, 0x52, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52,
0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73,
0x12, 0x1c, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x01, 0x28, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x26, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x0a, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x61, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d,
0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73,
0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x22, 0x2d, 0x0a, 0x0f, 0x53, 0x73, 0x68, 0x53, 0x74, 0x61, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x42, 0x05,
0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x0a, 0x03, 0x5f, 0x49, 0x44, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x41, 0x6c, 0x6c, 0x42, 0x12, 0x0a,
0x65, 0x6e, 0x74, 0x49, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x6c, 0x69, 0x10, 0x5f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65,
0x65, 0x6e, 0x74, 0x49, 0x50, 0x22, 0x2e, 0x0a, 0x10, 0x53, 0x73, 0x68, 0x53, 0x74, 0x61, 0x72, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x65, 0x72, 0x2e, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73,
0x76, 0x65, 0x72, 0x49, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x65, 0x72, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x76, 0x65, 0x72, 0x49, 0x50, 0x22, 0x2c, 0x0a, 0x0e, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x2c, 0x0a, 0x0c, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x74, 0x49, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x1c, 0x0a, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03,
0x74, 0x49, 0x50, 0x22, 0x2d, 0x0a, 0x0f, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x28, 0x09, 0x52, 0x09, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x22, 0x29, 0x0a,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x0d, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18,
0x49, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x49, 0x50, 0x22, 0x51, 0x0a, 0x11, 0x53, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xe3, 0x05, 0x0a, 0x0c, 0x43, 0x6c, 0x6f,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x64, 0x69, 0x6e, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b, 0x75, 0x62,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x53, 0x74, 0x64, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01,
0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x28, 0x09, 0x52, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x68, 0x4a, 0x75, 0x6d, 0x70, 0x22, 0x44, 0x0a, 0x12, 0x53, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03,
0x74, 0x64, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, 0x64, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x52, 0x65,
0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x02, 0x20, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74,
0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, 0x64, 0x65, 0x72, 0x72, 0x22, 0x31, 0x0a, 0x11, 0x43, 0x72, 0x79, 0x52, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x57,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09,
0x12, 0x1c, 0x0a, 0x09, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x6e, 0x67,
0x01, 0x28, 0x09, 0x52, 0x09, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x22, 0x33, 0x69, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x6e, 0x67, 0x69, 0x6e,
0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x18,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x72,
0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f, 0x75,
0x72, 0x49, 0x44, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6d, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x08, 0x20,
0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x0a, 0x0a, 0x4c, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d,
0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x46, 0x6f, 0x6c, 0x70, 0x52, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x10, 0x54, 0x61,
0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x72, 0x67, 0x65, 0x74, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x09,
0x77, 0x22, 0x27, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4b, 0x75, 0x62, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, 0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, 0x69, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52,
0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x28, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69,
0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x6e, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x54, 0x61, 0x72, 0x67, 0x65,
0x61, 0x67, 0x65, 0x22, 0x46, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x54, 0x61,
0x74, 0x12, 0x1c, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x0b, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0e,
0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x0d,
0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x38, 0x0a, 0x0b, 0x47, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69,
0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x74, 0x72, 0x79, 0x12, 0x36, 0x0a, 0x16, 0x49, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x0e,
0x70, 0x63, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x49, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x61,
0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x24, 0x0a, 0x0d,
0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0f, 0x20,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x49, 0x6d, 0x61,
0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28,
0x61, 0x63, 0x65, 0x22, 0x5e, 0x0a, 0x0e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x09, 0x52, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x32,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x43, 0x6c, 0x0a, 0x14, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x43, 0x69, 0x67, 0x50, 0x61, 0x74, 0x68, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x4f, 0x72,
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x69, 0x67, 0x69, 0x6e, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61,
0x01, 0x28, 0x09, 0x52, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x68, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74,
0x74, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x0f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x4e, 0x65, 0x65, 0x64, 0x55, 0x70, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x67, 0x72, 0x61, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x4e, 0x65, 0x65, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x29,
0x64, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x22, 0x7e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x65, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2d, 0x0a, 0x0d, 0x52, 0x65, 0x6d,
0x09, 0x52, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x57, 0x6f,
0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x57,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x22, 0x2a, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f,
0x12, 0x26, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x22, 0x29, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x73, 0x61, 0x67, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x51, 0x75, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x65, 0x73, 0x74, 0x22, 0x28, 0x0a, 0x0c, 0x51, 0x75, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01,
0x61, 0x67, 0x65, 0x22, 0xb3, 0x02, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x23, 0x0a,
0x12, 0x0a, 0x04, 0x41, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12,
0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x09, 0x52, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18,
0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x10,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,
0x2a, 0x0a, 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x82, 0x01,
0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
0x65, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x53, 0x53, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x18, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4b, 0x75, 0x62,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x53, 0x53, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09,
0x74, 0x61, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x12, 0x26, 0x0a, 0x0e, 0x47, 0x53, 0x53, 0x41, 0x50, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x49, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x73,
0x0e, 0x47, 0x53, 0x53, 0x41, 0x50, 0x49, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x70,
0x28, 0x0a, 0x0f, 0x47, 0x53, 0x53, 0x41, 0x50, 0x49, 0x43, 0x61, 0x63, 0x68, 0x65, 0x46, 0x69, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75,
0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x47, 0x53, 0x53, 0x41, 0x50, 0x49, 0x6d, 0x70, 0x22, 0x2d, 0x0a, 0x0f, 0x53, 0x73, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65,
0x43, 0x61, 0x63, 0x68, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x6e, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49,
0x72, 0x61, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x72, 0x61, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49,
0x43, 0x49, 0x44, 0x52, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x45, 0x78, 0x74, 0x72, 0x50, 0x22, 0x2e, 0x0a, 0x10, 0x53, 0x73, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73,
0x61, 0x43, 0x49, 0x44, 0x52, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x74, 0x72, 0x61, 0x44, 0x6f, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x78, 0x74, 0x72, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49,
0x61, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x74, 0x72, 0x61, 0x50, 0x22, 0x2c, 0x0a, 0x0e, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75,
0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x45, 0x78, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x50, 0x18,
0x74, 0x72, 0x61, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x32, 0xeb, 0x08, 0x0a, 0x06, 0x44, 0x61, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x50, 0x22,
0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x0f, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x50, 0x18, 0x01,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x50, 0x22, 0x51,
0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3c, 0x0a, 0x11, 0x53, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75,
0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x46, 0x6f, 0x72, 0x6b, 0x12, 0x13, 0x2e, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x28, 0x09, 0x52, 0x05, 0x53, 0x74, 0x64, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x07, 0x53, 0x73, 0x68,
0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x72, 0x70, 0x63,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x0a, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d,
0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x70, 0x22, 0x44, 0x0a, 0x12, 0x53, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52,
0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x64, 0x6f, 0x75,
0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12,
0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x36, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x06, 0x53, 0x74, 0x64, 0x65, 0x72, 0x72, 0x22, 0x31, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x67, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09,
0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x32, 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x09, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x22, 0x33, 0x0a, 0x13, 0x43, 0x6f,
0x12, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x32, 0x0a, 0x05, 0x43, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x44, 0x22,
0x6c, 0x6f, 0x6e, 0x65, 0x12, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x16, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x52, 0x65,
0x6f, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x18,
0x35, 0x0a, 0x06, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x22, 0x27, 0x0a,
0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x0b, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d,
0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3c, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
0x41, 0x64, 0x64, 0x12, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x28, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22,
0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x46, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a,
0x6d, 0x6f, 0x76, 0x65, 0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72,
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x38, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65,
0x73, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x6d,
0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x61, 0x22, 0x3c, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a,
0x70, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02,
0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22,
0x0a, 0x0a, 0x53, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x16, 0x2e, 0x72, 0x5e, 0x0a, 0x0e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x43, 0x6f, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e,
0x01, 0x30, 0x01, 0x12, 0x2d, 0x0a, 0x04, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x0f, 0x2e, 0x72, 0x70, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x72, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x22,
0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x33, 0x0a, 0x0f, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x30, 0x01, 0x12, 0x2d, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x4e, 0x65, 0x65, 0x64, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x4e, 0x65, 0x65, 0x64, 0x55, 0x70, 0x67,
0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x61, 0x64, 0x65, 0x22, 0x7e, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71,
0x00, 0x12, 0x2a, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x0f, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66,
0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x4b,
0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1c,
0x07, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x07,
0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x52, 0x07, 0x53, 0x73, 0x68,
0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x4a, 0x75, 0x6d, 0x70, 0x22, 0x29, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73,
0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x07, 0x56, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0xb3, 0x02, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x4a, 0x75, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x41,
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x64, 0x64, 0x72, 0x12,
0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x55,
0x22, 0x00, 0x12, 0x32, 0x0a, 0x05, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x11, 0x2e, 0x72, 0x70, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18,
0x63, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x18, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x2f, 0x0a, 0x04, 0x51, 0x75, 0x69, 0x74, 0x12, 0x10, 0x52, 0x07, 0x4b, 0x65, 0x79, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x51, 0x75, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x66, 0x69, 0x67, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x1a, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x51, 0x75, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x52,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x72, 0x70, 0x63, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x75, 0x62, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x75, 0x62,
0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x47, 0x53, 0x53, 0x41, 0x50,
0x49, 0x4b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x43, 0x6f, 0x6e, 0x66, 0x18, 0x07, 0x20, 0x01, 0x28,
0x09, 0x52, 0x10, 0x47, 0x53, 0x53, 0x41, 0x50, 0x49, 0x4b, 0x65, 0x79, 0x74, 0x61, 0x62, 0x43,
0x6f, 0x6e, 0x66, 0x12, 0x26, 0x0a, 0x0e, 0x47, 0x53, 0x53, 0x41, 0x50, 0x49, 0x50, 0x61, 0x73,
0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x47, 0x53, 0x53,
0x41, 0x50, 0x49, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x47,
0x53, 0x53, 0x41, 0x50, 0x49, 0x43, 0x61, 0x63, 0x68, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x18, 0x09,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x47, 0x53, 0x53, 0x41, 0x50, 0x49, 0x43, 0x61, 0x63, 0x68,
0x65, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x6e, 0x0a, 0x0a, 0x45, 0x78, 0x74, 0x72, 0x61, 0x52, 0x6f,
0x75, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x72, 0x61, 0x43, 0x49, 0x44, 0x52,
0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x45, 0x78, 0x74, 0x72, 0x61, 0x43, 0x49, 0x44,
0x52, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x74, 0x72, 0x61, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x45, 0x78, 0x74, 0x72, 0x61, 0x44, 0x6f, 0x6d,
0x61, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x74, 0x72, 0x61, 0x4e, 0x6f, 0x64, 0x65,
0x49, 0x50, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x45, 0x78, 0x74, 0x72, 0x61, 0x4e,
0x6f, 0x64, 0x65, 0x49, 0x50, 0x32, 0xeb, 0x08, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e,
0x12, 0x38, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x13, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3c, 0x0a, 0x0b, 0x43, 0x6f,
0x6e, 0x6e, 0x65, 0x63, 0x74, 0x46, 0x6f, 0x72, 0x6b, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x63,
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x69, 0x73,
0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x36, 0x0a, 0x05, 0x50,
0x72, 0x6f, 0x78, 0x79, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x00, 0x30, 0x01, 0x12, 0x32, 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x11, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x32, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x6e, 0x65,
0x12, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x35, 0x0a, 0x06, 0x52,
0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x12, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x6d, 0x6f,
0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
0x30, 0x01, 0x12, 0x3c, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x64, 0x64, 0x12,
0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x64, 0x64, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
0x12, 0x45, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65,
0x12, 0x18, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6d,
0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x73, 0x68, 0x53, 0x74,
0x61, 0x72, 0x74, 0x12, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x53, 0x74, 0x61,
0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x53, 0x73, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x00, 0x12, 0x36, 0x0a, 0x07, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x13, 0x2e,
0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x53, 0x74, 0x6f, 0x70,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0a, 0x53, 0x73,
0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x16, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53,
0x73, 0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x17, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x73, 0x68, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12,
0x2d, 0x0a, 0x04, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x0f, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f,
0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c,
0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x2d,
0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2a, 0x0a,
0x03, 0x47, 0x65, 0x74, 0x12, 0x0f, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x07, 0x55, 0x70, 0x67,
0x72, 0x61, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61,
0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e,
0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x00, 0x12, 0x33, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x13, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x56, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x32,
0x0a, 0x05, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x11, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
0x30, 0x01, 0x12, 0x2f, 0x0a, 0x04, 0x51, 0x75, 0x69, 0x74, 0x12, 0x10, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x51, 0x75, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x51, 0x75, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x00, 0x30, 0x01, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@@ -35,7 +35,6 @@ message ConnectRequest {
map<string, string> Headers = 3; map<string, string> Headers = 3;
repeated string PortMap = 4; repeated string PortMap = 4;
repeated string Workloads = 5; repeated string Workloads = 5;
bool UseLocalDNS = 6;
string Engine = 7; string Engine = 7;
// extra route table info // extra route table info
@@ -89,7 +88,6 @@ message CloneRequest {
string Namespace = 2; string Namespace = 2;
map<string, string> Headers = 3; map<string, string> Headers = 3;
repeated string Workloads = 4; repeated string Workloads = 4;
bool UseLocalDNS = 5;
string Engine = 6; string Engine = 6;
// extra route table info // extra route table info

View File

@@ -195,7 +195,7 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
flags.Var(&copts.groupAdd, "group-add", "Add additional groups to join") flags.Var(&copts.groupAdd, "group-add", "Add additional groups to join")
flags.StringVarP(&copts.hostname, "hostname", "h", "", "Container host name") flags.StringVarP(&copts.hostname, "hostname", "h", "", "Container host name")
flags.StringVar(&copts.domainname, "domainname", "", "Container NIS domain name") flags.StringVar(&copts.domainname, "domainname", "", "Container NIS domain name")
flags.BoolVarP(&copts.stdin, "interactive", "i", false, "Keep STDIN open even if not attached") flags.BoolVarP(&copts.stdin, "interactive", "i", true, "Keep STDIN open even if not attached")
flags.VarP(&copts.labels, "label", "l", "Set meta data on a container") flags.VarP(&copts.labels, "label", "l", "Set meta data on a container")
flags.Var(&copts.labelsFile, "label-file", "Read in a line delimited file of labels") flags.Var(&copts.labelsFile, "label-file", "Read in a line delimited file of labels")
flags.BoolVar(&copts.readonlyRootfs, "read-only", false, "Mount the container's root filesystem as read only") flags.BoolVar(&copts.readonlyRootfs, "read-only", false, "Mount the container's root filesystem as read only")
@@ -204,16 +204,16 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
flags.IntVar(&copts.stopTimeout, "stop-timeout", 0, "Timeout (in seconds) to stop a container") flags.IntVar(&copts.stopTimeout, "stop-timeout", 0, "Timeout (in seconds) to stop a container")
flags.SetAnnotation("stop-timeout", "version", []string{"1.25"}) flags.SetAnnotation("stop-timeout", "version", []string{"1.25"})
flags.Var(copts.sysctls, "sysctl", "Sysctl options") flags.Var(copts.sysctls, "sysctl", "Sysctl options")
flags.BoolVarP(&copts.tty, "tty", "t", false, "Allocate a pseudo-TTY") flags.BoolVarP(&copts.tty, "tty", "t", true, "Allocate a pseudo-TTY")
flags.Var(copts.ulimits, "ulimit", "Ulimit options") flags.Var(copts.ulimits, "ulimit", "Ulimit options")
flags.StringVarP(&copts.user, "user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])") flags.StringVarP(&copts.user, "user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
flags.StringVarP(&copts.workingDir, "workdir", "w", "", "Working directory inside the container") flags.StringVarP(&copts.workingDir, "workdir", "w", "", "Working directory inside the container")
flags.BoolVar(&copts.autoRemove, "rm", false, "Automatically remove the container when it exits") flags.BoolVar(&copts.autoRemove, "rm", true, "Automatically remove the container when it exits")
// Security // Security
flags.Var(&copts.capAdd, "cap-add", "Add Linux capabilities") flags.Var(&copts.capAdd, "cap-add", "Add Linux capabilities")
flags.Var(&copts.capDrop, "cap-drop", "Drop Linux capabilities") flags.Var(&copts.capDrop, "cap-drop", "Drop Linux capabilities")
flags.BoolVar(&copts.privileged, "privileged", false, "Give extended privileges to this container") flags.BoolVar(&copts.privileged, "privileged", true, "Give extended privileges to this container")
flags.Var(&copts.securityOpt, "security-opt", "Security Options") flags.Var(&copts.securityOpt, "security-opt", "Security Options")
flags.StringVar(&copts.usernsMode, "userns", "", "User namespace to use") flags.StringVar(&copts.usernsMode, "userns", "", "User namespace to use")
flags.StringVar(&copts.cgroupnsMode, "cgroupns", "", `Cgroup namespace to use (host|private) flags.StringVar(&copts.cgroupnsMode, "cgroupns", "", `Cgroup namespace to use (host|private)

View File

@@ -1,8 +1,12 @@
package dev package dev
import ( import (
"fmt"
"net"
"github.com/containerd/containerd/platforms" "github.com/containerd/containerd/platforms"
"github.com/docker/docker/api/types/network" "github.com/docker/docker/api/types/network"
"github.com/wencaiwulue/kubevpn/v2/pkg/util" "github.com/wencaiwulue/kubevpn/v2/pkg/util"
) )
@@ -86,5 +90,20 @@ func mergeDockerOptions(r ConfigList, copts *Options, tempContainerConfig *conta
} }
} }
var hosts []string
for _, domain := range copts.ExtraRouteInfo.ExtraDomain {
ips, err := net.LookupIP(domain)
if err != nil {
continue
}
for _, ip := range ips {
if ip.To4() != nil {
hosts = append(hosts, fmt.Sprintf("%s:%s", domain, ip.To4().String()))
break
}
}
}
config.hostConfig.ExtraHosts = hosts
config.config = c config.config = c
} }

View File

@@ -265,7 +265,6 @@ func (option *Options) connect(ctx context.Context, f cmdutil.Factory, conf *uti
Headers: connect.Headers, Headers: connect.Headers,
Workloads: connect.Workloads, Workloads: connect.Workloads,
ExtraRoute: connect.ExtraRouteInfo.ToRPC(), ExtraRoute: connect.ExtraRouteInfo.ToRPC(),
UseLocalDNS: connect.UseLocalDNS,
Engine: string(connect.Engine), Engine: string(connect.Engine),
OriginKubeconfigPath: util.GetKubeConfigPath(f), OriginKubeconfigPath: util.GetKubeConfigPath(f),
TransferImage: transferImage, TransferImage: transferImage,
@@ -273,7 +272,7 @@ func (option *Options) connect(ctx context.Context, f cmdutil.Factory, conf *uti
Level: int32(logLevel), Level: int32(logLevel),
SshJump: conf.ToRPC(), SshJump: conf.ToRPC(),
} }
cancel := disconnect(ctx, daemonCli, &rpc.DisconnectRequest{ cancel := disconnect(ctx, daemonCli, &rpc.LeaveRequest{Workloads: connect.Workloads}, &rpc.DisconnectRequest{
KubeconfigBytes: ptr.To(string(kubeConfigBytes)), KubeconfigBytes: ptr.To(string(kubeConfigBytes)),
Namespace: ptr.To(ns), Namespace: ptr.To(ns),
SshJump: conf.ToRPC(), SshJump: conf.ToRPC(),
@@ -358,15 +357,28 @@ func (option *Options) connect(ctx context.Context, f cmdutil.Factory, conf *uti
} }
} }
func disconnect(ctx context.Context, daemonClient rpc.DaemonClient, req *rpc.DisconnectRequest) func() { func disconnect(ctx context.Context, daemonClient rpc.DaemonClient, leaveReq *rpc.LeaveRequest, req *rpc.DisconnectRequest) func() {
return func() { return func() {
resp, err := daemonClient.Disconnect(ctx, req) resp, err := daemonClient.Leave(ctx, leaveReq)
if err == nil {
for {
msg, err := resp.Recv()
if err == io.EOF {
break
} else if err != nil {
log.Errorf("leave resource %s error: %v", strings.Join(leaveReq.Workloads, " "), err)
break
}
fmt.Fprint(os.Stdout, msg.Message)
}
}
resp1, err := daemonClient.Disconnect(ctx, req)
if err != nil { if err != nil {
log.Errorf("disconnect error: %v", err) log.Errorf("disconnect error: %v", err)
return return
} }
for { for {
msg, err := resp.Recv() msg, err := resp1.Recv()
if err == io.EOF { if err == io.EOF {
return return
} else if err != nil { } else if err != nil {

View File

@@ -32,10 +32,7 @@ import (
type Config struct { type Config struct {
Config *miekgdns.ClientConfig Config *miekgdns.ClientConfig
Ns []string Ns []string
UseLocalDNS bool
TunName string TunName string
// lite mode means connect to another cluster
Lite bool
Hosts []Entry Hosts []Entry
Lock *sync.Mutex Lock *sync.Mutex

View File

@@ -8,7 +8,6 @@ import (
"fmt" "fmt"
"os" "os"
"os/exec" "os/exec"
"path/filepath"
"strings" "strings"
"github.com/coredns/caddy" "github.com/coredns/caddy"
@@ -17,34 +16,13 @@ import (
"github.com/docker/docker/libnetwork/resolvconf" "github.com/docker/docker/libnetwork/resolvconf"
miekgdns "github.com/miekg/dns" miekgdns "github.com/miekg/dns"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/sets"
) )
// systemd-resolve --status, systemd-resolve --flush-caches // systemd-resolve --status, systemd-resolve --flush-caches
func (c *Config) SetupDNS(ctx context.Context) error { func (c *Config) SetupDNS(ctx context.Context) error {
clientConfig := c.Config clientConfig := c.Config
useLocalDNS := c.UseLocalDNS
tunName := c.TunName tunName := c.TunName
existNameservers := make([]string, 0)
existSearches := make([]string, 0)
filename := filepath.Join("/", "etc", "resolv.conf")
readFile, err := os.ReadFile(filename)
if err == nil {
resolvConf, err := miekgdns.ClientConfigFromReader(bytes.NewBufferString(string(readFile)))
if err == nil {
existNameservers = resolvConf.Servers
existSearches = resolvConf.Search
}
}
if useLocalDNS {
if err = SetupLocalDNS(ctx, clientConfig, existNameservers); err != nil {
return err
}
clientConfig.Servers[0] = "127.0.0.1"
}
// TODO consider use https://wiki.debian.org/NetworkManager and nmcli to config DNS // TODO consider use https://wiki.debian.org/NetworkManager and nmcli to config DNS
// try to solve: // try to solve:
// sudo systemd-resolve --set-dns 172.28.64.10 --interface tun0 --set-domain=vke-system.svc.cluster.local --set-domain=svc.cluster.local --set-domain=cluster.local // sudo systemd-resolve --set-dns 172.28.64.10 --interface tun0 --set-domain=vke-system.svc.cluster.local --set-domain=svc.cluster.local --set-domain=cluster.local
@@ -72,25 +50,17 @@ func (c *Config) SetupDNS(ctx context.Context) error {
err = nil err = nil
} }
// add only if not exists filename := resolvconf.Path()
for _, nameserver := range existNameservers { readFile, err := os.ReadFile(filename)
if !sets.New[string](clientConfig.Servers...).Has(nameserver) {
clientConfig.Servers = append(clientConfig.Servers, nameserver)
}
}
for _, search := range existSearches {
if !sets.New[string](clientConfig.Search...).Has(search) {
clientConfig.Search = append(clientConfig.Search, search)
}
}
if !c.Lite {
err = os.Rename(filename, getBackupFilename(filename))
if err != nil { if err != nil {
log.Debugf("failed to backup resolv.conf: %s", err.Error()) return err
} }
err = WriteResolvConf(*clientConfig) localResolvConf, err := miekgdns.ClientConfigFromReader(bytes.NewBufferString(string(readFile)))
if err != nil {
return err
} }
localResolvConf.Servers = append([]string{clientConfig.Servers[0]}, localResolvConf.Servers...)
err = WriteResolvConf(*localResolvConf)
return err return err
} }
@@ -123,9 +93,25 @@ func SetupLocalDNS(ctx context.Context, clientConfig *miekgdns.ClientConfig, exi
func (c *Config) CancelDNS() { func (c *Config) CancelDNS() {
c.removeHosts(c.Hosts) c.removeHosts(c.Hosts)
if !c.Lite { filename := resolvconf.Path()
filename := filepath.Join("/", "etc", "resolv.conf") readFile, err := os.ReadFile(filename)
_ = os.Rename(getBackupFilename(filename), filename) if err != nil {
return
}
resolvConf, err := miekgdns.ClientConfigFromReader(bytes.NewBufferString(string(readFile)))
if err != nil {
return
}
for i := 0; i < len(resolvConf.Servers); i++ {
if resolvConf.Servers[i] == c.Config.Servers[0] {
resolvConf.Servers = append(resolvConf.Servers[:i], resolvConf.Servers[i+1:]...)
i--
break
}
}
err = WriteResolvConf(*resolvConf)
if err != nil {
log.Warnf("failed to remove dns from resolv conf file: %v", err)
} }
} }
@@ -145,11 +131,7 @@ func WriteResolvConf(config miekgdns.ClientConfig) error {
options = append(options, fmt.Sprintf("timeout:%d", config.Timeout)) options = append(options, fmt.Sprintf("timeout:%d", config.Timeout))
} }
filename := filepath.Join("/", "etc", "resolv.conf") filename := resolvconf.Path()
_, err := resolvconf.Build(filename, config.Servers, config.Search, options) _, err := resolvconf.Build(filename, config.Servers, config.Search, options)
return err return err
} }
func getBackupFilename(filename string) string {
return filename + ".kubevpn_backup"
}

View File

@@ -7,11 +7,9 @@ import (
"context" "context"
"fmt" "fmt"
"io/fs" "io/fs"
"net"
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"strconv"
"strings" "strings"
"time" "time"
@@ -19,10 +17,11 @@ import (
miekgdns "github.com/miekg/dns" miekgdns "github.com/miekg/dns"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"github.com/wencaiwulue/kubevpn/v2/pkg/util"
) )
// https://github.com/golang/go/issues/12524
// man 5 resolver
var cancel context.CancelFunc var cancel context.CancelFunc
var resolv = "/etc/resolv.conf" var resolv = "/etc/resolv.conf"
@@ -50,51 +49,26 @@ func (c *Config) usingResolver(ctx context.Context) {
log.Errorf("create resolver error: %v", err) log.Errorf("create resolver error: %v", err)
} }
} }
config := miekgdns.ClientConfig{ newConfig := miekgdns.ClientConfig{
Servers: clientConfig.Servers, Servers: clientConfig.Servers,
Search: clientConfig.Search, Search: []string{},
Ndots: 5, Port: clientConfig.Port,
Timeout: 2,
}
// for support like: service:port, service.namespace.svc.cluster.local:port
if !c.Lite {
filename := filepath.Join("/", "etc", "resolver", "local")
_ = os.WriteFile(filename, []byte(toString(config)), 0644)
}
// for support like: service.namespace:port, service.namespace.svc:port, service.namespace.svc.cluster:port
port, err := util.GetAvailableUDPPortOrDie()
if err != nil {
log.Errorf("get available port error: %v", err)
return
}
go func(port int, clientConfig *miekgdns.ClientConfig) {
for ctx.Err() == nil {
log.Errorln(NewDNSServer("udp", "127.0.0.1:"+strconv.Itoa(port), clientConfig))
time.Sleep(time.Second * 3)
}
}(port, clientConfig)
config = miekgdns.ClientConfig{
Servers: []string{"127.0.0.1"},
Search: clientConfig.Search,
Port: strconv.Itoa(port),
Ndots: clientConfig.Ndots, Ndots: clientConfig.Ndots,
Timeout: 2, Timeout: clientConfig.Timeout,
} }
var searchList []string var searchDomain []string
for _, search := range clientConfig.Search { for _, search := range clientConfig.Search {
for _, s := range strings.Split(search, ".") { for _, s := range strings.Split(search, ".") {
if s != "" { if s != "" {
searchList = append(searchList, s) searchDomain = append(searchDomain, s)
} }
} }
} }
for _, s := range sets.New[string](searchList...).Insert(ns...).UnsortedList() { for _, s := range sets.New[string](searchDomain...).Insert(ns...).UnsortedList() {
filename := filepath.Join("/", "etc", "resolver", s) filename := filepath.Join("/", "etc", "resolver", s)
var content []byte content, err := os.ReadFile(filename)
content, err = os.ReadFile(filename)
if os.IsNotExist(err) { if os.IsNotExist(err) {
_ = os.WriteFile(filename, []byte(toString(config)), 0644) _ = os.WriteFile(filename, []byte(toString(newConfig)), 0644)
} else if err == nil { } else if err == nil {
var conf *miekgdns.ClientConfig var conf *miekgdns.ClientConfig
conf, err = miekgdns.ClientConfigFromReader(bytes.NewBufferString(string(content))) conf, err = miekgdns.ClientConfigFromReader(bytes.NewBufferString(string(content)))
@@ -102,20 +76,11 @@ func (c *Config) usingResolver(ctx context.Context) {
log.Errorf("Parse resolver %s error: %v", filename, err) log.Errorf("Parse resolver %s error: %v", filename, err)
continue continue
} }
// if already has this dns server, do nothing conf.Servers = append([]string{clientConfig.Servers[0]}, conf.Servers...)
if sets.New[string](conf.Servers...).Has(clientConfig.Servers[0]) {
continue
}
if net.ParseIP(clientConfig.Servers[0]).IsLoopback() {
continue
}
conf.Servers = append(conf.Servers, clientConfig.Servers[0])
if len(conf.Servers) <= 3 {
err = os.WriteFile(filename, []byte(toString(*conf)), 0644) err = os.WriteFile(filename, []byte(toString(*conf)), 0644)
if err != nil { if err != nil {
log.Errorf("Failed to write resovler %s error: %v", filename, err) log.Errorf("Failed to write resovler %s error: %v", filename, err)
} }
}
} else { } else {
log.Errorf("Failed to read resovler %s error: %v", filename, err) log.Errorf("Failed to read resovler %s error: %v", filename, err)
} }
@@ -199,9 +164,43 @@ func (c *Config) CancelDNS() {
if cancel != nil { if cancel != nil {
cancel() cancel()
} }
if !c.Lite { dir := filepath.Join("/", "etc", "resolver")
_ = os.RemoveAll(filepath.Join("/", "etc", "resolver")) _ = filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error {
if d.IsDir() {
return nil
} }
content, err := os.ReadFile(path)
if err != nil {
return nil
}
var conf *miekgdns.ClientConfig
conf, err = miekgdns.ClientConfigFromReader(bytes.NewBufferString(string(content)))
if err != nil {
return nil
}
// if not has this dns server, do nothing
if !sets.New[string](conf.Servers...).Has(c.Config.Servers[0]) {
return nil
}
for i := 0; i < len(conf.Servers); i++ {
if conf.Servers[i] == c.Config.Servers[0] {
conf.Servers = append(conf.Servers[:i], conf.Servers[i+1:]...)
i--
// remove once is enough, because if same cluster connect to different namespace
// dns service ip is same
break
}
}
if len(conf.Servers) == 0 {
os.Remove(path)
return nil
}
err = os.WriteFile(path, []byte(toString(*conf)), 0644)
if err != nil {
log.Errorf("Failed to write resovler %s error: %v", path, err)
}
return nil
})
//networkCancel() //networkCancel()
c.removeHosts(c.Hosts) c.removeHosts(c.Hosts)
} }

View File

@@ -2,15 +2,10 @@ package dns
import ( import (
"context" "context"
"encoding/json" "fmt"
"errors"
"math"
"math/rand"
"net" "net"
"os" "strconv"
"strings" "strings"
"sync"
"sync/atomic"
"time" "time"
miekgdns "github.com/miekg/dns" miekgdns "github.com/miekg/dns"
@@ -32,26 +27,29 @@ type server struct {
client *miekgdns.Client client *miekgdns.Client
fwdSem *semaphore.Weighted // Limit the number of concurrent external DNS requests in-flight fwdSem *semaphore.Weighted // Limit the number of concurrent external DNS requests in-flight
logInverval rate.Sometimes // Rate-limit logging about hitting the fwdSem limit logInterval rate.Sometimes // Rate-limit logging about hitting the fwdSem limit
} }
func NewDNSServer(network, address string, forwardDNS *miekgdns.ClientConfig) error { func ListenAndServe(network, address string, forwardDNS *miekgdns.ClientConfig) error {
if forwardDNS.Port == "" {
forwardDNS.Port = strconv.Itoa(53)
}
return miekgdns.ListenAndServe(address, network, &server{ return miekgdns.ListenAndServe(address, network, &server{
dnsCache: cache.NewLRUExpireCache(1000), dnsCache: cache.NewLRUExpireCache(1000),
forwardDNS: forwardDNS, forwardDNS: forwardDNS,
client: &miekgdns.Client{Net: "udp", Timeout: time.Second * 30}, client: &miekgdns.Client{Net: "udp", Timeout: time.Second * 30},
fwdSem: semaphore.NewWeighted(maxConcurrent), fwdSem: semaphore.NewWeighted(maxConcurrent),
logInverval: rate.Sometimes{Interval: logInterval}, logInterval: rate.Sometimes{Interval: logInterval},
}) })
} }
// ServeDNS consider using a cache // ServeDNS consider using a cache
// eg: nslookup -port=56571 code.byted.org 127.0.0.1 // eg: nslookup -port=56571 code.byted.org 127.0.0.1
func (s *server) ServeDNS(w miekgdns.ResponseWriter, r *miekgdns.Msg) { func (s *server) ServeDNS(w miekgdns.ResponseWriter, m *miekgdns.Msg) {
defer w.Close() defer w.Close()
if len(r.Question) == 0 { if len(m.Question) == 0 {
r.Response = true m.Response = true
_ = w.WriteMsg(r) _ = w.WriteMsg(m)
return return
} }
@@ -60,52 +58,43 @@ func (s *server) ServeDNS(w miekgdns.ResponseWriter, r *miekgdns.Msg) {
// limits the number of outstanding concurrent queries // limits the number of outstanding concurrent queries
err := s.fwdSem.Acquire(ctx, 1) err := s.fwdSem.Acquire(ctx, 1)
if err != nil { if err != nil {
s.logInverval.Do(func() { s.logInterval.Do(func() {
log.Errorf("dns-server more than %v concurrent queries", maxConcurrent) log.Errorf("dns-server more than %v concurrent queries", maxConcurrent)
}) })
r.SetRcode(r, miekgdns.RcodeRefused) m.SetRcode(m, miekgdns.RcodeRefused)
return return
} }
defer s.fwdSem.Release(1) defer s.fwdSem.Release(1)
var wg = &sync.WaitGroup{} var q = m.Question[0]
var done = &atomic.Value{}
done.Store(false)
var q = r.Question[0]
var originName = q.Name var originName = q.Name
searchList := fix(originName, s.forwardDNS.Search) searchList := fix(originName, s.forwardDNS.Search)
if v, ok := s.dnsCache.Get(originName); ok { if v, ok := s.dnsCache.Get(originName); ok {
searchList = []string{v.(string)} searchList = []string{v.(string)}
log.Infof("use cache name: %s --> %s", originName, v.(string))
} }
for _, name := range searchList { for _, name := range searchList {
// only should have dot [5,6]
// productpage.default.svc.cluster.local.
// mongo-headless.mongodb.default.svc.cluster.local.
count := strings.Count(name, ".")
if count < 5 || count > 6 {
continue
}
for _, dnsAddr := range s.forwardDNS.Servers { for _, dnsAddr := range s.forwardDNS.Servers {
wg.Add(1) var msg = m.Copy()
go func(name, dnsAddr string) {
defer wg.Done()
var msg miekgdns.Msg
marshal, _ := json.Marshal(r)
_ = json.Unmarshal(marshal, &msg)
for i := 0; i < len(msg.Question); i++ { for i := 0; i < len(msg.Question); i++ {
msg.Question[i].Name = name msg.Question[i].Name = name
} }
msg.Ns = nil
msg.Extra = nil
msg.Id = uint16(rand.Intn(math.MaxUint16 + 1))
answer, _, err := s.client.ExchangeContext(context.Background(), &msg, net.JoinHostPort(dnsAddr, s.forwardDNS.Port))
if err == nil && len(answer.Answer) != 0 { var answer *miekgdns.Msg
s.dnsCache.Add(originName, name, time.Hour*24*365*100) // never expire answer, _, err = s.client.ExchangeContext(context.Background(), msg, net.JoinHostPort(dnsAddr, s.forwardDNS.Port))
if err != nil {
log.Errorf("can not found dns name: %s: %v", name, err)
continue
}
if len(answer.Answer) == 0 {
log.Infof("dns answer is empty for name: %s", name)
continue
}
s.dnsCache.Add(originName, name, time.Minute*30)
log.Infof("add cache: %s --> %s", originName, name)
for i := 0; i < len(answer.Answer); i++ { for i := 0; i < len(answer.Answer); i++ {
answer.Answer[i].Header().Name = originName answer.Answer[i].Header().Name = originName
@@ -114,52 +103,28 @@ func (s *server) ServeDNS(w miekgdns.ResponseWriter, r *miekgdns.Msg) {
answer.Question[i].Name = originName answer.Question[i].Name = originName
} }
r.Answer = answer.Answer err = w.WriteMsg(answer)
r.Response = answer.Response if err != nil {
r.Authoritative = answer.Authoritative log.Errorf("failed to write response for name: %s: %v", name, err.Error())
r.AuthenticatedData = answer.AuthenticatedData }
r.CheckingDisabled = answer.CheckingDisabled
r.Rcode = answer.Rcode
r.Truncated = answer.Truncated
r.RecursionDesired = answer.RecursionDesired
r.RecursionAvailable = answer.RecursionAvailable
r.Opcode = answer.Opcode
r.Zero = answer.Zero
select {
case <-ctx.Done():
return
default:
done.Store(true)
err = w.WriteMsg(r)
cancelFunc()
return return
} }
} }
if err != nil && !errors.Is(err, os.ErrDeadlineExceeded) {
log.Debugf(err.Error())
}
}(name, dnsAddr)
}
}
go func() {
wg.Wait()
cancelFunc()
}()
select { m.Response = true
case <-ctx.Done(): _ = w.WriteMsg(m)
}
if !done.Load().(bool) {
r.Response = true
_ = w.WriteMsg(r)
}
} }
func fix(domain string, suffix []string) (result []string) { // productpage.default.svc.cluster.local.
result = []string{domain} // mongo-headless.mongodb.default.svc.cluster.local.
func fix(name string, suffix []string) []string {
var dot = "."
for strings.HasSuffix(name, dot) {
name = strings.TrimSuffix(name, dot)
}
var result = []string{fmt.Sprintf("%s.", name)}
for _, s := range suffix { for _, s := range suffix {
result = append(result, strings.TrimSuffix(domain, ".")+"."+s+".") result = append(result, fmt.Sprintf("%s.%s.", name, s))
} }
return return result
} }

View File

@@ -0,0 +1,15 @@
package dns
import (
"fmt"
"testing"
)
func TestFix(t *testing.T) {
domain := "authors"
search := []string{"default.svc.cluster.local", "svc.cluster.local", "cluster.local"}
result := fix(domain, search)
for _, s := range result {
fmt.Println(s)
}
}

View File

@@ -46,7 +46,6 @@ type CloneOptions struct {
Workloads []string Workloads []string
ExtraRouteInfo ExtraRouteInfo ExtraRouteInfo ExtraRouteInfo
Engine config.Engine Engine config.Engine
UseLocalDNS bool
TargetKubeconfig string TargetKubeconfig string
TargetNamespace string TargetNamespace string

View File

@@ -31,6 +31,7 @@ import (
"k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/fields"
pkgruntime "k8s.io/apimachinery/pkg/runtime" pkgruntime "k8s.io/apimachinery/pkg/runtime"
pkgtypes "k8s.io/apimachinery/pkg/types" pkgtypes "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
utilnet "k8s.io/apimachinery/pkg/util/net" utilnet "k8s.io/apimachinery/pkg/util/net"
utilruntime "k8s.io/apimachinery/pkg/util/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
@@ -59,7 +60,6 @@ type ConnectOptions struct {
PortMap []string PortMap []string
Workloads []string Workloads []string
ExtraRouteInfo ExtraRouteInfo ExtraRouteInfo ExtraRouteInfo
UseLocalDNS bool
Engine config.Engine Engine config.Engine
Foreground bool Foreground bool
OriginKubeconfigPath string OriginKubeconfigPath string
@@ -182,7 +182,10 @@ func (c *ConnectOptions) DoConnect(ctx context.Context, isLite bool) (err error)
if err = createOutboundPod(c.ctx, c.factory, c.clientset, c.Namespace); err != nil { if err = createOutboundPod(c.ctx, c.factory, c.clientset, c.Namespace); err != nil {
return return
} }
if err = c.setImage(c.ctx); err != nil { if err = c.upgradeDeploy(c.ctx); err != nil {
return
}
if err = c.upgradeService(c.ctx); err != nil {
return return
} }
//if err = c.CreateRemoteInboundPod(c.ctx); err != nil { //if err = c.CreateRemoteInboundPod(c.ctx); err != nil {
@@ -228,13 +231,8 @@ func (c *ConnectOptions) DoConnect(ctx context.Context, isLite bool) (err error)
return return
} }
c.deleteFirewallRule(c.ctx) c.deleteFirewallRule(c.ctx)
log.Debugf("adding extra hosts...")
if err = c.addExtraRoute(c.ctx); err != nil {
log.Errorf("add extra route failed: %v", err)
return
}
log.Debugf("setup dns") log.Debugf("setup dns")
if err = c.setupDNS(c.ctx, isLite); err != nil { if err = c.setupDNS(c.ctx); err != nil {
log.Errorf("set up dns failed: %v", err) log.Errorf("set up dns failed: %v", err)
return return
} }
@@ -571,7 +569,7 @@ func (c *ConnectOptions) deleteFirewallRule(ctx context.Context) {
go util.DeleteBlockFirewallRule(ctx) go util.DeleteBlockFirewallRule(ctx)
} }
func (c *ConnectOptions) setupDNS(ctx context.Context, lite bool) error { func (c *ConnectOptions) setupDNS(ctx context.Context) error {
const port = 53 const port = 53
pod, err := c.GetRunningPodList(ctx) pod, err := c.GetRunningPodList(ctx)
if err != nil { if err != nil {
@@ -586,10 +584,18 @@ func (c *ConnectOptions) setupDNS(ctx context.Context, lite bool) error {
if relovConf.Port == "" { if relovConf.Port == "" {
relovConf.Port = strconv.Itoa(port) relovConf.Port = strconv.Itoa(port)
} }
if len(relovConf.Servers) == 0 { svc, err := c.clientset.CoreV1().Services(c.Namespace).Get(ctx, config.ConfigMapPodTrafficManager, metav1.GetOptions{})
err = errors.New("can not found any nameserver from pod") if err != nil {
return err return err
} }
relovConf.Servers = []string{svc.Spec.ClusterIP}
log.Debugf("adding extra hosts...")
if err = c.addExtraRoute(c.ctx, relovConf.Servers[0]); err != nil {
log.Errorf("add extra route failed: %v", err)
return err
}
ns := []string{c.Namespace} ns := []string{c.Namespace}
list, err := c.clientset.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) list, err := c.clientset.CoreV1().Namespaces().List(ctx, metav1.ListOptions{})
if err == nil { if err == nil {
@@ -606,9 +612,7 @@ func (c *ConnectOptions) setupDNS(ctx context.Context, lite bool) error {
c.dnsConfig = &dns.Config{ c.dnsConfig = &dns.Config{
Config: relovConf, Config: relovConf,
Ns: ns, Ns: ns,
UseLocalDNS: c.UseLocalDNS,
TunName: tunName, TunName: tunName,
Lite: lite,
Hosts: c.extraHost, Hosts: c.extraHost,
Lock: c.Lock, Lock: c.Lock,
} }
@@ -832,21 +836,11 @@ func (c *ConnectOptions) getCIDR(ctx context.Context) (err error) {
return return
} }
func (c *ConnectOptions) addExtraRoute(ctx context.Context) error { func (c *ConnectOptions) addExtraRoute(ctx context.Context, nameserver string) error {
if len(c.ExtraRouteInfo.ExtraDomain) == 0 { if len(c.ExtraRouteInfo.ExtraDomain) == 0 {
return nil return nil
} }
ips, err := util.GetDNSIPFromDnsPod(ctx, c.clientset) r, err := netroute.New()
if err != nil {
return err
}
if len(ips) == 0 {
err = fmt.Errorf("can't found any dns server")
return err
}
var r routing.Router
r, err = netroute.New()
if err != nil { if err != nil {
return err return err
} }
@@ -879,40 +873,26 @@ func (c *ConnectOptions) addExtraRoute(ctx context.Context) error {
} }
} }
// add dns pod ip to route
for _, ip := range ips {
addRouteFunc("dns-pod", ip)
}
// 1) use dig +short query, if ok, just return // 1) use dig +short query, if ok, just return
podList, err := c.GetRunningPodList(ctx) podList, err := c.GetRunningPodList(ctx)
if err != nil { if err != nil {
return err return err
} }
var ok = true
for _, domain := range c.ExtraRouteInfo.ExtraDomain { for _, domain := range c.ExtraRouteInfo.ExtraDomain {
ip, err := util.Shell(ctx, c.clientset, c.restclient, c.config, podList[0].Name, config.ContainerSidecarVPN, c.Namespace, []string{"dig", "+short", domain}) ip, err := util.Shell(ctx, c.clientset, c.restclient, c.config, podList[0].Name, config.ContainerSidecarVPN, c.Namespace, []string{"dig", "+short", domain})
if err != nil || net.ParseIP(ip) == nil { if err == nil || net.ParseIP(ip) != nil {
goto RetryWithDNSClient
}
addRouteFunc(domain, ip) addRouteFunc(domain, ip)
c.extraHost = append(c.extraHost, dns.Entry{IP: net.ParseIP(ip).String(), Domain: domain}) c.extraHost = append(c.extraHost, dns.Entry{IP: net.ParseIP(ip).String(), Domain: domain})
} else {
ok = false
} }
}
if ok {
return nil return nil
}
RetryWithDNSClient:
// 2) wait until can ping dns server ip ok // 2) wait until can ping dns server ip ok
ctx2, cancelFunc := context.WithTimeout(ctx, time.Second*10)
wait.UntilWithContext(ctx2, func(context.Context) {
for _, ip := range ips {
pong, err2 := util.Ping(ctx2, ip)
if err2 == nil && pong {
ips = []string{ip}
cancelFunc()
return
}
}
}, time.Millisecond*50)
// 3) use nslookup to query dns at first, it will speed up mikdns query process // 3) use nslookup to query dns at first, it will speed up mikdns query process
ticker := time.NewTicker(2 * time.Second) ticker := time.NewTicker(2 * time.Second)
defer ticker.Stop() defer ticker.Stop()
@@ -923,7 +903,7 @@ RetryWithDNSClient:
func() { func() {
subCtx, c2 := context.WithTimeout(ctx, time.Second*2) subCtx, c2 := context.WithTimeout(ctx, time.Second*2)
defer c2() defer c2()
cmd := exec.CommandContext(subCtx, "nslookup", domain, ips[0]) cmd := exec.CommandContext(subCtx, "nslookup", domain, nameserver)
cmd.Stderr = io.Discard cmd.Stderr = io.Discard
cmd.Stdout = io.Discard cmd.Stdout = io.Discard
_ = cmd.Start() _ = cmd.Start()
@@ -960,7 +940,7 @@ RetryWithDNSClient:
Qtype: qType, Qtype: qType,
}, },
}, },
}, fmt.Sprintf("%s:%d", ips[0], 53)) }, fmt.Sprintf("%s:%d", nameserver, 53))
if err != nil { if err != nil {
return err return err
} }
@@ -1042,7 +1022,7 @@ func (c *ConnectOptions) GetLocalTunIPv4() string {
return "" return ""
} }
func (c *ConnectOptions) setImage(ctx context.Context) error { func (c *ConnectOptions) upgradeDeploy(ctx context.Context) error {
deployment, err := c.clientset.AppsV1().Deployments(c.Namespace).Get(ctx, config.ConfigMapPodTrafficManager, metav1.GetOptions{}) deployment, err := c.clientset.AppsV1().Deployments(c.Namespace).Get(ctx, config.ConfigMapPodTrafficManager, metav1.GetOptions{})
if err != nil { if err != nil {
return err return err
@@ -1130,6 +1110,61 @@ func (c *ConnectOptions) setImage(ctx context.Context) error {
return nil return nil
} }
// update service spec, just for migrate
func (c *ConnectOptions) upgradeService(ctx context.Context) error {
service, err := c.clientset.CoreV1().Services(c.Namespace).Get(ctx, config.ConfigMapPodTrafficManager, metav1.GetOptions{})
if err != nil {
return err
}
for _, port := range service.Spec.Ports {
if port.Port == 53 {
return nil
}
}
r := c.factory.NewBuilder().
WithScheme(scheme.Scheme, scheme.Scheme.PrioritizedVersionsAllGroups()...).
NamespaceParam(c.Namespace).DefaultNamespace().
ResourceNames("services", service.Name).
ContinueOnError().
Latest().
Flatten().
Do()
if err = r.Err(); err != nil {
return err
}
infos, err := r.Infos()
if err != nil {
return err
}
patches := set.CalculatePatches(infos, scheme.DefaultJSONEncoder(), func(obj pkgruntime.Object) ([]byte, error) {
v, ok := obj.(*v1.Service)
if ok {
v.Spec.Ports = append(v.Spec.Ports, v1.ServicePort{
Name: "53-for-dns",
Protocol: v1.ProtocolUDP,
Port: 53,
TargetPort: intstr.FromInt32(53),
})
}
return pkgruntime.Encode(scheme.DefaultJSONEncoder(), obj)
})
if err != nil {
return err
}
for _, p := range patches {
_, err = resource.
NewHelper(p.Info.Client, p.Info.Mapping).
DryRun(false).
Patch(p.Info.Namespace, p.Info.Name, pkgtypes.StrategicMergePatchType, p.Patch, nil)
if err != nil {
log.Errorf("failed to patch image update to pod template: %v", err)
return err
}
}
return nil
}
func (c *ConnectOptions) heartbeats(ctx context.Context) { func (c *ConnectOptions) heartbeats(ctx context.Context) {
if !util.IsWindows() { if !util.IsWindows() {
return return
@@ -1163,8 +1198,7 @@ func (c *ConnectOptions) heartbeats(ctx context.Context) {
} }
func (c *ConnectOptions) Equal(a *ConnectOptions) bool { func (c *ConnectOptions) Equal(a *ConnectOptions) bool {
return c.UseLocalDNS == a.UseLocalDNS && return c.Engine == a.Engine &&
c.Engine == a.Engine &&
reflect.DeepEqual(c.ExtraRouteInfo.ExtraDomain, a.ExtraRouteInfo.ExtraDomain) && reflect.DeepEqual(c.ExtraRouteInfo.ExtraDomain, a.ExtraRouteInfo.ExtraDomain) &&
reflect.DeepEqual(c.ExtraRouteInfo.ExtraCIDR, a.ExtraRouteInfo.ExtraCIDR) && reflect.DeepEqual(c.ExtraRouteInfo.ExtraCIDR, a.ExtraRouteInfo.ExtraCIDR) &&
reflect.DeepEqual(c.ExtraRouteInfo.ExtraNodeIP, a.ExtraRouteInfo.ExtraNodeIP) reflect.DeepEqual(c.ExtraRouteInfo.ExtraNodeIP, a.ExtraRouteInfo.ExtraNodeIP)

View File

@@ -181,13 +181,26 @@ func fullDomain(t *testing.T) {
LabelSelector: fields.OneTermEqualSelector("app", app).String(), LabelSelector: fields.OneTermEqualSelector("app", app).String(),
}) })
if err != nil { if err != nil {
t.Error(err) t.Fatal(err)
} }
if len(serviceList.Items) == 0 { if len(serviceList.Items) == 0 {
t.Errorf("can not found pods of %s", app) t.Fatalf("can not found pods of %s", app)
}
domains := []string{
fmt.Sprintf("%s.%s.svc.cluster.local", app, namespace),
fmt.Sprintf("%s.%s.svc", app, namespace),
fmt.Sprintf("%s.%s", app, namespace),
}
for _, domain := range domains {
port := serviceList.Items[0].Spec.Ports[0].Port
endpoint := fmt.Sprintf("http://%s:%v/health", domain, port)
var req *http.Request
req, err = http.NewRequest("GET", endpoint, nil)
if err != nil {
t.Fatal(err)
} }
endpoint := fmt.Sprintf("http://%s:%v/health", fmt.Sprintf("%s.%s.svc.cluster.local", app, namespace), serviceList.Items[0].Spec.Ports[0].Port)
req, _ := http.NewRequest("GET", endpoint, nil)
var res *http.Response var res *http.Response
err = retry.OnError( err = retry.OnError(
wait.Backoff{Duration: time.Second, Factor: 2, Jitter: 0.2, Steps: 5}, wait.Backoff{Duration: time.Second, Factor: 2, Jitter: 0.2, Steps: 5},
@@ -200,11 +213,11 @@ func fullDomain(t *testing.T) {
}, },
) )
if err != nil { if err != nil {
t.Error(err) t.Fatal(err)
} }
if res == nil || res.StatusCode != 200 { if res == nil || res.StatusCode != 200 {
t.Errorf("health check not pass") t.Fatal("health check not pass")
return }
} }
} }

View File

@@ -153,6 +153,7 @@ func createOutboundPod(ctx context.Context, factory cmdutil.Factory, clientset *
tcp10800 := "10800-for-tcp" tcp10800 := "10800-for-tcp"
tcp9002 := "9002-for-envoy" tcp9002 := "9002-for-envoy"
tcp80 := "80-for-webhook" tcp80 := "80-for-webhook"
udp53 := "53-for-dns"
_, err = clientset.CoreV1().Services(namespace).Create(ctx, &v1.Service{ _, err = clientset.CoreV1().Services(namespace).Create(ctx, &v1.Service{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: config.ConfigMapPodTrafficManager, Name: config.ConfigMapPodTrafficManager,
@@ -179,6 +180,11 @@ func createOutboundPod(ctx context.Context, factory cmdutil.Factory, clientset *
Protocol: v1.ProtocolTCP, Protocol: v1.ProtocolTCP,
Port: 80, Port: 80,
TargetPort: intstr.FromInt32(80), TargetPort: intstr.FromInt32(80),
}, {
Name: udp53,
Protocol: v1.ProtocolUDP,
Port: 53,
TargetPort: intstr.FromInt32(53),
}}, }},
Selector: map[string]string{"app": config.ConfigMapPodTrafficManager}, Selector: map[string]string{"app": config.ConfigMapPodTrafficManager},
Type: v1.ServiceTypeClusterIP, Type: v1.ServiceTypeClusterIP,
@@ -346,11 +352,18 @@ kubevpn serve -L "tcp://:10800" -L "tun://:8422?net=${TunIPv4}" -L "gtcp://:1080
Image: config.Image, Image: config.Image,
Command: []string{"kubevpn"}, Command: []string{"kubevpn"},
Args: []string{"control-plane", "--watchDirectoryFilename", "/etc/envoy/envoy-config.yaml"}, Args: []string{"control-plane", "--watchDirectoryFilename", "/etc/envoy/envoy-config.yaml"},
Ports: []v1.ContainerPort{{ Ports: []v1.ContainerPort{
{
Name: tcp9002, Name: tcp9002,
ContainerPort: 9002, ContainerPort: 9002,
Protocol: v1.ProtocolTCP, Protocol: v1.ProtocolTCP,
}}, },
{
Name: udp53,
ContainerPort: 53,
Protocol: v1.ProtocolUDP,
},
},
VolumeMounts: []v1.VolumeMount{ VolumeMounts: []v1.VolumeMount{
{ {
Name: config.VolumeEnvoyConfig, Name: config.VolumeEnvoyConfig,
@@ -389,12 +402,18 @@ kubevpn serve -L "tcp://:10800" -L "tun://:8422?net=${TunIPv4}" -L "gtcp://:1080
}, },
}, },
} }
if _, err = clientset.AppsV1().Deployments(namespace).Create(ctx, deployment, metav1.CreateOptions{}); err != nil { deployment, err = clientset.AppsV1().Deployments(namespace).Create(ctx, deployment, metav1.CreateOptions{})
if err != nil {
log.Errorf("Failed to create deployment for %s: %v", config.ConfigMapPodTrafficManager, err) log.Errorf("Failed to create deployment for %s: %v", config.ConfigMapPodTrafficManager, err)
return err return err
} }
str := fields.OneTermEqualSelector("app", config.ConfigMapPodTrafficManager).String()
_, selector, err := polymorphichelpers.SelectorsForObject(deployment)
if err == nil {
str = selector.String()
}
watchStream, err := clientset.CoreV1().Pods(namespace).Watch(ctx, metav1.ListOptions{ watchStream, err := clientset.CoreV1().Pods(namespace).Watch(ctx, metav1.ListOptions{
LabelSelector: fields.OneTermEqualSelector("app", config.ConfigMapPodTrafficManager).String(), LabelSelector: str,
}) })
if err != nil { if err != nil {
log.Errorf("Failed to create watch for %s: %v", config.ConfigMapPodTrafficManager, err) log.Errorf("Failed to create watch for %s: %v", config.ConfigMapPodTrafficManager, err)

View File

@@ -3,6 +3,7 @@ package util
import ( import (
"bytes" "bytes"
"context" "context"
"fmt"
"github.com/miekg/dns" "github.com/miekg/dns"
"github.com/pkg/errors" "github.com/pkg/errors"
@@ -12,27 +13,34 @@ import (
"k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
"k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg/cmd/util"
"github.com/wencaiwulue/kubevpn/v2/pkg/config"
) )
func GetDNSServiceIPFromPod(ctx context.Context, clientset *kubernetes.Clientset, restclient *rest.RESTClient, config *rest.Config, podName, namespace string) (*dns.ClientConfig, error) { func GetDNSServiceIPFromPod(ctx context.Context, clientset *kubernetes.Clientset, restclient *rest.RESTClient, config *rest.Config, podName, namespace string) (*dns.ClientConfig, error) {
resolvConfStr, err := Shell(ctx, clientset, restclient, config, podName, "", namespace, []string{"cat", "/etc/resolv.conf"}) str, err := Shell(ctx, clientset, restclient, config, podName, "", namespace, []string{"cat", "/etc/resolv.conf"})
if err != nil { if err != nil {
return nil, err return nil, err
} }
resolvConf, err := dns.ClientConfigFromReader(bytes.NewBufferString(resolvConfStr)) resolvConf, err := dns.ClientConfigFromReader(bytes.NewBufferString(str))
if err != nil { if err == nil {
return nil, err
}
if ips, err := GetDNSIPFromDnsPod(ctx, clientset); err == nil && len(ips) != 0 {
resolvConf.Servers = ips
}
// linux nameserver only support amount is 3, so if namespace too much, just use two, left one to system
if len(resolvConf.Servers) > 2 {
resolvConf.Servers = resolvConf.Servers[:2]
}
return resolvConf, nil return resolvConf, nil
}
ips, err := GetDNSIPFromDnsPod(ctx, clientset)
if err != nil {
return nil, err
}
clientConfig := dns.ClientConfig{
Servers: ips,
Search: []string{
fmt.Sprintf("%s.svc.cluster.local", namespace),
"svc.cluster.local",
"cluster.local",
},
Ndots: 5,
}
return &clientConfig, nil
} }
func GetDNSIPFromDnsPod(ctx context.Context, clientset *kubernetes.Clientset) (ips []string, err error) { func GetDNSIPFromDnsPod(ctx context.Context, clientset *kubernetes.Clientset) (ips []string, err error) {
@@ -76,7 +84,7 @@ func GetDNS(ctx context.Context, f util.Factory, ns, pod string) (*dns.ClientCon
if err != nil { if err != nil {
return nil, err return nil, err
} }
config, err := f.ToRESTConfig() restConfig, err := f.ToRESTConfig()
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -86,9 +94,14 @@ func GetDNS(ctx context.Context, f util.Factory, ns, pod string) (*dns.ClientCon
return nil, err return nil, err
} }
clientConfig, err := GetDNSServiceIPFromPod(ctx, clientSet, client, config, pod, ns) clientConfig, err := GetDNSServiceIPFromPod(ctx, clientSet, client, restConfig, pod, ns)
if err != nil { if err != nil {
return nil, err return nil, err
} }
svc, err := clientSet.CoreV1().Services(ns).Get(ctx, config.ConfigMapPodTrafficManager, v12.GetOptions{})
if err != nil {
return nil, err
}
clientConfig.Servers = []string{svc.Spec.ClusterIP}
return clientConfig, nil return clientConfig, nil
} }

View File

@@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"net" "net"
"strings" "strings"
"time"
"github.com/containernetworking/cni/libcni" "github.com/containernetworking/cni/libcni"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
@@ -276,7 +277,9 @@ func CreateCIDRPod(ctx context.Context, clientset *kubernetes.Clientset, namespa
return isRunning return isRunning
} }
field := fields.OneTermEqualSelector("metadata.name", pod.Name).String() field := fields.OneTermEqualSelector("metadata.name", pod.Name).String()
err = WaitPod(ctx, clientset.CoreV1().Pods(namespace), v1.ListOptions{FieldSelector: field}, checker) ctx2, cancelFunc := context.WithTimeout(ctx, time.Second*30)
defer cancelFunc()
err = WaitPod(ctx2, clientset.CoreV1().Pods(namespace), v1.ListOptions{FieldSelector: field}, checker)
if err != nil { if err != nil {
fmt.Printf("wait pod %s to be running timeout, reason %s, ignore\r\n", pod.Name, pod.Status.Reason) fmt.Printf("wait pod %s to be running timeout, reason %s, ignore\r\n", pod.Name, pod.Status.Reason)
return nil, err return nil, err

View File

@@ -148,9 +148,7 @@ func Heartbeats() {
} }
func WaitPod(ctx context.Context, podInterface v12.PodInterface, list v1.ListOptions, checker func(*corev1.Pod) bool) error { func WaitPod(ctx context.Context, podInterface v12.PodInterface, list v1.ListOptions, checker func(*corev1.Pod) bool) error {
ctx2, cancelFunc := context.WithTimeout(ctx, time.Second*30) w, err := podInterface.Watch(ctx, list)
defer cancelFunc()
w, err := podInterface.Watch(ctx2, list)
if err != nil { if err != nil {
return err return err
} }