From 11062152413ac6176987f402438227591dded93a Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Tue, 30 Dec 2025 23:45:34 -0600 Subject: [PATCH] feat: improve WebSocket interface logging and remove default interface configuration --- cmd/reticulum-go/main.go | 41 ++++++---------------------------------- 1 file changed, 6 insertions(+), 35 deletions(-) diff --git a/cmd/reticulum-go/main.go b/cmd/reticulum-go/main.go index 2a71b31..6596aa6 100644 --- a/cmd/reticulum-go/main.go +++ b/cmd/reticulum-go/main.go @@ -198,7 +198,13 @@ func NewReticulum(cfg *common.ReticulumConfig) (*Reticulum, error) { if wsURL == "" { wsURL = ifaceConfig.TargetHost } + debug.Log(debug.DEBUG_INFO, "Creating WebSocket interface", common.STR_NAME, name, "url", wsURL, "enabled", ifaceConfig.Enabled) iface, err = interfaces.NewWebSocketInterface(name, wsURL, ifaceConfig.Enabled) + if err != nil { + debug.Log(debug.DEBUG_ERROR, "Failed to create WebSocket interface", common.STR_NAME, name, common.STR_ERROR, err) + } else { + debug.Log(debug.DEBUG_INFO, "WebSocket interface created successfully", common.STR_NAME, name) + } default: debug.Log(debug.DEBUG_CRITICAL, "Unknown interface type", common.STR_TYPE, ifaceConfig.Type) continue @@ -295,41 +301,6 @@ func main() { } debug.Log(debug.DEBUG_ERROR, "Configuration loaded", "path", cfg.ConfigPath) - if len(cfg.Interfaces) == 0 { - debug.Log(debug.DEBUG_ERROR, "No interfaces configured, adding default interfaces") - cfg.Interfaces = make(map[string]*common.InterfaceConfig) - - // Auto interface for local discovery - cfg.Interfaces["Auto Discovery"] = &common.InterfaceConfig{ - Type: "AutoInterface", - Enabled: true, - Name: "Auto Discovery", - } - - cfg.Interfaces["Go-RNS-Testnet"] = &common.InterfaceConfig{ - Type: common.STR_TCP_CLIENT, - Enabled: false, - TargetHost: "127.0.0.1", - TargetPort: common.NUM_4242, - Name: "Go-RNS-Testnet", - } - - cfg.Interfaces["Quad4 TCP"] = &common.InterfaceConfig{ - Type: common.STR_TCP_CLIENT, - Enabled: true, - TargetHost: "rns2.quad4.io", - TargetPort: common.NUM_4242, - Name: "Quad4 TCP", - } - - cfg.Interfaces["Quad4 WebSocket"] = &common.InterfaceConfig{ - Type: "WebSocketInterface", - Enabled: true, - Address: "wss://socket.quad4.io/ws", - Name: "Quad4 WebSocket", - } - } - r, err := NewReticulum(cfg) if err != nil { debug.GetLogger().Error("Failed to create Reticulum instance", common.STR_ERROR, err)