Skip to content

sshkeeper v0.3.1

Choose a tag to compare

@mirivlad mirivlad released this 18 Aug 10:47
· 5 commits to main since this release

Bug-fix release. No TUI or behaviour changes beyond the fix below.

Fixed: forward add was unusable from the CLI

sshkeeper forward add could never succeed. The command read --local-port
and marked it required, but the flag was never registered, so cobra rejected it
as an unknown option and the value fell back to 0:

$ sshkeeper forward add web --name "Local PostgreSQL" --type local \
    --local-port 15432 --remote-addr 127.0.0.1 --remote-port 5432
unknown flag: --local-port

$ sshkeeper forward add web --name "Local PostgreSQL" --type local \
    --remote-addr 127.0.0.1 --remote-port 5432
invalid local port 0: must be 1-65535

No combination of arguments worked. Both forms now behave as documented:

$ sshkeeper forward add web --name "Local PostgreSQL" --type local \
    --local-port 15432 --remote-addr db01.internal.example.com --remote-port 5432
✓ Forward added [1]

$ sshkeeper forward add web --name "SOCKS proxy" --type dynamic --local-port 1080
✓ Forward added [2]

Omitting the flag now produces required flag(s) "local-port" not set instead
of the misleading port-range error.

This affects v0.2.0 and v0.3.0. If you script port forwards, upgrade. The
TUI (Ctrl+W) was never affected, and stored forwards are untouched — this is
purely a CLI argument-parsing fix, so no migration is needed.

Why it went unnoticed

The command's tests constructed their own throwaway cobra command, registered
the flags on it by hand, and passed that to the real RunE. The actual
command's flag registration was therefore never exercised, and the tests passed
against a completely broken command. This release adds coverage that parses
argv into the real command's own flag set, plus a check pinning the required
annotation; both fail against the unfixed code with unknown flag: --local-port. An audit of the remaining commands found no other flag that is
read but never registered.

Install

tar -xzf sshkeeper_v0.3.1_linux_amd64.tar.gz
sudo install -m 0755 sshkeeper_v0.3.1_linux_amd64/sshkeeper /usr/local/bin/sshkeeper

Verify downloads against checksums.txt. Linux and macOS are the primary
release targets; Windows is experimental.