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:
@@ -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`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user