Skip to content

rwahyudi/webdiskstat

Repository files navigation

webdiskstat turns gdu or ncdu JSON into a static browser disk usage report

webdiskstat

webdiskstat converts JSON from gdu -o- or ncdu -o- into a self-contained disk usage HTML report you can open in a browser. It gives scanner output a WinDirStat-style directory list, browser treemap, search, keyboard navigation, a compressed embedded payload, and optional password encryption without running a web server.

Try the live example report before generating your own.

See It

gdu and ncdu web disk usage HTML report showing a browser treemap, directory list, details panel, and encrypted data footer

The included example uses 83,000 generated files across 12 uneven top-level workspaces and 4 loose root files, including one workspace with 12,000 direct files, so it exercises large-directory navigation and search.

Quick Start

Generate a gdu report:

gdu -o- /path/to/scan | webdiskstat -o diskstats.html

Open diskstats.html in a browser. The report is a static HTML file, so it can be viewed offline or shared as a single artifact.

Download and Install

Download a release package from GitHub Releases.

Linux x86-64:

curl -L -o webdiskstat-linux-amd64.tar.gz https://github.com/rwahyudi/webdiskstat/releases/latest/download/webdiskstat-linux-amd64.tar.gz
tar -xzf webdiskstat-linux-amd64.tar.gz
install -Dm755 webdiskstat ~/.local/bin/webdiskstat

Windows x86-64 PowerShell:

Invoke-WebRequest -Uri https://github.com/rwahyudi/webdiskstat/releases/latest/download/webdiskstat-windows-amd64.zip -OutFile webdiskstat-windows-amd64.zip
Expand-Archive .\webdiskstat-windows-amd64.zip -DestinationPath .
.\webdiskstat.exe --help

Features

Area What it does
Inputs Reads gdu -o- JSON by default, ncdu -o- JSON with --input-type ncdu, stdin, saved JSON files, and .gz exports.
Output Writes one self-contained HTML disk usage report with embedded scan data and favicon.
Browser UI Provides sortable columns, configurable visible columns, nested treemap tiles, breadcrumb navigation, browser back/forward support, bookmarkable URL hashes, and a biggest-files view.
Scale Virtualizes large directory listings and builds a global search index for quickly jumping to files or directories.
Security Can encrypt embedded scan data with --password using PBKDF2-SHA256 and ChaCha20-Poly1305. Encrypted reports prompt for the password in the browser.
Offline use Generated reports work as static files after generation without Go, gdu, ncdu, or a web server.

More Examples

Generate an ncdu web report:

ncdu -o- /path/to/scan | webdiskstat --input-type ncdu -o diskstats.html

Generate a disk usage HTML report from a saved scanner export:

gdu -o report.json /path/to/scan
./webdiskstat report.json -o diskstats.html

Read a compressed scanner export:

./webdiskstat report.json.gz -o diskstats.html

Options

usage: webdiskstat [--input-type gdu|ncdu] [-o OUTPUT] [--password PASSWORD] [input]
  • input: scanner JSON file, .gz file, or - for stdin. Defaults to stdin.
  • --input-type: input JSON format, either gdu or ncdu. Defaults to gdu.
  • -o, --output: output HTML path. Defaults to webdiskstat.html.
  • --password PASSWORD: encrypt the embedded scan data. Defaults to unencrypted.

Running the script without piped input or an input file prints the usage instructions.

Encryption

Encrypt the embedded report data with --password:

./webdiskstat report.json -o diskstats.html --password 'choose-a-strong-password'

Encrypted reports use Web Crypto when available and include a JavaScript fallback for file:// and other non-HTTPS schemes. Unencrypted reports disclose the scan metadata embedded in the HTML, and encrypted reports still depend on password strength.

Interface

  • The left panel lists the current directory entries, including modified time when the scan data provides it.
  • Columns are sortable by name, item count, file count, size, and modified date.
  • Optional columns can be shown or hidden from the column settings button next to the Name header.
  • The toolbar search finds files and directories across the whole report and jumps to the selected result.
  • The treemap shows the current directory, including nested subdirectories and files inside larger directory tiles when space allows.
  • The home view shows a smaller treemap and a framed biggest-files list.
  • Details show size, percentage, type, extension, item count, file count, and modified time when the scan data provides it.
  • The Help button in the toolbar, or the ? shortcut, explains mouse actions, keyboard shortcuts, and navigation.

Navigation

  • Breadcrumbs, the parent button, and browser back/forward move between directories.
  • Use the search box, /, or Ctrl+F to find files and directories across the report.
  • Double-click a directory row or treemap tile to enter it.
  • Double-click a file or biggest-files row to jump to the directory containing that file.
  • The URL hash changes as you navigate, so directory views are bookmarkable.
  • Arrow Up / Arrow Down: move selection in the directory list.
  • Page Up / Page Down: move selection by one visible page.
  • Home / End: jump to the first or last item.
  • Enter / Arrow Right: enter the selected directory.
  • Backspace / Arrow Left: go up one directory.
  • n / s / C / M or m: sort by name, size, file count, or modified time. Repeating the same shortcut toggles ascending or descending order.
  • ?: open the Help dialog.

Compression and Security

The generated report embeds scan data as a compact string-table payload that is gzip-compressed before being stored in the HTML.

  • Viewing generated reports requires a browser with the standard DecompressionStream API.
  • Encrypted reports show an encrypted data indicator in the footer and prompt for the password before loading scan data.
  • Encryption uses PBKDF2-SHA256 key derivation and ChaCha20-Poly1305 payload encryption.
  • Reports use the browser Web Crypto API when available and include a slower JavaScript fallback for file:// and other non-HTTPS schemes.
  • Unencrypted reports disclose the scan metadata embedded in the HTML.
  • Command-line passwords may be visible in shell history or process lists.

Build From Source

Requirements

  • Go 1.25 or newer
git clone https://github.com/rwahyudi/webdiskstat.git
cd webdiskstat
go build -o webdiskstat .
install -Dm755 webdiskstat ~/.local/bin/webdiskstat

About

Static web-based disk usage viewer for gdu JSON exports, with a WinDirStat-style treemap and sortable file browser

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors