PolHunter mission prep (every rebuilt network site gets one, Marty 2026-11-14): the front page's How it works steps carry the PolHunter embed (data-selector ".steps .step", 3 slots); CSP admits https://polhunter.com in script-src and connect-src only. Hunters never count: a page with a ?ph= / #ph= token (or PolHunter's tab token in sessionStorage) asks /api/wire with hunt=1, and a visit from polhunter.com is treated the same, so no visit ticket is issued (no ad views, no Boost delivery, no verified-click token); daily counter huntVisits. Smoke 186/186.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-15 06:23:24 -06:00
parent 4efc1239b0
commit 72f4eb664f
15 changed files with 35 additions and 16 deletions
+8 -3
View File
@@ -49,8 +49,8 @@ wire.setSecret(SECRET);
// ---- http helpers ----
const MIME = { '.html': 'text/html; charset=utf-8', '.css': 'text/css', '.js': 'text/javascript', '.png': 'image/png', '.jpg': 'image/jpeg',
'.gif': 'image/gif', '.svg': 'image/svg+xml', '.ico': 'image/x-icon', '.json': 'application/json', '.txt': 'text/plain; charset=utf-8', '.xml': 'application/xml' };
const CSP = "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net https://linkspin.app; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; "
+ "img-src 'self' data: blob: https:; connect-src 'self' https://linkspin.app https://*.walletconnect.com wss://*.walletconnect.com https://*.walletconnect.org wss://*.walletconnect.org "
const CSP = "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net https://linkspin.app https://polhunter.com; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; "
+ "img-src 'self' data: blob: https:; connect-src 'self' https://linkspin.app https://polhunter.com https://*.walletconnect.com wss://*.walletconnect.com https://*.walletconnect.org wss://*.walletconnect.org "
+ "https://*.reown.com wss://*.reown.com https://*.reown.org wss://*.reown.org https://*.web3modal.org https://*.drpc.org https://*.publicnode.com https://*.coinbase.com; "
+ "font-src 'self' data: https://fonts.gstatic.com https://fonts.reown.com; form-action 'self'; frame-src https: 'self'";
function headers(extra) { return Object.assign({ 'Content-Security-Policy': CSP, 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin' }, extra || {}); }
@@ -276,7 +276,12 @@ const server = http.createServer(async (req, res) => {
if (mp.ownAd) shown.push(mp.ownAd.id); mp.line.forEach(x => shown.push(x.ad.id)); mp.boosted.forEach(a => shown.push(a.id));
ref = mp.ownerAddr;
}
out.ticket = issueTicket(req, kind === 'member' ? 'member:' + String(u.searchParams.get('u')).toLowerCase() : kind, shown, ref, u.searchParams.get('src'));
// PolHunter hunters (mission on the front page's How it works, 2026-11-15) are paid to be here: their visit is never a verified
// view or click (no ticket: no ad views, no Boost delivery, no verified-click token). The page says so with hunt=1 (a ?ph= / #ph=
// token or PolHunter's tab token), or the visit comes from polhunter.com.
const hunt = u.searchParams.get('hunt') === '1' || srcHost(u.searchParams.get('src')) === 'polhunter.com';
out.ticket = hunt ? null : issueTicket(req, kind === 'member' ? 'member:' + String(u.searchParams.get('u')).toLowerCase() : kind, shown, ref, u.searchParams.get('src'));
if (hunt) { out.hunt = true; store.bump('huntVisits'); }
out.seconds = C.visitSeconds;
return json(res, 200, out);
}