From 78d66278eaa088de8a789a5532577d5e5ee10bcc Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Tue, 20 Jun 2023 09:55:48 -0400
Subject: [PATCH] Use "--allow-stdin-close" to keep Tahoe-LAFS running when
 daemonized

Also update to the latest Tahoe-LAFS so this option is available.
---
 nixos/modules/tahoe.nix               | 2 +-
 nixos/pkgs/privatestorage/default.nix | 2 +-
 nixos/pkgs/privatestorage/repo.json   | 6 +++---
 nixos/tests/run-client.py             | 2 +-
 nixos/tests/run-introducer.py         | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/nixos/modules/tahoe.nix b/nixos/modules/tahoe.nix
index 16491c3b..b5343508 100644
--- a/nixos/modules/tahoe.nix
+++ b/nixos/modules/tahoe.nix
@@ -221,7 +221,7 @@ in
               # arguments to $(tahoe run). The node directory must come first,
               # and arguments which alter Twisted's behavior come afterwards.
               ExecStart = ''
-                ${settings.package}/bin/tahoe --eliot-destination ${eliotLog} run ${nodedir} -n -l- --pidfile=${pidfile}
+                ${settings.package}/bin/tahoe --eliot-destination ${eliotLog} run --allow-stdin-close ${nodedir} -n -l- --pidfile=${pidfile}
               '';
 
               # Twisted wants non-blocking sockets:
diff --git a/nixos/pkgs/privatestorage/default.nix b/nixos/pkgs/privatestorage/default.nix
index e152f021..f2c7ddea 100644
--- a/nixos/pkgs/privatestorage/default.nix
+++ b/nixos/pkgs/privatestorage/default.nix
@@ -4,7 +4,7 @@ let
   repo = fetchFromGitHub (builtins.removeAttrs repo-data [ "branch" ]);
   zk = import repo;
   # XXX package version choice here
-  zkapauthorizer = zk.outputs.packages.x86_64-linux.zkapauthorizer-python39-tahoe_1_17_1;
+  zkapauthorizer = zk.outputs.packages.x86_64-linux.zkapauthorizer-python39-tahoe_dev;
   python = zkapauthorizer.passthru.python;
 in
   python.withPackages (ps: [ zkapauthorizer ] )
diff --git a/nixos/pkgs/privatestorage/repo.json b/nixos/pkgs/privatestorage/repo.json
index f57181a6..a0aab486 100644
--- a/nixos/pkgs/privatestorage/repo.json
+++ b/nixos/pkgs/privatestorage/repo.json
@@ -1,8 +1,8 @@
 {
   "owner": "PrivateStorageio",
-  "branch": "458.update-tahoe-lafs",
+  "branch": "main",
   "repo": "ZKAPAuthorizer",
-  "rev": "6f8d67c81cdc6de2f52e0a699a077b43232a0589",
+  "rev": "fb89e91a6c7f595cd0b1c7aa7055cbd32c482180",
   "outputHashAlgo": "sha512",
-  "outputHash": "3bg882wlm0bn23xazal81mzac63svg66gcbrabvzqyin98jrwlimk5n64hrdiywiw954g7srpdr1g9f1y4p79vbpnkfkrv7sa108aa4"
+  "outputHash": "3f44znykq8f7mcgdwdyhgf2dvnx7yydmlrjcr17mxfwya4jqmx8zb59mxkxvar0ahn639y2nq3bcqxdyipljfxilfi1cz21li908kkw"
 }
\ No newline at end of file
diff --git a/nixos/tests/run-client.py b/nixos/tests/run-client.py
index 86909bde..403e4797 100755
--- a/nixos/tests/run-client.py
+++ b/nixos/tests/run-client.py
@@ -43,7 +43,7 @@ def main():
         "daemonize",
         "-o", "/tmp/stdout",
         "-e", "/tmp/stderr",
-        which("tahoe"), "run", "/tmp/client",
+        which("tahoe"), "run", "--allow-stdin-close", "/tmp/client",
     ])
 
 def run(argv):
diff --git a/nixos/tests/run-introducer.py b/nixos/tests/run-introducer.py
index bce2dadb..9062c432 100755
--- a/nixos/tests/run-introducer.py
+++ b/nixos/tests/run-introducer.py
@@ -31,7 +31,7 @@ def main():
         "daemonize",
         "-o", "/tmp/stdout",
         "-e", "/tmp/stderr",
-        which("tahoe"), "run", "/tmp/introducer",
+        which("tahoe"), "run", "--allow-stdin-close", "/tmp/introducer",
     ])
 
     retry(
-- 
GitLab