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 (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/openziti/zrok/agent/agentGrpc"
|
||||
"github.com/openziti/zrok/agent/agentUi"
|
||||
@ -13,9 +17,6 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
type Agent struct {
|
||||
@ -66,7 +67,9 @@ func (a *Agent) Run() error {
|
||||
a.agentSocket = agentSocket
|
||||
|
||||
go a.manager()
|
||||
go a.gateway()
|
||||
if a.cfg.ConsoleEnabled {
|
||||
go a.gateway()
|
||||
}
|
||||
go a.remoteAgent()
|
||||
|
||||
a.persistRegistry = false
|
||||
|
@ -4,6 +4,7 @@ type AgentConfig struct {
|
||||
ConsoleAddress string
|
||||
ConsoleStartPort uint16
|
||||
ConsoleEndPort uint16
|
||||
ConsoleEnabled bool
|
||||
}
|
||||
|
||||
func DefaultConfig() *AgentConfig {
|
||||
@ -11,5 +12,6 @@ func DefaultConfig() *AgentConfig {
|
||||
ConsoleAddress: "127.0.0.1",
|
||||
ConsoleStartPort: 8080,
|
||||
ConsoleEndPort: 8181,
|
||||
ConsoleEnabled: true,
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"github.com/openziti/zrok/agent"
|
||||
"github.com/openziti/zrok/environment"
|
||||
"github.com/openziti/zrok/tui"
|
||||
"github.com/spf13/cobra"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -54,7 +55,7 @@ func (cmd *agentStartCommand) run(_ *cobra.Command, _ []string) {
|
||||
tui.Error("error creating agent", err)
|
||||
}
|
||||
|
||||
c := make(chan os.Signal)
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
go func() {
|
||||
<-c
|
||||
|
Loading…
x
Reference in New Issue
Block a user