Commit Graph
63 Commits
Author SHA1 Message Date
Sebastian Unterschütz 15fb57c0ea Merge remote-tracking branch 'origin/main' into work-25 2026-11-13 23:19:44 +01:00
Sebi c55aae520f Merge pull request 'chore(deps): update module golang.org/x/text to v0.44.0' (#29) from renovate/golang.org-x-text-0.x into main 2026-11-13 22:18:52 +00:00
Sebastian Unterschütz 88af34a64b Merge remote-tracking branch 'origin/main' into work-29
# Conflicts:
#	go.sum
2026-11-13 23:18:04 +01:00
Sebi 314905c538 Merge pull request 'fix(deps): update module golang.org/x/sys to v0.50.0' (#27) from renovate/golang.org-x-sys-0.x into main 2026-11-13 22:17:44 +00:00
Sebastian Unterschütz ad3f14186d Merge remote-tracking branch 'origin/main' into work-27 2026-11-13 23:17:15 +01:00
Sebi 4f08a1c92a Merge pull request 'fix(deps): update module charm.land/lipgloss/v2 to v2.1.0' (#28) from renovate/charm.land-lipgloss-v2-2.x into main 2026-11-13 22:16:38 +00:00
Sebastian Unterschütz 45a2abce90 Merge remote-tracking branch 'origin/main' into work-28 2026-11-13 23:16:05 +01:00
Sebi f7fc1b2a37 Merge pull request 'fix(deps): update module charm.land/bubbletea/v2 to v2.1.1' (#21) from renovate/charm.land-bubbletea-v2-2.x into main 2026-11-13 22:15:25 +00:00
Sebastian Unterschütz c45ad9f0d1 Merge remote-tracking branch 'origin/main' into work-21 2026-11-13 23:14:56 +01:00
Sebi 97fc8f5458 Merge pull request 'chore(deps): update go module directive to v1.27.4' (#30) from renovate/go-1.x into main 2026-11-13 22:13:41 +00:00
Sebastian Unterschütz d24870e4c0 Merge remote-tracking branch 'origin/main' into work-30 2026-11-13 23:13:04 +01:00
Sebi 053db984be Merge pull request 'SFTP, SCP und benannte Port-Forwards' (#32) from feat/sftp-forwarding into main 2026-11-13 22:08:48 +00:00
Sebi 6419fbb00d Merge pull request 'v0.0.23: Configurator für alle Optionen, Regex-Kurznamen' (#31) from feat/configure-all-options into main 2026-11-13 22:07:45 +00:00
Sebastian UnterschützandClaude Opus 5.5 b7fa71fe45 feat: sftp, scp, and named port forwards
Add netssh sftp and netssh scp. Both resolve the host like a connection
does (cache, shortcuts and rewrites, instance/host, default user and
port, SSH options and rules, --jump/--no-jump, --dry-run) and get shell
completion. The per-client flag tables handle the differences from ssh:
the port is -P, -l is a bandwidth limit (the default user goes in as
-o User=), and IPv6 addresses are bracketed in host:path. All remote
scp operands must name the same host.

Add named port forwards under ssh.forwards (global, per instance, per
rule; a more specific layer replaces a forward of the same name),
netssh tunnel HOST NAME|SPEC... (ssh -N with ExitOnForwardFailure) and
netssh --forward NAME. Specs such as 8080:localhost:80 work without
configuration. Forwards are editable in netssh configure and completed
in the shell; the TUI opens SFTP with ctrl+o and a tunnel with ctrl+t.

Host resolution moves out of runSSHWrapper into resolveTarget, shared
by ssh, sftp, scp, tunnel, and the TUI.

Options added by netssh are now inserted before the first operand or
"--": after "--", ssh read them as the destination, and scp stops
reading options at the first operand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 23:05:07 +01:00
Sebastian UnterschützandClaude Opus 5.5 878701aba7 feat(shortcuts): regex rewrite rules for host shortcuts
shortcuts.rewrites applies regex replacements after the domain suffix
is stripped, e.g. ^([a-z]+)[0-9]+- -> $1 turns fsn1-bx1.hoster.de into
fsnbx1. The shortcut works for connecting (cached hosts), shell
aliases, and Tab completion, where it is offered when the full name
does not match the typed text. Rules are editable in netssh configure,
and netssh alias --test HOSTNAME shows a name's shortcut and the cached
hosts it matches.

The shortcut lookup only ran when domains or strip_hyphens were set;
it now also runs for rewrite-only configurations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 22:42:13 +01:00
Sebastian UnterschützandClaude Opus 5.5 d51c040d9f feat(configure): edit every config option in the configurator
After the NetBox instances, netssh configure now opens a menu with all
sections: SSH defaults, global SSH options (jump host, host key
checking, target, address family, extra args, -o options), SSH rules,
resolver & cache (including the cache file), shortcuts & command alias,
and completion.max_results. SSH options can also be set per instance.

The wizard rebuilt the config from its own fields, so re-running it
dropped global SSH options, ssh.rules and completion.max_results from
the file. It now edits a copy of the loaded config, and save validates
SSH options and rules before writing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 22:42:13 +01:00
Sebi bbc04723b4 chore(deps): update go module directive to v1.27.4 2026-11-10 17:45:15 +00:00
Sebi 22c9a3c32b chore(deps): update module golang.org/x/text to v0.44.0 2026-11-09 17:46:12 +00:00
Sebi b3f40ac3ad fix(deps): update module charm.land/lipgloss/v2 to v2.1.0 2026-11-09 13:44:02 +00:00
Sebi a80049a7c3 fix(deps): update module golang.org/x/sys to v0.50.0 2026-11-09 12:45:57 +00:00
Sebi 238e3a7798 chore(deps): update module github.com/spf13/pflag to v1.1.0 2026-11-06 08:45:37 +00:00
Sebi a26e96cd32 fix(deps): update module charm.land/bubbletea/v2 to v2.1.1 2026-10-28 10:54:26 +00:00
Sebi ac713ac97b Merge pull request 'Fix/instance prefix completion' (#20) from fix/instance-prefix-completion into main
Release / release (push) Successful in 5m43s
Reviewed-on: #20
v0.0.22
2026-10-28 10:46:29 +00:00
Sebastian UnterschützandClaude Opus 5.5 091f5cc518 fix(completion): offer unique hostnames without instance prefix
bash (and zsh without a matcher) only accept candidates that start with
the typed text, so "fsn1-bx1<Tab>" found nothing when every candidate
was qualified as "prod/…". Hostnames that exist in only one instance
are now offered bare; names present in several instances stay
qualified. Connecting to a bare name still checks every instance for
ambiguity, so the connection behavior is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:44:54 +01:00
Sebastian UnterschützandClaude Opus 5.5 6243514def fix(completion): accept instance-qualified hosts for a bare name in zsh
With several NetBox instances, netssh offers "prod/fsn1-bx1…" for the
typed text "fsn1". compadd discarded these matches because they do not
start with the typed word, so <Tab> found nothing. The matcher
'l:|=*' lets zsh accept text before the typed word; netssh has already
filtered the candidates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:44:54 +01:00
Sebi 6f00d69b6f Merge pull request 'v0.0.21' (#19) from feat/ssh-options-completion-uninstall into main
Release / release (push) Successful in 5m45s
Reviewed-on: #19
v0.0.21
2026-10-28 10:25:20 +00:00
Sebastian UnterschützandClaude Opus 5.5 6711b610f1 docs: document SSH options, uninstall, and zsh completion for v0.0.21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:23:31 +01:00
Sebastian UnterschützandClaude Opus 5.5 c2e590bf52 feat: add netssh uninstall
Remove everything netssh and install.sh set up, also leftovers of
older versions:

- netssh blocks and unmarked legacy lines in bash, zsh, and fish
  profiles
- completion files for bash, zsh (incl. the oh-my-zsh cache), fish,
  and the command alias; files not generated by netssh are kept
- the cache directory with hosts, aliases, and per-instance caches
- the config file and local notes; the config is first copied to a
  private netssh.yaml.backup-<timestamp> because it holds API tokens
- the netssh binary; for protected paths the sudo command is printed

--keep-config keeps config and notes, --dry-run only lists the plan,
and --yes skips the confirmation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:23:28 +01:00
Sebastian UnterschützandClaude Opus 5.5 786768ec53 feat: add netssh version and --version
`netssh --version` used to be passed to ssh and failed with
"unknown option -- -". Release builds now embed the tag via
-X main.version; other builds fall back to the module build info.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:23:19 +01:00
Sebastian UnterschützandClaude Opus 5.5 2b46c4f74d feat(ssh): jump hosts, host key checking, and configurable ssh options
Add SSH settings that apply only to netssh connections, so
~/.ssh/config does not need global changes:

- proxy_jump (passed as -J; "none" disables an inherited jump host)
- host_key_checking: strict | accept-new | off (off prints a notice)
- target: ip (default) | name | hostname; "name" connects to the
  NetBox name with -o HostName=<ip> and -o HostKeyAlias=<name>, so
  `Host *.example.com` rules apply and known_hosts entries follow the
  device instead of a reused IP
- address_family: any | inet | inet6
- options (-o Key=Value) and extra_args

Settings layer global -> netboxes[].ssh -> ssh.rules (match by tag,
instance, kind, or name glob). Options given on the command line
always win: -o values are inserted after the user's own, and
extra_args before them.

New wrapper flags: --jump HOST, --no-jump, and --dry-run, which prints
the final ssh command instead of connecting. The TUI uses the same
options. The setup wizard keeps all new settings when it saves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:23:09 +01:00
Sebastian UnterschützandClaude Opus 5.5 129a7201bc feat(hook): write marked profile blocks and register zsh completion
`netssh hook install` and the setup wizard now write the same marked
`# >>> netssh >>>` block as install.sh and replace unmarked entries of
older versions instead of appending duplicates. Uninstall shares the
legacy patterns with the installer (eval/alias/source variants).

For zsh the block adds ~/.zfunc to fpath and calls compdef, so
completion also works when compinit already ran earlier in .zshrc,
e.g. with oh-my-zsh. The installer reports which completion it set up
per shell and how to reset ~/.zcompdump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:22:53 +01:00
Sebastian UnterschützandClaude Opus 5.5 8fb7633783 feat(completion): fast zsh completion for large host caches
Cobra's generated zsh script spawns a subshell per candidate and sends
every host through _describe, so <Tab> hangs for seconds with thousands
of cached hosts. netssh now ships its own script: subcommands and flags
go through _describe, plain hostnames through compadd. 5000 hosts
complete in ~0.08 s instead of ~4 s.

Add completion.max_results to cap the number of offered hostnames and
sort host candidates for a stable order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 11:22:18 +01:00
Sebastian Unterschütz 7f53b90266 feat: search multiple NetBox instances with isolated host identities
Release / release (push) Successful in 5m16s
v0.0.20
2026-10-27 23:14:42 +01:00
Sebastian Unterschütz a2a6dd7591 chore(deps): update github.com/charmbracelet/ultraviolet digest to a45b7c8
Release / release (push) Successful in 5m7s
v0.0.19
2026-10-27 22:44:00 +01:00
Sebastian Unterschütz 79c0027833 fix(deps): migrate Charm to v2 and require Go 1.27.3
Release / release (push) Successful in 6m16s
v0.0.18
2026-10-27 22:29:54 +01:00
Sebastian Unterschütz fa7446e5f7 Fix host resolution and concurrent cache updates 2026-10-27 22:23:59 +01:00
Sebastian Unterschütz 92b1c40cb8 Update Go module dependencies
Release / release (push) Successful in 4m46s
v0.0.17
2026-10-27 19:25:37 +01:00
Sebastian Unterschütz 34503de68e Enable shell completion for configured command aliases
Release / release (push) Successful in 5m8s
v0.0.16
2026-10-27 19:19:42 +01:00
Sebastian Unterschütz 14d519d010 Use public Gitea URL for releases and download links
Release / release (push) Successful in 5m37s
v0.0.15
2026-10-27 18:46:38 +01:00
Sebastian Unterschütz fa4509038b Package installer in releases and expand Renovate dependency updates
Release / release (push) Successful in 4m41s
v0.0.14
2026-10-27 18:38:54 +01:00
Sebastian Unterschütz 66a49786c9 Translate remaining German text to English
Release / release (push) Successful in 5m32s
v0.0.13
2026-10-27 18:27:21 +01:00
Sebastian Unterschütz 4b28d441b0 Improve installer updates and dependency checks and add command aliases
Release / release (push) Successful in 7m57s
v0.0.12
2026-10-27 18:10:44 +01:00
Sebastian Unterschütz 12cc64fdd9 Add local and NetBox server notes and improve reliability
Release / release (push) Successful in 6m52s
v0.0.11
2026-10-27 17:51:59 +01:00
Sebi 2852dff2c4 Merge pull request 'chore(deps): update actions/setup-go action to v7' (#3) from renovate/actions-setup-go-7.x into main 2026-10-11 17:15:15 +00:00
Sebi 2d11303014 Merge pull request 'chore(deps): update actions/checkout action to v7' (#2) from renovate/actions-checkout-7.x into main 2026-10-11 17:13:57 +00:00
Sebi 5c6cc7dbbf chore(deps): update actions/setup-go action to v7 2026-10-11 16:30:19 +00:00
Sebi b17ace7fc5 chore(deps): update actions/checkout action to v7 2026-10-11 16:29:56 +00:00
Sebi 8241a064f4 Merge pull request 'chore: Configure Renovate' (#1) from renovate/configure into main 2026-10-11 16:12:43 +00:00
Sebi 86fc2f19eb Add renovate.json 2026-10-11 15:45:13 +00:00
Sebastian Unterschütz fa646f25a6 feat: add alias file generation and management for shell hooks
Release / release (push) Successful in 49s
- **Aliases**: Generate shell alias files (`aliases.sh` for bash/zsh, `netssh.fish` for fish) from cached hosts. Regenerate on each shell startup and cache refresh to keep aliases updated.
- **Hooks**: Extend shell hook functionality to include alias file support. Install and uninstall commands updated for bash, zsh, and fish.
- **Tests**: Add unit tests to verify alias file generation, path resolution, and idempotent hook installation.
- **Docs**: Update README with instructions for alias file usage, installation, and relation to hooks.
v0.0.10
2026-05-27 23:08:30 +02:00