fix: resolve merge conflicts and compile errors for transport layer
- Resolve stash conflicts in Cargo.toml, rpc/mod.rs, AppDetails.vue, Apps.vue - Fix ScopedIp conversion in LAN transport (mdns-sd compatibility) - Fix String vs &str in transport RPC send handler - Remove duplicate mod transport declaration - Remove stale mesh.discover route (replaced by mesh.peers/messages/send) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -209,6 +209,76 @@ impl Server {
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize mesh networking service (if config has enabled: true)
|
||||
{
|
||||
let data_dir = config.data_dir.clone();
|
||||
let did = identity::did_key_from_pubkey_hex(&data.server_info.pubkey)
|
||||
.unwrap_or_default();
|
||||
let pubkey_hex = identity.pubkey_hex();
|
||||
let signing_key = identity.signing_key();
|
||||
match crate::mesh::MeshService::new(&data_dir, signing_key, &did, &pubkey_hex).await {
|
||||
Ok(mut mesh_service) => {
|
||||
let mesh_config = crate::mesh::load_config(&data_dir).await.unwrap_or_default();
|
||||
if mesh_config.enabled {
|
||||
if let Err(e) = mesh_service.start() {
|
||||
warn!("Mesh service start failed (non-fatal): {}", e);
|
||||
} else {
|
||||
info!("📡 Mesh networking started");
|
||||
}
|
||||
}
|
||||
api_handler.rpc_handler().set_mesh_service(mesh_service).await;
|
||||
info!("📡 Mesh service initialized");
|
||||
}
|
||||
Err(e) => {
|
||||
warn!("Mesh service init failed (non-fatal): {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize transport router (unified routing: mesh > lan > tor)
|
||||
{
|
||||
let data_dir = config.data_dir.clone();
|
||||
let did = identity::did_key_from_pubkey_hex(&data.server_info.pubkey)
|
||||
.unwrap_or_default();
|
||||
let pubkey_hex = identity.pubkey_hex();
|
||||
let mesh_config = crate::mesh::load_config(&data_dir).await.unwrap_or_default();
|
||||
let mesh_only = mesh_config.mesh_only_mode.unwrap_or(false);
|
||||
|
||||
match crate::transport::PeerRegistry::load(&data_dir).await {
|
||||
Ok(registry) => {
|
||||
let registry = std::sync::Arc::new(registry);
|
||||
let mut transports: Vec<Box<dyn crate::transport::NodeTransport>> = Vec::new();
|
||||
|
||||
transports.push(Box::new(
|
||||
crate::transport::tor::TorTransport::new(&pubkey_hex),
|
||||
));
|
||||
transports.push(Box::new(
|
||||
crate::transport::mesh_transport::MeshTransport::new(
|
||||
api_handler.rpc_handler().mesh_service_arc(),
|
||||
),
|
||||
));
|
||||
|
||||
let mut lan = crate::transport::lan::LanTransport::new(&did, &pubkey_hex, 5678);
|
||||
match lan.start(registry.clone()) {
|
||||
Ok(()) => info!("📡 LAN transport (mDNS) started"),
|
||||
Err(e) => debug!("LAN transport init (non-fatal): {}", e),
|
||||
}
|
||||
transports.push(Box::new(lan));
|
||||
|
||||
let router = std::sync::Arc::new(crate::transport::TransportRouter::new(
|
||||
transports,
|
||||
registry,
|
||||
mesh_only,
|
||||
));
|
||||
api_handler.rpc_handler().set_transport_router(router).await;
|
||||
info!("📡 Transport router initialized (mesh_only={})", mesh_only);
|
||||
}
|
||||
Err(e) => {
|
||||
warn!("Transport router init failed (non-fatal): {}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize container scanner — discovers installed apps from Podman/Docker
|
||||
{
|
||||
let scanner = create_docker_scanner(&config).await?;
|
||||
|
||||
Reference in New Issue
Block a user