╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ net.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1449 .ssh => try std.fmt.allocPrint(allocator, "git@localhost:admin/{s}", .{repo_name}), 1450 }, 1451 }; 1452 } 1453 1454 // the ssh command the haxy git client should invoke, or null when not using 1455 // ssh. haxy generates a fresh host key on every run, so accept the unknown host 1456 // and skip writing to known_hosts. 1457 fn sshCommand( 1458 is_ssh: bool, 1459 allocator: std.mem.Allocator, 1460 cwd_path: []const u8, 1461 temp_dir_name: []const u8, 1462 ) !?[]u8 { 1463 if (!is_ssh) return null; 1464 1465 const priv_key_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "key" }); 1466 defer allocator.free(priv_key_path); 1467 1468 return try std.fmt.allocPrint(allocator, "ssh -p {} -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -o IdentitiesOnly=yes -o IdentityFile=\"{s}\"", .{ ssh_port, priv_key_path }); 1469 } 1470