Various scripts that I maintain

podman-remote-tcp (new script)

matrixfurry.com 9dafa890 428b8a98

verified
+15
+15
scripts/podman-remote-tcp.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 + def main [ 6 + remote?: string 7 + ...rest 8 + --root (-r) # Connect to rootful socket 9 + ] { 10 + if $root { 11 + ssh -tL 2047:localhost:47 $remote ...$rest "sudo socat TCP-LISTEN:47,reuseaddr,fork UNIX-CONNECT:/run/podman/podman.sock" 12 + } else { 13 + ssh -tL 2047:localhost:2047 $remote ...$rest "socat TCP-LISTEN:2047,reuseaddr,fork UNIX-CONNECT:/run/user/1000/podman/podman.sock" 14 + } 15 + }