Skip to content

Commit 3d1f792

Browse files
edimarlnxclaude
andcommitted
README and screenshots for 0.6.0
Document --open and the quoted previews, render the install snippet for 0.6.0, mark the manifest beta explicitly, and re-render every screenshot with tui-kit v0.4.3 (box borders fixed) plus a new one of the prefilled --open form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MbCfX3T8khyd9hsrN5kMo3
1 parent b3f2038 commit 3d1f792

21 files changed

Lines changed: 60 additions & 2 deletions

‎Makefile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ tidy:
6767
## nftables one for the router screens — the flow rule list, the NAT and alias
6868
## views, the phase-2 add form and the staged atomic apply — and the iptables
6969
## one for the cloud-image screens: the insert before the catch-all REJECT and
70-
## the persist diff.
70+
## the persist diff. The last run is the --open hand-off: the add form opened
71+
## prefilled (the rest of the comment is typed, since --args splits on spaces).
7172
screenshots: build
7273
python3 $(KIT)/tools/render-screenshots.py \
7374
--bin $(BIN)/$(TOOL) --name $(TOOL) --out docs/screenshots \
@@ -94,6 +95,10 @@ screenshots: build
9495
--screen iptables= \
9596
--screen 'iptables-add=a\t51820\t\rudp\r\t\r' \
9697
--screen 'iptables-persist=a\t51820\t\rudp\r\t\ryW'
98+
python3 $(KIT)/tools/render-screenshots.py \
99+
--bin $(BIN)/$(TOOL) --name $(TOOL) --out docs/screenshots \
100+
--args="--demo --open=19443/tcp,41641/udp --comment=headscale" \
101+
--screen 'open= control (tailnet)'
97102

98103
## readme: regenerate the generated README sections from tool.json.
99104
readme:

‎README.md‎

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Upgrades then arrive with the rest of your system updates.
135135
### Any distribution, static binary
136136

137137
```sh
138-
curl -fsSL https://github.com/tui-tools/tui-firewall/releases/download/v0.5.0/tui-firewall_0.5.0_linux_amd64.tar.gz | tar -xz tui-firewall
138+
curl -fsSL https://github.com/tui-tools/tui-firewall/releases/download/v0.6.0/tui-firewall_0.6.0_linux_amd64.tar.gz | tar -xz tui-firewall
139139
sudo install -m0755 tui-firewall /usr/local/bin/tui-firewall
140140
```
141141

@@ -222,6 +222,8 @@ tui-firewall --demo=iptables # sample cloud-image iptables
222222
tui-firewall --demo=nftables # sample router ruleset
223223
tui-firewall --check # read the firewall, print JSON, exit
224224
tui-firewall --report # print what a bug report needs, exit
225+
tui-firewall --open 19443/tcp,41641/udp --comment 'headscale control (tailnet)'
226+
# open the add form prefilled, per port
225227
tui-firewall --backend ufw # skip autodetection
226228
tui-firewall --backend firewalld
227229
tui-firewall --backend iptables
@@ -265,6 +267,52 @@ would run a binary nobody asked this tool to touch.
265267
against real firewalls on Ubuntu, Fedora and Omarchy Server; the assertions live
266268
in [`test/smoke.sh`](test/smoke.sh).
267269

270+
### `--open`, a prefilled add form for a hand-off
271+
272+
```sh
273+
tui-firewall --open 19443/tcp,41641/udp --comment 'headscale control (tailnet)'
274+
tui-firewall --open 19443/tcp --open 41641/udp # the same list, repeated
275+
tui-firewall --demo --open 19443/tcp --comment test # try it on the demo
276+
```
277+
278+
`--open` starts the UI straight in the add-rule form, filled in to allow the
279+
first port: action ALLOW, the port, the protocol and the `--comment`. Enter
280+
shows the preview and `y` applies it, exactly as a rule added by hand with `a`;
281+
nothing is applied without that confirm. Then the form for the next port opens,
282+
one form and one confirm per port, in the order given. `esc` skips a port and
283+
`n` at the confirm declines it; either way the sequence moves on. Every other
284+
field of the form is still there to change before Enter.
285+
286+
It is the entry point for another tool that has just found a port closed, such
287+
as [tui-tailscale](https://github.com/tui-tools/tui-tailscale) handing over the
288+
ports a self-hosted control plane needs, so the user does not have to retype
289+
what that tool already knew.
290+
291+
Where the rule goes depends on the backend:
292+
293+
| Backend | Group the rule is added to |
294+
|---|---|
295+
| ufw | the rule list (`ufw allow 19443/tcp comment 'headscale control (tailnet)'`) |
296+
| firewalld | the default zone (`--add-port=19443/tcp`); firewalld has no rule comments, so `--comment` is not used and the status line says so |
297+
| nftables | the `input` chain of the `inet tui` table, or else the first chain hooked on input; on an empty ruleset the status line says so and the forms open once the chains are created with `x` |
298+
| iptables | the filter `INPUT` chain of each family, so a port gets one form for `iptables` and one for `ip6tables` |
299+
300+
The value is checked before anything is read: each entry is a single port from
301+
1 to 65535 and `tcp` or `udp`, a port may not be given twice, and the comment is
302+
one line of at most 128 characters. A wrong value exits with the reason instead
303+
of opening a half-filled form. `--comment` without `--open`, and `--open` with
304+
`--check` or `--report`, are refused the same way. `--check` itself is
305+
unchanged.
306+
307+
Every preview is shell-quoted, so a comment with a space or a parenthesis reads
308+
as one argument, and the line pasted into a shell runs the same argv:
309+
310+
```console
311+
$ /usr/bin/sudo -n ufw allow 19443/tcp comment 'headscale control (tailnet)'
312+
```
313+
314+
![A prefilled --open form](docs/screenshots/tui-firewall-open.png)
315+
268316
### `--report`, for bug reports
269317

270318
`--report` prints, in one block, everything a maintainer has to ask for
-4.48 KB
Loading
-2.7 KB
Loading
-5.15 KB
Loading
-6.89 KB
Loading
17.5 KB
Loading
-8.93 KB
Loading
-18.6 KB
Loading
-11.3 KB
Loading

0 commit comments

Comments
 (0)