Commit Graph

11 Commits

Author SHA1 Message Date
shuki
220d30e515 Change default web port from 8080 to 2323
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:27:16 +02:00
shuki
ebe5645fb9 Fix auth middleware: use insert(0) on FrozenList before app starts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:18:05 +02:00
shuki
1800babbc2 Add HTTP Basic Auth to textual-serve web dashboard
Browser prompts for username/password before showing the TUI.
Credentials from gniza.conf: WEB_USER (default: admin) + WEB_API_KEY.

- Monkey-patches textual-serve's aiohttp app with auth middleware
- Uses secrets.compare_digest for timing-safe comparison
- Install script generates credentials and prints them
- Skips auth if no WEB_API_KEY configured

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:14:51 +02:00
shuki
fa7eb14369 Fix textual-serve web: robust IP detection for WebSocket URL
The landing page wasn't interactive because public_url resolved to
localhost, making WebSocket connections fail from remote browsers.

- Added multiple IP detection methods (socket, hostname -I, gethostbyname)
- Support --port= and --host= flag formats
- Print actual serving URL on startup
- Switch web start back to textual-serve (TUI in browser)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:12:29 +02:00
shuki
4fb6d45c1a Fix web GUI crash: detect LAN IP for WebSocket public_url
public_url="" caused IndexError in textual-serve URL builder.
Now auto-detects the machine's LAN IP when binding to 0.0.0.0
so the browser can connect to the correct WebSocket endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:23:55 +02:00
shuki
09ff0f9482 Fix web GUI WebSocket: use relative public_url
Setting public_url="" makes textual-serve generate relative
WebSocket URLs so the browser connects to the correct host
regardless of whether accessed via localhost or remote IP.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:02:15 +02:00
shuki
01cbe70c5d Fix install: copy tui/ package and install Python deps
- Install script now copies tui/ directory to install location
- Installs textual and textual-serve via pip after file copy
- __main__.py uses GNIZA_DIR env var for correct path resolution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 00:58:58 +02:00
shuki
63e88d11df Fix web GUI: set env vars in process instead of command string
textual-serve shows the command string as the app title.
Set PYTHONPATH and GNIZA_DIR as real env vars so the spawned
subprocess inherits them. Add title="gniza" for clean display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 00:56:32 +02:00
shuki
bd25d99056 Fix web GUI by setting PYTHONPATH in spawned command
textual-serve spawns the app as a subprocess which doesn't
inherit PYTHONPATH. Bake the project root into the command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 00:55:43 +02:00
shuki
f21f652fea Add web GUI mode via textual-serve
Run `gniza web` or `gniza --web` to serve the TUI as a web app
on port 8080. Use --port to change. Requires textual-serve.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 00:52:59 +02:00
shuki
587149f062 Add Python Textual TUI replacing gum-based bash TUI
New tui/ package with 14 screens (main menu, backup, restore, targets,
remotes, snapshots, verify, retention, schedule, logs, settings, wizard),
3 custom widgets (folder picker, confirm dialog, operation log), async
backend wrapper, pure-Python config parser, and TCSS theme.

bin/gniza now launches Textual TUI when available, falls back to gum.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 23:39:48 +02:00