cjdns: 21.4 -> 22.1 (#426168)

authored by Pavol Rusnak and committed by GitHub ffba411e 5b09dc45

+44 -28
+2 -2
nixos/modules/services/networking/cjdns.nix
··· 49 49 k: v: 50 50 lib.optionalString ( 51 51 v.hostname != "" 52 - ) "echo $(${pkgs.cjdns}/bin/publictoip6 ${v.publicKey}) ${v.hostname}" 52 + ) "echo $(${pkgs.cjdns}/bin/cjdnstool util key2ip6 ${v.publicKey}) ${v.hostname}" 53 53 ) (cfg.ETHInterface.connectTo // cfg.UDPInterface.connectTo) 54 54 )} 55 55 ''; ··· 268 268 269 269 if [ -z "$CJDNS_PRIVATE_KEY" ]; then 270 270 shopt -s lastpipe 271 - ${pkg}/bin/makekeys | { read private ipv6 public; } 271 + ${pkg}/bin/cjdnstool util keygen | { read private ipv6 public; } 272 272 273 273 install -m 600 <(echo "CJDNS_PRIVATE_KEY=$private") /etc/cjdns.keys 274 274 install -m 444 <(echo -e "CJDNS_IPV6=$ipv6\nCJDNS_PUBLIC_KEY=$public") /etc/cjdns.public
+7 -7
nixos/tests/cjdns.nix
··· 105 105 106 106 def cjdns_ip(machine): 107 107 res = machine.succeed("ip -o -6 addr show dev tun0") 108 - ip = re.split("\s+|/", res)[3] 108 + ip = re.split("\\s+|/", res)[3] 109 109 machine.log("has ip {}".format(ip)) 110 110 return ip 111 111 ··· 116 116 117 117 # ping a few times each to let the routing table establish itself 118 118 119 - alice.succeed("ping -c 4 {}".format(carol_ip6)) 120 - bob.succeed("ping -c 4 {}".format(carol_ip6)) 119 + alice.wait_until_succeeds("ping -c 4 {}".format(carol_ip6)) 120 + bob.wait_until_succeeds("ping -c 4 {}".format(carol_ip6)) 121 121 122 - carol.succeed("ping -c 4 {}".format(alice_ip6)) 123 - carol.succeed("ping -c 4 {}".format(bob_ip6)) 122 + carol.wait_until_succeeds("ping -c 4 {}".format(alice_ip6)) 123 + carol.wait_until_succeeds("ping -c 4 {}".format(bob_ip6)) 124 124 125 - alice.succeed("ping -c 4 {}".format(bob_ip6)) 126 - bob.succeed("ping -c 4 {}".format(alice_ip6)) 125 + alice.wait_until_succeeds("ping -c 4 {}".format(bob_ip6)) 126 + bob.wait_until_succeeds("ping -c 4 {}".format(alice_ip6)) 127 127 128 128 alice.wait_for_unit("httpd.service") 129 129
+3 -3
pkgs/by-name/cj/cjdns-tools/package.nix
··· 37 37 cp -r node_modules $out/node_modules 38 38 ''; 39 39 40 - meta = with lib; { 40 + meta = { 41 41 homepage = "https://github.com/cjdelisle/cjdns"; 42 42 description = "Tools for cjdns managment"; 43 - license = licenses.gpl3Plus; 43 + license = lib.licenses.gpl3Plus; 44 44 maintainers = [ ]; 45 - platforms = platforms.linux; 45 + platforms = lib.platforms.linux ++ lib.platforms.darwin; 46 46 mainProgram = "cjdns-tools"; 47 47 }; 48 48 }
+32 -16
pkgs/by-name/cj/cjdns/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 fetchFromGitHub, 5 + fetchpatch, 5 6 rustPlatform, 6 7 nodejs, 7 8 which, 8 - python3, 9 - libuv, 10 9 util-linux, 11 10 nixosTests, 12 11 libsodium, ··· 16 15 17 16 rustPlatform.buildRustPackage rec { 18 17 pname = "cjdns"; 19 - version = "21.4"; 18 + version = "22.1"; 20 19 21 20 src = fetchFromGitHub { 22 21 owner = "cjdelisle"; 23 22 repo = "cjdns"; 24 - rev = "cjdns-v${version}"; 25 - sha256 = "sha256-vI3uHZwmbFqxGasKqgCl0PLEEO8RNEhwkn5ZA8K7bxU="; 23 + tag = "cjdns-v${version}"; 24 + hash = "sha256-0imQrkcvIA+2Eq/zlC65USMR7T3OUKwQxrB1KtVexyU="; 26 25 }; 27 26 28 27 patches = [ 29 28 (replaceVars ./system-libsodium.patch { 30 29 libsodium_include_dir = "${libsodium.dev}/include"; 31 30 }) 31 + # Remove mkpasswd since it is failing the build 32 + (fetchpatch { 33 + url = "https://github.com/cjdelisle/cjdns/commit/6391dba3f5fdab45df4b4b6b71dbe9620286ce32.patch"; 34 + hash = "sha256-XVA4tdTVMLrV6zuGoBCkOgQq6NXh0x7u8HgmaxFeoRI="; 35 + }) 36 + (fetchpatch { 37 + url = "https://github.com/cjdelisle/cjdns/commit/436d9a9784bae85734992c2561c778fbd2f5ac32.patch"; 38 + hash = "sha256-THcYNGVbMx/xf3/5UIxEhz3OlODE0qiYgDBOlHunhj8="; 39 + }) 32 40 ]; 33 41 34 - cargoHash = "sha256-LJEKjhyAsK6b7mKObX8tNJdKt53iagMD/YLzoY5GVPw="; 42 + cargoHash = "sha256-f96y6ZW0HxC+73ts5re8GIo2aigQgK3gXyF7fMrcJ0o="; 35 43 36 44 nativeBuildInputs = [ 37 45 which 38 - python3 39 46 nodejs 40 47 pkg-config 41 48 ] ··· 43 50 # for flock 44 51 lib.optional stdenv.hostPlatform.isLinux util-linux; 45 52 46 - buildInputs = [ 47 - libuv 48 - libsodium 49 - ]; 53 + buildInputs = [ libsodium ]; 50 54 51 55 env.SODIUM_USE_PKG_CONFIG = 1; 52 56 env.NIX_CFLAGS_COMPILE = toString ( ··· 61 65 ] 62 66 ); 63 67 68 + cargoTestFlags = [ 69 + # don't run doctests since they fail with "cannot find type `Ctx` in this scope" 70 + "--lib" 71 + "--bins" 72 + "--tests" 73 + ]; 74 + 75 + checkFlags = [ 76 + # Tests don't seem to work - "called `Result::unwrap()` on an `Err` value: DecryptErr: NO_SESSION" 77 + "--skip=crypto::crypto_auth::tests::test_wireguard_iface_encrypt_decrypt" 78 + "--skip=crypto::crypto_auth::tests::test_wireguard_iface_encrypt_decrypt_with_auth" 79 + ]; 80 + 64 81 passthru.tests.basic = nixosTests.cjdns; 65 82 66 - meta = with lib; { 67 - broken = true; # outdated, incompatible with supported python versions 83 + meta = { 68 84 homepage = "https://github.com/cjdelisle/cjdns"; 69 85 description = "Encrypted networking for regular people"; 70 - license = licenses.gpl3Plus; 71 - maintainers = with maintainers; [ ehmry ]; 72 - platforms = platforms.linux; 86 + license = lib.licenses.gpl3Plus; 87 + maintainers = with lib.maintainers; [ ehmry ]; 88 + platforms = lib.platforms.linux ++ lib.platforms.darwin; 73 89 }; 74 90 }