From 2344acbf4260c608c00a13438509177f4799bbb7 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 27 Feb 2023 13:17:09 +0100 Subject: [PATCH] btcpayserver: support restarting from the web interface This is required since version 1.7.4. See: https://github.com/btcpayserver/btcpayserver/releases/tag/v1.7.4 --- dev/dev-scenarios.nix | 3 +++ modules/btcpayserver.nix | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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} = {