hermes-piandClaude Haiku 5.5 c3141daf0b
CI / autotest (push) Failing after 7s
release: normalize dist file names in publish.py
uv build writes opensnitch_tui-<version>; the script expected the
project name with hyphens and failed the twine check.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-12-03 13:20:46 +01:00
2026-12-02 18:18:49 +01:00

opensnitch-tui

A full-screen terminal UI for OpenSnitch, the application firewall, so it can be managed over SSH instead of the desktop GUI. It speaks the daemon's own gRPC UI protocol (ui.proto of opensnitchd v1.6.9) and never edits the daemon config or rule files.

Status: 0.1.0, the first release. The design is in spec.md.

Requirements

  • Python 3.13 or newer
  • uv (or pip) to install
  • opensnitchd v1.6.9, running on the same machine

Install

Standalone, into its own uv tool environment:

uv tool install --python 3.13 opensnitch-tui

Until the package is on PyPI, install from the repository instead:

uv tool install --python 3.13 \
  git+https://gitea.nolivaldeziii.com/nvaldez/opensnitch-tui.git@v0.1.0

Through daedalus (from the daedalus-scripts feed):

daedalus install daedalus.opensnitch-tui
daedalus opensnitch-tui

Check the install with opensnitch-tui --version. No root step and no daemon configuration step is needed.

Run

The default run takes the socket from the desktop GUI: it stops the GUI, runs the TUI, and starts the GUI again when you quit. Inside tmux over SSH:

ssh pi -t 'tmux new -A -s snitch opensnitch-tui'

Options: --socket PATH (default /tmp/osui.sock), --no-handover (run without stopping the desktop GUI; exits 3 while the GUI holds the socket), --restore-gui (restart the GUI from the saved state and exit), --log-file PATH, --debug.

If the TUI is killed (for example the SSH session drops hard), the desktop GUI stays stopped. Start the GUI again with opensnitch-tui --restore-gui, or with a normal run followed by a quit. --restore-gui starts nothing when the GUI is already running.

Safety

  • A connection nobody answers is denied after the prompt timeout (30 s by default, 5 to 100 s in Settings). The daemon's own wait is longer, so the TUI always answers first.
  • A prompt's a or d first highlights the action; a second press of the same key sends it. A stray key cannot allow or deny a connection.
  • Rule changes are only enable, disable, delete and change. The TUI never writes the daemon config, the rule files or the firewall.

Keys

Key Where Does
tab, shift+tab anywhere switch tabs
up, down tables; Stats move the cursor; on Stats, scroll the rows
left, right Stats switch table (not while a text box has focus)
? anywhere help
q anywhere quit (asks first when a prompt is pending)
a / d a prompt highlight allow / deny; press again to answer
1 2 3 4 a prompt once, 30m, until restart, always
p h i o a prompt match process, host, ip, port
a / d Rules set the action
space Rules enable or disable
x / delete Rules delete (asks first)
e / enter Rules edit
u Rules undo the last rule change
/ Rules filter; enter keeps it, escape clears it. A prompt wins over the filter: its keys answer it even while the filter has focus
r Connections new rule for the event
f Connections follow the newest event
enter Alerts full text
c Alerts clear the list
R anywhere reconnect: ask the daemon to send its rules again
esc reconnect box close the box
enter / space Settings change the selected setting
+ / - Settings prompt timeout, 5 s steps (5 to 100 s)

Rule changes need a connected daemon; the status bar says when one is not.

Develop

uv sync --group dev
uv run python autotest.py          # every check, run before each commit
uv run pytest tests/unit -q        # fast loop
uv run daedalus builtin.linter all -n --exclude 'src/opensnitch_tui/proto/*' .   # lint

Tests never touch the real desktop GUI: an autouse fixture replaces the GUI matcher and the state and lock paths. Opt-in tests run with OSTUI_DAEMON_TESTS=1 (a real daemon) and OSTUI_DAEDALUS_TESTS=1 (a real daedalus install).

Change order: spec first, then failing tests, then code (AGENTS.md).

Licence

GPL-3.0-only. See LICENSE.

S
Description
No description provided
Readme
468 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 100%