diff --git a/dev/dev-scenarios.nix b/dev/dev-scenarios.nix index d809440..cd70754 100644 --- a/dev/dev-scenarios.nix +++ b/dev/dev-scenarios.nix @@ -9,6 +9,9 @@ with lib; services.btcpayserver.enable = true; test.container.exposeLocalhost = true; # services.btcpayserver.lbtc = false; + + # Required for testing interactive plugin installation + test.container.enableWAN = true; }; # A node with internet access to test joinmarket-ob-watcher diff --git a/modules/btcpayserver.nix b/modules/btcpayserver.nix index 325a1a8..1bdd02c 100644 --- a/modules/btcpayserver.nix +++ b/modules/btcpayserver.nix @@ -236,11 +236,16 @@ in { --datadir='${cfg.btcpayserver.dataDir}' ''; User = cfg.btcpayserver.user; - Restart = "on-failure"; - RestartSec = "10s"; + # Also restart after the program has exited successfully. + # This is required to support restarting from the web interface after + # interactive plugin installation. + # Restart rate limiting is implemented via the `startLimit*` options below. + Restart = "always"; ReadWritePaths = [ cfg.btcpayserver.dataDir ]; MemoryDenyWriteExecute = false; } // nbLib.allowedIPAddresses cfg.btcpayserver.tor.enforce; + startLimitIntervalSec = 30; + startLimitBurst = 10; }; in self; users.users.${cfg.nbxplorer.user} = {