Skip to content
Snippets Groups Projects
Commit 63bb2b26 authored by Malte Bauch's avatar Malte Bauch
Browse files

Add path and controller flags

parent b8972fdc
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,7 @@ generate-csbi-yang-models: install-tools ...@@ -56,7 +56,7 @@ generate-csbi-yang-models: install-tools
../../$(TOOLS_DIR)/go-ygot-generator-generator config.yaml gostructs.go &&\ ../../$(TOOLS_DIR)/go-ygot-generator-generator config.yaml gostructs.go &&\
go generate go generate
build: pre build-gosdn build-gosdnc build-orchestrator build-venv-manager build-arista-routing-engine-app build-hostname-checker-app build: pre build-gosdn build-gosdnc build-orchestrator build-venv-manager build-arista-routing-engine-app build-hostname-checker-app build-basic-interface-monitoring-app
build-gosdn: pre build-gosdn: pre
$(GOBUILD) -trimpath -o $(BUILD_ARTIFACTS_PATH)/gosdn ./controller/cmd/gosdn $(GOBUILD) -trimpath -o $(BUILD_ARTIFACTS_PATH)/gosdn ./controller/cmd/gosdn
...@@ -76,6 +76,9 @@ build-arista-routing-engine-app: pre ...@@ -76,6 +76,9 @@ build-arista-routing-engine-app: pre
build-hostname-checker-app: pre build-hostname-checker-app: pre
$(GOBUILD) -trimpath -o $(BUILD_ARTIFACTS_PATH)/hostname-checker ./applications/hostname-checker $(GOBUILD) -trimpath -o $(BUILD_ARTIFACTS_PATH)/hostname-checker ./applications/hostname-checker
build-basic-interface-monitoring-app: pre
$(GOBUILD) -trimpath -o $(BUILD_ARTIFACTS_PATH)/basic-interface-monitoring ./applications/basic-interface-monitoring
containerize-all: containerize-gosdn containerize-gosdnc containerize-orchestrator containerize-target containerize-all: containerize-gosdn containerize-gosdnc containerize-orchestrator containerize-target
containerize-gosdn: containerize-gosdn:
......
...@@ -12,7 +12,7 @@ var clientChannels = make(map[chan []byte]bool) ...@@ -12,7 +12,7 @@ var clientChannels = make(map[chan []byte]bool)
// StartHTTPServer starts the HTTP server to provide the monitoring page. // StartHTTPServer starts the HTTP server to provide the monitoring page.
func StartHTTPServer() error { func StartHTTPServer() error {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "webpage/index.html") http.ServeFile(w, r, indexPath)
}) })
http.HandleFunc("/sse", sseHandler) http.HandleFunc("/sse", sseHandler)
......
package main package main
import ( import (
"flag"
"os" "os"
"code.fbi.h-da.de/danet/gosdn/application-framework/event" "code.fbi.h-da.de/danet/gosdn/application-framework/event"
...@@ -8,8 +9,16 @@ import ( ...@@ -8,8 +9,16 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
var controllerAddress string
var indexPath string
func main() { func main() {
queueCredentials, err := registration.Register("localhost:55055", "basic-interface-monitoring", "SecurePresharedToken") flag.StringVar(&indexPath, "path", "webpage/index.html", "path to the webpage index.html file")
flag.StringVar(&controllerAddress, "controller-address", "localhost:55055", "the address to the controller")
flag.Parse()
queueCredentials, err := registration.Register(controllerAddress, "basic-interface-monitoring", "SecurePresharedToken")
if err != nil { if err != nil {
logrus.Errorf("failed to register application on control plane. %v", err) logrus.Errorf("failed to register application on control plane. %v", err)
os.Exit(1) os.Exit(1)
...@@ -29,5 +38,5 @@ func main() { ...@@ -29,5 +38,5 @@ func main() {
stopChannel: make(chan os.Signal, 1), stopChannel: make(chan os.Signal, 1),
} }
app.Run("localhost:55055") app.Run(controllerAddress)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment