ZDDC — Zero Day Document Control. A file-naming convention plus five single-file HTML tools (archive, transmittal, classifier, mdedit, landing) and an optional Go HTTP server (zddc-server) with ACL and a virtual archive index. Self-contained, offline-capable, dependency-free. See README.md for an overview, AGENTS.md and ARCHITECTURE.md for the build/release/architecture detail, bootstrap/README.md for the two-level deployment install pattern, and zddc/README.md for the HTTP server.
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
(function (app) {
|
|
'use strict';
|
|
|
|
var dom = app.dom;
|
|
var util = app.util;
|
|
|
|
var verification = app.modules.verification = {};
|
|
|
|
// ── Directory scanning for file hash verification ────
|
|
verification.scanDirectoryForFiles = async function scanDirectoryForFiles(dirHandle, basePath) {
|
|
var base = basePath || '';
|
|
var files = [];
|
|
|
|
for await (var entry of dirHandle.values()) {
|
|
if (entry.kind === 'file') {
|
|
var file = await entry.getFile();
|
|
var sha256 = await util.hashFile(file);
|
|
var path = base ? base + '/' + entry.name : entry.name;
|
|
files.push({ name: entry.name, path: path, sha256: sha256, size: file.size });
|
|
} else if (entry.kind === 'directory') {
|
|
var subPath = base ? base + '/' + entry.name : entry.name;
|
|
var subFiles = await verification.scanDirectoryForFiles(entry, subPath);
|
|
for (var j = 0; j < subFiles.length; j++) { files.push(subFiles[j]); }
|
|
}
|
|
}
|
|
|
|
return files;
|
|
};
|
|
|
|
})(window.transmittalApp);
|