diff --git a/client/cmd/debug.go b/client/cmd/debug.go index 1a3688e1d..ed8286fdf 100644 --- a/client/cmd/debug.go +++ b/client/cmd/debug.go @@ -378,7 +378,7 @@ func generateDebugBundle(config *profilemanager.Config, recorder *peer.Status, c InternalConfig: config, StatusRecorder: recorder, SyncResponse: syncResponse, - LogFile: logFilePath, + LogPath: logFilePath, }, debug.BundleConfig{ IncludeSystemInfo: true, diff --git a/client/internal/connect.go b/client/internal/connect.go index e85af42b1..33464a737 100644 --- a/client/internal/connect.go +++ b/client/internal/connect.go @@ -62,8 +62,8 @@ func NewConnectClient( } // Run with main logic. -func (c *ConnectClient) Run(runningChan chan struct{}, logFile string) error { - return c.run(MobileDependency{}, runningChan, logFile) +func (c *ConnectClient) Run(runningChan chan struct{}, logPath string) error { + return c.run(MobileDependency{}, runningChan, logPath) } // RunOnAndroid with main logic on mobile system @@ -103,7 +103,7 @@ func (c *ConnectClient) RunOniOS( return c.run(mobileDependency, nil, "") } -func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan struct{}, logFile string) error { +func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan struct{}, logPath string) error { defer func() { if r := recover(); r != nil { rec := c.statusRecorder @@ -246,7 +246,7 @@ func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan relayURLs, token := parseRelayInfo(loginResp) peerConfig := loginResp.GetPeerConfig() - engineConfig, err := createEngineConfig(myPrivateKey, c.config, peerConfig, logFile) + engineConfig, err := createEngineConfig(myPrivateKey, c.config, peerConfig, logPath) if err != nil { log.Error(err) return wrapErr(err) @@ -413,7 +413,7 @@ func (c *ConnectClient) SetSyncResponsePersistence(enabled bool) { } // createEngineConfig converts configuration received from Management Service to EngineConfig -func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConfig *mgmProto.PeerConfig, logFile string) (*EngineConfig, error) { +func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConfig *mgmProto.PeerConfig, logPath string) (*EngineConfig, error) { nm := false if config.NetworkMonitor != nil { nm = *config.NetworkMonitor @@ -444,7 +444,7 @@ func createEngineConfig(key wgtypes.Key, config *profilemanager.Config, peerConf LazyConnectionEnabled: config.LazyConnectionEnabled, MTU: selectMTU(config.MTU, peerConfig.Mtu), - LogFile: logFile, + LogPath: logPath, ProfileConfig: config, } diff --git a/client/internal/debug/debug.go b/client/internal/debug/debug.go index 442f54e71..cec8a45de 100644 --- a/client/internal/debug/debug.go +++ b/client/internal/debug/debug.go @@ -202,7 +202,7 @@ type BundleGenerator struct { internalConfig *profilemanager.Config statusRecorder *peer.Status syncResponse *mgmProto.SyncResponse - logFile string + logPath string anonymize bool clientStatus string @@ -223,7 +223,7 @@ type GeneratorDependencies struct { InternalConfig *profilemanager.Config StatusRecorder *peer.Status SyncResponse *mgmProto.SyncResponse - LogFile string + LogPath string } func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGenerator { @@ -239,7 +239,7 @@ func NewBundleGenerator(deps GeneratorDependencies, cfg BundleConfig) *BundleGen internalConfig: deps.InternalConfig, statusRecorder: deps.StatusRecorder, syncResponse: deps.SyncResponse, - logFile: deps.LogFile, + logPath: deps.LogPath, anonymize: cfg.Anonymize, clientStatus: cfg.ClientStatus, @@ -327,7 +327,7 @@ func (g *BundleGenerator) createArchive() error { log.Errorf("failed to add wg show output: %v", err) } - if g.logFile != "" && !slices.Contains(util.SpecialLogs, g.logFile) { + if g.logPath != "" && !slices.Contains(util.SpecialLogs, g.logPath) { if err := g.addLogfile(); err != nil { log.Errorf("failed to add log file to debug bundle: %v", err) if err := g.trySystemdLogFallback(); err != nil { @@ -630,14 +630,14 @@ func (g *BundleGenerator) addCorruptedStateFiles() error { } func (g *BundleGenerator) addLogfile() error { - if g.logFile == "" { + if g.logPath == "" { log.Debugf("skipping empty log file in debug bundle") return nil } - logDir := filepath.Dir(g.logFile) + logDir := filepath.Dir(g.logPath) - if err := g.addSingleLogfile(g.logFile, clientLogFile); err != nil { + if err := g.addSingleLogfile(g.logPath, clientLogFile); err != nil { return fmt.Errorf("add client log file to zip: %w", err) } diff --git a/client/internal/engine.go b/client/internal/engine.go index e061408cc..df7511b75 100644 --- a/client/internal/engine.go +++ b/client/internal/engine.go @@ -137,7 +137,7 @@ type EngineConfig struct { // for debug bundle generation ProfileConfig *profilemanager.Config - LogFile string + LogPath string } // Engine is a mechanism responsible for reacting on Signal and Management stream events and managing connections to the remote peers. @@ -1016,7 +1016,7 @@ func (e *Engine) handleBundle(params *mgmProto.BundleParameters) (*mgmProto.JobR InternalConfig: e.config.ProfileConfig, StatusRecorder: e.statusRecorder, SyncResponse: syncResponse, - LogFile: e.config.LogFile, + LogPath: e.config.LogPath, } bundleJobParams := debug.BundleConfig{ diff --git a/client/server/debug.go b/client/server/debug.go index 330b476e6..0284bc1f1 100644 --- a/client/server/debug.go +++ b/client/server/debug.go @@ -29,7 +29,7 @@ func (s *Server) DebugBundle(_ context.Context, req *proto.DebugBundleRequest) ( InternalConfig: s.config, StatusRecorder: s.statusRecorder, SyncResponse: syncResponse, - LogFile: s.logFile, + LogPath: s.logFile, }, debug.BundleConfig{ Anonymize: req.GetAnonymize(),