Commit Graph

17 Commits

Author SHA1 Message Date
shuki
c1d00108ba Add MySQL grants backup and MySQL restore support
- mysql_dump_grants(): backs up user grants via SHOW CREATE USER + SHOW GRANTS,
  skipping system users (root, mysql.sys, etc.)
- mysql_restore_databases(): restores .sql.gz dumps and grants.sql from snapshot
- Backup flow: grants dumped alongside database dumps into _mysql/
- Restore flow: automatically restores MySQL databases and grants when _mysql/
  exists in snapshot and target has MySQL enabled
- CLI: --skip-mysql flag to opt out of MySQL restore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:53:41 +02:00
shuki
1425c416eb Add per-schedule active toggle with crontab sync
Each schedule has SCHEDULE_ACTIVE field (yes/no). Table shows active
status with checkmark/cross. Toggle Active button flips state and
reinstalls crontab with only active schedules. Inactive schedules
are skipped during crontab install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:38:51 +02:00
shuki
313d1fe873 Replace free-text day inputs with proper dropdowns per schedule type
- Daily: multi-select checkboxes for days of week (empty = every day)
- Weekly: single dropdown for day of week
- Monthly: dropdown with 1st/7th/14th/21st/28th of the month
- Cron generation supports daily with specific days via SCHEDULE_DAY

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:11:49 +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
791584aa60 Fix MySQL dump remote path to use _mysql/ instead of full temp path
Add optional dest_name parameter to transfer_folder to override the
remote subpath. MySQL dumps now land in _mysql/ inside the snapshot
instead of tmp/gniza-mysql-xxx/_mysql/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:56:37 +02:00
shuki
733bb5de62 Add MySQL database backup support
Dump MySQL/MariaDB databases as part of backup snapshots. Each database
is dumped to a separate gzipped file under _mysql/ in the snapshot.
Supports all-databases mode with exclude list, or explicit database
selection. Includes TUI form fields for full configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:48:47 +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
3d5a9cdfdd Remove verify feature and align main menu layout
Remove verify screen, CLI subcommand, and all related functions.
Fix logo/menu height alignment on main menu screen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:57:55 +02:00
shuki
611fe7da3f Add test connection step when creating remotes
- SSH: tests ssh connection before saving, option to save anyway on failure
- Local: checks if directory exists
- S3: tests rclone connection if rclone is available
- GDrive: tests rclone connection if rclone is available
- All tests are optional and can be skipped

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:57:57 +02:00
shuki
74efc08903 Trigger wizard when either remote or target is missing
- Changed condition from AND to OR: wizard runs if remotes OR targets
  are not configured (not only when both are empty)
- Wizard skips steps that are already done (e.g. if remote exists,
  jumps straight to target creation)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:47:56 +02:00
shuki
4306b9e3b3 Open file browser immediately in folder picker
- First gum file browser opens right after target name entry
- Shows selected folders list, then offers Add/Remove/Done
- No extra menu step before the first folder selection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:43:45 +02:00
shuki
4f9ab94c69 Clarify target name prompt mentions file browser next
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:41:24 +02:00
shuki
a956bd9e30 Fix gum file browser returning relative paths
gum file returns paths relative to the start directory.
Prepend / to ensure absolute paths for backup targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:29:30 +02:00
shuki
f80c786597 Use gum file browser for folder selection in target picker
Replace manual path input with gum file --directory for browsing
and selecting folders. Adds duplicate detection. Shows selected
count in menu header.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:22:33 +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
0004dbed9f Add first-time setup wizard for new installations
Guides users through creating their first remote and target when gniza
launches with no configuration. Optionally runs a first backup.
Triggers only when both remotes.d/ and targets.d/ are empty.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 21:38:19 +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