fix(mobile): improve app store search and launches

This commit is contained in:
archipelago
2026-05-19 18:29:04 -04:00
parent 3e01e57c8d
commit 1836b035b4
12 changed files with 138 additions and 27 deletions

View File

@@ -1404,7 +1404,9 @@ impl RpcHandler {
.await
.context("Failed to create NetBird data directory")?;
let host_ip = self.config.host_ip.clone();
let host_ip = detect_netbird_public_host_ip()
.await
.unwrap_or_else(|| self.config.host_ip.clone());
let dashboard_origin = format!("http://{}:8087", host_ip);
let mgmt_origin = format!("http://{}:8086", host_ip);
let relay_secret = read_or_generate_b64_secret("netbird-relay-auth-secret").await;
@@ -1544,6 +1546,19 @@ async fn read_or_generate_b64_secret(name: &str) -> String {
secret
}
async fn detect_netbird_public_host_ip() -> Option<String> {
let output = tokio::process::Command::new("hostname")
.args(["-I"])
.output()
.await
.ok()?;
let stdout = String::from_utf8_lossy(&output.stdout);
stdout
.split_whitespace()
.find(|ip| ip.starts_with("100.") && ip.contains('.'))
.map(str::to_string)
}
#[cfg(test)]
mod tests {
use super::{btcpay_stack_app_ids, mempool_stack_app_ids};