File & Directory Browser adalah script PHP tunggal (single-file PHP script) yang aman, responsif, dan sangat ringan untuk menampilkan daftar file serta direktori. Dilengkapi dengan fitur pengurutan instan, pencarian real-time tanpa reload halaman, verifikasi hash file (CRC32, MD5, SHA-1) menggunakan sistem cache lokal, perlindungan ketat dari eksploitasi path traversal, proteksi folder berbasis password dengan bcrypt hashing, serta antarmuka modern bertema glassmorphic berbasis Bootstrap 5 dan Font Awesome 6.
File & Directory Browser is a security-hardened, highly responsive, and lightweight single-file PHP script designed to display file and directory lists. It features real-time search without reloading, instant sorting, file hash verification (CRC32, MD5, SHA-1) with a local caching mechanism, strict protection against path traversal attacks, bcrypt-secured password-protected folders, and a premium glassmorphic user interface built using Bootstrap 5 and Font Awesome 6.
- 🔒 Keamanan Kelas Enterprise:
- Proteksi Path Traversal tingkat lanjut dengan normalisasi path segment dan verifikasi canonical path.
- Pembatasan Symlink eksternal secara default untuk mencegah akses di luar direktori utama.
- Header Keamanan Lengkap (Content-Security-Policy berbasis nonce, Referrer-Policy, Frame-Options, X-Content-Type-Options).
- Cookie Sesi dengan konfigurasi
HttpOnly,SameSite=Strict, danSecureflag. - Proteksi folder
.cacheotomatis menggunakan file.htaccessberisi larangan akses publik. - Proteksi Folder dengan Password menggunakan bcrypt (
password_hash/password_verify) — password tidak pernah disimpan plaintext. - CSRF protection pada form login folder, menggunakan token acak
random_bytes(32).
- ⚡ Sistem Caching Hash Pintar: Menghitung hash file (CRC32, MD5, SHA-1) hanya saat diperlukan dan menyimpannya ke cache lokal secara aman berbasis ukuran file, waktu modifikasi (mtime), dan versi cache.
- 🔍 Pencarian Real-Time & Sortir Instan: Cari nama file secara instan menggunakan JavaScript dan urutkan daftar file berdasarkan Nama, Tanggal, atau Ukuran secara cepat tanpa merusak rendering layout.
- 🎨 Antarmuka Premium & Aksesibilitas: Desain Glassmorphic dengan dukungan Dark/Light Mode, ikon file berkode warna dinamis, layout responsif penuh, tombol Back-to-Top, dan floating Home FAB button yang ramah aksesibilitas keyboard (a11y).
- ⚙️ CSS Minified: Seluruh CSS inline di-minify untuk performa loading halaman yang lebih cepat.
- 🔒 Enterprise-Grade Security:
- Advanced Path Traversal protection featuring path segment normalization and canonical path verification.
- Disabled external symlinks by default to prevent file access leaks outside the root directory.
- Robust Security Headers (Nonce-based Content-Security-Policy, Referrer-Policy, Frame-Options, X-Content-Type-Options).
- Session Cookies configured with
HttpOnly,SameSite=Strict, andSecureattributes. - Automatic creation of a protected
.cachedirectory featuring auto-generated.htaccesspublic denial access. - Password-Protected Folders secured with bcrypt (
password_hash/password_verify) — passwords are never stored in plaintext. - CSRF protection on the folder login form using
random_bytes(32)tokens.
- ⚡ Smart Hash Caching System: Computes file checksums (CRC32, MD5, SHA-1) on demand and securely caches results locally using file size, modified time (mtime), and cache-version checks.
- 🔍 Real-Time Search & Instant Sorting: Instantly filter file listings via client-side JavaScript, and sort them seamlessly by Name, Date, or Size without breaking the visual grid.
- 🎨 Premium UI & Accessibility: A stunning Glassmorphic layout with Dark/Light Mode toggle, color-coded file type icons, responsive viewport scaling, Back-to-Top button, and a floating Home FAB button — all keyboard-accessible (a11y).
- ⚙️ Minified Inline CSS: All inline stylesheets are minified for faster page load performance.
| Layanan / Requirement | Versi Minimum / Minimum Version |
|---|---|
| PHP | 8.0 atau lebih baru / or newer |
| PHP Extensions | session, hash, json, pcre, spl |
| Web Server | Apache (direkomendasikan / recommended), Nginx, Lighttpd, dll |
Buka file index.php untuk menyesuaikan setelan variabel berikut di bagian paling atas:
$browseDirectories = true; // Mengizinkan penelusuran sub-direktori
$title = 'Index of {{path}}'; // Format judul halaman utama
$subtitle = '{{files}} files'; // Format sub-judul halaman
$showDirectories = true; // Menampilkan direktori
$showDirectoriesFirst = true; // Mengurutkan direktori di posisi atas
$showHiddenFiles = false; // Menyembunyikan/menampilkan file dot (.)
$dateFormat = 'd-M-Y H:i'; // Format tanggal modifikasi file
$allowExternalSymlinks = false; // Mengizinkan symlink ke luar root
$enableHashCache = true; // Mengaktifkan penyimpanan cache hash file
$passwordSessionLifetime = 2400; // Durasi sesi login folder (detik)// Generate bcrypt hash terlebih dahulu:
// php -r "echo password_hash('password_anda', PASSWORD_BCRYPT);"
$protectedFolders = [
'nama-folder' => '$2y$12$hashBcryptAnda...',
];
⚠️ PENTING: Jangan pernah menyimpan password plaintext. Selalu gunakan hasilpassword_hash().
Version 3.8 (29-30 Juli 2026 / July 29-30, 2026) — Security Hardening, DevSkim, CSP Compliance & Code Quality
- 🔒 SECURITY [CSP & DevSkim] — DevSkim Security Scan & CSP Compliance:
- Standardized CSRF token generation using cryptographically secure
bin2hex(random_bytes(32))instead of non-cryptographic time-based hashing (uniqid+microtime). Added explicit DevSkim ignore annotations (DS197836,DS126858) for intentional file checksum features (md5,sha1), query string parameters, and filesystem cache keys. - Removed
javascript:history.back()URI from hash page back-link; replaced with a proper<button id="backBtn">handled via nonce script block to fully comply with strict CSPscript-srcpolicy. - Removed inline
style="display:none"from#noResultRowelement; moved to CSS class.hidden-rowto comply with strict CSPstyle-srcpolicy. - Added
nonceattribute to<noscript><style>blocks on all pages for consistent CSP compliance across all rendering paths. - Port number in
getSafeHost()is now validated to be within valid TCP range (1–65535) to prevent malformed Host header injection via out-of-range port values.
- Standardized CSRF token generation using cryptographically secure
- 🐛 BUG FIXES:
- Fixed column misalignment in table body — directory rows had 5
<td>elements (date-primary and date-secondary as separate columns) while file rows had 4. Unified date display so both dir and file rows use a single<td class="date-cell">containing both primary and secondary spans inside, matching thead column count of 4. sanitizePath()preg_replacewith/umodifier now has explicit fallback if the regex fails due to invalid UTF-8 input, preventing silent null return.ensureCacheDir()now checksmkdir()return value and logs error on failure instead of silently continuing, preventing obscure cache-write errors downstream.calculateHashes()now callserror_log()whenfopen()fails, improving production debuggability.writeHashCache()now verifies return value ofrename()and logs on failure, ensuring temp file cleanup even on rename failure.
- Fixed column misalignment in table body — directory rows had 5
- ✨ IMPROVEMENTS:
humanizeFilesize()now usesnumber_format()instead ofround()to ensure consistent decimal display (e.g., "1.0 MB" not "1 MB").humanizeFilesize()cachescount($units)before the loop to avoid repeated function calls on every iteration.$unlockedSessionsreference at directory browsing section replaced with explicit null-safe array initialization to prevent potential reference warnings.- Added
$_GET['sort'] ?? 'name'and$_GET['order'] ?? 'asc'with explicit null coalescing before allowlist check for strict_types safety.
- 🛠️ CODE QUALITY & LINTER COMPLIANCE (PHPCS & Sonar):
- PHP CodeSniffer (PHPCS): Executed
phpcbfand manual formatting fixes across all PHP files to resolve all syntax, indentation, and spacing errors (0 PHPCS errors remaining). - Multiple Returns Reduction: Refactored
getMediaIconClass(),createHashCacheDir(),readHashCache(), andlistDirectory()to reduce multiple return statements (max 1 per function). - Cognitive Complexity: Extracted
isValidHashData(),processDirectoryItem(), andgetScandirFiles()helper functions, reducing cognitive complexity inreadHashCache()(from 22 to 2) andlistDirectory()(from 24 to 3). - Nested Ternaries & Parameter Limits: Replaced nested ternary operations in
buildDirectoryEntry()and sort button icons ($nameIcon,$dateIcon,$sizeIcon) with clearifstatements. Reduced parameter count ofprocessDirectoryItem()from 9 to 5.
- PHP CodeSniffer (PHPCS): Executed
- 🐛 Bug Fix [CRITICAL] — Extension Guard:
- Memperbaiki unreachable code pada pemeriksaan ekstensi PHP — blok
foreach($requiredExtensions)sebelumnya ditempatkan di dalam blokif (version_compare())setelahexit(), sehingga seluruh pemeriksaan ekstensi tidak pernah dieksekusi akibat brace yang salah posisi. - Fixed unreachable code in the extension guard —
foreach($requiredExtensions)was placed inside theversion_compare()if-block afterexit(), causing all extension checks to never execute due to a misplaced closing brace.
- Memperbaiki unreachable code pada pemeriksaan ekstensi PHP — blok
- 🔒 Bug Fix [SECURITY] — Reflected XSS on Password Page:
- Menambahkan fungsi
e()escaping pada$lockedFolderdi hidden input dan seluruh atribut HTMLrenderPasswordPage()untuk mencegah Reflected XSS melalui nama folder. - Added
e()escaping on$lockedFolderin therenderPasswordPage()hidden input and all HTML attributes to prevent Reflected XSS via folder name.
- Menambahkan fungsi
- 🔒 Bug Fix [SECURITY] — CSRF Token Fixation:
- Menambahkan regenerasi CSRF token setelah login folder berhasil untuk mencegah serangan CSRF token fixation / reuse.
- Added CSRF token regeneration after successful folder login to prevent CSRF token fixation and reuse attacks.
- 🐛 Bug Fix —
queryUrl()Empty String:queryUrl()kini mengembalikan''(string kosong) alih-alih'?'saat parameter kosong, mencegah URL yang tidak valid pada link sortir dan breadcrumb.queryUrl()now returns''(empty string) instead of'?'when params are empty, preventing malformed URLs in sort links and breadcrumbs.
- 🐛 Bug Fix —
calculateHashes()fread Error:calculateHashes()kini melakukan pengecekanfread() === falsesecara benar sebelum memanggilhash_update(), mencegah komputasi hash pada pembacaan file yang gagal.calculateHashes()now correctly short-circuits onfread() === falsebefore callinghash_update(), preventing hash computation on failed reads.
- 🔒 Security —
isValidHashData()Hex Length Validation:isValidHashData()kini memvalidasi panjang hex string secara ketat per algoritma (crc32=8, md5=32, sha1=40) untuk menolak entri cache yang korup atau dipalsukan.isValidHashData()now strictly validates hex string length per algorithm (crc32=8, md5=32, sha1=40) to reject corrupt or spoofed cache entries.
- 🔒 Security —
ensureCacheDir()Path Sanitization:ensureCacheDir()kini membersihkan$hashCacheVersionsebelum menggunakannya sebagai komponen path filesystem untuk mencegah path injection.ensureCacheDir()now sanitizes$hashCacheVersionbefore using it as a filesystem path component to prevent path injection.
- 🔒 Security — Removed Error Suppression Operator:
- Menghapus operator
@suppression berlebihan pada fungsi I/O file (file_put_contents,rename,unlink,chmod,fopen) dan menggantinya dengan pemeriksaan nilai kembalian secara eksplisit. - Removed excessive
@error suppression on file I/O functions (file_put_contents,rename,unlink,chmod,fopen) and replaced with explicit return-value checks.
- Menghapus operator
- ✨ Improvement — Session Cleanup on
getFirstLockedFolder():- Menambahkan pembersihan entri
unlocked_foldersyang kedaluwarsa di dalamgetFirstLockedFolder()untuk mencegah membengkaknya data sesi secara tak terbatas. - Added cleanup of expired
unlocked_folderssession entries insidegetFirstLockedFolder()to prevent unbounded session bloat over time.
- Menambahkan pembersihan entri
- ✨ Improvement — Explicit
Content-TypeHeader:- Menambahkan header
Content-Type: text/html; charset=UTF-8secara eksplisit disendSecurityHeaders()untuk menghilangkan ketergantungan pada deteksi charset browser. - Added an explicit
Content-Type: text/html; charset=UTF-8header insendSecurityHeaders()to remove reliance on browser charset sniffing.
- Menambahkan header
- ✨ Improvement — Integer Cast on Lock Timer:
- Menambahkan cast eksplisit
(int)pada output$lockTimeRemainingdi HTML untuk keamananstrict_typesdan rendering bilangan bulat yang bersih. - Added explicit
(int)cast on$lockTimeRemainingoutput in HTML forstrict_typessafety and clean integer rendering.
- Menambahkan cast eksplisit
- 🛠️ Code Quality:
- Penyesuaian penyelarasan PSR-12 minor dan peningkatan konsistensi komentar.
- Minor PSR-12 alignment and comment consistency improvements.
Version 3.6 (18 Juli 2026 / July 18, 2026) — Security Hardening, CSP Compliance & Performance Optimization
- 🔒 Security — CSP Inline Style Fix:
- Memperbaiki atribut
styleinline pada container halaman hash yang melanggar kebijakan CSP ketat. - Fixed inline
styleattribute on the hash page container that violated the strict CSP policy.
- Memperbaiki atribut
- 🔒 Security — CSP Script-src Compliance:
- Menghapus handler
onsubmitinline pada form pencarian untuk kepatuhan penuhCSP script-srctanpa'unsafe-inline'. - Removed inline
onsubmithandler from the search form to achieve fullCSP script-srccompliance.
- Menghapus handler
- 🔒 Security — Session Fixation Prevention:
- Menambahkan
session_regenerate_id(true)setelah verifikasi password folder berhasil untuk mencegah session fixation. - Added
session_regenerate_id(true)after successful folder password verification to prevent session fixation.
- Menambahkan
- 🔒 Security —
X-XSS-Protection: 0Header:- Menambahkan header
X-XSS-Protection: 0untuk menonaktifkan XSS auditor browser lama (mencegah false positive). - Added
X-XSS-Protection: 0header to disable the legacy browser XSS auditor and prevent false positives.
- Menambahkan header
- ⚡ Performance —
isHiddenName()Static Cache:- Meng-cache pemetaan
strtolowerdiisHiddenName()menggunakan variabelstaticuntuk menghindari pemanggilanarray_mapberulang. - Cached
strtolowermapping inisHiddenName()using astaticvariable to avoid repeatedarray_mapcalls.
- Meng-cache pemetaan
- ⚡ Performance —
humanizeFilesize()Loop Optimization:- Menghitung jumlah unit terlebih dahulu di luar batas loop pada
humanizeFilesize(). - Pre-computed unit count outside the loop boundary in
humanizeFilesize().
- Menghitung jumlah unit terlebih dahulu di luar batas loop pada
- ⚡ Performance —
ob_end_flush()Safety Check:- Meningkatkan shutdown handler
ob_end_flushdengan pemeriksaanob_get_level()untuk keamanan. - Improved the
ob_end_flushshutdown handler with anob_get_level()safety check.
- Meningkatkan shutdown handler
- 🐛 Bug Fix — Lock Time Display:
- Menggunakan
intdiv()untuk tampilan waktu penguncian guna mencegah keluaran float pada pesan yang terlihat pengguna. - Used
intdiv()for lock time display to prevent float output in user-facing messages.
- Menggunakan
- 🎨 UI/UX — Premium Glassmorphic Dark Theme:
- Mengimplementasikan tema Premium Glassmorphic Dark modern dengan latar belakang radial-gradient tetap yang indah dan elegan.
- Implemented a modern Premium Glassmorphic Dark Theme featuring a beautiful fixed radial-gradient background.
- 🎨 UI/UX — Custom Link & Icon Styling:
- Menyesuaikan gaya tautan folder/file dan ikon di mode terang maupun gelap sesuai spesifikasi desain.
- Custom-styled folder/file links and icons in both Light and Dark modes to match design specifications.
- 🎨 UI/UX — Breadcrumb Open Folder Icon:
- Mengintegrasikan ikon folder terbuka (
fa-folder-open) pada navigasi breadcrumb, sekaligus mempertahankan ikon folder tertutup standar pada tampilan daftar untuk konsistensi visual. - Integrated the open folder icon (
fa-folder-open) in breadcrumb navigation while retaining standard closed folder icons in the file list view for visual consistency.
- Mengintegrasikan ikon folder terbuka (
- 📱 UI/UX — Mobile Responsiveness:
- Mengoptimalkan media query mobile untuk memperkecil seluruh teks, padding, dan elemen header agar tampilan sangat kompak dan responsif di semua resolusi perangkat.
- Optimized mobile media queries to scale down all text, paddings, and header elements for a highly compact and responsive layout across all device resolutions.
- 🐛 Bug Fix — Infinite 301 Redirect Loop:
- Memperbaiki loop redirect 301 tak terbatas pada parameter folder berlapis yang mengandung karakter
%2F(slash ter-encode) yang sebelumnya menyebabkan spinner loader tidak berhenti. - Resolved an infinite 301 redirect loop on nested folder parameters containing URL-encoded slashes (
%2F) which previously caused the spinner loader to get stuck indefinitely.
- Memperbaiki loop redirect 301 tak terbatas pada parameter folder berlapis yang mengandung karakter
Version 3.4 (14 Juli 2026 / July 14, 2026) — URL Sanitizer, Rate-Limit, Quality Audits & UI Enhancement
- 🔒 Security, Quality Audits & Rate-Limiting:
- Menambahkan pembatasan percobaan login salah (
$loginMaxAttempts = 5) dan durasi penguncian login ($loginLockSeconds = 300) untuk proteksi folder dengan tampilan hitung mundur (countdown) secara real-time. - Memperbaiki kualitas kode dan menghilangkan peringatan IDE dengan menyederhanakan struktur logic
ifbersarang yang redundan. - Memindahkan
ob_end_flush()dari bagian akhir skrip keregister_shutdown_function()terpusat agar buffer selalu dibilas secara otomatis dan aman saat skrip berakhir. - Added brute-force/rate-limit protection to folder passwords using login attempt limits (
$loginMaxAttempts = 5) and temporary lockout timers ($loginLockSeconds = 300) with real-time countdown display. - Merged nested conditional
ifstatements to resolve code analyzer warnings. - Relocated
ob_end_flush()to a centralizedregister_shutdown_function()to ensure proper output buffer cleaning upon termination.
- Menambahkan pembatasan percobaan login salah (
- ⚡ Performance Optimization:
- Melakukan minifikasi (minify) pada seluruh kode JavaScript internal (termasuk modul peralihan tema, hitung mundur penguncian, pencarian, dan visual halaman) untuk memperkecil ukuran berkas dan meningkatkan kecepatan muat.
- Minified all internal JavaScript blocks (Theme Switchers, Lock Countdown, Search and lists controller) to minimize payload size and improve execution speed.
- 🎨 UI/UX & Dark Mode Contrast Fix:
- Memperbaiki tulisan buram pada halaman Hash Check di mode gelap dengan menetapkan warna teks
h2menggunakanvar(--text-primary)dan.text-muted/.text-secondaryagar kontras dan terbaca jelas. - Resolved blurry text styling in dark mode on the Hash Check page by setting
h2heading color viavar(--text-primary)and updating.text-muted/.text-secondaryrules to use crisp high-contrast colors.
- Memperbaiki tulisan buram pada halaman Hash Check di mode gelap dengan menetapkan warna teks
- 🔗 Clean URL Routing:
- Mengubah parameter query penelusuran folder dari
foldermenjadiberkas. - Menghapus segment
index.phppada URL serta mengarahkan otomatis (HTTP 301) permintaan lama/index.php?folder=XXXmenjadi/?berkas=XXXuntuk SEO dan navigasi yang lebih bersih. - Swapped directory browsing query parameter from
foldertoberkas. - Stripped
index.phppath segment from URLs and implemented automatic redirects (HTTP 301) from/index.php?folder=XXXto/?berkas=XXXfor cleaner SEO routing. - Mengubah penanganan routing agar karakter
%2Fdalam parameter queryberkasotomatis diterjemahkan kembali menjadi/(?berkas=folder1/subfolder1), dan mengarahkan otomatis jika diakses dengan format URL-encoded. - Decoded
%2Fin query parameters back to slashes to display clean folder paths (e.g.?berkas=folder1/subfolder1), redirecting requests containing URL-encoded%2Fto clean slash representations.
- Mengubah parameter query penelusuran folder dari
- ✨ Modern Hash Check UI & Clipboard Support:
- Merancang ulang tampilan pengecekan hash (CRC32, MD5, SHA-1) dengan kotak/card yang lebih ringkas dan ramping, ikon perisai yang elegan, serta menambahkan tombol salin cepat (Copy to Clipboard) yang interaktif dan sepenuhnya patuh terhadap kebijakan CSP (Content-Security-Policy).
- Modernized the Hash Check overlay with a narrower card layout, elegant shield badge styling, and CSP-compliant, one-click clipboard copying buttons with visual success feedback.
- Footer Encoding Fix:
- Memperbaiki pengkodean karakter hak cipta pada footer (
© 2009–2026 · All Rights Reserved) guna menghindari kendala rendering simbol di berbagai tipe browser. - Replaced copyright character symbols in the footer with robust HTML entities to prevent font encoding glitches.
- Memperbaiki pengkodean karakter hak cipta pada footer (
- ✨ Sorting Interactive Improvement:
- Menghilangkan visual terpilih/aktif (default selection state) pada tombol sortir secara bawaan. Pilihan sort hanya akan aktif jika diklik secara eksplisit, dan cukup menampilkan hover style saat disorot saja.
- Removed default highlighted/active selection state from sorting buttons. Active highlight only appears upon explicit query sort requests; otherwise, buttons display standard interactive hover effects.
- 🛠️ Font Awesome Maintenance:
- Menyederhanakan pemetaan ikon Font Awesome dengan memusatkan seluruh relasi ekstensi file ke dalam satu struktur array statis di fungsi
getFileIconClass(), menghapus 6 sub-fungsi pendukung untuk mempermudah pemeliharaan kode jangka panjang. - Consolidated and simplified Font Awesome mappings into a single static array in
getFileIconClass(), removing six helper subfunctions to maximize readability and ease of maintenance.
- Menyederhanakan pemetaan ikon Font Awesome dengan memusatkan seluruh relasi ekstensi file ke dalam satu struktur array statis di fungsi
Version 3.3 (13 Juli 2026 / July 13, 2026) — Strict CSP Compliance, Readability Overhaul & Clean Layout
- 🔒 Security & CSP Hardening:
- Menghilangkan seluruh sisa atribut inline
style="..."pada elemen HTML (#search-form-container,#fileTable, dan tag<col>) untuk kepatuhan 100% terhadap Content Security Policy (CSP) tanpa'unsafe-inline'. - Memperbaiki style tag di dalam block
<noscript>dengan menyematkan nonce-key CSP secara dinamis. - Mengganti manipulasi style
.cssTextdi JavaScript menjadi modifikasi properti style individual guna mencegah pemblokiran CSP. - Removed all remaining inline
style="..."attributes on HTML tags (#search-form-container,#fileTable, and<col>elements) to achieve 100% CSP compliance without relying on'unsafe-inline'. - Added dynamic CSP nonce value to the style tag within the
<noscript>block. - Rewrote JavaScript
.cssTextmanipulation to use individual style property settings instead, avoiding CSP style-src blocks.
- Menghilangkan seluruh sisa atribut inline
- 🎨 UI/UX & Light Mode Contrast Enhancement:
- Mengoptimalkan warna kontras tinggi pada Light Mode agar menyerupai
repo.alsyundawy.com— tulisan tajam, terang, tidak buram, dan ramah mata. - Memperbaiki transisi warna pada mode gelap (Dark Mode) agar teks utama dan sekunder tidak buram dan sakit mata.
- Penyelarasan posisi tombol Back-to-Top dan Home FAB button di sisi kanan bawah agar presisi, mudah dijangkau, dan tidak terlalu ke bawah.
- Optimized Light Mode contrast to match the design aesthetics of
repo.alsyundawy.com— featuring high readability, crisp text, and zero eye-strain. - Hardened text and color contrast in Dark Mode to ensure high legibility and eliminate blurry fonts.
- Aligned the Back-to-Top and Home FAB button coordinates on the bottom-right for clean, non-overlapping floating layouts.
- Mengoptimalkan warna kontras tinggi pada Light Mode agar menyerupai
- 🐛 Bug Fix:
- Memperbaiki tombol kembali pada halaman verifikasi hash agar berfungsi dengan baik di bawah aturan CSP strict.
- Fixed the back-to-listing button on the file hash verification page to function correctly under strict CSP headers.
- 🔒 Security:
- Migrasi password folder protection dari plaintext ke
password_hash(PASSWORD_BCRYPT)/password_verify(). - Ganti perbandingan password plaintext
===menjadipassword_verify()untuk mencegah timing attack.
- Migrasi password folder protection dari plaintext ke
- 🐛 Bug Fix:
- Tombol "Back to Listing" di halaman Hash Check tidak berfungsi karena
onclickdiblokir oleh Content-Security-Policy — dipindah ke nonce-tagged script block. - Perbaiki logika breadcrumb path accumulation menggunakan
array_values()setelaharray_filter()untuk menghindari off-by-one pada subfolder dalam.
- Tombol "Back to Listing" di halaman Hash Check tidak berfungsi karena
- ✨ Feature:
- Tambahkan floating Home FAB button (ikon rumah, warna indigo) di atas tombol Back-to-Top, muncul saat halaman di-scroll lebih dari 300px.
- Tombol Home FAB navigasi langsung ke halaman root (
?) dengan animasi hover dan dukungan dark/light mode.
- ⚡ Performance:
- Minify seluruh CSS inline menggunakan regex-based minifier — menghemat ±16.7 KB (15.3%) ukuran file.
- Pindahkan
array_change_key_case($protectedFolders)ke luar loopforeachpada render tabel — dari O(n) menjadi O(1).
- ♿ Accessibility & Code Quality:
- Post-login redirect diarahkan ke folder yang baru di-unlock, bukan canonical URL umum.
- Tambahkan
aria-labelpada hash fingerprint link danaria-hidden="true"pada ikon dekoratif. - Pisahkan helper
findOriginalFolderKey()untuk mereduksi cognitive complexity padagetFirstLockedFolder().
- Refactoring & Clean Code:
- Mengurangi kompleksitas kognitif (Cognitive Complexity) pada fungsi utama (
listDirectory,processDirectoryItem,readHashCache) dengan memisahkannya ke helper functions yang modular dan memiliki satu jalur return. - Mengurangi parameter masukan pada fungsi daftar file untuk mematuhi standar parameter maksimum.
- Mengonversi elemen inline HTML dalam README menjadi format Markdown standar guna mematuhi aturan analisis Markdownlint.
- Mengurangi kompleksitas kognitif (Cognitive Complexity) pada fungsi utama (
- Security & Standards Hardening:
- Mengintegrasikan kode Subresource Integrity (SRI) SHA-384 dan parameter crossorigin pada seluruh library eksternal (CSS/JS Bootstrap dan Font Awesome).
- Menyederhanakan penanganan cookie sesi secara terpusat dan menerapkan tanda keamanan
securesecara eksplisit.
- Accessibility & CSS Enhancements:
- Menghadirkan kompatibilitas penuh properti standard
background-clipbersama dengan-webkit-background-clip. - Mengonversi tombol Back-to-Top dari tag non-standar menjadi tag native
<button>untuk menunjang kontrol aksesibilitas via keyboard.
- Menghadirkan kompatibilitas penuh properti standard
- Performance Optimizations:
- Mengoptimalkan pembacaan direktori dengan memangkas pemanggilan fungsi
realpathyang berat pada symlink. - Memperkenalkan validasi folder aman
isDisplayableFolderguna mencegah kebocoran direktori tersembunyi.
- Mengoptimalkan pembacaan direktori dengan memangkas pemanggilan fungsi
- Aesthetic Overhaul:
- Memperbarui total desain UI menjadi bertema Glassmorphism bernuansa gelap (Glassmorphic Dark Theme) dengan animasi mikro yang halus serta ikon file berkode warna dinamis.
- Menambahkan noscript styling fallback untuk transisi loading layar saat JavaScript dinonaktifkan.
Important
- Hak Akses Direktori Cache: Pastikan direktori tempat script dijalankan memiliki izin tulis (write permission) agar script dapat membuat direktori
.cacheotomatis. Jika hak akses tidak tersedia, fitur penyimpanan cache hash akan dinonaktifkan demi keselamatan runtime. - Dukungan SSL/HTTPS: Untuk keamanan optimal, jalankan script ini di lingkungan yang didukung HTTPS untuk menjamin enkripsi cookie sesi CSRF dan token transit.
- Pemblokiran File Sensitif: Secara bawaan, script memblokir file berekstensi seperti
.php,.bat,.env,.sql, dan sejenisnya untuk mencegah eksekusi kode berbahaya serta kebocoran informasi kredensial. - Password Folder — Wajib Hash: Password untuk fitur proteksi folder TIDAK BOLEH disimpan dalam bentuk teks biasa (plaintext). Gunakan selalu hasil dari
password_hash('password_anda', PASSWORD_BCRYPT). Jalankan perintah berikut untuk generate hash:php -r "echo password_hash('password_anda', PASSWORD_BCRYPT);" - CSP & Inline Event Handler: Script ini menggunakan Content-Security-Policy berbasis nonce. Inline
onclick=""attribute pada HTML akan diblokir oleh CSP — semua event listener harus didaftarkan dalam<script nonce="...">block.
- Cache Folder Permissions: Ensure that the directory where the script executes has write permissions so it can spawn the
.cachefolder automatically. If permissions are missing, hash caching will be bypassed gracefully to ensure execution. - HTTPS/SSL Deployment: It is highly recommended to host this script under an SSL/HTTPS enabled domain to guarantee safe transit of session cookies and browser tokens.
- Exclusion of Sensitive Files: By default, critical file formats including
.php,.bat,.env,.sql, and others are locked from being displayed or hashed to prevent unauthorized code execution and credential leakage. - Folder Passwords — Must Be Hashed: Folder protection passwords MUST NOT be stored as plaintext. Always use the output of
password_hash('your_password', PASSWORD_BCRYPT). Generate a hash with:php -r "echo password_hash('your_password', PASSWORD_BCRYPT);" - CSP & Inline Event Handlers: This script uses a nonce-based Content-Security-Policy. Inline
onclick=""HTML attributes will be blocked by CSP — all event listeners must be registered inside a<script nonce="...">block.
Anda bebas untuk mengubah, mendistribusikan script ini untuk keperluan anda.
If you find this project helpful and would like to support it, please consider donating via https://www.paypal.me/alsyundawy or https://ko-fi.com/alsyundawy. Thank you for your support!
Jika Anda merasa terbantu dan ingin mendukung proyek ini, pertimbangkan untuk berdonasi melalui https://www.paypal.me/alsyundawy atau https://ko-fi.com/alsyundawy. Terima kasih atas dukungannya!
Jika Anda merasa terbantu dan ingin mendukung proyek ini, pertimbangkan untuk berdonasi melalui QRIS. Terima kasih atas dukungannya!
MIT License — Copyright © 2026 HARRY DS ALSYUNDAWY — ALSYUNDAWY IT SOLUTION
Note: Please retain credit to the original author (HARRY DS ALSYUNDAWY — ALSYUNDAWY IT SOLUTION) if you use or modify this script. Attribution is appreciated but not legally required under the MIT License.


