refactor: update dependencies and remove unused code
- Added new dependencies: `adler2`, `crc32fast`, `flate2`, `miniz_oxide`, and `libredox`. - Updated existing dependencies: `tokio-rustls` to version 0.26.4 and `filetime` to version 0.2.27. - Removed the `backup.rs` file as it is no longer needed. - Introduced tests for configuration and credential management. - Enhanced the `identity` module to generate W3C compliant DID documents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,29 +46,27 @@ impl Server {
|
||||
tracing::debug!("Nostr revoke (non-fatal): {}", e);
|
||||
}
|
||||
|
||||
// Publish node identity to Nostr only when opt-in (nostr_discovery_enabled + relays)
|
||||
// Publish presence-only to Nostr (DID + Nostr pubkey, NO onion address).
|
||||
// Onion addresses are exchanged privately via NIP-44 encrypted DMs.
|
||||
if config.nostr_discovery_enabled
|
||||
&& !config.nostr_relays.is_empty()
|
||||
&& data.server_info.node_address.is_some()
|
||||
{
|
||||
let identity_dir = config.data_dir.join("identity");
|
||||
let did = identity::did_key_from_pubkey_hex(&data.server_info.pubkey).unwrap_or_default();
|
||||
let node_addr = data.server_info.node_address.clone().unwrap_or_default();
|
||||
let version = data.server_info.version.clone();
|
||||
let relays = config.nostr_relays.clone();
|
||||
let tor_proxy = config.nostr_tor_proxy.clone();
|
||||
tokio::spawn(async move {
|
||||
if let Err(e) = nostr_discovery::publish_node_identity(
|
||||
if let Err(e) = nostr_handshake::publish_presence(
|
||||
&identity_dir,
|
||||
&did,
|
||||
&node_addr,
|
||||
&version,
|
||||
&relays,
|
||||
tor_proxy.as_deref(),
|
||||
)
|
||||
.await
|
||||
{
|
||||
tracing::debug!("Nostr publish (non-fatal): {}", e);
|
||||
tracing::debug!("Nostr presence publish (non-fatal): {}", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -100,25 +98,25 @@ impl Server {
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize Docker scanner if in dev mode
|
||||
if config.dev_mode {
|
||||
// Initialize container scanner — discovers installed apps from Podman/Docker
|
||||
{
|
||||
let scanner = create_docker_scanner(&config).await?;
|
||||
let state = state_manager.clone();
|
||||
let identity_clone = identity.clone();
|
||||
|
||||
|
||||
// Initial scan
|
||||
tokio::spawn(async move {
|
||||
info!("🐳 Scanning Docker containers...");
|
||||
info!("🐳 Scanning containers...");
|
||||
if let Err(e) = scan_and_update_packages(&scanner, &state, identity_clone.as_ref()).await {
|
||||
error!("Failed to scan Docker containers: {}", e);
|
||||
error!("Failed to scan containers: {}", e);
|
||||
}
|
||||
|
||||
|
||||
// Periodic scan every 10 seconds (only broadcasts if state changed)
|
||||
let mut interval = tokio::time::interval(Duration::from_secs(10));
|
||||
loop {
|
||||
interval.tick().await;
|
||||
if let Err(e) = scan_and_update_packages(&scanner, &state, identity_clone.as_ref()).await {
|
||||
error!("Failed to update Docker containers: {}", e);
|
||||
error!("Failed to update containers: {}", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user