Commit Graph

146 Commits

Author SHA1 Message Date
shuki
8f42cc19c9 Use public IP for git clone in install script
Target servers won't have the gitea SSH alias, so use the direct
SSH URL with the public IP for remote installs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 06:17:06 +02:00
shuki
b22a8d14a7 Update repository URLs to use gitea SSH config alias
Replace hardcoded 192.168.100.100 addresses with gitea SSH alias
from ~/.ssh/config across CLAUDE.md, README.md, and install.sh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 06:16:13 +02:00
shuki
bf6624b607 Add daily stats collection cron job at 05:00 UTC
The gniza stats command is now automatically scheduled when
install_schedules() runs, tagged as # gniza:_stats so it is
managed alongside backup schedules (installed/removed together).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 05:33:55 +02:00
shuki
325020338d Replace stat components with card-based layout for stats grid
DaisyUI stat components have internal styles that conflict when used
as standalone grid items, causing vertical overlap. Switch to plain
card components with manual typography classes instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 05:30:21 +02:00
shuki
46edee9dc2 Fix stats cards overlap and make grid responsive
Remove stat-figure emoji icons that caused content overflow and
switch from fixed grid-cols-3 to responsive grid-cols-2 sm:grid-cols-3.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 05:26:54 +02:00
shuki
7404e88cd9 Add dashboard stats cards with cached remote data
Add 6 stat cards to the WHM dashboard showing cPanel accounts, backed up
accounts, total snapshots, remotes, schedules, and last backup status.
Remote-dependent stats are collected via `gniza stats` CLI command and
cached in stats.json, with a manual Refresh button on the dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 05:23:40 +02:00
shuki
3a342f091e Add disk usage and schedule columns to WHM remotes list
Enhance the remotes table with AJAX-loaded disk usage info (SSH via df,
S3/GDrive via rclone about) and server-side schedule assignment counts
with tooltip showing schedule names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 05:08:27 +02:00
shuki
237a2b7a1f Update WHM logo SVG with latest version
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:42:36 +02:00
shuki
fc4a9ea8b1 Update cPanel icon from revised SVG
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:42:34 +02:00
shuki
45d5c4372b Use 48x48 PNG icon to match cPanel sprite expectations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:36:24 +02:00
shuki
5b2319ae6e Convert top tabs to DaisyUI navbar with menu links
Replace tabs-box with navbar component: logo+text in navbar-start,
menu links in navbar-end. Remove all inline styles, use only
Tailwind/DaisyUI classes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:36:04 +02:00
shuki
fceb9b8b88 Increase nav icon size to 48px
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:32:13 +02:00
shuki
20a8a1136e Revert to 256x256 PNG icon — cPanel sprites don't support SVG
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:30:55 +02:00
shuki
6e9e1599fb Clean up cPanel icon SVG: 48x48 viewBox, no clipPath
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:30:14 +02:00
shuki
7376c98595 Try SVG icon for cPanel plugin instead of PNG
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:28:53 +02:00
shuki
a273b996e8 Fix blurry cPanel icon: 256x256 PNG + per-user sprite rebuild
Regenerated icon at 256x256 with transparency for crisp rendering.
Added cpapi2 Branding gensprites call for all cPanel users during
install so sprites update immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:28:01 +02:00
shuki
440d741fdb Match logo text size to icon height (32px)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:21:15 +02:00
shuki
a81702f344 Increase nav logo text size from 1.4rem to 2rem
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:20:24 +02:00
shuki
b7232f9c69 Replace blurry 48x48 cPanel icon with crisp 128x128 PNG
Reverts SVG approach (cPanel sprites don't support SVG) and
regenerates PNG at higher resolution from the SVG source.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:20:14 +02:00
shuki
ffd4792aa0 Update WHM logo: new icon + "GNIZA Backup" text in nav
Replace old logo SVG with gniza.svg and render the icon alongside
"GNIZA Backup" text where "Backup" uses the icon's orange (#f47216).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:19:46 +02:00
shuki
e48907ecd4 Switch cPanel plugin icon from PNG to SVG for crisp rendering
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:18:00 +02:00
shuki
7b2a9ad601 Move logo inline with nav tabs instead of above them
Place the SVG icon next to the tab bar in a flex row instead of
rendering it as a separate centered block above the navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 04:15:58 +02:00
shuki
7f84778351 Disable Terminate First toggle in Selective restore mode
Uncheck and disable the toggle when switching to Selective so
the value cannot carry through to the confirmation step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:52:43 +02:00
shuki
1e6097eb9e Fix restore spinner not hiding due to !important CSS override
Use hidden class toggle instead of inline style.display, since
Tailwind CSS is built with the important flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:50:05 +02:00
shuki
6ecba2ae43 Load restore account dropdown from remote backups via AJAX
The WHM restore page now populates the account dropdown dynamically
from the selected remote, making terminated/removed accounts visible
and restorable. Accounts not on the local server show "(terminated)".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:43:00 +02:00
shuki
d069c490ae Add Status column (Success/Warning/Error) to WHM logs list
Scans each log file for [ERROR] and [WARN] markers and displays
a color-coded badge in the logs table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:40:45 +02:00
shuki
05db1f2340 Fix restore: use whmapi1 removeacct instead of /scripts/removeacct
The /scripts/removeacct script was failing with "You do not have
permission to remove that account" even when running as root. Switch
to whmapi1 removeacct which uses the WHM API with proper root
authentication context. Also check the whmapi1 result field since
whmapi1 returns exit code 0 even on logical failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:36:28 +02:00
shuki
3b5488f0d7 Fix restore: correct removeacct argument order, add debug output
cPanel's removeacct expects username before flags. Also capture and
log the command output to aid debugging if termination still fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:33:31 +02:00
shuki
6779db023a Fix restore: remove invalid --skipbw flag from removeacct
The /scripts/removeacct command only accepts --force and --keepdns.
The --skipbw flag is not a valid option and was causing account
termination to fail during full account restore with terminate enabled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:28:39 +02:00
shuki
4408917aec Redesign cPanel restore plugin to match WHM workflow
Replace the 8-card category grid with a unified restore workflow:
- index.live.cgi: now serves as Step 1 (remote + snapshot selection)
- restore.live.cgi: Step 2 (Full Account/Selective mode toggle with
  type checkboxes, exclude paths, file browser), Step 3 (multi-type
  confirmation), Step 4 (multi-type execution via AdminBin)

Also update cPanel plugin icon from gniza.svg source.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:13:53 +02:00
shuki
9dc427a1e6 Fix AdminBin: use get_caller_username() instead of REMOTE_USER
AdminBin modules run as root, so $ENV{'REMOTE_USER'} is not set.
The correct way to get the authenticated cPanel user is via the
parent class method get_caller_username().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 02:31:50 +02:00
shuki
8822f93438 Fix JS syntax errors: convert qq{} to heredocs in restore.live.cgi
Perl's qq{} delimiter matches balanced braces, which conflicted with
JavaScript curly braces, producing empty function bodies. Converted
_print_step1_js and _print_step2_js to heredoc blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 02:16:58 +02:00
shuki
d26a327595 Add cPanel chrome (sidebar/topbar) to plugin pages
Use $cpanel->header() and $cpanel->footer() from LiveAPI to wrap
plugin content in cPanel's standard layout with sidebar navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 02:08:56 +02:00
shuki
97eb3ff2ed Remove Content-Type header from index.live.cgi
cPanel's live engine provides the HTTP headers and page chrome
(sidebar, topbar). CGI should not output its own Content-Type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 02:04:00 +02:00
shuki
c672c9d8ee Fix AdminBin: move run() after variable declarations
__PACKAGE__->run() was called before my variables were declared,
so $MAIN_CONFIG and $REMOTES_DIR were undef when action methods ran.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 02:01:28 +02:00
shuki
af46c76e62 Fix LIVEAPI error: initialize Cpanel::LiveAPI in .live.cgi files
cPanel's live engine requires .live.cgi files to create a
Cpanel::LiveAPI connection. Without it, the engine cannot
establish communication with the CGI subprocess.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 01:59:53 +02:00
shuki
065f83d691 Fix AdminBin: add shebang and __PACKAGE__->run()
cPanel's adminbin framework requires the module to be directly
executable with a shebang line, and Script::Call modules need
__PACKAGE__->run() to bootstrap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 01:57:56 +02:00
shuki
3b6d9ea88f Fix AdminBin compilation: declare $in/$out before open3
Variables declared with 'my' inside open3() were scoped to that call,
causing 'Global symbol requires explicit package name' errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 01:52:19 +02:00
shuki
a769281e88 Rename cPanel plugin to GNIZA Backups
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 01:49:53 +02:00
shuki
0aa5e26a02 Fix cPanel icon: use 48x48 PNG for sprite compatibility
The SVG had negative coordinates that rendered off-screen in cPanel's
sprite sheet. Export to clean 48x48 PNG (2.8KB) instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 01:48:14 +02:00
shuki
7e5fd16a3c Add rebuild_sprites after cPanel plugin install
cPanel requires sprite rebuild for new icons to appear in the interface.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 01:43:22 +02:00
shuki
70ef4d3bcd Use gniza SVG icon for cPanel plugin
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 01:40:22 +02:00
shuki
c1555da3c7 Use gniza backup PNG icon for cPanel plugin
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:52:59 +02:00
shuki
66e9cb9def Revert cPanel icon to original gniza-logo.svg
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:50:55 +02:00
shuki
5bb85c35ef Fix cPanel icon: replace headphones with backup/restore icon
Server box with data rows (navy) and circular restore arrow (copper)
matching gniza brand colors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:42:42 +02:00
shuki
f297d40a85 Add lightweight cPanel icon and update plugin registration
Replace 378KB VTracer-traced logo with a clean 1KB 48x48 SVG icon
for cPanel's icon system. Update install.json, install.sh, and
uninstall.sh to reference the new icon. Also update README with
skip-suspended flag and schedule config fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:40:57 +02:00
shuki
894c918d32 Document correct cPanel install.json format with required fields
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:34:58 +02:00
shuki
a87ca4a823 Fix cPanel plugin registration: correct install.json format and include icon
- install.json: use cPanel's required fields (type, id, group_id, uri)
  instead of incorrect keys (target_type, category, url)
- Include icon SVG in tar.gz archive (install_plugin validates icon exists)
- Without correct fields, install_plugin silently skipped registration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:34:43 +02:00
shuki
c05a0293b0 Comprehensive documentation update for cPanel plugin, install scripts, and security
- Expand cPanel User Restore Plugin section with restore categories table,
  CGI naming convention, AdminBin validation patterns, and registration details
- Add detailed GnizaCPanel::UI function reference including safe I/O functions
- Expand AdminBin Module section with validation regex table and remote filtering
- Reorganize Security section into CLI, WHM, and cPanel subsections
- Add Install/Uninstall Scripts section documenting all steps and tar.gz quirk
- Add Upgrade Considerations section (CSRF file→dir migration, token write
  robustness, SMTP test token sync)
- Add "Adding a new cPanel plugin page" guide

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:17:45 +02:00
shuki
a779d861a6 Fix CSRF upgrade path: remove stale file before creating directory
Old versions stored CSRF/flash as plain files at the directory path.
New code expects directories. _ensure_dir now removes conflicting
plain files left by older versions.

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