From 3480232f2af02a9378a5dc4f60bff3a916116826 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Sun, 19 Feb 2023 13:53:54 +0000 Subject: [PATCH 1/2] update nixpkgs btcpayserver: 1.7.3 -> 1.7.12 elementsd: 22.0.2 -> 22.1 nbxplorer: 2.3.54 -> 2.3.62 Also add new required argument to flake-info in CI test script. --- flake.lock | 24 +++++++++++------------ pkgs/pinned.nix | 8 ++++---- test/nixos-search/ci-test.sh | 2 +- test/nixos-search/flake-info-sandboxed.sh | 2 +- test/nixos-search/flake.lock | 12 ++++++------ 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index adf4cc7..489dbcc 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ ] }, "locked": { - "lastModified": 1671802034, - "narHash": "sha256-mkv2u5nQJEV3KlWiopkt/gMz0OM4nmEXSfzkSw6welQ=", + "lastModified": 1673201375, + "narHash": "sha256-qlDIl1j6m3hrwbp993/1ncxyKfFRjt32zc3IHq6CeIk=", "owner": "erikarvstedt", "repo": "extra-container", - "rev": "e34f0cca15f6f0f2e598dad0b329196d0dab6d4f", + "rev": "8448f0d65bb436550c2a6eece0dd1b43c8b33462", "type": "github" }, "original": { @@ -25,11 +25,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", "type": "github" }, "original": { @@ -40,11 +40,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1674407282, - "narHash": "sha256-2qwc8mrPINSFdWffPK+ji6nQ9aGnnZyHSItVcYDZDlk=", + "lastModified": 1676718858, + "narHash": "sha256-giQecvcifVLNHCC9lMfTGP09tNxXhOMw+d/aql7MhRw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ab1254087f4cdf4af74b552d7fc95175d9bdbb49", + "rev": "e6d5772f3515b8518d50122471381feae7cbae36", "type": "github" }, "original": { @@ -56,11 +56,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1674487464, - "narHash": "sha256-Jgq50e4S4JVCYpWLqrabBzDp/1mfaxHCh8/OOorHTy0=", + "lastModified": 1676763583, + "narHash": "sha256-y8j1GRwWeRN7KIrUIksgoTyYXWjraWvMtWK/cc4muNY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3954218cf613eba8e0dcefa9abe337d26bc48fd0", + "rev": "06365ba4549654b7ce58c33365c1282800e83a9e", "type": "github" }, "original": { diff --git a/pkgs/pinned.nix b/pkgs/pinned.nix index 7cff844..94204a9 100644 --- a/pkgs/pinned.nix +++ b/pkgs/pinned.nix @@ -4,21 +4,21 @@ pkgs: pkgsUnstable: inherit (pkgs) bitcoin bitcoind - elementsd extra-container lightning-loop lightning-pool - lndconnect - nbxplorer; + lndconnect; inherit (pkgsUnstable) btcpayserver charge-lnd clightning electrs + elementsd fulcrum hwi - lnd; + lnd + nbxplorer; inherit pkgs pkgsUnstable; } diff --git a/test/nixos-search/ci-test.sh b/test/nixos-search/ci-test.sh index db483d9..c4c70d1 100755 --- a/test/nixos-search/ci-test.sh +++ b/test/nixos-search/ci-test.sh @@ -20,4 +20,4 @@ if [[ ${CACHIX_SIGNING_KEY:-} ]]; then fi echo "Running flake-info (nixos-search)" -flake-info flake ../.. +flake-info --json flake ../.. >/dev/null diff --git a/test/nixos-search/flake-info-sandboxed.sh b/test/nixos-search/flake-info-sandboxed.sh index cb7d727..2b664e0 100755 --- a/test/nixos-search/flake-info-sandboxed.sh +++ b/test/nixos-search/flake-info-sandboxed.sh @@ -41,4 +41,4 @@ bwrap \ --ro-bind "$tmpDir/nix.conf" /etc/nix/nix.conf \ --ro-bind /usr /usr \ --ro-bind-try /run /run \ - -- flake-info flake "$nbFlake" + -- flake-info --json flake "$nbFlake" >/dev/null diff --git a/test/nixos-search/flake.lock b/test/nixos-search/flake.lock index 9e6649b..881eade 100644 --- a/test/nixos-search/flake.lock +++ b/test/nixos-search/flake.lock @@ -39,11 +39,11 @@ "npmlock2nix": "npmlock2nix" }, "locked": { - "lastModified": 1674593115, - "narHash": "sha256-P4bjLR/8tJ/jVBBeHDzNS2BgVUdB6vS7Udfh30kULJs=", + "lastModified": 1676541227, + "narHash": "sha256-UP5X8ik4pUFcGeFTivJyuLr3CTojhRnr4HkDAeb+6Ms=", "owner": "nixos", "repo": "nixos-search", - "rev": "be9a717b8032c7410337139f9dcfd6227b7407a4", + "rev": "e5a15ec2e3faa55aba93a0d092b525ff5bd67467", "type": "github" }, "original": { @@ -54,11 +54,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1667629849, - "narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=", + "lastModified": 1673315479, + "narHash": "sha256-GNCFRtDHjTygXGJp/H+f2XQPMGxpYSmNiibIqYzihtM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3bacde6273b09a21a8ccfba15586fb165078fb62", + "rev": "c07552f6f7d4eead7806645ec03f7f1eb71ba6bd", "type": "github" }, "original": { From 3a2730d2871f4e0e7fbc6ff03fb5144a14e6f137 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 27 Feb 2023 13:17:09 +0100 Subject: [PATCH 2/2] 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} = {