Various scripts that I maintain

pods-remote (new script)

Signed-off-by: Shiloh Fen <shiloh@shilohfen.com>

matrixfurry.com 6a0d4694 1167685a

verified
+16
+16
scripts/pods-remote.nu
··· 1 + #!/usr/bin/env nu 2 + # SPDX-License-Identifier: AGPL-3.0-only 3 + # Copyright (c) 2025 Shiloh Fen <shiloh@shilohfen.com> 4 + 5 + # This will not work with Tailscale SSH, see https://github.com/tailscale/tailscale/issues/5295 6 + def main [ 7 + remote: string 8 + --uid (-u): int # Remote user ID 9 + --name (-n): string # Socket name 10 + ] { 11 + let local_sock = $env.XDG_RUNTIME_DIR | path join 'pods-remote' ($name | default $'($uid).sock') 12 + mkdir $"($env.XDG_RUNTIME_DIR)/pods-remote" 13 + print $"URL: unix://($local_sock)" 14 + ssh -NTL $"($local_sock):/run/user/($uid)/podman/podman.sock" $remote 15 + rm $local_sock 16 + }