reshape swarm peers: domain-as-key, certFingerprint field
This commit is contained in:
parent
a8e8c50a30
commit
52cfc3ea1c
3 changed files with 45 additions and 66 deletions
|
|
@ -51,14 +51,14 @@ pub fn swarm_name() -> Option<String> {
|
|||
/// One peer hive in the same swarm. Parsed from `HYPERHIVE_PEERS`.
|
||||
#[derive(Debug, Clone, serde::Deserialize)]
|
||||
pub struct PeerHive {
|
||||
pub label: String,
|
||||
pub domain: String,
|
||||
pub cert_fingerprint: Option<String>,
|
||||
}
|
||||
|
||||
/// Peer hives in the same swarm, parsed from `HYPERHIVE_PEERS` env var
|
||||
/// (JSON array of `{label,domain}` objects, emitted by the c0re NixOS
|
||||
/// module from `services.hyperhive.peers`). Returns empty vec on
|
||||
/// single-hive deploys (env var absent).
|
||||
/// (JSON array of `{domain, cert_fingerprint}` objects, emitted by the
|
||||
/// c0re NixOS module from `services.hyperhive.swarm.peers`). Returns
|
||||
/// empty vec on single-hive deploys (env var absent).
|
||||
#[must_use]
|
||||
pub fn peers() -> Vec<PeerHive> {
|
||||
env::var("HYPERHIVE_PEERS")
|
||||
|
|
|
|||
Loading…
Reference in a new issue