[object Object]

← back to Small Business Builder

website-analysis: fix public-host critique page — whitelist screenshot+deep-dive, hide SHIP on public host (fantasea.agentabrams.com)

82a9729317563b46ed876f8562302f6c4e6c56e0 · 2026-06-24 15:33:59 -0700 · Steve Abrams

Files touched

Diff

commit 82a9729317563b46ed876f8562302f6c4e6c56e0
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jun 24 15:33:59 2026 -0700

    website-analysis: fix public-host critique page — whitelist screenshot+deep-dive, hide SHIP on public host (fantasea.agentabrams.com)
---
 data/wa-screenshots/fantaseayachts-com.png | Bin 0 -> 797697 bytes
 src/render/website-analysis.js             |   6 +++---
 src/server/index.js                        |   5 ++++-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/data/wa-screenshots/fantaseayachts-com.png b/data/wa-screenshots/fantaseayachts-com.png
new file mode 100644
index 0000000..767b30e
Binary files /dev/null and b/data/wa-screenshots/fantaseayachts-com.png differ
diff --git a/src/render/website-analysis.js b/src/render/website-analysis.js
index f270671..5a1812b 100644
--- a/src/render/website-analysis.js
+++ b/src/render/website-analysis.js
@@ -163,7 +163,7 @@ export function renderEntry({ error = '' } = {}) {
 // ---------------------------------------------------------------------------
 // /wa/:slug — result page (your site iframe + 3 mockup cards)
 // ---------------------------------------------------------------------------
-export function renderResult({ analysis, mockups }) {
+export function renderResult({ analysis, mockups, isPublic = false }) {
   const url = analysis.url;
   const ig = analysis.ig_handle ? `@${String(analysis.ig_handle).replace(/^@/, '')}` : null;
   const iframeBlocked = !!(analysis.meta_json && analysis.meta_json.iframe_blocked);
@@ -209,12 +209,12 @@ export function renderResult({ analysis, mockups }) {
           <div style="font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#666">★ CLICK TO PREVIEW FULL SIZE</div>
         </div>
       </a>
-      <form method="post" action="/api/wa/${esc(analysis.slug)}/ship/${esc(m.mockup_id)}" style="margin:0">
+      ${isPublic ? '' : `<form method="post" action="/api/wa/${esc(analysis.slug)}/ship/${esc(m.mockup_id)}" style="margin:0">
         <button type="submit"
           style="width:100%;background:#facc15;color:#000;border:0;border-top:4px solid #000;padding:18px;font-family:'Archivo Black',sans-serif;font-size:18px;text-transform:uppercase;letter-spacing:.04em;cursor:pointer">
           ★ SHIP THIS REBUILD →
         </button>
-      </form>
+      </form>`}
     </div>
   `).join('');
 
diff --git a/src/server/index.js b/src/server/index.js
index 1fa35cf..d5372f2 100644
--- a/src/server/index.js
+++ b/src/server/index.js
@@ -93,6 +93,8 @@ const PUBLIC_PATH_ALLOW = [
   /^\/api\/website-analysis(\/|$)/,       // form POST endpoint
   /^\/wa\/[^/]+$/,                        // analysis result page (read-only)
   /^\/wa\/[^/]+\/m\/[^/]+$/,              // mockup preview (read-only)
+  /^\/wa\/[^/]+\/screenshot\.png$/,       // hero screenshot (read-only)
+  /^\/api\/wa\/[^/]+\/deep-dive$/,        // deep-dive synthesis (local, no scrape/LLM)
   /^\/wall$/,                             // brutalist gallery of all builds
   /^\/grades$/,                           // top graded + most-roasted (/leaderboard taken by LA Salon)
   /^\/roasts\.rss$/,                      // RSS feed of latest roasts
@@ -4107,7 +4109,8 @@ app.get('/wa/:slug', async (req, res) => {
     [analysis.id]
   );
   res.set('content-type', 'text/html; charset=utf-8');
-  res.send(renderWAResult({ analysis, mockups }));
+  const isPublic = PUBLIC_HOSTS.has((req.hostname || '').toLowerCase());
+  res.send(renderWAResult({ analysis, mockups, isPublic }));
 });
 
 // /wa/:slug/screenshot.png — Playwright-captured, disk-cached screenshot of the

← 0a5f356 auto-save: 2026-06-24T15:27:54 (1 files) — src/server/index.  ·  back to Small Business Builder  ·  chore: macstudio3 migration — reconcile from mac2 + repoint e704581 →