diff --git a/scripts/pods-remote.nu b/scripts/pods-remote.nu new file mode 100755 index 0000000..85be0ef --- /dev/null +++ b/scripts/pods-remote.nu @@ -0,0 +1,16 @@ +#!/usr/bin/env nu +# SPDX-License-Identifier: AGPL-3.0-only +# Copyright (c) 2025 Shiloh Fen + +# This will not work with Tailscale SSH, see https://github.com/tailscale/tailscale/issues/5295 +def main [ + remote: string + --uid (-u): int # Remote user ID + --name (-n): string # Socket name +] { + let local_sock = $env.XDG_RUNTIME_DIR | path join 'pods-remote' ($name | default $'($uid).sock') + mkdir $"($env.XDG_RUNTIME_DIR)/pods-remote" + print $"URL: unix://($local_sock)" + ssh -NTL $"($local_sock):/run/user/($uid)/podman/podman.sock" $remote + rm $local_sock +}