mirror of
https://github.com/openziti/zrok.git
synced 2025-06-26 12:42:18 +02:00
disable the agent console (#976)
This commit is contained in:
parent
c161e68c68
commit
bb506cf01a
@ -2,6 +2,10 @@ package agent
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"net"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||||
"github.com/openziti/zrok/agent/agentGrpc"
|
"github.com/openziti/zrok/agent/agentGrpc"
|
||||||
"github.com/openziti/zrok/agent/agentUi"
|
"github.com/openziti/zrok/agent/agentUi"
|
||||||
@ -13,9 +17,6 @@ import (
|
|||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
"net"
|
|
||||||
"net/http"
|
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Agent struct {
|
type Agent struct {
|
||||||
@ -66,7 +67,9 @@ func (a *Agent) Run() error {
|
|||||||
a.agentSocket = agentSocket
|
a.agentSocket = agentSocket
|
||||||
|
|
||||||
go a.manager()
|
go a.manager()
|
||||||
|
if a.cfg.ConsoleEnabled {
|
||||||
go a.gateway()
|
go a.gateway()
|
||||||
|
}
|
||||||
go a.remoteAgent()
|
go a.remoteAgent()
|
||||||
|
|
||||||
a.persistRegistry = false
|
a.persistRegistry = false
|
||||||
|
@ -4,6 +4,7 @@ type AgentConfig struct {
|
|||||||
ConsoleAddress string
|
ConsoleAddress string
|
||||||
ConsoleStartPort uint16
|
ConsoleStartPort uint16
|
||||||
ConsoleEndPort uint16
|
ConsoleEndPort uint16
|
||||||
|
ConsoleEnabled bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func DefaultConfig() *AgentConfig {
|
func DefaultConfig() *AgentConfig {
|
||||||
@ -11,5 +12,6 @@ func DefaultConfig() *AgentConfig {
|
|||||||
ConsoleAddress: "127.0.0.1",
|
ConsoleAddress: "127.0.0.1",
|
||||||
ConsoleStartPort: 8080,
|
ConsoleStartPort: 8080,
|
||||||
ConsoleEndPort: 8181,
|
ConsoleEndPort: 8181,
|
||||||
|
ConsoleEnabled: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/openziti/zrok/agent"
|
"github.com/openziti/zrok/agent"
|
||||||
"github.com/openziti/zrok/environment"
|
"github.com/openziti/zrok/environment"
|
||||||
"github.com/openziti/zrok/tui"
|
"github.com/openziti/zrok/tui"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"os"
|
|
||||||
"os/signal"
|
|
||||||
"syscall"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -54,7 +55,7 @@ func (cmd *agentStartCommand) run(_ *cobra.Command, _ []string) {
|
|||||||
tui.Error("error creating agent", err)
|
tui.Error("error creating agent", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
c := make(chan os.Signal)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||||
go func() {
|
go func() {
|
||||||
<-c
|
<-c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user