Commit Graph

18 Commits

Author SHA1 Message Date
shuki
0eb480489e Add per-schedule toggle to skip suspended cPanel accounts
Adds SKIP_SUSPENDED config key and --skip-suspended CLI flag that
excludes suspended accounts (detected via /var/cpanel/suspended/)
from backups. Follows the same pattern as the existing SYSBACKUP
toggle across all layers: config, schedule loader, cron builder,
CLI flag parsing, and WHM UI (table toggle, AJAX handler, form card).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 19:10:18 +02:00
shuki
ade44dfff4 Align button rows with items-center to fix vertical misalignment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:01:02 +02:00
shuki
35eac96f25 Change all Cancel/Back buttons from btn-ghost to btn-info
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:59:18 +02:00
shuki
6511715b2b Add Sys Backup toggle column to schedules list
Adds a "Sys Backup" column with an AJAX toggle in the schedules
table. Toggling it updates SYSBACKUP in the schedule config and
reinstalls the cron entry to include/remove --sysbackup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:49:48 +02:00
shuki
543b38bd53 Add 'gniza schedule run <name>' command
Runs a schedule's backup immediately with the correct --remote and
--sysbackup flags from the schedule config. Also fixes WHM Run Now
button to include --sysbackup when enabled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:46:26 +02:00
shuki
0da580666c Always reinstall cron when saving a schedule
Previously the cron was only updated if it was already active.
Now every save reinstalls the cron entry so changes (like enabling
--sysbackup) take effect immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:36:20 +02:00
shuki
3547b00ead Add sysbackup/sysrestore CLI commands and schedule integration
- Add lib/sysbackup.sh and lib/sysrestore.sh for system-level
  backup and restore of WHM/cPanel config, packages, and cron jobs
- Wire cmd_sysbackup and cmd_sysrestore into bin/gniza
- Add --sysbackup flag to cmd_backup: runs system backup after all
  account backups complete
- Add SYSBACKUP schedule config key so cron jobs can include
  --sysbackup automatically via build_cron_line()
- Add "Include system backup" toggle to WHM schedule form
- Revert sysbackup toggle from remotes.cgi (belongs in schedules)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 17:30:10 +02:00
shuki
f9326390d7 Convert all anchor buttons to button elements for consistent sizing
WHM styles override <a> tag padding, making anchor-based buttons
larger than native buttons. Using <button> elements everywhere
ensures uniform button sizing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 05:50:11 +02:00
shuki
0ada0cc034 Standardize all table action buttons to btn-sm and use button elements
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 05:48:09 +02:00
shuki
2831d91916 Change schedule Edit button to btn-primary
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 05:45:12 +02:00
shuki
5d32eee62f Use btn-xs for table action buttons in remotes and schedules
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 05:44:57 +02:00
shuki
f19609423f Rename display text to GNIZA Backup Manager across all WHM pages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 05:37:26 +02:00
shuki
3805b87300 Use bg-white for card backgrounds across all WHM pages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 05:34:34 +02:00
shuki
1efde7487b Replace all inline CSS with Tailwind utility classes
Convert style attributes to Tailwind: width:fit-content → w-fit,
background:#fafafa → bg-[#fafafa], display:none → hidden attr,
display:inline → inline class, max-height → max-h-[360px],
padding/border-radius/font-size → px-5 py-3 rounded-lg text-sm.
Update JS to use .hidden property instead of .style.display.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 05:03:22 +02:00
shuki
749881dd5d Fix Run Now backup process getting killed on CGI exit
The forked child stayed in the CGI's process group and got killed
when Apache cleaned up the CGI process. Now uses double-fork with
POSIX::setsid() to fully daemonize the backup process.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 04:53:18 +02:00
shuki
425085f018 Add Run Now button to schedules page
Adds a "Run Now" button in each schedule's Actions column that
triggers the backup in the background, logging to the same cron
log file. Forks the process and redirects immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 04:30:42 +02:00
shuki
ad884665cd Refactor setup wizard to reuse remotes.cgi and schedules.cgi
Setup wizard step 1 (SSH key) stays as-is, then redirects to
remotes.cgi?action=add&wizard=1 and schedules.cgi?action=add&wizard=1
instead of reimplementing its own forms.

- Remove ~200 lines of duplicated form/handler code from setup.cgi
- Wizard gets full feature parity (S3/GDrive, password auth, etc.)
- key_path pre-fills REMOTE_KEY, remote_name pre-fills REMOTES
- wizard=1 flag chains the flow: remote add → schedule add → index

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 03:30:44 +02:00
shuki
1459bd1b8b Initial commit: gniza backup & disaster recovery CLI + WHM plugin
Full-featured cPanel backup tool with SSH, S3, and Google Drive support.
Includes WHM plugin with Tailwind/DaisyUI UI, multi-remote management,
decoupled schedules, and account restore workflows.

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