Web interface used to visualize and navigate through ncdu results (Ncdu is a disk usage analyzer).
This tool could be used internaly at Abes for analyze and cleanup steps when manipulating massive data. Thanks to the web interface it makes easier to give this tool to a librarian. Thanks to the dump
feature, it makes easier to analyze very big folder so that only one guy will generate the export/dump of a given folder and all the staff will be able to view it concurrently without generating performance isues on this big folder.
- docker
NCDU_WEB_VIEWER_SCAN_FROM
: two values are allowed (folder
ordump
)- if
folder
(default value) then it will tell ncdu to scan the/folder-to-scan/
folder in the current container. - if
dump
, then it will tell ncdu to import the/ncdu-dump.json
dump and view its content (instead of scanning a folder).
- if
NCDU_WEB_VIEWER_READONLY
: to enable or disable ncdu readonly feature (yes
by default, only used with NCDU_WEB_VIEWER_SCAN_FROM=folder feature)
By default ncdu will scan the folder /folder-to-scan/
. This folder is located inside the container. You have to mount the wanted folder as a docker volume to be able to analyze the folder you want.
Example if you want to analyze the /applis/
folder on your docker host:
docker run --rm \
-e NCDU_WEB_VIEWER_SCAN_FROM=folder \
-e NCDU_WEB_VIEWER_READONLY=no \
-v /applis/:/folder-to-scan/ \
-p 3000:3000 abesesr/ncdu-web-viewer:1.0.0
Then open your web browser (replace 127.0.0.1 by your server ip): http://127.0.0.1:3000/
If you want to visualize a precalculated scan of a folder, you can use the dump
feature.
You first have to generate a ncdu dump this way:
ssh my-server-to-scan
ncdu -o /tmp/ncdu-dump-applis.json /applis/
Then (if you want on another server) you have to copy your dump and run ncdu-web-viewer this way:
ssh my-web-server
scp my-server-to-scan:/tmp/ncdu-dump-applis.json /opt/
docker run --rm \
-e NCDU_WEB_VIEWER_SCAN_FROM=dump \
-v /opt/ncdu-dump-applis.json:/ncdu-dump.json \
-p 3000:3000 abesesr/ncdu-web-viewer:1.0.0
Then open your web browser (replace 127.0.0.1 by your server ip): http://127.0.0.1:3000/wetty/
To develop or debug ncdu-web-viewer, you can use the docker-compose.yml in the example folder this way:
cd example/
docker compose up
Then navigate to http://127.0.0.1:3000 or http://127.0.0.1:3001 or http://127.0.0.1:3002 to test the 3 features.
Then CTRL+C, modify the code, and docker compose up
again to test your modification.
This repository gives a docker-compose.yml / .env example.
Use this github action, run the workflow and choose a free incremenal version respecting the sementic versioning rulez: https://github.com/abes-esr/ncdu-web-viewer/actions/workflows/create-release.yml