feat(agent): service systemd DynamicUser + documentation déploiement

- Ajoute deploy/nanometrics-agent.service avec DynamicUser, ProtectSystem,
  PrivateTmp, NoNewPrivileges et RestrictAddressFamilies
- Ajoute deploy/README.md avec procédure d'installation/désinstallation
- Corrige 3 avertissements clippy : iter_kv_map (network.rs) et
  collapsible_match (mqtt.rs)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gilles Soulier
2026-05-22 11:44:13 +02:00
co-authored by Claude Sonnet 4.6
parent 960fd02fd7
commit 12203f453f
4 changed files with 73 additions and 8 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
use sysinfo::Networks;
pub fn get(networks: &Networks) -> (u64, u64) {
let rx: u64 = networks.iter().map(|(_, n)| n.total_received()).sum();
let tx: u64 = networks.iter().map(|(_, n)| n.total_transmitted()).sum();
let rx: u64 = networks.values().map(|n| n.total_received()).sum();
let tx: u64 = networks.values().map(|n| n.total_transmitted()).sum();
(rx, tx)
}
+4 -6
View File
@@ -57,12 +57,10 @@ pub fn start(
QoS::AtLeastOnce,
);
}
Ok(Event::Incoming(Packet::Publish(p))) => {
if p.topic == config_topic_clone {
let _ = incoming_tx.send(MqttIncoming::ConfigUpdate(
p.payload.to_vec(),
));
}
Ok(Event::Incoming(Packet::Publish(p))) if p.topic == config_topic_clone => {
let _ = incoming_tx.send(MqttIncoming::ConfigUpdate(
p.payload.to_vec(),
));
}
Err(e) => {
eprintln!("[mqtt] erreur: {}", e);