roles/syncthingserver: initial implementation
This commit is contained in:
@@ -15,7 +15,49 @@ in
|
||||
{
|
||||
options.syncthingserver = {
|
||||
enable = mkEnableOption "Enables syncthingserver role";
|
||||
|
||||
guiInterface = mkOption {
|
||||
type = types.str;
|
||||
default = "0.0.0.0";
|
||||
description = "Interface the GUI should be listening on";
|
||||
example = "localhost";
|
||||
};
|
||||
|
||||
guiPort = mkOption {
|
||||
type = types.int;
|
||||
default = 8384;
|
||||
description = "Port for syncthing GUI";
|
||||
example = 8384;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { };
|
||||
config = mkIf cfg.enable {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
relay.enable = true;
|
||||
autoAcceptFolders = true;
|
||||
|
||||
guiAddress = "${cfg.guiInterface}:${toString guiPort}";
|
||||
|
||||
dataDir = "/mnt/data/syncthing";
|
||||
|
||||
overrideDevices = false;
|
||||
overrideFolders = false;
|
||||
|
||||
settings = {
|
||||
# don't accept tracking
|
||||
options.urAccepted = -1;
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
cfg.guiPort
|
||||
config.services.syncthing.relay.port
|
||||
];
|
||||
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
22000
|
||||
21027
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user