╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ net.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1796 } 1797 1798 // the ssh command the haxy git client should invoke, or null when not using 1799 // ssh. haxy generates a fresh host key on every run, so accept the unknown host 1800 // and skip writing to known_hosts. 1801 fn sshCommand( 1802 is_ssh: bool, 1803 allocator: std.mem.Allocator, 1804 cwd_path: []const u8, 1805 temp_dir_name: []const u8, 1806 port: u16, 1807 ) !?[]u8 { 1808 if (!is_ssh) return null; 1809 1810 const priv_key_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "key" }); 1811 defer allocator.free(priv_key_path); 1812 1813 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}\"", .{ port + 1, priv_key_path }); 1814 } 1815