Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 54 additions & 16 deletions checksum/index.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File Checksum</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="../style.css">
</head>
<body>
<body class="bg-zinc-950 text-zinc-200 min-h-screen flex flex-col items-center justify-center relative bg-grid-overlay">

<form method="post">
<button type="submit" name="checksum">Generate Checksum</button>
</form>
<!-- Ambient blob -->
<div class="absolute inset-0 overflow-hidden pointer-events-none z-0" aria-hidden="true">
<div class="animate-blob absolute top-1/3 left-1/2 -translate-x-1/2 w-96 h-96 bg-amber-900/15 rounded-full blur-3xl"></div>
</div>

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['checksum'])) {
$file = '../dl/KT-latest.zip';
<div class="relative z-10 w-full max-w-md px-4 animate-fade-in-up">

if (file_exists($file)) {
$checksum = hash_file('sha256', $file);
echo "<p>SHA256 Checksum: <strong>$checksum</strong></p>";
} else {
echo "<p style='color:red;'>File not found!</p>";
}
}
?>
<!-- Card -->
<div class="glass-card rounded-2xl p-8 text-center shadow-2xl">

<!-- Icon + title -->
<div class="flex items-center justify-center gap-3 mb-6">
<div class="bg-amber-600/20 p-3 rounded-xl border border-amber-500/30">
<svg class="w-6 h-6 text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
</svg>
</div>
<h1 class="text-xl font-bold text-white tracking-tight">File Checksum</h1>
</div>

<p class="text-sm text-zinc-500 mb-6">Generate a SHA-256 checksum for <span class="font-mono text-zinc-300">KT-latest.zip</span></p>

<form method="post">
<button type="submit" name="checksum"
class="w-full flex items-center justify-center gap-2 px-6 py-3 bg-amber-600 hover:bg-amber-500 text-white font-semibold rounded-xl transition-all btn-glow-amber hover-lift border border-amber-500">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
</svg>
Generate Checksum
</button>
</form>

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['checksum'])) {
$file = '../dl/KT-latest.zip';
if (file_exists($file)) {
$checksum = hash_file('sha256', $file);
echo '<div class="mt-6 text-left">';
echo '<p class="text-xs text-zinc-500 uppercase tracking-widest font-semibold mb-2">SHA-256 Checksum</p>';
echo '<div class="code-block break-all">' . htmlspecialchars($checksum) . '</div>';
echo '</div>';
} else {
echo '<div class="mt-6 flex items-center gap-2 bg-red-900/20 border border-red-500/30 rounded-xl px-4 py-3 text-red-400 text-sm">';
echo '<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>';
echo 'File not found!';
echo '</div>';
}
}
?>
</div>

