do-webforms-smart
JSON-driven decision questionnaires for static Hugo sites, with end-to-end encrypted submission by e-mail.
do-webforms-smart turns a JSON definition into a nested decision questionnaire that runs entirely in the browser on a static Hugo site. Every answer is encrypted in the browser and sent by plain e-mail, so no questionnaire data ever reaches an HTTP backend; the server only hands out encryption keys and later decrypts incoming mail into a readable report. It is built for discovery and assessment interviews where answers are sensitive and the hosting must stay static. Status (2026-11-04): prototype, not ready for deployment.
Features
Questionnaires for your Hugo site
- Hugo shortcode that renders a nested questionnaire from
questionnaire.json, with Yes / No / Unknown answers plus a free-text note per question. - Declarative rule engine (
visibleWhen,expandWhen,enabledWhen,requiredWhenwithequals,in,all,any,not) that shows, hides, enables and expands child questions. - Explicit three-state answer model (
nullunanswered,yes,no,unknown); inactive branches keep their answers but are labelled “not applicable” and never counted as decisions. - Answers stored in the browser’s
localStorage, with plaintext JSON backup export, import and reset.
Encrypted, backend-free submission
- End-to-end encryption in the browser: fetch a server-issued 256-bit key, encrypt the full package with AES-256-GCM, and emit a PEM-style
FORM-ENCenvelope. - Submission via a
mailto:link plus an on-page monospace block with recipient, subject and a Copy button, including guards that discard a stale block when answers change, the form is reset, or an import occurs mid-send; packages over 1 MiB are refused before a key is requested.
Key service and mail decryption
form-key-servicebinary with two modes:serve(loopback key-issuance HTTP endpoint) anddecrypt-mail(procmail entry point that decrypts incoming mail and delivers a plain-text and HTML report as a second local mail, leaving the original untouched).- Server-side validation mirroring the browser’s limits and rules, with bounded decryption work and fixed error reasons that never quote message content.
Tests and deployment artifacts
- Test suite with unit and integration tests, real-Chromium browser tests (chromedp), shared accepted-package fixtures, and reproducible mutation testing.
- Deployment artifacts: systemd unit, Nginx snippets, procmail recipe and a SYSOP hand-over document (not yet executed on a real server).
Roadmap
- Decision-tree sidebar with green / blue / gray states and visible-but-disabled inactive branches (agreed, not yet built).
- Fetch the encryption key on first visit instead of on Send (per specification).
- Shared JS/Go rule evaluator with parity fixtures to close the rule-semantics drift (Go lacks
enabledWhen/expandWhen; audit “Fix 3” work was lost and must be redone). - Fix
requiredWhenreading raw answers of inactive questions (audit M06; part of the rule-evaluator work). - Key lifecycle: retention/expiry limits and protection against unbounded key creation (currently only an Nginx rate limit).
- Authenticate the decrypted-copy subject and guard header (currently forgeable by an external sender).
- Integration test on a real mail host (Postfix acceptance, procmail ordering vs. SpamAssassin, mail-client rendering).
- Validate the
mailto:size limit and clipboard fallback against real mail clients. - Legacy-data compatibility for the earlier
MAIT-REQ-ENC/mait-requirements-v1variant (currently rejected).