modules/ipfs-lain: add bypass port

This commit is contained in:
Max Headroom 2022-09-25 20:35:52 +02:00
parent 7e9d8685a8
commit 5901e1125a

View file

@ -5,6 +5,10 @@ let
in { in {
services.ipfs = { services.ipfs = {
enable = true; enable = true;
swarmAddress = [
"/ip4/0.0.0.0/tcp/4001"
"/ip4/0.0.0.0/tcp/110"
];
localDiscovery = true; localDiscovery = true;
autoMount = true; autoMount = true;
startWhenNeeded = false; startWhenNeeded = false;
@ -21,6 +25,7 @@ in {
systemd.services.ipfs = { systemd.services.ipfs = {
environment.LIBP2P_FORCE_PNET = "1"; environment.LIBP2P_FORCE_PNET = "1";
serviceConfig = { serviceConfig = {
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
ReadWritePaths = lib.mkForce [ ]; ReadWritePaths = lib.mkForce [ ];
}; };
}; };
@ -37,7 +42,7 @@ in {
}; };
}; };
networking.firewall.allowedTCPPorts = [ 4001 ]; networking.firewall.allowedTCPPorts = [ 110 4001 ];
environment.systemPackages = lib.singleton (pkgs.writeShellScriptBin "share" '' environment.systemPackages = lib.singleton (pkgs.writeShellScriptBin "share" ''
PATH=${cfg.package}/bin:$PATH PATH=${cfg.package}/bin:$PATH