Use IPAddress{Allow,Deny} by default for systemd services

This commit is contained in:
Jonas Nick
2019-04-27 23:53:26 +00:00
parent d9533edad1
commit eaaf8e9aab
12 changed files with 79 additions and 22 deletions

View File

@@ -3,7 +3,7 @@
with lib;
let
nix-bitcoin-services = import ./nix-bitcoin-services.nix;
nix-bitcoin-services = pkgs.callPackage ./nix-bitcoin-services.nix { };
cfg = config.services.electrs;
index-batch-size = "${if cfg.high-memory then "" else "--index-batch-size=10"}";
jsonrpc-import = "${if cfg.high-memory then "" else "--jsonrpc-import"}";
@@ -43,6 +43,7 @@ in {
default = 50003;
description = "Override the default port on which to listen for connections.";
};
enforceTor = nix-bitcoin-services.enforceTor;
};
config = mkIf cfg.enable {
@@ -75,7 +76,11 @@ in {
User = "electrs";
Restart = "on-failure";
RestartSec = "10s";
} // nix-bitcoin-services.defaultHardening;
} // nix-bitcoin-services.defaultHardening
// (if cfg.enforceTor
then nix-bitcoin-services.allowTor
else nix-bitcoin-services.allowAnyIP
);
};
services.nginx = {