diff --git a/README.md b/README.md index 0341a4d..3c1edd6 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,26 @@ Deploy it to any static host (Vercel, Netlify, nginx) with the repo root as the ## Waitlist -The form takes a phone number (SMS, the default) or an email, then asks for a name. Signups go to a Google Sheet through `tools/waitlist-apps-script.gs`, which also emails a notification for each one. Until `ENDPOINT` in `index.html` is set, signups are only saved in the visitor's browser. +The form takes a phone number (SMS, the default) or an email, then asks for a name. The live `ENDPOINT` posts to `tools/waitlist-apps-script.gs`, which saves to a private Google Sheet owned by `kiburtw1@gmail.com` and sends an internal notification to `info@gishenpharmacy.org`. The page only confirms success after a server-side save; there is no browser-only success fallback. + +Individuals and institutions are stored in separate tabs. Duplicate contacts do not create extra waitlist rows or repeat already-sent notifications. Notification failures and Google email quota exhaustion leave rows marked `pending`; an hourly trigger retries them. User-entered values are protected against spreadsheet formula injection. + +Keep the Sheet private. The anonymous web app runs as the owner and exposes only a signup count on GET, not contact details. Owner access, links, deployment notes and remaining human tasks are in [TASKS.md](TASKS.md). Saving script changes is not enough: update its existing web-app deployment to a new version, preserving the `/exec` URL. Run `setupWaitlist` once when provisioning a new project; it creates the tabs and hourly retry trigger. + +Run backend regression checks: `node --test tools/waitlist.test.mjs`. + +This collects a waitlist; it does not send welcome emails, SMS or launch campaigns automatically. + +## Invisible spam protection + +Both forms obtain a fresh Cloudflare Turnstile token on final submission. The widget is configured in **Invisible** mode for `gishenpharmacy.org`, so visitors do not see a checkbox or puzzle. No email or phone ownership verification is performed. + +Apps Script validates every token with Cloudflare before writing to Sheets or sending notifications. It requires a successful verification, the exact `gishenpharmacy.org` hostname and the matching `waitlist` or `b2b` action. A script-lock-protected hash ledger also prevents token reuse even if the provider repeats a successful response; hashes expire after ten minutes and are pruned on subsequent accepted requests. Raw tokens are never stored. Missing, expired/reused, invalid and wrong-site tokens are rejected. Verification outages fail closed, with a retry/contact message; there is no unprotected submission fallback. + +Only the public sitekey belongs in `index.html`. The secret is stored as `TURNSTILE_SECRET_KEY` in Apps Script **Project Settings → Script properties**. Never put it in HTML, source control or logs. If replacing the widget, update both its public sitekey and that private property, then test both forms. Saving server code is not enough: update the existing web-app deployment to a new version. + +`privacy.html` discloses this use and links Cloudflare's Turnstile Privacy Addendum, as required for invisible mode. Keep it deployed and linked from the footer. This bot check is not a substitute for rate limiting and does not prove ownership of a submitted contact address. ## B2B onboarding -Institutions sign up through the form in the B2B section (institution, type, contact person, phone, optional email and usual orders). It posts to the same Apps Script endpoint with `type: 'b2b'`, which adds a row to an "Institutions" tab and emails `NOTIFY`. Until `ENDPOINT` is set, the form opens a pre-filled email to `b2b@gishenpharmacy.org` instead. Institutions can also call `+251 930 099 850`. Setting up the inbox is tracked in [TASKS.md](TASKS.md). +Institutions sign up through the form in the B2B section (institution, type, contact person, phone, optional email and usual orders). It posts to the same Apps Script endpoint with `type: 'b2b'`, which adds a row to an "Institutions" tab and emails `NOTIFY`. Without an endpoint the B2B form falls back to opening a pre-filled email. Direct mail to `b2b@gishenpharmacy.org` is also copied to `info@`, retaining both mailboxes. Institutions can call `+251 930 099 850`; the team must confirm that this number is staffed and ensure the promised one-working-day response. diff --git a/TASKS.md b/TASKS.md index 4493d47..6519902 100644 --- a/TASKS.md +++ b/TASKS.md @@ -4,8 +4,35 @@ The coming-soon page asks people to email or call Gishen. Before we share the link: -- [ ] Create the mailboxes the page links to: `b2b@gishenpharmacy.org` (B2B onboarding CTA) and `info@gishenpharmacy.org` (footer contact). If only one inbox is set up, make the other an alias that forwards to it. -- [ ] Forward all contact and inquiry mail (B2B onboarding, general contact, waitlist notifications) to that inbox, and make sure someone on the Gishen team reads it daily. The page promises a reply within one working day. +- [x] Create `b2b@gishenpharmacy.org` and `info@gishenpharmacy.org`. Mail DNS, SPF, DKIM, DMARC and mail-client TLS are configured; Kerod verified end-to-end mail delivery. +- [x] Route inquiries to `info@gishenpharmacy.org`: B2B mail is copied there while retaining the B2B mailbox; both web forms send their internal notifications there. +- [ ] Assign someone on the Gishen team to read `info@` daily and respond within one working day, as promised on the page. - [ ] Confirm `+251 930 099 850` is answered for B2B onboarding calls, or send us the right number to put on the page. -- [ ] Deploy `tools/waitlist-apps-script.gs` (steps are at the top of the file). Set `NOTIFY` to the inbox above, then paste the `/exec` URL into `ENDPOINT` in `index.html`. Until then, signups only save in the visitor's browser. -- [ ] Send a test email to `b2b@gishenpharmacy.org` and do one test waitlist signup to confirm both reach the inbox. +- [x] Deploy `tools/waitlist-apps-script.gs`, owned by `kiburtw1@gmail.com`, with `NOTIFY=info@gishenpharmacy.org`. The live `/exec` URL is configured in `index.html` and deployed to the VPS. +- [x] Verify the email, phone-only and B2B forms on the live page. All three saved successfully and their notification messages arrived in `info@`. Kerod also confirmed end-to-end mailbox delivery. + +## Operations + +- Private Sheet: [Gishen launch waitlist & B2B inquiries](https://docs.google.com/spreadsheets/d/14zuxfxr1XVNcc7Ld6b2aZcoVfNdKBR6n8GKWwqoVK_k/edit#gid=38651670). Sharing was verified as "Private to only me" under `kiburtw1@gmail.com`. Grant individual team members access as needed; never make the contact list public. +- Apps Script: [Gishen website — Waitlist & B2B](https://script.google.com/home/projects/1h9MhmjgO67uSBHP3juTBz1WBSknQ10lc3049wtaRCNzQidiVxcAXlKob/edit). +- The `Waitlist` tab stores individuals; `Institutions` stores B2B inquiries. `notificationStatus` records whether the internal email was sent. Pending notifications retry hourly. +- Notifications are sent by the owning Google account, with replies directed to `info@`. Google email quotas apply; a delayed notification does not discard a saved signup. +- This is signup collection only. Subscriber launch emails and SMS campaigns are not automatically sent. Plan the launch communication separately, honoring the page's promise of one launch message. +- Updating Apps Script code requires updating the existing deployment to a new version; saving the editor alone does not update `/exec`. +- Run backend regression checks with `node --test tools/waitlist.test.mjs`. +- Three clearly labelled `TEST — Gishen ... setup 2026-11-09` records remain as verification examples: two in `Waitlist` and one in `Institutions`. Exclude/delete these test records before using the lists for real outreach. Their notifications were received in `info@`. +- The previous live page is recoverable at `/var/backups/gishen-waitlist-20261109-Jjqo59/index.html` on the production VPS. + +## Silent CAPTCHA configuration + +- [x] Deployed Apps Script **Version 3** to the existing `/exec` URL on 2026-11-09, with invisible Turnstile verification and the independent replay guard. +- [x] Verified in Safari: both forms succeed without visible challenges; missing/invalid tokens, wrong-form tokens and replayed valid tokens are rejected. Existing labelled test contacts were reused, and the signup count did not change during these checks. +- [x] All 13 backend regression tests pass, including failure-closed behavior, duplicate protection and replay rejection even if the provider repeats success. + +- Cloudflare account: the Yaltopia-Gishen profile's existing account. Widget: `Gishen .org waitlist — invisible`, restricted to `gishenpharmacy.org`; invisible mode, no pre-clearance. +- Public sitekey: `0x4AAAAAAF5kBCYJ6Vhl5ok7`. The matching secret is stored only in Apps Script's `TURNSTILE_SECRET_KEY` Script property, not in this repository. +- Both final form submissions require a fresh token. The server checks hostname and the appropriate `waitlist`/`b2b` action before storing or emailing. Invalid/missing/replayed tokens must fail without changing the lists. +- Token reuse is also blocked by a script-lock-protected hash ledger, independent of the provider response. It stores only SHA-256 hashes for a ten-minute replay window; expired hash entries are pruned on subsequent accepted requests. Do not delete active replay properties to bypass a failed challenge. +- No email/phone ownership check is enabled. If verification cannot finish, visitors can retry or contact Gishen directly; there is no unprotected form bypass. +- Deploy `privacy.html` alongside the page; its footer link and Cloudflare Privacy Addendum disclosure are required for invisible mode. +- Pre-captcha landing-page backup: `/var/backups/gishen-turnstile-20261109.XmlNVe/index.html` on the production server. Reverting HTML alone is not sufficient: the protected backend still requires a token. Coordinate a complete rollback of the Apps Script deployment if needed; Version 1 is the earlier unprotected backend. diff --git a/index.html b/index.html index a4349b0..c88a389 100644 --- a/index.html +++ b/index.html @@ -546,14 +546,50 @@