Skip to content
Snippets Groups Projects
Commit 18c404a5 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Define options for public IPv4 and port number.

Also open the firewall!  Yea.  That is a pretty important thing.
parent 570731a0
Branches
No related tags found
1 merge request!4Configurable public address
...@@ -33,6 +33,22 @@ in ...@@ -33,6 +33,22 @@ in
The package to use for the Tahoe-LAFS daemon. The package to use for the Tahoe-LAFS daemon.
''; '';
}; };
services.private-storage.publicIPv4 = lib.mkOption
{ default = "127.0.0.1";
type = lib.types.str;
example = lib.literalExample "192.0.2.0";
description = ''
An IPv4 address to advertise for this storage service.
'';
};
services.private-storage.publicStoragePort = lib.mkOption
{ default = 8898;
type = lib.types.int;
example = lib.literalExample 8098;
description = ''
The port number on which to service storage clients.
'';
};
}; };
config = lib.mkIf cfg.enable config = lib.mkIf cfg.enable
{ services.tahoe.nodes."storage" = { services.tahoe.nodes."storage" =
...@@ -42,6 +58,8 @@ in ...@@ -42,6 +58,8 @@ in
# XXX Should try to name that is unique across the grid. # XXX Should try to name that is unique across the grid.
{ nickname = "storage"; { nickname = "storage";
"web.port" = "tcp:3456:interface=127.0.0.1"; "web.port" = "tcp:3456:interface=127.0.0.1";
"tub.port" = "tcp:${toString cfg.publicStoragePort}";
"tub.location" = "tcp:${cfg.publicIPv4}:${toString cfg.publicStoragePort}";
}; };
storage = storage =
{ enabled = true; { enabled = true;
...@@ -52,5 +70,7 @@ in ...@@ -52,5 +70,7 @@ in
}; };
}; };
}; };
networking.firewall.allowedTCPPorts = [ cfg.publicStoragePort ];
}; };
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment