Fix branding: display GNIZA in UI, fix remaining double-replacements in bin and AdminBin
This commit is contained in:
@@ -847,7 +847,7 @@ cmd_status() {
|
||||
|
||||
local hostname; hostname=$(hostname -f)
|
||||
|
||||
echo "${C_BOLD}gniza4cp v${GNIZA4CP4CP_VERSION}${C_RESET}"
|
||||
echo "${C_BOLD}gniza4cp v${GNIZA4CP_VERSION}${C_RESET}"
|
||||
echo ""
|
||||
echo "Hostname: $hostname"
|
||||
echo "Log level: ${LOG_LEVEL}"
|
||||
@@ -1468,7 +1468,7 @@ cmd_stats() {
|
||||
|
||||
cmd_usage() {
|
||||
cat <<EOF
|
||||
${C_BOLD}gniza4cp v${GNIZA4CP4CP_VERSION}${C_RESET} — cPanel Backup, Restore & Disaster Recovery
|
||||
${C_BOLD}gniza4cp v${GNIZA4CP_VERSION}${C_RESET} — cPanel Backup, Restore & Disaster Recovery
|
||||
|
||||
${C_BOLD}Usage:${C_RESET}
|
||||
gniza4cp <command> [options]
|
||||
@@ -1533,7 +1533,7 @@ EOF
|
||||
main() {
|
||||
# Global --debug flag (used by config.sh load_config)
|
||||
# shellcheck disable=SC2034
|
||||
has_flag debug "$@" && GNIZA4CP4CP_DEBUG=true || GNIZA4CP4CP_DEBUG=false
|
||||
has_flag debug "$@" && GNIZA4CP_DEBUG=true || GNIZA4CP_DEBUG=false
|
||||
|
||||
local command="${1:-}"
|
||||
shift 2>/dev/null || true
|
||||
@@ -1549,7 +1549,7 @@ main() {
|
||||
remote) cmd_remote "$@" ;;
|
||||
schedule) cmd_schedule "$@" ;;
|
||||
stats) cmd_stats "$@" ;;
|
||||
version) echo "gniza4cp v${GNIZA4CP4CP_VERSION}" ;;
|
||||
version) echo "gniza4cp v${GNIZA4CP_VERSION}" ;;
|
||||
help|-h|--help) cmd_usage ;;
|
||||
"") cmd_usage ;;
|
||||
*) die "Unknown command: $command"$'\n'"Run 'gniza4cp help' for usage" ;;
|
||||
|
||||
@@ -8,11 +8,11 @@ use IPC::Open3;
|
||||
use Symbol 'gensym';
|
||||
use POSIX qw(setsid);
|
||||
|
||||
my $GNIZA4CP4CP_BIN = '/usr/local/bin/gniza4cp';
|
||||
my $GNIZA4CP_BIN = '/usr/local/bin/gniza4cp';
|
||||
my $MAIN_CONFIG = '/etc/gniza4cp/gniza4cp.conf';
|
||||
my $REMOTES_DIR = '/etc/gniza4cp/remotes.d';
|
||||
|
||||
# Argument validation patterns (mirrors Gniza4cp4cpWHM::Runner)
|
||||
# Argument validation patterns (mirrors Gniza4cpWHM::Runner)
|
||||
my %OPT_PATTERNS = (
|
||||
remote => qr/^[a-zA-Z0-9_,-]+$/,
|
||||
timestamp => qr/^\d{4}-\d{2}-\d{2}T\d{6}$/,
|
||||
@@ -90,7 +90,7 @@ sub _run_gniza4cp {
|
||||
|
||||
my $err_fh = gensym;
|
||||
my ($in, $out);
|
||||
my $pid = eval { open3($in, $out, $err_fh, $GNIZA4CP4CP_BIN, @args) };
|
||||
my $pid = eval { open3($in, $out, $err_fh, $GNIZA4CP_BIN, @args) };
|
||||
unless ($pid) {
|
||||
return (0, '', "Failed to execute gniza4cp: $@");
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ print $cpanel->header('');
|
||||
my $remotes_raw = eval { Cpanel::AdminBin::Call::call('Gniza4cp', 'Restore', 'LIST_ALLOWED_REMOTES') } // '';
|
||||
my @remotes = grep { $_ ne '' } split /\n/, $remotes_raw;
|
||||
|
||||
print Gniza4cpCPanel::UI::page_header('GNIZA4CP Backups');
|
||||
print Gniza4cpCPanel::UI::page_header('GNIZA Backups');
|
||||
print Gniza4cpCPanel::UI::render_nav('index.live.cgi');
|
||||
print Gniza4cpCPanel::UI::render_flash();
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{
|
||||
"type": "link",
|
||||
"id": "gniza4cp",
|
||||
"name": "GNIZA4CP Backups",
|
||||
"name": "GNIZA Backups",
|
||||
"group_id": "files",
|
||||
"description": "Restore files, databases, email, and more from gniza4cp backups",
|
||||
"description": "Restore files, databases, email, and more from GNIZA backups",
|
||||
"uri": "gniza4cp/index.live.cgi",
|
||||
"feature": "gniza4cp_restore",
|
||||
"order": 1,
|
||||
|
||||
@@ -35,7 +35,7 @@ sub render_nav {
|
||||
my $logo = '';
|
||||
if ($_logo_data_uri) {
|
||||
$logo = qq{<img src="$_logo_data_uri" alt="" style="height:3rem;width:auto">}
|
||||
. qq{<span class="text-3xl font-bold leading-none">GNIZA4CP <span class="text-secondary">Backup</span></span>};
|
||||
. qq{<span class="text-3xl font-bold leading-none">GNIZA <span class="text-secondary">Backup</span></span>};
|
||||
}
|
||||
my $menu_items = '';
|
||||
for my $item (@NAV_ITEMS) {
|
||||
@@ -207,7 +207,7 @@ sub csrf_hidden_field {
|
||||
|
||||
sub page_header {
|
||||
my ($title) = @_;
|
||||
$title = esc($title // 'gniza4cp Restore');
|
||||
$title = esc($title // 'GNIZA Restore');
|
||||
my $css = '';
|
||||
if (open my $fh, '<', $CSS_FILE) {
|
||||
local $/;
|
||||
|
||||
@@ -37,7 +37,7 @@ exit;
|
||||
sub show_list {
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
print $cpanel->header('');
|
||||
print Gniza4cpCPanel::UI::page_header('GNIZA4CP Activity Log');
|
||||
print Gniza4cpCPanel::UI::page_header('GNIZA Activity Log');
|
||||
print Gniza4cpCPanel::UI::render_nav('logs.live.cgi');
|
||||
print Gniza4cpCPanel::UI::render_flash();
|
||||
|
||||
@@ -134,7 +134,7 @@ sub show_entry {
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
print $cpanel->header('');
|
||||
print Gniza4cpCPanel::UI::page_header('GNIZA4CP Activity Detail');
|
||||
print Gniza4cpCPanel::UI::page_header('GNIZA Activity Detail');
|
||||
print Gniza4cpCPanel::UI::render_nav('logs.live.cgi');
|
||||
|
||||
# Validate entry index (numeric only)
|
||||
|
||||
@@ -53,9 +53,9 @@ if (($form->{'action'} // '') eq 'refresh_stats' && ($ENV{'REQUEST_METHOD'} // '
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Dashboard', '', '/cgi/gniza4cp-whm/index.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Dashboard', '', '/cgi/gniza4cp-whm/index.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('GNIZA4CP Backup Manager');
|
||||
print Gniza4cpWHM::UI::page_header('GNIZA Backup Manager');
|
||||
print Gniza4cpWHM::UI::render_nav('index.cgi');
|
||||
print Gniza4cpWHM::UI::render_flash();
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ sub render_nav {
|
||||
if ($_logo_data_uri) {
|
||||
$logo = qq{<div class="flex items-center gap-2">}
|
||||
. qq{<img src="$_logo_data_uri" alt="" class="h-12 w-auto">}
|
||||
. qq{<span class="text-3xl font-bold leading-none">GNIZA4CP <span class="text-secondary">Backup</span></span>}
|
||||
. qq{<span class="text-3xl font-bold leading-none">GNIZA <span class="text-secondary">Backup</span></span>}
|
||||
. qq{</div>};
|
||||
}
|
||||
# Build menu items for reuse in both mobile dropdown and desktop menu
|
||||
@@ -696,7 +696,7 @@ sub test_smtp_connection {
|
||||
|
||||
sub page_header {
|
||||
my ($title) = @_;
|
||||
$title = esc($title // 'GNIZA4CP Backup Manager');
|
||||
$title = esc($title // 'GNIZA Backup Manager');
|
||||
my $css = '';
|
||||
if (open my $fh, '<', $CSS_FILE) {
|
||||
local $/;
|
||||
|
||||
@@ -36,7 +36,7 @@ exit;
|
||||
sub show_list {
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('gniza4cp — Logs');
|
||||
print Gniza4cpWHM::UI::page_header('GNIZA4CP Backup Manager');
|
||||
print Gniza4cpWHM::UI::page_header('GNIZA Backup Manager');
|
||||
print Gniza4cpWHM::UI::render_nav('logs.cgi');
|
||||
print Gniza4cpWHM::UI::render_flash();
|
||||
|
||||
@@ -175,7 +175,7 @@ sub show_file {
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('gniza4cp — Log Viewer');
|
||||
print Gniza4cpWHM::UI::page_header('GNIZA4CP Backup Manager');
|
||||
print Gniza4cpWHM::UI::page_header('GNIZA Backup Manager');
|
||||
print Gniza4cpWHM::UI::render_nav('logs.cgi');
|
||||
|
||||
# Validate filename (prevents path traversal)
|
||||
|
||||
@@ -141,7 +141,7 @@ sub handle_test_connection {
|
||||
|
||||
sub handle_list {
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Remotes', '', '/cgi/gniza4cp-whm/remotes.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Remotes', '', '/cgi/gniza4cp-whm/remotes.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('Remote Destinations');
|
||||
print Gniza4cpWHM::UI::render_nav('remotes.cgi');
|
||||
@@ -595,7 +595,7 @@ sub handle_add {
|
||||
RENDER_ADD:
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Add Remote', '', '/cgi/gniza4cp-whm/remotes.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Add Remote', '', '/cgi/gniza4cp-whm/remotes.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('Add Remote Destination');
|
||||
print Gniza4cpWHM::UI::render_nav('remotes.cgi');
|
||||
@@ -703,7 +703,7 @@ sub handle_edit {
|
||||
}
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Edit Remote', '', '/cgi/gniza4cp-whm/remotes.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Edit Remote', '', '/cgi/gniza4cp-whm/remotes.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header("Edit Remote: " . Gniza4cpWHM::UI::esc($name));
|
||||
print Gniza4cpWHM::UI::render_nav('remotes.cgi');
|
||||
|
||||
@@ -153,7 +153,7 @@ sub handle_fetch_accounts {
|
||||
|
||||
sub handle_step1 {
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Restore', '', '/cgi/gniza4cp-whm/restore.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Restore', '', '/cgi/gniza4cp-whm/restore.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('Restore from Backup');
|
||||
print Gniza4cpWHM::UI::render_nav('restore.cgi');
|
||||
@@ -305,7 +305,7 @@ sub handle_step2 {
|
||||
my ($ok, $stdout, $stderr) = Gniza4cpWHM::Runner::run('list', undef, [], { remote => $remote, account => $account });
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Restore', '', '/cgi/gniza4cp-whm/restore.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Restore', '', '/cgi/gniza4cp-whm/restore.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('Restore from Backup');
|
||||
print Gniza4cpWHM::UI::render_nav('restore.cgi');
|
||||
@@ -995,7 +995,7 @@ sub handle_step3 {
|
||||
}
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Restore', '', '/cgi/gniza4cp-whm/restore.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Restore', '', '/cgi/gniza4cp-whm/restore.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('Restore from Backup');
|
||||
print Gniza4cpWHM::UI::render_nav('restore.cgi');
|
||||
|
||||
@@ -34,7 +34,7 @@ exit;
|
||||
|
||||
sub handle_list {
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Schedules', '', '/cgi/gniza4cp-whm/schedules.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Schedules', '', '/cgi/gniza4cp-whm/schedules.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('Schedule Management');
|
||||
print Gniza4cpWHM::UI::render_nav('schedules.cgi');
|
||||
@@ -239,7 +239,7 @@ sub handle_add {
|
||||
RENDER_ADD:
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Add Schedule', '', '/cgi/gniza4cp-whm/schedules.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Add Schedule', '', '/cgi/gniza4cp-whm/schedules.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('Add Schedule');
|
||||
print Gniza4cpWHM::UI::render_nav('schedules.cgi');
|
||||
@@ -317,7 +317,7 @@ sub handle_edit {
|
||||
}
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Edit Schedule', '', '/cgi/gniza4cp-whm/schedules.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Edit Schedule', '', '/cgi/gniza4cp-whm/schedules.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header("Edit Schedule: " . Gniza4cpWHM::UI::esc($name));
|
||||
print Gniza4cpWHM::UI::render_nav('schedules.cgi');
|
||||
|
||||
@@ -108,7 +108,7 @@ if ($method eq 'POST') {
|
||||
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA4CP Backup Manager — Settings', '', '/cgi/gniza4cp-whm/settings.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Backup Manager — Settings', '', '/cgi/gniza4cp-whm/settings.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('Settings');
|
||||
print Gniza4cpWHM::UI::render_nav('settings.cgi');
|
||||
|
||||
@@ -19,9 +19,9 @@ exit;
|
||||
|
||||
sub handle_step1 {
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
Whostmgr::HTMLInterface::defheader('gniza4cp Setup Wizard', '', '/cgi/gniza4cp-whm/setup.cgi');
|
||||
Whostmgr::HTMLInterface::defheader('GNIZA Setup Wizard', '', '/cgi/gniza4cp-whm/setup.cgi');
|
||||
|
||||
print Gniza4cpWHM::UI::page_header('gniza4cp Setup Wizard');
|
||||
print Gniza4cpWHM::UI::page_header('GNIZA Setup Wizard');
|
||||
|
||||
my $keys = Gniza4cpWHM::UI::detect_ssh_keys();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user