21 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
907c77feb4 Remove username prompt, default to admin (configurable in gniza.conf)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:26:16 +02:00
shuki
343b49d245 Move web credentials to post-install summary section
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:25:08 +02:00
shuki
a7c50e4b0b Always regenerate web credentials on install, prompt for username
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:21:03 +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
133ae1e7a4 Restore Flask dashboard with redesigned UI and API key auth
- Revert from textual-serve back to Flask (textual-serve had WebSocket issues)
- Completely redesigned dashboard: modern dark theme, stat cards, clean tables
- Redesigned login page to match
- Restored API key generation in install script
- Keep API key field in TUI settings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:09:39 +02:00
shuki
1a24371446 Replace Flask web dashboard with textual-serve
Serves the exact same TUI in the browser via textual-serve.
No more separate Flask app, API keys, or login page needed.

- gniza web start now runs textual-serve instead of Flask
- Simplified systemd service to use python3 -m tui --web
- Removed web_enabled and web_api_key from settings/models
- Simplified install script web setup (no API key generation)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:05:29 +02:00
shuki
97918f259e Read web dashboard prompt from /dev/tty for curl|bash support
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 06:01:00 +02:00
shuki
3464a0d19f Fix web dashboard config path and install script robustness
- Fix GNIZA_CONFIG_DIR in systemd service: /usr/local/gniza/etc -> /etc/gniza
- Add LOG_DIR and PYTHONPATH to systemd environment
- Fix default CONFIG_DIR in web/app.py and web/__main__.py
- Refactor install.sh web setup into function for robustness
- Replace Unicode box-drawing chars with ASCII in install.sh
- Read from /dev/tty to prevent stdin issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:55:33 +02:00
shuki
a868143eca Fix install web setup: use if/else instead of grep&&sed||echo chain
The && || chain with set -e caused syntax errors on some systems.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:44:48 +02:00
shuki
0bce1bc194 Simplify install web setup for maximum bash compatibility
Use POSIX [ ] tests instead of [[ ]], avoid case statement,
replace em-dash with ASCII, use simple if/then/fi structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:43:52 +02:00
shuki
29948d454a Fix install script web setup to avoid bash compatibility issues
Replace nested if/fi with case statement and inline sed calls
instead of helper function. Add error handling for service install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:42:55 +02:00
shuki
cf00ecdd4b Add web dashboard with systemd service support
- Flask web dashboard with dark theme matching TUI
- Login with API key authentication
- Dashboard shows targets, remotes, schedules, last backup status
- Trigger backups from web UI per target
- View logs via /api/logs endpoint
- systemd service: gniza web install-service / remove-service / status
- CLI: gniza web start [--port=PORT] [--host=HOST]
- TUI settings: web enabled, port, host, API key fields
- Install script: optional web dashboard setup with auto-generated API key
- Uninstall script: removes systemd service

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:34:02 +02:00
shuki
b3c055c9be Add configurable WORK_DIR instead of /tmp for temp files
Default: /usr/local/gniza/workdir (root) or ~/.local/state/gniza/workdir
(user). MySQL dumps and rclone temp configs now use WORK_DIR. Configurable
via gniza.conf or TUI Settings screen. Created during install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:00:21 +02:00
shuki
121a615e67 Remove legacy gum TUI and clean up install script
- Delete all lib/ui_*.sh files (gum-based TUI)
- Remove gum download from install script
- Remove gum fallback and show_logo from bin/gniza
- Update README to reference Textual TUI and web GUI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:15:52 +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
a27ae7faf4 Bundle gum binary with gniza installation
- Install script auto-downloads gum from GitHub releases into
  $INSTALL_DIR/bin/gum (supports x86_64, arm64, armv7, i386)
- Skips download if gum is already installed system-wide
- bin/gniza adds $GNIZA_DIR/bin to PATH so bundled gum is found
- No system package installation required

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:20:00 +02:00
shuki
6c16f65c3c Replace whiptail TUI with gum (charmbracelet/gum)
- Rewrite ui_common.sh wrappers to use gum choose, gum input,
  gum confirm, gum style, gum pager
- Menu items display as "TAG  Description" for reliable tag extraction
  (handles duplicate descriptions safely)
- Replace whiptail --gauge with text-based progress bar
- Use printf %b instead of echo -e to avoid escape injection
- Read msgbox keypress from /dev/tty to work in piped contexts
- Update bin/gniza, install.sh, README.md references

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 21:45:15 +02:00
shuki
30c87a9147 Add curl one-liner install support
- Switch REPO_URL to HTTPS for machines without SSH keys
- Handle piped execution (curl | bash) where BASH_SOURCE is unavailable
- Add one-liner install commands to README (root and user mode)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 21:33:11 +02:00
shuki
43daeec779 Update REPO_URL to Gitea server in install script and README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 21:31:24 +02:00
shuki
928d5af54c Initial implementation of gniza4linux backup tool
Complete Linux backup manager with Whiptail TUI and CLI interface.
Adapted from gniza4cp (cPanel backup tool) with target/profile-based
system replacing cPanel-specific features.

- 14 core engine modules (backup, restore, targets, remotes, transfer, etc.)
- 11 Whiptail TUI screens (full CRUD for targets/remotes/schedules)
- CLI entrypoint with subcommands for scripting/cron
- Support for SSH, local, S3, and Google Drive remotes
- rsync --link-dest incremental snapshots
- Root and user mode (XDG paths)
- 70 passing tests
- Config templates, installer, uninstaller

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 21:15:29 +02:00