Skip to content

Declare CLI client port forwards in the config; make the control panel read-only - #102

Merged
andrewchen5678 merged 1 commit into
mainfrom
config-declared-forwards
Sep 16, 2026
Merged

andrewchen5678 merged 1 commit into
mainfrom
config-declared-forwards

Conversation

@andrewchen5678

Copy link
Copy Markdown
Contributor

Summary

  • The CLI client's port forwards are now declared as [[forwards]] tables in the client TOML config (label optional, local_port, remote_host, remote_port). They are validated at startup (labels, hosts, nonzero ports, unique local ports) and fixed for the session.
  • The per-instance forwards-<key>.json store and the TUI add/edit/delete form are gone. The on/off toggle is gone too. The panel is read-only, so the client's on-disk identity is just the lock and the control socket.
  • The IPC control channel is read-only (Status and ConnPath only). The socket stays owner-only since snapshots describe the user's network. The panel runs as the same user and needs no elevated privilege.
  • A forward whose listener fails to bind is still switched off by the ticker, with the reason shown on its row.
  • Docs updated: client.toml.example, README, docs/systemd.md (edit the config and restart to change forwards; the quick client has no forwards).

No backward compatibility with the removed JSON store, per the repo rule.

Test plan

  • cargo clippy --workspace --all-targets clean
  • ci/unix/ci.sh passes (25 + 154 tests)
  • Smoke test with a throwaway HOME: duplicate local_port rejected with a clear error; a valid config logs the loaded forwards and binds both listeners; only the lock file is written

🤖 Generated with Claude Code

…l read-only

The CLI client's port forwards are now `[[forwards]]` tables in the client
config (label optional; local_port, remote_host, remote_port), validated at
startup like the rest of the config (valid host and label, nonzero ports,
unique local ports) and brought up with the client. There is no CLI flag.

The per-instance forwards JSON store, the TUI add/edit/delete form and
delete confirmation, and the on/off toggle are removed. The control
channel now only serves status and connection-path snapshots — nothing
about the client can be changed from `client control`. A forward whose
listener fails to bind is still switched off by the client itself, with
the reason shown next to its row. A `--quick` client reads no config, so
it has no forwards.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@andrewchen5678
andrewchen5678 merged commit 5688d33 into main Sep 16, 2026
4 checks passed
@andrewchen5678
andrewchen5678 deleted the config-declared-forwards branch September 16, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant