Commit Graph

157 Commits

Author SHA1 Message Date
shuki
2cf0a8866c Always write all log levels to file, only filter console output
LOG_LEVEL was gating both file and console output, causing empty
log files when set to error/warn. Now the log file always captures
everything while LOG_LEVEL only controls stderr verbosity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 18:55:55 +02:00
shuki
55cd576d53 Show WHM-specific next steps when cPanel is detected
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 18:51:40 +02:00
shuki
beb17a2298 Update repository URLs to git.linux-hosting.co.il
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 18:42:43 +02:00
shuki
89ca3187df Hide cron wrapper logs from logs listing
Only show per-run gniza-*.log files in the logs page. Cron wrapper
logs (cron-*.log) are redundant with the structured per-run logs
and just accumulate noise. They remain accessible via direct URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 18:09:17 +02:00
shuki
6be3e8fabf Show System Backup type in logs page
Add [TYPE:SYSBACKUP] marker to sysbackup log output. The logs page
detects this in the first 5 lines and displays "System" badge instead
of "Backup".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 18:06:54 +02:00
shuki
42ee83f433 Add SVG icons to dashboard stat cards
Each of the 6 stat cards now has a contextual SVG icon in the top-right
corner: users, shield-check, upload, server, clock, and file-text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 18:02:13 +02:00
shuki
0fb640d585 Use d/m/Y H:i:s date format for all user-facing timestamps
Update log lines, email notifications, generated config comments,
and WHM logs page. Structural dates (filenames, snapshot dirs,
.complete markers) are unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 07:35:49 +02:00
shuki
19368ee2c6 Use d/m/Y H:i:s format for stats updated timestamp
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 07:33:20 +02:00
shuki
af55437bed Move hamburger menu to right side of navbar
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 06:45:43 +02:00
shuki
43fdf116cc Make navbar responsive with hamburger dropdown on small screens
Desktop (lg+) shows horizontal menu links. Smaller screens show
a dropdown hamburger button with the same navigation items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 06:44:14 +02:00
shuki
3a48c3265f Use HTTP URL for git clone in install script
Target servers don't need SSH keys — use public HTTP endpoint
for unauthenticated clone during install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 06:20:32 +02:00
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