The installed moderation page is local to the AMDA6 lighttpd host, but in daily use it connects directly to the production Cloudflare D1 database. “Local moderation” describes where the private operator interface, site builder, and publishing coordinator run; it does not mean that production comments are stored only on the Windows machine. The Pi400 performs the Cloudflare Pages upload through its existing Wrangler login. The public reader page remains a static site and never queries D1 while being read.

The visitor posts; email alerts the moderator
A reader fills the comment form on an article and chooses Send for moderation. The static page posts the article ID, language, title, name, optional email, optional reply target, and comment to the public Worker. The Worker validates the request and writes a pending row in D1. The browser receives an on-page receipt; the reader does not receive an immediate email. A durable mail job alerts the configured moderator inbox, with a link that opens the local moderation page at the matching article and message.
The supplied address is optional notification data, not a verified identity. It is used to send an approval notice only if the comment is published. The moderator email and the later reader email are separate events: the first reports a pending submission; the second follows successful publication. A provider accepting a mail request does not itself prove that it reached an inbox.
Review, approve, reply, or reject
Open http://192.168.0.21:8080/cgi-bin/blog/moderation.cgi.js from the trusted LAN. The Inbox lists pending reader comments and private contact messages; All threads lists article discussions, including articles with no messages, and Search finds a topic or message. Select an article to see its pending items and full conversation. The Writing Studio’s Manage this article messages link and the moderator email deep link can take you directly to the relevant context.
Choose Approve, publish and notify to approve a pending comment. You may add an optional moderator reply; the system attaches it to the approved comment and quotes the stored original, so the browser cannot replace the quotation. Approval starts the publication job automatically: approved public fields are exported to a generated discussion snapshot, the static blog is rebuilt in private staging, the Pi uploads the ZIP contents to Pages, and the publisher confirms the production deployment. Only after confirmation does the system record publication and queue a reader email, if an address was supplied. The email contains the original message, your optional answer, and a link back to the article.
Choose Reject to mark the submission rejected in D1. It is excluded from the public snapshot, does not appear on the static article, and does not trigger an approval email. If a publication step fails after approval, the comment stays approved but is not falsely reported as published; fix the reported problem and use Retry publication. The page shows the persisted phase so you can tell whether the job is queued, building, uploading, notifying, complete, or failed.
Close or reopen discussion for one article
In All threads, find an article by topic or title and open its Article comments panel. Close comments and Reopen comments are article-level actions, independent of the comment list. Closing updates the D1 discussion flag immediately and starts a static publication job. The public Worker checks that flag in its insert operation, so it rejects new submissions even if a reader still has an old form open. After the site is rebuilt, the article keeps existing approved messages but hides the comment and reply forms and shows the closure notice.
Reopening flips the D1 gate back to open and starts another publication. New submissions are accepted by the Worker as soon as the state changes; the visible static form and reply controls return when the Pages deployment completes. Neither close nor reopen sends an email. If publishing fails, the database gate still reflects the selected state, while the static page may lag until Retry publication succeeds.
Other local moderation actions
Start or continue the conversation publishes a new top-level moderator message on an article and uses the same build-and-publish path; it does not send an approval email to a visitor. Private contact-form messages stay in the inbox and are marked read rather than exported as article comments. Clean up messages permanently deletes selected test conversations after you type DELETE; removing an already published message starts a rebuild so the public copy can be removed too. These actions operate through the same private page, not manual SQL or shell commands.
The moderation URL is intentionally restricted to the configured LAN and loopback, but it has no separate application login; anyone on that trusted network can moderate. Its current LAN HTTP connection is not encrypted. Keep it off public hosting, port forwarding, and reverse proxies. Local development on the Pi uses a separate workerd/D1 database and does not change production until the installed AMDA6 workflow is used.
