Compare commits

..

1 Commits

Author SHA1 Message Date
76b6e3373e Change auto connection type to prioritize local IP first
All checks were successful
Build and Release / build-and-release (push) Successful in 2m36s
Update the auto connection type logic to try local network connections
before falling back to Tailscale. This provides better performance by
using faster local connections when available while maintaining Tailscale
as a reliable fallback.

Changes:
- Auto connection priority: local → tailscale → hostname (was tailscale → local)
- Fallback retry order updated to match new priority
- Supports omitting IP field in config for hosts without static local IP
2025-11-13 12:52:46 +01:00
5 changed files with 17 additions and 16 deletions

6
Cargo.lock generated
View File

@@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
[[package]]
name = "cm-dashboard"
version = "0.1.67"
version = "0.1.68"
dependencies = [
"anyhow",
"chrono",
@@ -292,7 +292,7 @@ dependencies = [
[[package]]
name = "cm-dashboard-agent"
version = "0.1.67"
version = "0.1.68"
dependencies = [
"anyhow",
"async-trait",
@@ -315,7 +315,7 @@ dependencies = [
[[package]]
name = "cm-dashboard-shared"
version = "0.1.67"
version = "0.1.68"
dependencies = [
"chrono",
"serde",

View File

@@ -1,6 +1,6 @@
[package]
name = "cm-dashboard-agent"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
[dependencies]

View File

@@ -1,6 +1,6 @@
[package]
name = "cm-dashboard"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
[dependencies]

View File

@@ -62,11 +62,11 @@ impl HostDetails {
}
}
"auto" | _ => {
// Try tailscale first, then local, then hostname
if let Some(ref ts_ip) = self.tailscale_ip {
ts_ip.clone()
} else if let Some(ref local_ip) = self.ip {
// Try local first, then tailscale, then hostname
if let Some(ref local_ip) = self.ip {
local_ip.clone()
} else if let Some(ref ts_ip) = self.tailscale_ip {
ts_ip.clone()
} else {
hostname.to_string()
}
@@ -81,18 +81,19 @@ impl HostDetails {
// Add all available IPs except the primary one
let primary = self.get_connection_ip(hostname);
if let Some(ref ts_ip) = self.tailscale_ip {
if ts_ip != &primary {
fallbacks.push(ts_ip.clone());
}
}
// Add fallbacks in priority order: local first, then tailscale
if let Some(ref local_ip) = self.ip {
if local_ip != &primary {
fallbacks.push(local_ip.clone());
}
}
if let Some(ref ts_ip) = self.tailscale_ip {
if ts_ip != &primary {
fallbacks.push(ts_ip.clone());
}
}
// Always include hostname as final fallback if not already primary
if hostname != primary {
fallbacks.push(hostname.to_string());

View File

@@ -1,6 +1,6 @@
[package]
name = "cm-dashboard-shared"
version = "0.1.68"
version = "0.1.69"
edition = "2021"
[dependencies]