Network ad zones in seven subtle places (Marty 2026-11-13: 'do all seven'), LinkSpin zones on Marty's account, each mounted once with a small 'Network' label: ledger after the 10th sale (468x60), above the footer on every page (728x90 wide / 320x50 phone), after a purchase (300x250), My Spots under the stats (468x60), How it works between cards (300x250), contract proof (468x60), 404 (300x250). CSP admits linkspin.app (script + serve call). SEO: per-page descriptions, canonical, Open Graph + Twitter cards with a 1200x630 preview (art/og-share.png), JSON-LD on home, /sitemap.xml, robots Sitemap line, My Spots noindex. common.js?v=4, line.css?v=6. Smoke 76/76.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 10:52:10 -06:00
parent d559c1cf26
commit d5fdddd5af
16 changed files with 167 additions and 39 deletions
+12 -4
View File
@@ -37,8 +37,8 @@ const hmac = s => crypto.createHmac('sha256', SECRET).update(s).digest('hex').sl
// ---- 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' };
const CSP = "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; "
+ "img-src 'self' data: blob: https:; connect-src 'self' 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; 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 "
+ "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 || {}); }
@@ -227,7 +227,14 @@ const server = http.createServer(async (req, res) => {
return sendFile(res, path.join(PUB, PAGES[p]), ex);
}
if (/^\/r\/[^/]+$/.test(p)) { res.writeHead(302, { Location: '/?ref=' + encodeURIComponent(decodeURIComponent(p.slice(3))) }); return res.end(); }
if (p.startsWith('/assets/') || p.startsWith('/art/house-') || p === '/art/mark.svg' || p === '/logo-icon.png' || p === '/robots.txt') {
// sitemap (2026-11-13, SEO): the public pages only
if (p === '/sitemap.xml') {
const day = new Date().toISOString().slice(0, 10);
const urls = ['/', '/board', '/how', '/ledger', '/contract', '/join'].map(u => '<url><loc>https://' + C.site + u + '</loc><lastmod>' + day + '</lastmod></url>').join('');
res.writeHead(200, headers({ 'Content-Type': 'application/xml; charset=utf-8', 'Cache-Control': 'public, max-age=3600' }));
return res.end('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' + urls + '</urlset>');
}
if (p.startsWith('/assets/') || p.startsWith('/art/house-') || p === '/art/mark.svg' || p === '/art/og-share.png' || p === '/logo-icon.png' || p === '/robots.txt') {
const f = path.normalize(path.join(PUB, p)); if (!f.startsWith(PUB)) { res.writeHead(400); return res.end(); }
return sendFile(res, f);
}
@@ -415,7 +422,8 @@ const server = http.createServer(async (req, res) => {
if (p.startsWith('/api/')) return json(res, 404, { error: 'Not found' });
res.writeHead(404, headers({ 'Content-Type': 'text/html; charset=utf-8' }));
return res.end('<!doctype html><title>Not found</title><p style="font-family:sans-serif">Not found. <a href="/">Downline Banners home</a></p>');
return res.end('<!doctype html><title>Not found</title><body style="background:#09080f;color:#f3f1fa;font-family:sans-serif;text-align:center;padding:40px 16px"><p>Not found. <a style="color:#c6f432" href="/">Downline Banners home</a></p>'
+ '<p style="color:#a29cbc;font-size:11px;margin:24px 0 4px">Network</p><script async src="https://linkspin.app/z.js" data-zone="ls-00c064"></script></body>');
} catch (e) {
console.error('request', p, e.message);
if (!res.headersSent) json(res, 500, { error: 'Server error' });