Set up data-mesher
This service is experimental and will change in the future.
This service will set up data-mesher, a file synchronization daemon that uses a gossip protocol to replicate files across a cluster of nodes.
Data-mesher v2 uses a file-based approach where:
inventory.instances = {
data-mesher = {
module = {
name = "data-mesher";
input = "clan-core";
};
roles.default.settings = {
files = {
"config_app" = [
"azwT+VhTxA+BF73Hwq0uqdXHG8XvHU2BknoVXgmEjww="
];
"shared_data" = [
"azwT+VhTxA+BF73Hwq0uqdXHG8XvHU2BknoVXgmEjww="
"Mdtz9s2DEyEk0DL8ZzW7WqwAehoQ97PFHVbJJdskkGo="
];
};
};
};
} logLevel: Log level (default: info)port: Port for cluster communication (default: 7946)extraBootstrapPeers: List of extra bootstrap peers to connect to when joining the cluster.interfaces: The network interface(s) for cluster communication - defaults to all interfacesfiles: Map of file names to lists of authorized ED25519 public keysOnce the cluster is running, you can upload files using the CLI:
# Create a file and upload it
echo "my content" > /tmp/myfile
data-mesher file update /tmp/myfile --url http://localhost:7331 --key-path /path/to/signing.key Files will automatically sync to all nodes in the cluster that have the same file definition in their configuration.
The data-mesher service has the following roles:
admin role has no configurationbootstrap role has no configurationdefault roleAdditional bootstrap peers that act as an initial gateway when joining the cluster. These are merged with machines from the 'bootstrap' role.
They must be libp2p multi addresses: https://libp2p.io/guides/addressing
Type: list of string
Default:
[ ] [
"/ip4/192.168.1.1/tcp/7946/p2p/12D3KooWHs5NXo2CPFvFT6cdsu8eSkfggNtfqTtKBVojHY7En86i"
"/ip4/192.168.1.2/tcp/7946/p2p/12D3KooWDSrQ6xLqFmS44bZKXDujBmTDNu7BQS9HmDz6FRS52CyN"
]Declared in: clanServices/data-mesher/default.nix
We will bind to each each interface listed, listening for connections on cluster.port.
If no interfaces are provided, we will bind to all available.
Type: list of string
Default:
[ ] [
"eth1"
"tailscale0"
]Declared in: clanServices/data-mesher/default.nix
Log level
Type: one of "fatal", "error", "warn", "info", "debug"
Default:
"info" Declared in: clanServices/data-mesher/default.nix
A mapping of file names to lists of base64-encoded ED25519 public keys. Only files listed here can be uploaded or imported from other nodes, and they must be signed by one of the configured public keys.
Type: attribute set of list of string
Default:
{ } {
"config:app" = [
"ZasdhiAVJTa5b2qG8ynWvdHqALUxC6Eg8pdn6RVXuQE="
"1ru2QQ1eWV7yDlyfTTDEml3xTiacASYn0KprzknN8Pc="
];
"dns:sol" = [
"P6AE0lukf9/qmVglYrGPNYo5ZnpFrnqLeAzlCZF0lTk="
];
}Declared in: clanServices/data-mesher/default.nix
Port to listen on for cluster communication.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
7946 Declared in: clanServices/data-mesher/default.nix
peer role has no configurationsigner role has no configuration