From 8cc68235337170bfebf1bed350f13d918b84634b Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Thu, 5 Feb 2026 12:08:47 +0100 Subject: [PATCH] Agent parameter logic fix --- .../Configuration/AgentConfiguration.cs | 2 +- src/Agent/AutopilotMonitor.Agent/Program.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Agent/AutopilotMonitor.Agent.Core/Configuration/AgentConfiguration.cs b/src/Agent/AutopilotMonitor.Agent.Core/Configuration/AgentConfiguration.cs index cd0ed901..b02cb2c3 100644 --- a/src/Agent/AutopilotMonitor.Agent.Core/Configuration/AgentConfiguration.cs +++ b/src/Agent/AutopilotMonitor.Agent.Core/Configuration/AgentConfiguration.cs @@ -95,7 +95,7 @@ namespace AutopilotMonitor.Agent.Core.Configuration /// /// Whether to enable geo-location detection (queries external IP services) /// - public bool EnableGeoLocation { get; set; } = false; + public bool EnableGeoLocation { get; set; } = true; /// /// Validates the configuration diff --git a/src/Agent/AutopilotMonitor.Agent/Program.cs b/src/Agent/AutopilotMonitor.Agent/Program.cs index 169cbab4..411e7970 100644 --- a/src/Agent/AutopilotMonitor.Agent/Program.cs +++ b/src/Agent/AutopilotMonitor.Agent/Program.cs @@ -102,7 +102,7 @@ namespace AutopilotMonitor.Agent var noAuth = args?.Contains("--no-auth") ?? false; var noCleanup = args?.Contains("--no-cleanup") ?? false; var rebootOnComplete = args?.Contains("--reboot-on-complete") ?? false; - var enableGeoLocation = args?.Contains("--enable-geolocation") ?? false; + var disableGeoLocation = args?.Contains("--disable-geolocation") ?? false; // Parse certificate thumbprint if provided string certThumbprint = null; @@ -128,7 +128,7 @@ namespace AutopilotMonitor.Agent bool cleanupOnExit = true; bool selfDestructOnComplete = true; bool rebootOnCompleteConfig = false; - bool enableGeoLocationConfig = false; + bool enableGeoLocationConfig = true; bool useClientCertAuthConfig = true; // Try to load configuration from JSON file (written by PowerShell bootstrap script) @@ -206,7 +206,7 @@ namespace AutopilotMonitor.Agent CleanupOnExit = cleanupOnExit, SelfDestructOnComplete = selfDestructOnComplete, RebootOnComplete = rebootOnComplete || rebootOnCompleteConfig, - EnableGeoLocation = enableGeoLocation || enableGeoLocationConfig + EnableGeoLocation = !disableGeoLocation && enableGeoLocationConfig }; } }