</div>
</body>
</html>
99 changes: 75 additions & 24 deletions debug/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,85 @@ function formatSize($bytes) {
?>

<!DOCTYPE html>
<html lang="en">
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<title>Debug Page</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="../style.css">
</head>
<body>
<div class="container mt-5">
<h1>Debug Utility</h1>
<div class="mt-4">
<form method="POST">
<button type="submit" name="list_files" class="btn btn-primary mb-3">[DEBUG] List all files in download directory</button>
<button type="submit" name="list_chunks" class="btn btn-secondary mb-3">[DEBUG] List all chunks (failed or live)</button>
<button type="submit" name="checksum" class="btn btn-warning mb-3">[DEBUG] SHA 256 CheckSum of KT-latest.zip</button>
<button type="submit" name="checksum2" class="btn btn-warning mb-3">[DEBUG] SHA 256 CheckSum of KT-new.zip</button>
</form>
<body class="bg-zinc-950 text-zinc-200 min-h-screen relative bg-grid-overlay">

<!-- Ambient blobs -->
<div class="absolute inset-0 overflow-hidden pointer-events-none z-0" aria-hidden="true">
<div class="animate-blob absolute top-0 right-0 w-96 h-96 bg-amber-900/10 rounded-full blur-3xl"></div>
<div class="animate-blob animation-delay-4000 absolute bottom-0 left-0 w-80 h-80 bg-indigo-900/10 rounded-full blur-3xl"></div>
</div>

<div class="mt-4">
<h2>Output:</h2>
<pre class="border p-3">
<div class="relative z-10 max-w-3xl mx-auto px-4 py-12">

<!-- Header -->
<div class="mb-10 animate-fade-in-up">
<div class="flex items-center gap-3 mb-1">
<div class="bg-amber-600/20 p-2.5 rounded-xl border border-amber-500/30">
<svg class="w-5 h-5 text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
</div>
<h1 class="text-2xl font-bold text-white tracking-tight">Debug Utility</h1>
</div>
<p class="text-sm text-zinc-500 ml-14">Internal diagnostics &amp; file inspection tools</p>
</div>

<!-- Action buttons card -->
<div class="glass-card rounded-2xl p-6 mb-8 animate-fade-in-up delay-100">
<h2 class="text-xs font-semibold text-zinc-500 uppercase tracking-widest mb-4">Actions</h2>
<form method="POST" class="flex flex-wrap gap-3">
<button type="submit" name="list_files"
class="group flex items-center gap-2 px-4 py-2.5 bg-indigo-600 hover:bg-indigo-500 text-white text-sm font-semibold rounded-lg transition-all btn-glow-indigo hover-lift border border-indigo-500">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16"/>
</svg>
[DEBUG] List all files in download directory
</button>

<button type="submit" name="list_chunks"
class="group flex items-center gap-2 px-4 py-2.5 bg-zinc-700 hover:bg-zinc-600 text-zinc-200 hover:text-white text-sm font-semibold rounded-lg transition-all hover-lift border border-zinc-600 hover:border-zinc-500">
<svg class="w-4 h-4 text-zinc-400 group-hover:text-zinc-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2"/>
</svg>
[DEBUG] List all chunks (failed or live)
</button>

<button type="submit" name="checksum"
class="group flex items-center gap-2 px-4 py-2.5 bg-amber-600 hover:bg-amber-500 text-white text-sm font-semibold rounded-lg transition-all hover-lift border border-amber-500">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
</svg>
[DEBUG] SHA 256 CheckSum of KT-latest.zip
</button>

<button type="submit" name="checksum2"
class="group flex items-center gap-2 px-4 py-2.5 bg-amber-700 hover:bg-amber-600 text-white text-sm font-semibold rounded-lg transition-all hover-lift border border-amber-600">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/>
</svg>
[DEBUG] SHA 256 CheckSum of KT-new.zip
</button>
</form>
</div>

<!-- Output card -->
<div class="glass-card rounded-2xl p-6 animate-fade-in-up delay-200">
<h2 class="text-xs font-semibold text-zinc-500 uppercase tracking-widest mb-4 flex items-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
Output
</h2>
<pre class="code-block">
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['list_files'])) {
Expand Down Expand Up @@ -85,15 +142,9 @@ function formatSize($bytes) {
}
}
?>
</pre>
</div>
</div>



<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>


</pre>
</div>

</div>
</body>
</html>
12 changes: 6 additions & 6 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ function listFiles($title, $folder) {
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KT - Management [Alleria]</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="style.css">
<style>
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #18181b; }
::-webkit-scrollbar-track { background: #09090b; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
</style>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-J0WCNB0WDW"></script>
<script>
Expand All @@ -72,13 +72,13 @@ function gtag(){dataLayer.push(arguments);}
gtag('config', 'G-J0WCNB0WDW');
</script>
</head>
<body class="bg-zinc-950 text-zinc-200 h-full flex flex-col overflow-hidden">
<body class="bg-zinc-950 text-zinc-200 h-full flex flex-col overflow-hidden bg-grid-overlay">

<header class="bg-zinc-900 border-b border-zinc-800 shadow-md z-20 flex-shrink-0">
<header class="bg-zinc-900/90 backdrop-blur-md border-b border-zinc-800/80 shadow-lg shadow-black/20 z-20 flex-shrink-0">
<div class="w-full flex flex-wrap items-center justify-between px-6 py-3">

<div class="flex items-center mr-8 flex-shrink-0">
<div class="bg-indigo-600 p-2 rounded-lg mr-3 shadow-lg shadow-indigo-500/20">
<div class="bg-indigo-600 p-2 rounded-lg mr-3 shadow-lg shadow-indigo-500/30 ring-1 ring-indigo-400/20">
<img src="http://alleria.pl/image/favicon.png" alt="Alleria Logo" class="w-6 h-6 object-contain">
</div>
<div>
Expand Down Expand Up @@ -165,7 +165,7 @@ class="w-full h-full border-none opacity-0 transition-opacity duration-500"
<?php } ?>
</main>

<footer class="bg-zinc-900 border-t border-zinc-800 py-3 flex-shrink-0 z-20">
<footer class="bg-zinc-900/90 backdrop-blur-md border-t border-zinc-800/80 py-3 flex-shrink-0 z-20">
<div class="text-center text-xs font-mono text-zinc-500">
&copy; 2025 - <?php echo $currentYear; ?> <a target="_blank" href="https://alleria.pl" class="text-zinc-300 hover:text-white transition-colors">Alleria</a> | All Rights Reserved |
Built by <a target="_blank" href="https://x.com/henas_pl" class="text-zinc-300 hover:text-white transition-colors">@henas_pl</a>
Expand Down
Loading