Skip to content

Commit

Permalink
Merge pull request #167 from smnzlnsk/remove-playground
Browse files Browse the repository at this point in the history
Remove obsolete/unused playground
  • Loading branch information
giobart authored Jul 5, 2024
2 parents f643429 + 2690ce4 commit bf62b02
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1,589 deletions.
26 changes: 10 additions & 16 deletions node-net-manager/NetManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"NetManager/logger"
"NetManager/mqtt"
"NetManager/network"
"NetManager/playground"
"NetManager/proxy"
"encoding/json"
"flag"
Expand Down Expand Up @@ -49,10 +48,12 @@ func handleRequests(port int) {
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), netRouter))
}

var Env env.Environment
var Proxy proxy.GoProxyTunnel
var WorkerID string
var Configuration netConfiguration
var (
Env env.Environment
Proxy proxy.GoProxyTunnel
WorkerID string
Configuration netConfiguration
)

/*
DEPRECATED
Expand Down Expand Up @@ -104,7 +105,7 @@ func register(writer http.ResponseWriter, request *http.Request) {
}
log.Println(requestStruct)

//drop the request if the node is already initialized
// drop the request if the node is already initialized
if WorkerID != "" {
if WorkerID == requestStruct.ClientID {
log.Printf("Node already initialized")
Expand All @@ -118,14 +119,14 @@ func register(writer http.ResponseWriter, request *http.Request) {

WorkerID = requestStruct.ClientID

//initialize mqtt connection to the broker
// initialize mqtt connection to the broker
mqtt.InitNetMqttClient(requestStruct.ClientID, Configuration.ClusterUrl, Configuration.ClusterMqttPort)

//initialize the proxy tunnel
// initialize the proxy tunnel
Proxy = proxy.New()
Proxy.Listen()

//initialize the Env Manager
// initialize the Env Manager
Env = *env.NewEnvironmentClusterConfigured(Proxy.HostTUNDeviceName)

Proxy.SetEnvironment(&Env)
Expand All @@ -134,11 +135,9 @@ func register(writer http.ResponseWriter, request *http.Request) {
}

func main() {

cfgFile := flag.String("cfg", "/etc/netmanager/netcfg.json", "Set a cluster IP")
localPort := flag.Int("p", 6000, "Default local port of the NetManager")
debugMode := flag.Bool("D", false, "Debug mode, it enables debug-level logs")
p2pMode := flag.Bool("p2p", false, "Start the engine in p2p mode (playground2playground), requires the address of a peer node. Useful for debugging.")
flag.Parse()

err := gonfig.GetConf(*cfgFile, &Configuration)
Expand All @@ -154,11 +153,6 @@ func main() {

network.IptableFlushAll()

if *p2pMode {
defer playground.APP.Stop()
playground.CliLoop(Configuration.NodePublicAddress, Configuration.NodePublicPort)
}

log.Println("NetManager started. Waiting for registration.")
handleRequests(*localPort)
}
52 changes: 0 additions & 52 deletions node-net-manager/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ module NetManager
go 1.22.0

require (
github.com/containerd/containerd v1.7.13
github.com/coreos/go-iptables v0.7.0
github.com/eclipse/paho.mqtt.golang v1.4.3
github.com/gdamore/tcell/v2 v2.7.4
github.com/google/gopacket v1.1.19
github.com/gorilla/mux v1.8.1
github.com/opencontainers/runtime-spec v1.2.0
github.com/rivo/tview v0.0.0-20240225120200-5605142ca62e
github.com/sipcapture/heplify v1.65.16
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
github.com/tkanos/gonfig v0.0.0-20210106201359-53e13348de2f
Expand All @@ -21,58 +17,16 @@ require (
)

require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20231105174938-2b5cbb29f3e2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.12.0 // indirect
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
github.com/containerd/continuity v0.4.3 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/ttrpc v1.2.3 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/dblohm7/wingoes v0.0.0-20240123200102-b75a8a7d7eb0 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect
github.com/jsimonetti/rtnetlink v1.4.1 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mdlayher/netlink v1.7.2 // indirect
github.com/mdlayher/socket v0.5.0 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runc v1.1.12 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/crypto v0.21.0 // indirect
Expand All @@ -81,13 +35,7 @@ require (
golang.org/x/net v0.22.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.19.0 // indirect
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
google.golang.org/genproto v0.0.0-20240304212257-790db918fca8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit bf62b02

Please sign in to comment.