Add encrypted build and save flow

build.js seals a JSON document into the single-file HTML (passphrase from
a hidden prompt or FW_PASSPHRASE, 12 character minimum). In the page,
Save writes via the File System Access API when available and downloads
otherwise; Backup copy downloads final-wishes-YYYYMMDD.html; Ctrl+S and
Change passphrase are supported. Build and Save share assemble() in
template.js, replacing src/index.html. Tests confirm the built file
holds no plaintext and that the payload round-trips.

Closes #6

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 08:17:20 -05:00
parent e291ee75b6
commit fec23c3e80
8 changed files with 293 additions and 32 deletions

View File

@@ -67,3 +67,9 @@ export function addItem(doc, section) {
touch(doc);
return it;
}
// final-wishes-YYYYMMDD.html (local date)
export function backupName(date) {
const p = (n) => String(n).padStart(2, '0');
return `final-wishes-${date.getFullYear()}${p(date.getMonth() + 1)}${p(date.getDate())}.html`;
}