Passer wgautomesh en prod #9

Merged
lx merged 11 commits from wgautomesh into main 2023-03-24 11:05:29 +00:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit bb2660792f - Show all commits

View file

@ -250,6 +250,7 @@ in
interface = "wg0";
gossipPort = 1666;
gossipSecretFile = "/var/lib/wgautomesh/gossip_secret";
persistFile = "/var/lib/wgautomesh/state";
upnpForwardPublicPort =
let
us = filter ({ hostname, ...}: hostname == config.networking.hostName) cfg.cluster_nodes;

View file

@ -1,7 +1,7 @@
let
src = builtins.fetchGit {
url = "https://git.deuxfleurs.fr/lx/wgautomesh";
rev = "43eced6e9aa5935b4553251604207f72bf0214c1";
rev = "65e979de801daa5f6ef77ed875e6505aa902fd9c";
};
wgautomesh = (import src).packages.x86_64-linux.default;
in
@ -27,6 +27,10 @@ in
type = types.nullOr types.str;
description = "File containing the gossip secret encryption key";
};
persistFile = mkOption {
type = types.nullOr types.str;
description = "Path where to persist known peer addresses";
};
lanDiscovery = mkOption {
type = types.bool;
default = true;
@ -78,6 +82,8 @@ in
extraDefs = (if cfg.lanDiscovery then ["lan_discovery = true"] else [])
++ (if (cfg.gossipSecretFile != null)
then [''gossip_secret_file = "${cfg.gossipSecretFile}"''] else [])
++ (if (cfg.persistFile != null)
then [''persist_file = "${cfg.persistFile}"''] else [])
++ (if (cfg.upnpForwardPublicPort != null)
then [''upnp_forward_external_port = ${toString cfg.upnpForwardPublicPort}''] else []);
configfile = pkgs.writeText "wgautomesh.toml" ''