kubo: 0.34.1 -> 0.35.0 (#410858)

authored by Matthias Beyer and committed by GitHub 34ccd78c 63a34284

+50 -10
+10 -3
nixos/modules/services/network-filesystems/kubo.nix
··· 161 161 autoMount = lib.mkOption { 162 162 type = lib.types.bool; 163 163 default = false; 164 - description = "Whether Kubo should try to mount /ipfs and /ipns at startup."; 164 + description = "Whether Kubo should try to mount /ipfs, /ipns and /mfs at startup."; 165 165 }; 166 166 167 167 autoMigrate = lib.mkOption { ··· 236 236 default = "/ipns"; 237 237 description = "Where to mount the IPNS namespace to"; 238 238 }; 239 + 240 + Mounts.MFS = lib.mkOption { 241 + type = lib.types.str; 242 + default = "/mfs"; 243 + description = "Where to mount the MFS namespace to"; 244 + }; 239 245 }; 240 246 }; 241 247 description = '' ··· 356 362 ${cfg.dataDir}.d = defaultConfig; 357 363 ${cfg.settings.Mounts.IPFS}.d = lib.mkIf (cfg.autoMount) defaultConfig; 358 364 ${cfg.settings.Mounts.IPNS}.d = lib.mkIf (cfg.autoMount) defaultConfig; 365 + ${cfg.settings.Mounts.MFS}.d = lib.mkIf (cfg.autoMount) defaultConfig; 359 366 }; 360 367 361 368 # The hardened systemd unit breaks the fuse-mount function according to documentation in the unit file itself ··· 401 408 ipfs --offline config replace - 402 409 ''; 403 410 postStop = lib.mkIf cfg.autoMount '' 404 - # After an unclean shutdown the fuse mounts at cfg.settings.Mounts.IPFS and cfg.settings.Mounts.IPNS are locked 405 - umount --quiet '${cfg.settings.Mounts.IPFS}' '${cfg.settings.Mounts.IPNS}' || true 411 + # After an unclean shutdown the fuse mounts at cfg.settings.Mounts.IPFS, cfg.settings.Mounts.IPNS and cfg.settings.Mounts.MFS are locked 412 + umount --quiet '${cfg.settings.Mounts.IPFS}' '${cfg.settings.Mounts.IPNS}' '${cfg.settings.Mounts.MFS}' || true 406 413 ''; 407 414 serviceConfig = { 408 415 ExecStart = [
+38 -5
nixos/tests/kubo/kubo-fuse.nix
··· 27 27 testScript = '' 28 28 start_all() 29 29 30 - with subtest("FUSE mountpoint"): 31 - machine.fail("echo a | su bob -l -c 'ipfs add --quieter'") 30 + with subtest("Create a file for testing"): 31 + machine.succeed("echo 'fnord3' > /tmp/test.txt") 32 + 33 + 34 + with subtest("/ipfs/ FUSE mountpoint"): 35 + machine.fail("su bob -l -c 'ipfs add --quieter' < /tmp/test.txt") 32 36 # The FUSE mount functionality is broken as of v0.13.0. This is still the case with v0.29.0. 33 37 # See https://github.com/ipfs/kubo/issues/9044. 34 38 # Workaround: using CID Version 1 avoids that. ··· 36 40 "echo fnord3 | su alice -l -c 'ipfs add --quieter --cid-version=1'" 37 41 ).strip() 38 42 39 - machine.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") 43 + machine.succeed(f"diff /tmp/test.txt /ipfs/{ipfs_hash}") 44 + 45 + 46 + with subtest("/mfs/ FUSE mountpoint"): 47 + with subtest("Write the test file in three different ways"): 48 + machine.succeed("cp /tmp/test.txt /mfs/test-1.txt") 49 + machine.succeed("su alice -c 'ipfs files write --create /test-2.txt < /tmp/test.txt'") 50 + machine.succeed(f"ipfs files cp /ipfs/{ipfs_hash} /test-3.txt") 51 + 52 + with subtest("Show the files (for debugging)"): 53 + # Different hashes for the different ways of adding the file to the MFS probably come from different linking structures of the merkle tree. Copying the file to /mfs with `cp` is even non-deterministic. 54 + machine.succeed("ipfs files ls --long >&2") 55 + machine.succeed("ls -l /mfs >&2") 56 + 57 + with subtest("Check that everyone has permission to read the file (because of Mounts.FuseAllowOther)"): 58 + machine.succeed("su alice -c 'cat /mfs/test-1.txt' | grep fnord3") 59 + machine.succeed("su bob -c 'cat /mfs/test-1.txt' | grep fnord3") 60 + 61 + with subtest("Check the file contents"): 62 + machine.succeed("diff /tmp/test.txt /mfs/test-1.txt") 63 + machine.succeed("diff /tmp/test.txt /mfs/test-2.txt") 64 + machine.succeed("diff /tmp/test.txt /mfs/test-3.txt") 65 + 66 + with subtest("Check the CID extended attribute"): 67 + output = machine.succeed( 68 + "getfattr --only-values --name=ipfs_cid /mfs/test-3.txt" 69 + ).strip() 70 + assert ipfs_hash == output, f"Expected {ipfs_hash} but got {output}" 40 71 41 - with subtest("Unmounting of /ipns and /ipfs"): 72 + 73 + with subtest("Unmounting of /ipns, /ipfs and /mfs"): 42 74 # Force Kubo to crash and wait for it to restart 43 75 machine.systemctl("kill --signal=SIGKILL ipfs.service") 44 76 machine.wait_for_unit("ipfs.service", timeout = 30) 45 77 46 - machine.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") 78 + machine.succeed(f"diff /tmp/test.txt /ipfs/{ipfs_hash}") 79 + machine.succeed("diff /tmp/test.txt /mfs/test-3.txt") 47 80 ''; 48 81 }
+2 -2
pkgs/by-name/ku/kubo/package.nix
··· 8 8 9 9 buildGoModule rec { 10 10 pname = "kubo"; 11 - version = "0.34.1"; # When updating, also check if the repo version changed and adjust repoVersion below 11 + version = "0.35.0"; # When updating, also check if the repo version changed and adjust repoVersion below 12 12 rev = "v${version}"; 13 13 14 14 passthru.repoVersion = "16"; # Also update kubo-migrator when changing the repo version ··· 16 16 # Kubo makes changes to its source tarball that don't match the git source. 17 17 src = fetchurl { 18 18 url = "https://github.com/ipfs/kubo/releases/download/${rev}/kubo-source.tar.gz"; 19 - hash = "sha256-wrAnmPfls7LFO3gQBISSmn4ucuUVmzvYEoz+eVc/A5M="; 19 + hash = "sha256-OubXaa2JWbEaakDV6pExm5PkiZ5XPd9uG+S4KwWb0xQ="; 20 20 }; 21 21 22 22 # tarball contains multiple files/directories