Repository navigation
Free plan: watch one domain, with email alerts - #137
Merged
Merged
Conversation
Server (Worker): - free-watch.js: below Pro, the personal workspace may run cert-expiry and email-posture monitors on ONE distinct domain in total (paused ones count), email alerts only, at most once a day, Run now at most once per 10 minutes. A 2nd domain, kev-epss, chat/webhook channels or a team workspace get 402 plan:true with a plain message. Pro and above are unchanged. - alert-email.js: alert emails through Resend to the account's own address only (from the verified ID token, re-checked in Firebase Auth at send time), plain text + simple HTML, no images or trackers: what changed, why it matters, the exact fix, the Deck link, a signed stop link with List-Unsubscribe one-click. Capped at 5 per account per UTC day; a capped or failed send is logged as failed in the delivery log. - /api/watch/stop: GET shows a confirm page, POST pauses the monitors that email that account (HMAC token of workspace + account). - email-posture keeps the SPF/DMARC policy per domain so an alert can say "weakened from reject to none". Deck: - Overview first run: Watch this domain after a check sets up both monitors and says what is watched, how often and where alerts go; names the watched domain and points to Plans when Free already watches another. - Monitors is shown on Free: the watch with Turn off / Turn on, email as an alert channel, KEV/EPSS and webhooks hidden below Pro. - Copy: Deck Plans, landing Free card (one line), docs FAQ, changelog, Privacy, Terms section 14; TOS_VERSION 2026-11-25. Tests: test/worker/free-watch.test.mjs (rules, DO gating, email payload, cap, stop link); plan-features updated for the Free watch.
# Conflicts: # public/js/deck-ui.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Free accounts can now watch one domain. After a domain check, Watch this domain sets up a certificate-expiry monitor and an email/DNS monitor on that domain. Both run once a day on the server, and alerts go by email to the account's own verified address. Base:
feat/domain-check.Server limits (enforced in the MonitorDO,
worker/free-watch.js)Below Pro,
handleMonitormarks the requestx-mon-plan: free, and the DO checks it in the same step as the write:402 plan:true("Continuous monitoring is part of the Pro plan...").cert-expiryandemail-postureonly.kev-epssgets 402.planHeld).Email alerts (
worker/alert-email.js)email_verified === true), via thex-mon-emailheader. Any address in the request is ignored, and there is one email channel per monitor. Firebase Auth is checked again at send time, and an unverified, disabled or missing account sends nothing (logged as failed).Darknode <digest@darknode.ai>, with an Idempotency-Key,List-UnsubscribeandList-Unsubscribe-Post: One-Click./api/watch/stoptakes an HMAC token of (workspace, account). GET shows a confirm page; POST, or a mail client's one-click unsubscribe, pauses the monitors that email that account.Sample from the unit test (DMARC weakened between two runs):
Deck
<li>atpublic/js/landing.jsline 732. Nothing else on the landing changed.TOS_VERSIONis now2026-11-25with a new "What changed" item, so every account re-accepts.Verification
npm test: 5122 passed.npm run release:check: READY.test/worker/free-watch.test.mjsand has not run against a live Worker. The local site talks to the production Worker, which does not have this code yet.monitor-client.js), I checked the offer, watching, conflict, Monitors watch and empty states, and Turn off pausing both monitors. No console errors, no horizontal overflow at 390px.Deploy notes
cd worker && npx wrangler deploy --env staging, then production. No new secrets: it reusesRESEND_KEY,FIREBASE_SAandDIGEST_SECRET/SA for stop tokens.npx firebase deploy --only hosting. If hosting goes first, Free users would see Watch this domain and get the old 402 until the Worker deploys.Owner decisions
digest@darknode.ai.DIGEST_SECRETnor the service account is set, emails carry only the Deck path, with no stop link.