From 92cedd00b3aadbfdf88d00fdf88f0fd64d2f6e67 Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 15 Sep 2025 10:58:40 -0700 Subject: [PATCH] Quiet up the logs --- blueprint.yaml | 37 +++++++++++++++++++++++++++++++++++++ healthcheck/healthcheck.go | 2 +- main.go | 14 +++++++------- 3 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 blueprint.yaml diff --git a/blueprint.yaml b/blueprint.yaml new file mode 100644 index 0000000..5c979d1 --- /dev/null +++ b/blueprint.yaml @@ -0,0 +1,37 @@ +resources: + resource-nice-id: + name: this is my resource + protocol: http + full-domain: level1.test3.example.com + host-header: example.com + tls-server-name: example.com + auth: + pincode: 123456 + password: sadfasdfadsf + sso-enabled: true + sso-roles: + - Member + sso-users: + - owen@fossorial.io + whitelist-users: + - owen@fossorial.io + targets: + # - site: glossy-plains-viscacha-rat + - hostname: localhost + method: http + port: 8000 + healthcheck: + port: 8000 + hostname: localhost + # - site: glossy-plains-viscacha-rat + - hostname: localhost + method: http + port: 8001 + resource-nice-id2: + name: this is other resource + protocol: tcp + proxy-port: 3000 + targets: + # - site: glossy-plains-viscacha-rat + - hostname: localhost + port: 3000 \ No newline at end of file diff --git a/healthcheck/healthcheck.go b/healthcheck/healthcheck.go index 9cce0f9..49ac718 100644 --- a/healthcheck/healthcheck.go +++ b/healthcheck/healthcheck.go @@ -76,7 +76,7 @@ type Monitor struct { // NewMonitor creates a new health check monitor func NewMonitor(callback StatusChangeCallback, enforceCert bool) *Monitor { - logger.Info("Creating new health check monitor with certificate enforcement: %t", enforceCert) + logger.Debug("Creating new health check monitor with certificate enforcement: %t", enforceCert) // Configure TLS settings based on certificate enforcement transport := &http.Transport{ diff --git a/main.go b/main.go index 30a30e9..33b55a5 100644 --- a/main.go +++ b/main.go @@ -478,7 +478,7 @@ func main() { // Register handlers for different message types client.RegisterHandler("newt/wg/connect", func(msg websocket.WSMessage) { - logger.Info("Received registration message") + logger.Debug("Received registration message") if stopFunc != nil { stopFunc() // stop the ws from sending more requests stopFunc = nil // reset stopFunc to nil to avoid double stopping @@ -571,7 +571,7 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub if err != nil { logger.Warn("Initial reliable ping failed, but continuing: %v", err) } else { - logger.Info("Initial connection test successful") + logger.Debug("Initial connection test successful") } pingWithRetryStopChan, _ = pingWithRetry(tnet, wgData.ServerIP, pingTimeout) @@ -610,7 +610,7 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub if err := healthMonitor.AddTargets(wgData.HealthCheckTargets); err != nil { logger.Error("Failed to bulk add health check targets: %v", err) } else { - logger.Info("Successfully added %d health check targets", len(wgData.HealthCheckTargets)) + logger.Debug("Successfully added %d health check targets", len(wgData.HealthCheckTargets)) } err = pm.Start() @@ -657,7 +657,7 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub }) client.RegisterHandler("newt/ping/exitNodes", func(msg websocket.WSMessage) { - logger.Info("Received ping message") + logger.Debug("Received ping message") if stopFunc != nil { stopFunc() // stop the ws from sending more requests stopFunc = nil // reset stopFunc to nil to avoid double stopping @@ -979,7 +979,7 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub if err != nil { logger.Error("Failed to send Docker container list: %v", err) } else { - logger.Info("Docker container list sent, count: %d", len(containers)) + logger.Debug("Docker container list sent, count: %d", len(containers)) } }) @@ -1095,7 +1095,7 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub if err := healthMonitor.AddTargets(config.Targets); err != nil { logger.Error("Failed to add health check targets: %v", err) } else { - logger.Info("Added %d health check targets", len(config.Targets)) + logger.Debug("Added %d health check targets", len(config.Targets)) } logger.Debug("Health check targets added: %+v", config.Targets) @@ -1238,7 +1238,7 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub } // request from the server the list of nodes to ping at newt/ping/request stopFunc = client.SendMessageInterval("newt/ping/request", map[string]interface{}{}, 3*time.Second) - logger.Info("Requesting exit nodes from server") + logger.Debug("Requesting exit nodes from server") clientsOnConnect() }