syncthing-relay

This commit is contained in:
Motiejus Jakštys 2024-08-03 18:11:44 +03:00
parent 9b9b609a5f
commit 1dc59683e8
3 changed files with 38 additions and 20 deletions

View File

@ -127,7 +127,6 @@ in
};
};
#syncthing-relay.restartIfChanged = false;
};
paths = {
@ -299,27 +298,23 @@ in
job_name = "caddy";
static_configs = [ { targets = [ "127.0.0.1:${toString myData.ports.exporters.caddy}" ]; } ];
}
{
job_name = "${config.networking.hostName}.${config.networking.domain}";
static_configs = [ { targets = [ "127.0.0.1:${port}" ]; } ];
}
{
job_name = "fra1-b.servers.jakst";
static_configs = [ { targets = [ "${myData.hosts."fra1-b.servers.jakst".jakstIP}:${port}" ]; } ];
}
{
job_name = "vno3-rp3b.servers.jakst";
static_configs = [ { targets = [ "${myData.hosts."vno3-rp3b.servers.jakst".jakstIP}:${port}" ]; } ];
}
{
job_name = "mtworx.motiejus.jakst";
static_configs = [ { targets = [ "${myData.hosts."mtworx.motiejus.jakst".jakstIP}:${port}" ]; } ];
}
{
job_name = "vno1-vinc.vincentas.jakst";
static_configs = [ { targets = [ "${myData.hosts."vno1-vinc.vincentas.jakst".jakstIP}:9100" ]; } ];
}
];
]
++
map
(s: {
job_name = s;
static_configs = [ { targets = [ "${myData.hosts.${s}.jakstIP}:${port}" ]; } ];
})
[
"fra1-b.servers.jakst"
"fwminex.servers.jakst"
"mtworx.motiejus.jakst"
"vno3-rp3b.servers.jakst"
];
};
};
@ -346,6 +341,7 @@ in
sshguard.enable = true;
gitea.enable = true;
hass.enable = true;
syncthing-relay.enable = true;
vaultwarden = {
enable = true;
@ -566,8 +562,6 @@ in
53
80
443
#config.services.syncthing.relay.port
#config.services.syncthing.relay.statusPort
];
};
};

View File

@ -19,6 +19,7 @@
./remote-builder
./sshguard
./syncthing
./syncthing-relay
./tailscale
./vaultwarden
./wifibackup

View File

@ -0,0 +1,23 @@
{ config, lib, ... }:
let
cfg = config.mj.services.syncthing-relay;
in
{
options.mj.services.syncthing-relay = with lib.types; {
enable = lib.mkEnableOption "enable syncthing-relay";
};
config = lib.mkIf cfg.enable {
services.syncthing.relay = {
enable = true;
providedBy = "jakstys.lt";
};
systemd.services.syncthing-relay.restartIfChanged = false;
networking.firewall.allowedTCPPorts = [
config.services.syncthing.relay.port
config.services.syncthing.relay.statusPort
];
};
}