IpfsClusterSecretsGenerator
Idempotently ensures a customer config carries private-IPFS-cluster secrets when it declares any NixIPFS host. Called defensively before every secrets emit (install + inline-built configs). The swarm key + cluster secret are generated ONCE (256 bits each, lowercase hex) and stored on config.IpfsCluster; a second call with a non-null IpfsCluster is a no-op so the swarm stays stable across the run (regenerating would partition the cluster).
public static class IpfsClusterSecretsGenerator
1. Methods
1.1. EnsureOn(NETSetupConfig)
Generates + assigns config.IpfsCluster when the config declares at least one NixIPFS host in DirectoryService.Machines and no cluster secrets exist yet. No-op otherwise. Production directory-iterating paths use this overload.
public static void EnsureOn(NETSetupConfig config)
| Name | Type | Description |
|---|---|---|
config |
NETSetupConfig |
1.2. EnsureOn(NETSetupConfig, SystemManagement.Entities.Machine)
Generates + assigns config.IpfsCluster when the machine ACTUALLY BEING PROVISIONED is a NixIPFS host and no cluster secrets exist yet. The provisioning entrypoints pass the target machine as a separate argument (it is not necessarily registered in config.DirectoryService.Machines - inline-built configs pass it directly), so the single-arg EnsureOn(NETSetupConfig) would miss it. No-op once IpfsCluster is set, so calling both overloads is safe.
public static void EnsureOn(NETSetupConfig config, SystemManagement.Entities.Machine machine)
| Name | Type | Description |
|---|---|---|
config |
NETSetupConfig |
|
machine |
SystemManagement.Entities.Machine |