Compare commits

...

14 Commits

Author SHA1 Message Date
martbost cb7fd00477 Promo kit: add 600x300 wide and 250x250 small creatives for all 3 angles
Member request. kit-art.mjs (shared with VBB) gains wide + small layouts and
a short headline per angle for the small square.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:00:24 -06:00
martbost c053fedbd1 Tutorial video: 2.5-minute narrated walkthrough on /how (Watch how it works) + 'Watch the 2-minute walkthrough' link under the home hero; /art/how-it-works.{mp4,jpg} served, video with byte ranges (sendMedia); chatbot fact; site.css?v=3 (Marty 2026-11-18: tutorial explainer videos for each rebuilt site)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:15:09 -06:00
martbost 5513584d40 Network link nwypb: YourProgramBuilder as its own tracked network link (netsites CODES), the nwvas pattern (YourProgramBuilder go-live, Marty GO 2026-11-17)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:31:14 -06:00
martbost e00b7b2f59 Guides (Marty 2026-11-17, evergreen guides plan): /guides index, /guides/is-it-legit (BannerLine 0x6c77...9f9b on Polygonscan, live ledger, the 30 / 10x5.5 / 5+5 / 5 split from the contract constants plus the edge rules: sponsor set once and only if already a member, failed send to the fund, missing early levels to the company, kept spots feed the fund), /guides/free-account (one network sign-in, own a spot before sharing, banner checks, refuel spots, fund gifts), /guides/faq (from the chatbot canned answers, FAQPage JSON-LD); /how links them; footer Guides link; sitemap; chatbot f-guides entry + sponsor rule fact
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:25:02 -06:00
martbost f8e6a9d174 Old /splashpg.php?r= and /lcp.php?r= links keep the referral (301 to /?ref=<network username>), like ViralAdSource
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:17:12 -06:00
martbost ae880afb75 netweekend.js: shared copy synced (Network Weekend 2026-11-17)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:32:04 -06:00
martbost 0bf89646a9 netdeals.js: the first ask after a boot waits for the hub once (shared copy, Network Weekend 2026-11-17)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:31:29 -06:00
martbost 6313bbf719 Network Weekend (Marty 2026-11-17): ribbon + date-gated chatbot fact (gift a spot), no price or split change
netdeals.js + /assets/netweekend.js (/api/network-deals from the hub), loaded by common.js (not admin, never in a frame),
common.js?v=20261117nw. FACTS line live Fri 11-27 00:00 CT to Tue 12-01 00:00 CT (WEEKEND_NOW test clock).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:25:58 -06:00
martbost 493a57183b Network sign-in: the way back after signing in on InstantAdPay (Marty 2026-11-17)
networksso.js (the shared file, same in every network site): providers now also know every
site in the hub's GET /v1/sso-sites, ?return=<site>&to=/path links on IAP/LinkSpin remember
the way back, a missing wallet sends the member to the provider's wallet step first and then
back, and the deliberate-tap state lives 1 hour (was 20 minutes) so a sign-up has time.
Join links to InstantAdPay carry ?return=<this site>&to=/my.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:09:38 -06:00
martbost 845843c921 netsites: ViralAdSource tracked link code nwvas (LinkSpin /r/nwvas, Marty 2026-11-17 go-live)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 05:59:15 -06:00
martbost 387997864a Remove street mailing address from public pages (Marty 2026-11-16)
Pages, footers and the site assistant now name only TrustClickz; the footer
reads "(c) 2026 TrustClickz". Contact stays the network support link.
QA checks updated to assert no street address is shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:52:41 -06:00
martbost be7cbc03cf Smarter chatbot matching by meaning (Marty 2026-11-16): the hub's semantic match (free core2 embeddings)
chatcore.js + netkb.js (route): a hand-off pattern still answers first; then the hub's POST /v1/kb/match answers with this
site's entry when it is sure, keeps or overrules the CANNED regex hit, and picks the AI prompt context, this site's own entries
first. 1.5 s timeout, then the hub is skipped for 30 s and the old pattern + BM25 path answers (NETKB_MATCH=0 = off).
netkb.js also has suggest() for the support desk (used by InstantAdPay and LinkSpin). Same chatcore.js in the six rebuilt
sites, same netkb.js in all eight. Test: node qa/netkb-semantic.test.mjs (decisions, fail soft, shared-file parity).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 05:48:35 -06:00
martbost a428075330 Spot edits: unlimited, full link check on every one, every one logged; admin takedown and restore (Marty 2026-11-16)
Edits (POST /api/my/spot/<id>, /api/my/default, uploads): still any number of times. Every change now gets the full check:
checkLink, then (LINK_PROBE on) the link must answer (safety.probeLink, up to 3 redirects each checked) and an image address must
download as a real 468x60 image of 150 KB or less (safety.probeImage; the address is kept, a Banner Spin image rotates). The
Banner Spin image + click link LinkSpin just handed the member are not fetched (that would count a LinkSpin click). safety.js gains
privateIp + safeLookup with the Node 20 fix VBB/ViralAdBlitz needed (honors opts.all, answers an array). Every real change is
logged on the spot (or the default): old and new link and image, time, via edit/upload; the owner sees the newest 10. 120 changes
an hour per connection (each one fetches the link).

Admin takedown (the Viral Banner Blitz way, 8e6d2f9): /admin (new page) finds a spot by #number, wallet or network username;
POST /api/admin/spots/<id>/takedown {reason (required, the owner sees it), credit}. Hidden everywhere at once: the board shows a
house tile in its place (nobody else moves), the gate gives its step to a house site, /go/<id> goes home, its Network Ad Space
banner is paused (approved = 0) and no new one is placed. No views or clicks count while down. My Spots shows "Taken down" with
the reason and no edit controls. Restore (POST .../restore) reverses it (NAS resumed). Admin ledger: GET /api/admin/actions (who,
when, reason, credit decision). The contract is never touched.
CREDIT BACK IS NOT BUILT: a spot is a $5 on-chain purchase and this site has no free replacement spot or post credit, so
credit: "back" is refused with a note until Marty decides what it means here; takedowns are "no credit".
Chatbot: CANNED takedown + banner answer (unlimited checked, logged edits) + FACTS EDITS/TAKEDOWN lines, KNOWLEDGE_DATE 2026-11-16.
line.css?v=9, my.js?v=z3.
Tests: smoke section 10 (the lookup shape, edit log, unlimited edits, refusals: unreachable, 404, private address, http redirect,
shortener, bad image size/404/unreachable; redirect followed; same link logs nothing; upload logged; default checked + logged;
takedown: token, reason, credit choice, credit back refused, held house tile, image nowhere, /go home, gate, no views, owner view,
no edits while down, ledger, restore, /admin) against a stand-in internet preloaded into the app (qa/out/probe-stub.cjs, nothing
leaves the machine), plus phone renders of My Spots taken down and /admin: 193/193 with UI. chatbot.test 181/181.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 05:23:54 -06:00
martbost 197aa39fca Network hub hook (Marty 2026-11-16): sign out everywhere, hub blocks and erases end sessions here; "Sign out everywhere" button
hubevents.js (new, byte-identical in VBB, DLB, ViralAdBlitz, DownlineHydra, 5xYourTeam): POST /api/hub/events, signed by the hub
with HUB_SECRET (same hook InstantAdPay and LinkSpin take). member.signedout and member.blocked: the person is looked up by hub id
(/v1/resolve, signed as bannerline) and every session of their main wallet or any contract wallet ends. member.erased: matched by
the wallet SHA-256s the hub now sends with the event. Only sessions made before the event end (a replay never signs anyone out
twice); a failed hub lookup answers 503 so the hub resends. Off with HUB_HOOK=0. Admin status: hubEvents (counts only).
My Spots: "Sign out everywhere" next to Sign out (POST /api/auth/logout-everywhere -> networksso.signOutEverywhere, then every
session of this wallet here ends). my.js?v=z2.
Smoke section 9 (refused signatures, signedout in two browsers, replay, older event, blocked, erased by wallet hash, other events,
hub down -> 503 -> resent, Sign out everywhere, admin view): 145/145 with UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 05:01:28 -06:00
50 changed files with 1486 additions and 109 deletions
+7 -1
View File
@@ -9,6 +9,8 @@ const store = require('./store');
const DAY = 86400000; const DAY = 86400000;
function creative(spot) { function creative(spot) {
// taken down by the admin (2026-11-16): the spot keeps its place but shows a house banner, nothing of its own
if (store.spotDown(spot.id)) { const h = houseFor(spot.id); return { img: h.img, link: h.link, from: 'down', key: h.key, title: h.title }; }
const m = store.spotMeta(spot.id); const m = store.spotMeta(spot.id);
if (m && m.img && m.link) return { img: m.img, link: m.link, from: 'spot' }; if (m && m.img && m.link) return { img: m.img, link: m.link, from: 'spot' };
const d = store.memberDefault(spot.owner); const d = store.memberDefault(spot.owner);
@@ -30,7 +32,11 @@ let SPINS = [];
function setMemberSpins(list) { SPINS = Array.isArray(list) ? list : []; } function setMemberSpins(list) { SPINS = Array.isArray(list) ? list : []; }
function memberSpins() { const a = SPINS.slice(); for (let i = a.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [a[i], a[j]] = [a[j], a[i]]; } return a; } function memberSpins() { const a = SPINS.slice(); for (let i = a.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [a[i], a[j]] = [a[j], a[i]]; } return a; }
// a spot the admin took down holds its place on the board with a house tile: no image, owner, link or number of its own, and
// t 'house' so no view or click is ever counted for it
function heldTile(s) { const h = houseFor(s.id); return { t: 'house', key: h.key, img: h.img, href: '/go/h-' + h.key, title: h.title, note: h.note || '', held: true }; }
function spotTile(s) { function spotTile(s) {
if (store.spotDown(s.id)) return heldTile(s);
const c = cfgMod.get(); const cr = creative(s); const v = store.views(s.id); const c = cfgMod.get(); const cr = creative(s); const v = store.views(s.id);
return { t: 'spot', id: s.id, owner: s.owner, img: cr.img, href: '/go/' + s.id, views: v.total, owed: c.viewsOwed, kind: s.kind }; return { t: 'spot', id: s.id, owner: s.owner, img: cr.img, href: '/go/' + s.id, views: v.total, owed: c.viewsOwed, kind: s.kind };
} }
@@ -86,7 +92,7 @@ async function frameable(url) {
function target(ref) { function target(ref) {
if (/^h-/.test(ref)) { const h = cfgMod.house().find(x => 'h-' + x.key === ref); return h ? { link: h.link, spotId: null } : null; } if (/^h-/.test(ref)) { const h = cfgMod.house().find(x => 'h-' + x.key === ref); return h ? { link: h.link, spotId: null } : null; }
const s = chain.spot(Number(ref)); if (!s || s.kind === 3) return null; const s = chain.spot(Number(ref)); if (!s || s.kind === 3 || store.spotDown(s.id)) return null; // taken down: /go/<id> goes home
return { link: creative(s).link, spotId: s.id }; return { link: creative(s).link, spotId: s.id };
} }
+20 -5
View File
@@ -12,7 +12,11 @@
const core = require('./chatcore'); const core = require('./chatcore');
const C = require('./config').get(); const C = require('./config').get();
const KNOWLEDGE_DATE = '2026-11-15'; const KNOWLEDGE_DATE = '2026-11-18';
// Network Weekend (Black Friday to Cyber Monday 2026): live Fri 11-27 00:00 CT to Tue 12-01 00:00 CT (CST = UTC-6); WEEKEND_NOW = test clock
const NW_START = Date.parse('2026-11-27T06:00:00Z'), NW_END = Date.parse('2026-12-01T06:00:00Z');
const nwNow = () => { const t = process.env.WEEKEND_NOW ? Date.parse(process.env.WEEKEND_NOW) : NaN; return Number.isNaN(t) ? Date.now() : t; };
const nwLive = () => { const t = nwNow(); return t >= NW_START && t < NW_END; };
const URL_ = 'https://' + C.site; const URL_ = 'https://' + C.site;
const SUPPORT = 'https://instantadpay.com/support'; const SUPPORT = 'https://instantadpay.com/support';
const NOT_PROMISED = 'Nothing is promised: you are paid only when spots sell after yours, and a spot can earn back less than it cost.'; const NOT_PROMISED = 'Nothing is promised: you are paid only when spots sell after yours, and a spot can earn back less than it cost.';
@@ -24,6 +28,9 @@ const CANNED = [
{ id: 'refund', title: 'Refunds', q: ['Can I get a refund on my spot?', 'Can I cancel my spot?'], tags: ['refund', 'cancel'], { id: 'refund', title: 'Refunds', q: ['Can I get a refund on my spot?', 'Can I cancel my spot?'], tags: ['refund', 'cancel'],
re: /\brefund|cancel (my |the |a )?spot|money back|reverse (my |a |the )?(payment|transaction)/i, handoff: true, re: /\brefund|cancel (my |the |a )?spot|money back|reverse (my |a |the )?(payment|transaction)/i, handoff: true,
a: 'Spots are paid on Polygon straight to the contract and are final once confirmed, so they cannot be reversed or refunded. A spot is one payment, never a subscription. If something went wrong with a payment, open network support at ' + SUPPORT + ' with the transaction link.' }, a: 'Spots are paid on Polygon straight to the contract and are final once confirmed, so they cannot be reversed or refunded. A spot is one payment, never a subscription. If something went wrong with a payment, open network support at ' + SUPPORT + ' with the transaction link.' },
{ id: 'takedown', title: 'A spot taken down', q: ['Why was my spot taken down?', 'My banner was removed', 'Can my spot be taken down?'], tags: ['taken down', 'takedown', 'removed', 'hidden'],
re: /(taken down|take ?down|took (my |it |the )?(spot|banner)? ?down|(spot|banner) (was |got |is )?(removed|hidden|gone|blocked))/i,
a: 'A spot whose banner or link breaks the rules (terms: ' + URL_ + '/terms) can be taken down by the admin. It is then hidden everywhere at once, its place in the line is kept (a network banner shows there, so nobody else moves), and no views count while it is down. My Spots shows "Taken down" with the reason. The on-chain payments from the purchase already happened and do not change. The admin can restore a spot taken down by mistake. To ask about one, open network support at ' + SUPPORT + ' with the spot number.' },
{ id: 'about', title: 'What is Downline Banners?', q: ['What is Downline Banners?', 'How does Downline Banners work?', 'What is DLB?'], tags: ['downline banners', 'dlb', 'line', 'board', 'overview'], { id: 'about', title: 'What is Downline Banners?', q: ['What is Downline Banners?', 'How does Downline Banners work?', 'What is DLB?'], tags: ['downline banners', 'dlb', 'line', 'board', 'overview'],
re: /(what('s| is) (downline ?banners?|dlb|the line|this (site|place))|how does (downline ?banners?|dlb|the line|this site|it) work)/i, re: /(what('s| is) (downline ?banners?|dlb|the line|this (site|place))|how does (downline ?banners?|dlb|the line|this site|it) work)/i,
a: 'Downline Banners is one global line of 468x60 banner spots. A $5 spot buys ' + C.viewsOwed + ' guaranteed views on the board for your image and link (within ' + C.spotDays + ' days, newest spots on top) and a place in the line. When a later spot sells, the contract pays the 10 spots before it and the buyer\'s sponsor in that same transaction. ' + NOT_PROMISED + ' See ' + URL_ + '/how' }, a: 'Downline Banners is one global line of 468x60 banner spots. A $5 spot buys ' + C.viewsOwed + ' guaranteed views on the board for your image and link (within ' + C.spotDays + ' days, newest spots on top) and a place in the line. When a later spot sells, the contract pays the 10 spots before it and the buyer\'s sponsor in that same transaction. ' + NOT_PROMISED + ' See ' + URL_ + '/how' },
@@ -50,19 +57,22 @@ const CANNED = [
a: 'A spot is $5 in POL at the Chainlink POL/USD price, one payment, never a subscription. It buys ' + C.viewsOwed + ' guaranteed views on the board for your 468x60 image and link, delivered within ' + C.spotDays + ' days, and a place in the line. Each spot takes the next place, so you can buy more than one. If a spot has not reached ' + C.viewsOwed + ' views after ' + C.spotDays + ' days, Network Ad Space finishes it. Get one at ' + URL_ + '/join' }, a: 'A spot is $5 in POL at the Chainlink POL/USD price, one payment, never a subscription. It buys ' + C.viewsOwed + ' guaranteed views on the board for your 468x60 image and link, delivered within ' + C.spotDays + ' days, and a place in the line. Each spot takes the next place, so you can buy more than one. If a spot has not reached ' + C.viewsOwed + ' views after ' + C.spotDays + ' days, Network Ad Space finishes it. Get one at ' + URL_ + '/join' },
{ id: 'banner', title: 'Your banner image and link', q: ['How do I add my banner?', 'What size is the banner?', 'How do I change my image?'], tags: ['banner', '468x60', 'image', 'link', 'my spots'], { id: 'banner', title: 'Your banner image and link', q: ['How do I add my banner?', 'What size is the banner?', 'How do I change my image?'], tags: ['banner', '468x60', 'image', 'link', 'my spots'],
re: /(468 ?x ?60|banner (size|image)|what size|upload|add (my |an )?(image|banner|link)|change (my )?(image|banner|link)|my spots)/i, re: /(468 ?x ?60|banner (size|image)|what size|upload|add (my |an )?(image|banner|link)|change (my )?(image|banner|link)|my spots)/i,
a: 'After buying, open My Spots (' + URL_ + '/my), sign in with one free signature (it cannot move funds), and add your 468x60 image (150 KB or less) and link to each spot. Your spot then shows on the board, newest on top, until it has its ' + C.viewsOwed + ' views.' }, a: 'After buying, open My Spots (' + URL_ + '/my), sign in with one free signature (it cannot move funds), and add your 468x60 image (150 KB or less) and link to each spot. Your spot then shows on the board, newest on top, until it has its ' + C.viewsOwed + ' views. You can change the image or link any time, as often as you like: every change gets the full check (https, a real website, no link shorteners, the link must open, an image address must load as a 468x60 image) and is logged on the spot.' },
{ id: 'wallet', title: 'Signing in and paying', q: ['How do I sign in?', 'Which wallet should I use?', 'How do I pay?'], tags: ['sign in', 'wallet', 'pol', 'safepal'], { id: 'wallet', title: 'Signing in and paying', q: ['How do I sign in?', 'Which wallet should I use?', 'How do I pay?'], tags: ['sign in', 'wallet', 'pol', 'safepal'],
re: /(sign ?(in|up)|log ?in|account|which wallet|what wallet|wallet|metamask|safepal|\bpol\b|polygon|crypto|gas|fee|how (do|can) i (pay|buy))/i, re: /(sign ?(in|up)|log ?in|account|which wallet|what wallet|wallet|metamask|safepal|\bpol\b|polygon|crypto|gas|fee|how (do|can) i (pay|buy))/i,
a: 'Pay from your own wallet straight to the contract with SafePal or any other crypto wallet on Polygon; the site never holds your money. Keep a little extra POL for the network fee. Sign in to My Spots with one free signature, or through your InstantAdPay or LinkSpin account.' }, a: 'Pay from your own wallet straight to the contract with SafePal or any other crypto wallet on Polygon; the site never holds your money. Keep a little extra POL for the network fee. Sign in to My Spots with one free signature, or through your InstantAdPay or LinkSpin account.' },
{ id: 'safe', title: 'Is it safe? Is it a scheme?', q: ['Is this a pyramid scheme?', 'Is Downline Banners legit?', 'Who holds the money?'], tags: ['safe', 'legit', 'pyramid', 'contract'], { id: 'safe', title: 'Is it safe? Is it a scheme?', q: ['Is this a pyramid scheme?', 'Is Downline Banners legit?', 'Who holds the money?'], tags: ['safe', 'legit', 'pyramid', 'contract'],
re: /(pyramid|ponzi|scam|scheme|legit|safe|trust|rug|who holds)/i, re: /(pyramid|ponzi|scam|scheme|legit|safe|trust|rug|who holds)/i,
a: 'A spot buys guaranteed banner views and a place in the line. The BannerLine contract on Polygon splits each $5 in the same transaction with fixed shares, no setters and no owner withdraw; it holds nothing except the momentum fund. From the line alone, a member who refers nobody gets back less than the $5 a spot costs. Check every sale at ' + URL_ + '/ledger and the contract at ' + URL_ + '/contract. This is advertising with a share of later sales, not an investment.' }, a: 'A spot buys guaranteed banner views and a place in the line. The BannerLine contract on Polygon splits each $5 in the same transaction with fixed shares, no setters and no owner withdraw; it holds nothing except the momentum fund. From the line alone, a member who refers nobody gets back less than the $5 a spot costs. Check every sale at ' + URL_ + '/ledger and the contract at ' + URL_ + '/contract; the guide at ' + URL_ + '/guides/is-it-legit walks through both. This is advertising with a share of later sales, not an investment.' },
{ id: 'promote', title: 'Promote Downline Banners', q: ['Is there a promo kit?', 'Where are the banners to promote DLB?'], tags: ['promote', 'kit', 'banners'], { id: 'promote', title: 'Promote Downline Banners', q: ['Is there a promo kit?', 'Where are the banners to promote DLB?'], tags: ['promote', 'kit', 'banners'],
re: /(promo|promote|creatives?|kit|swipes?|my link|referral link)/i, re: /(promo|promote|creatives?|kit|swipes?|my link|referral link)/i,
a: 'The promo kit at ' + URL_ + '/promote has your referral links, creatives in the common sizes and copy. When someone you referred buys a spot, you receive $1.50 in POL in that transaction.' } a: 'The promo kit at ' + URL_ + '/promote has your referral links, creatives in the common sizes and copy. When someone you referred buys a spot, you receive $1.50 in POL in that transaction.' }
]; ];
const FAQ = [ const FAQ = [
{ id: 'f-guides', title: 'Downline Banners guides', source: 'faq', tags: ['guides', 'guide', 'faq', 'legit', 'free account', 'help'],
questions: ['Is there a guide?', 'Where is the FAQ?', 'How do I get the most from a free account?', 'How can I check Downline Banners is legit?'],
answer: 'The Guides at ' + URL_ + '/guides: How it works (' + URL_ + '/how), Is it legit? with the contract, ledger and exact split (' + URL_ + '/guides/is-it-legit), Getting the most from your free account (' + URL_ + '/guides/free-account) and the FAQ (' + URL_ + '/guides/faq). Tip from the free-account guide: own a spot before you share your link, because the contract records the sponsor of a buyer once, with their first spot, and only if that sponsor already owns a spot.' },
{ id: 'f-network', title: 'Downline Banners and the other network sites', source: 'faq', tags: ['network', 'one account', 'sponsor'], { id: 'f-network', title: 'Downline Banners and the other network sites', source: 'faq', tags: ['network', 'one account', 'sponsor'],
questions: ['Is Downline Banners part of InstantAdPay?', 'Who is my sponsor here?', 'Which network sites are there?'], questions: ['Is Downline Banners part of InstantAdPay?', 'Who is my sponsor here?', 'Which network sites are there?'],
answer: 'Downline Banners is part of the network: one account, username and sponsor across InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, ViralAdBlitz, DownlineHydra, 5xYourTeam, Stack POL and Earners Corner. Your sponsor here is your network sponsor. Open board slots show network sites such as InstantAdPay and LinkSpin. Ad credits buy advertising, not income.' }, answer: 'Downline Banners is part of the network: one account, username and sponsor across InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, ViralAdBlitz, DownlineHydra, 5xYourTeam, Stack POL and Earners Corner. Your sponsor here is your network sponsor. Open board slots show network sites such as InstantAdPay and LinkSpin. Ad credits buy advertising, not income.' },
@@ -75,11 +85,16 @@ const FACTS = () => [
'- WHAT IT IS: Downline Banners (' + URL_ + ') is one global line of 468x60 banner spots on the BannerLine contract (Polygon). A spot = $5 in POL at the Chainlink price, one payment = ' + C.viewsOwed + ' guaranteed board views for the image and link within ' + C.spotDays + ' days (newest on top, ' + C.boardSlots + ' board slots) + the next place in the line. Not done after ' + C.spotDays + ' days: Network Ad Space finishes the views owed.', '- WHAT IT IS: Downline Banners (' + URL_ + ') is one global line of 468x60 banner spots on the BannerLine contract (Polygon). A spot = $5 in POL at the Chainlink price, one payment = ' + C.viewsOwed + ' guaranteed board views for the image and link within ' + C.spotDays + ' days (newest on top, ' + C.boardSlots + ' board slots) + the next place in the line. Not done after ' + C.spotDays + ' days: Network Ad Space finishes the views owed.',
'- SPLIT (contract constants, no setters, no owner withdraw): 30% ($1.50) to the buyer\'s sponsor (none: the momentum fund); 55% = $0.275 to each owner of the 10 spots bought just before; 10% company; 5% momentum fund. Same transaction. A failed send goes to the fund. The contract holds nothing except the fund. From the line alone, a member who refers nobody gets back less than $5 per spot. Never estimate totals.', '- SPLIT (contract constants, no setters, no owner withdraw): 30% ($1.50) to the buyer\'s sponsor (none: the momentum fund); 55% = $0.275 to each owner of the 10 spots bought just before; 10% company; 5% momentum fund. Same transaction. A failed send goes to the fund. The contract holds nothing except the fund. From the line alone, a member who refers nobody gets back less than $5 per spot. Never estimate totals.',
'- MOMENTUM FUND: only buys spots. No sale for ' + C.keeperStallHours + ' hours: it buys one (max ' + C.keeperMaxPerDay + ' a day), gifted to an active member who owns a paid spot and had no gift in 7 days, recent referrers first; nobody qualifies: the fund keeps the spot and its line money returns to the fund.', '- MOMENTUM FUND: only buys spots. No sale for ' + C.keeperStallHours + ' hours: it buys one (max ' + C.keeperMaxPerDay + ' a day), gifted to an active member who owns a paid spot and had no gift in 7 days, recent referrers first; nobody qualifies: the fund keeps the spot and its line money returns to the fund.',
'- SPONSOR RULE (contract): the sponsor of a buyer is recorded once, with their first spot, and only if that sponsor already owns a spot at that moment; otherwise the share goes to someone up the network line who owns a spot, or to the momentum fund. So a member should own a spot before sharing their link.',
'- JOIN FLOW: "Look around first" on the home page (sponsor\'s spot, the board, the 3 newest spots, each a short timer), then Join unlocks. /join: connect a wallet and buy, or "Buy a spot for someone else" (they own it). My Spots (/my): one free signature, add a 468x60 image (150 KB max) and link per spot.', '- JOIN FLOW: "Look around first" on the home page (sponsor\'s spot, the board, the 3 newest spots, each a short timer), then Join unlocks. /join: connect a wallet and buy, or "Buy a spot for someone else" (they own it). My Spots (/my): one free signature, add a 468x60 image (150 KB max) and link per spot.',
'- EDITS: a spot\'s image and link (and the default) can be changed any number of times. Every change gets the full check (https, public site, no shorteners, the link must answer, an image address must download as a real 468x60 image of 150 KB or less) and is logged on the spot (old and new link and image, time).',
'- TAKEDOWN: the admin can take down a spot that breaks the rules, with a reason. It is hidden everywhere (board, gate, links, Network Ad Space), keeps its place (a house banner holds it, nobody moves), counts no views while down; the owner sees "Taken down" with the reason on My Spots. On-chain payments already happened at purchase and never change; there is no refund. The admin can restore it.',
'- REFUEL SPOTS: a counted Monthly Refuel of $50+ on InstantAdPay or LinkSpin earns one spot, bought for the member under their network sponsor, paid by the company.', '- REFUEL SPOTS: a counted Monthly Refuel of $50+ on InstantAdPay or LinkSpin earns one spot, bought for the member under their network sponsor, paid by the company.',
'- BOARD: open slots show members\' LinkSpin Banner Spins, then network house ads (InstantAdPay, LinkSpin, network games). Pages: /, /board, /how, /join, /my, /promote, /ledger, /contract, /terms, /disclaimer, /privacy.', '- VIDEO (2026-11-18): a short walkthrough video (what a spot buys, where the $5 goes, what is not promised, My Spots, own a spot before you share, where to start) is on ' + URL_ + '/how.',
'- BOARD: open slots show members\' LinkSpin Banner Spins, then network house ads (InstantAdPay, LinkSpin, network games). Pages: /, /board, /how, /join, /my, /promote, /ledger, /contract, /terms, /disclaimer, /privacy. Guides: /guides (index), /guides/is-it-legit (contract, ledger, split), /guides/free-account, /guides/faq.',
(nwLive() ? '- NETWORK WEEKEND (live now, Black Friday to Cyber Monday, Fri 11-27 to Mon 11-30, midnight to midnight Central): Downline Banners has no price or split change (a spot stays $5). The weekend idea here is gifting: on /join, "Buy a spot for someone else" pays a $5 spot for a teammate, the spot is theirs and the payment splits exactly like any other spot. Every network deal: https://instantadpay.com/weekend' : null),
'- NO REFUNDS: blockchain payments are final. SUPPORT for account or payment problems: network support at ' + SUPPORT + ' (InstantAdPay runs the one desk for every network site). This is advertising with a share of later sales, not an investment. Nothing is promised.' '- NO REFUNDS: blockchain payments are final. SUPPORT for account or payment problems: network support at ' + SUPPORT + ' (InstantAdPay runs the one desk for every network site). This is advertising with a share of later sales, not an investment. Nothing is promised.'
].join('\n'); ].filter(Boolean).join('\n');
const SITE = { const SITE = {
id: 'bannerline', hubSite: 'bannerline', netId: 'dlb', name: 'Downline Banners', url: URL_, supportUrl: SUPPORT, knowledgeDate: KNOWLEDGE_DATE, id: 'bannerline', hubSite: 'bannerline', netId: 'dlb', name: 'Downline Banners', url: URL_, supportUrl: SUPPORT, knowledgeDate: KNOWLEDGE_DATE,
+12 -2
View File
@@ -2,6 +2,9 @@
// The site's own chatbot.js holds what it knows (CANNED instant answers + FACTS, written from that site's code); this file // The site's own chatbot.js holds what it knows (CANNED instant answers + FACTS, written from that site's code); this file
// holds how it answers, the same on every site: // holds how it answers, the same on every site:
// 1. the knowledge base's instant answers (kb.js, seeded from CANNED; first matching pattern wins, no AI call) // 1. the knowledge base's instant answers (kb.js, seeded from CANNED; first matching pattern wins, no AI call)
// (since 2026-11-16 only a hand-off pattern answers outright; any other pattern hit is checked against step 1b)
// 1b. the hub's semantic match by meaning (netkb.route, core2 embeddings): answers with this site's entry when it is sure,
// keeps or overrules a pattern hit, and picks the prompt context; fails soft to the old path within NETKB_MATCH_MS
// 2. retrieval over the merged NETWORK knowledge base (this site's entries boosted, netkb.js), into the system prompt // 2. retrieval over the merged NETWORK knowledge base (this site's entries boosted, netkb.js), into the system prompt
// 3. OpenRouter (deepseek/deepseek-v4-flash:nitro, reasoning OFF, retried once), house rules in the prompt and on the way out // 3. OpenRouter (deepseek/deepseek-v4-flash:nitro, reasoning OFF, retried once), house rules in the prompt and on the way out
// Account problems go to the network support desk on InstantAdPay (handoff: true makes the widget offer it). // Account problems go to the network support desk on InstantAdPay (handoff: true makes the widget offer it).
@@ -125,12 +128,19 @@ async function answerRaw(message, historyText) {
hit = await kb.fastPath(msg); hit = await kb.fastPath(msg);
if (hit && other.length && !hit.handoff) hit = null; if (hit && other.length && !hit.handoff) hit = null;
} catch (e) { kbOk = false; console.error('kb fast path', e.message); } } catch (e) { kbOk = false; console.error('kb fast path', e.message); }
if (hit) return Object.assign({ reply: hit.answer, canned: true, kb: hit.id }, hit.handoff ? { handoff: true } : {}); // a hand-off (support, one person's account problem) always answers from its exact pattern, before anything else
if (hit && hit.handoff) return { reply: hit.answer, canned: true, kb: hit.id, handoff: true };
// then meaning (2026-11-16, netkb.route): the hub's semantic match over the network KB answers, keeps or overrules the
// pattern hit, and picks the prompt context. Hub or model slow or down: null, and the pattern + BM25 path below runs as before.
let sem = null;
if (kbOk) { try { sem = await netkb.route(msg, { fast: hit, own: await kb.own(), prefer: other }); } catch (e) { sem = null; } }
if (sem) hit = sem.hit;
if (hit) return Object.assign({ reply: hit.answer, canned: true, kb: hit.id }, sem ? { via: sem.via } : {}, hit.handoff ? { handoff: true } : {});
if (!kbOk) for (const c of S.canned) if (c.re && c.re.test(msg)) return Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {}); if (!kbOk) for (const c of S.canned) if (c.re && c.re.test(msg)) return Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {});
let kbBlock = '', kbIds = [], hits = []; let kbBlock = '', kbIds = [], hits = [];
try { try {
const query = msg.split(/\s+/).length < 4 && historyText ? msg + ' ' + String(historyText).slice(-200) : msg; const query = msg.split(/\s+/).length < 4 && historyText ? msg + ' ' + String(historyText).slice(-200) : msg;
hits = await kb.context(query, 6); hits = sem && sem.hits.length ? sem.hits : await kb.context(query, 6);
kbBlock = kb.promptBlock(hits); kbIds = hits.map(h => h.entry.id); kbBlock = kb.promptBlock(hits); kbIds = hits.map(h => h.entry.id);
} catch (e) { console.error('kb search', e.message); } } catch (e) { console.error('kb search', e.message); }
if (!enabled()) { if (!enabled()) {
+3
View File
@@ -42,6 +42,9 @@ function get() {
// board + gate // board + gate
viewsOwed: 300, spotDays: 30, boardSlots: Number(e.BOARD_SLOTS || 12), viewsOwed: 300, spotDays: 30, boardSlots: Number(e.BOARD_SLOTS || 12),
gateVisitSeconds: 9, gateBoardSeconds: 10, gateVisitSeconds: 9, gateBoardSeconds: 10,
// every edit of a spot's (or the default's) link and image gets the full check (2026-11-16): the link must answer, an image
// address must download as a real 468x60 image. LINK_PROBE=0 turns the network part off (local smoke only).
linkProbe: e.LINK_PROBE !== '0',
// keeper (fund buys). KEEPER_KEY is never stored in cfg: keeper.js reads it from env at signing time only. // keeper (fund buys). KEEPER_KEY is never stored in cfg: keeper.js reads it from env at signing time only.
keeperEnabled: e.KEEPER_ENABLED === '1', keeperEnabled: e.KEEPER_ENABLED === '1',
keeperStallHours: Number(e.KEEPER_STALL_HOURS || 4), keeperStallHours: Number(e.KEEPER_STALL_HOURS || 4),
+14 -2
View File
@@ -5,6 +5,8 @@
// so the board gets traffic without crowding InstantAdPay members' paid ads out of NAS. // so the board gets traffic without crowding InstantAdPay members' paid ads out of NAS.
// - spots: a spot past its 30 days with fewer than 300 views gets its own banner placed in NAS for exactly the views still owed; // - spots: a spot past its 30 days with fewer than 300 views gets its own banner placed in NAS for exactly the views still owed;
// what NAS serves counts toward the spot's 300 (served(spotId)). // what NAS serves counts toward the spot's 300 (served(spotId)).
// - a spot the admin took down (2026-11-16) gets no new NAS banner, and its running one is paused (approved = 0, so NAS serves
// none of it and no views count) until it is restored (approved = 1).
// State in dlb-nas.json (a MySQL document through docstore). Inert unless NAS_DB_* are set. // State in dlb-nas.json (a MySQL document through docstore). Inert unless NAS_DB_* are set.
'use strict'; 'use strict';
const crypto = require('crypto'); const crypto = require('crypto');
@@ -50,7 +52,8 @@ async function tick() {
for (const sp of R.spots()) { for (const sp of R.spots()) {
const id = String(sp.id); const owed = c.viewsOwed - R.views(sp.id); const id = String(sp.id); const owed = c.viewsOwed - R.views(sp.id);
const rec = s.spots[id]; const rec = s.spots[id];
if (rec) { const sv = await served(rec.id); if (sv != null) rec.served = sv; continue; } if (rec) { const sv = await served(rec.id); if (sv != null) rec.served = sv; if (R.isDown && R.isDown(sp.id) && !rec.paused) await pause(sp.id); continue; }
if (R.isDown && R.isDown(sp.id)) continue; // taken down: no NAS banner while it is down
if (sp.kind === 3 || owed <= 0 || Date.now() - sp.boughtAt < c.spotDays * 86400000) continue; if (sp.kind === 3 || owed <= 0 || Date.now() - sp.boughtAt < c.spotDays * 86400000) continue;
const cr = R.creative(sp); let img = cr.img || ''; if (img.startsWith('/')) img = site + img; const cr = R.creative(sp); let img = cr.img || ''; if (img.startsWith('/')) img = site + img;
if (!/^https:\/\/.+\.(png|jpe?g|gif)(\?.*)?$/i.test(img) && !/\/i\/[a-z0-9]+\.gif/i.test(img)) img = site + '/art/house-strip-nas.png'; if (!/^https:\/\/.+\.(png|jpe?g|gif)(\?.*)?$/i.test(img) && !/\/i\/[a-z0-9]+\.gif/i.test(img)) img = site + '/art/house-strip-nas.png';
@@ -61,8 +64,17 @@ async function tick() {
} catch (e) { s.lastErr = String(e.message).slice(0, 200); console.error('dlbnas', e.message); } } catch (e) { s.lastErr = String(e.message).slice(0, 200); console.error('dlbnas', e.message); }
save(); save();
} }
// takedown / restore (2026-11-16): pause or resume a spot's running NAS banner. -> 'paused' | 'resumed' | 'none' | 'off'
async function pause(id) {
const rec = load().spots[String(id)]; if (!rec) return 'none'; if (!on()) return 'off';
await q('UPDATE sponsorads SET approved = 0 WHERE ID = ?', [Number(rec.id)]); rec.paused = Date.now(); save(); return 'paused';
}
async function resume(id) {
const rec = load().spots[String(id)]; if (!rec || !rec.paused) return 'none'; if (!on()) return 'off';
await q('UPDATE sponsorads SET approved = 1 WHERE ID = ?', [Number(rec.id)]); delete rec.paused; save(); return 'resumed';
}
// views NAS delivered for a spot (counted toward its 300) // views NAS delivered for a spot (counted toward its 300)
function spotServed(id) { const r = load().spots[String(id)]; return r ? (r.served || 0) : 0; } function spotServed(id) { const r = load().spots[String(id)]; return r ? (r.served || 0) : 0; }
function init(deps) { R = deps; if (!on()) { console.log('dlbnas: off (no NAS_DB_*)'); return; } load(); setTimeout(() => tick().catch(() => {}), 30000); const t = setInterval(() => tick().catch(() => {}), 6 * 3600000); t.unref && t.unref(); } function init(deps) { R = deps; if (!on()) { console.log('dlbnas: off (no NAS_DB_*)'); return; } load(); setTimeout(() => tick().catch(() => {}), 30000); const t = setInterval(() => tick().catch(() => {}), 6 * 3600000); t.unref && t.unref(); }
function view() { const s = load(); return { on: on(), house: s.house || null, spots: s.spots, lastOk: s.lastOk || null, lastErr: s.lastErr || null }; } function view() { const s = load(); return { on: on(), house: s.house || null, spots: s.spots, lastOk: s.lastOk || null, lastErr: s.lastErr || null }; }
module.exports = { init, tick, spotServed, view, on }; module.exports = { init, tick, spotServed, view, on, pause, resume };
+135
View File
@@ -0,0 +1,135 @@
// Network hub events for a wallet site (Marty 2026-11-16, "Yes do 1 and 2"). Byte-identical in Viral Banner Blitz, Downline Banners,
// ViralAdBlitz, DownlineHydra and 5xYourTeam (like networksso.js): copy it whole, never edit one copy alone.
//
// The hub tells every hooked site what changed (POST /api/hub/events, the same hook InstantAdPay and LinkSpin take): X-Hub-Ts +
// X-Hub-Sig = hex HMAC-SHA256(HUB_SECRET, ts + newline + raw body), 5-minute window. The hub only moves its cursor after a 2xx and
// may send an event twice. This site acts on three events and ignores every other one:
// member.signedout "Sign out everywhere" on any network site
// member.blocked the hub blocked the person
// member.erased the hub erased the person ({emailHash, walletHashes}: the person is gone from the hub, so no lookup)
// Each one ends that person's sessions here. A wallet site keys sessions by wallet, so the person is mapped through the hub:
// POST /v1/resolve {id} (signed as HUB_SITE) gives their main wallet and every contract wallet (contractWallets). An erased
// person cannot be looked up any more: the event carries the SHA-256 of each of their wallets (and of their email) instead.
// Only sessions made BEFORE the event end (a fresh sign-in after it stays), so a replay can never sign anyone out twice.
// A failed lookup answers 503 so the hub sends the batch again; after 5 tries an event is set aside in the log.
// Nothing here sends mail, posts or touches a banner, a payout or the chain: it only ends sign-in sessions.
//
// init({ dataDir, site, end }) where end({ type, personId, at, wallets, walletHashes, emailHash, match }) ends the sessions and
// answers how many; match(session-like {address?, email?, wallet?, hubId?}) is the shared test (wallet, wallet hash, email
// hash, hub id). Off when HUB_HOOK=0, or without HUB_URL and a 32+ character HUB_SECRET (then the route answers 404).
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const WALLET_RE = /^0x[0-9a-f]{40}$/, HASH_RE = /^[0-9a-f]{64}$/;
const TRIES = 5, KEEP = 3000, SKEW = 2000;
const ACTS = new Set(['member.signedout', 'member.blocked', 'member.erased']);
let R = null, st = null, chain_ = Promise.resolve();
const SECRET = () => String(process.env.HUB_SECRET || '').trim();
const BASE = () => String(process.env.HUB_URL || '').trim().replace(/\/+$/, '');
const SITE = () => String(process.env.HUB_SITE || (R && R.site) || '').trim().toLowerCase();
const on = () => !/^(0|false|no|off)$/i.test(String(process.env.HUB_HOOK || '').trim()) && /^https?:\/\/[a-z0-9.:-]+$/i.test(BASE()) && SECRET().length >= 32;
const lc = v => String(v == null ? '' : v).trim().toLowerCase();
const sha = v => crypto.createHash('sha256').update(lc(v)).digest('hex');
const FILE = () => path.join(R.dataDir, 'hubevents.json');
function load() {
if (st) return st;
try { st = JSON.parse(fs.readFileSync(FILE(), 'utf8')); } catch (e) { st = null; }
if (!st || typeof st !== 'object') st = {};
st.done = st.done || {}; st.tries = st.tries || {}; st.log = st.log || [];
st.stats = Object.assign({ batches: 0, events: 0, ended: 0, ignored: 0, skipped: 0, gaveUp: 0, refused: 0 }, st.stats || {});
return st;
}
function save() { if (!R || !R.dataDir) return; try { const t = FILE() + '.tmp'; fs.writeFileSync(t, JSON.stringify(load())); fs.renameSync(t, FILE()); } catch (e) { console.error('hubevents save', e.message); } }
function note(x) { const s = load(); s.log.push(Object.assign({ ts: Date.now() }, x)); if (s.log.length > 200) s.log = s.log.slice(-200); }
function init(deps) { R = deps || {}; load(); }
const sign = (ts, raw) => crypto.createHmac('sha256', SECRET()).update(String(ts) + '\n' + raw).digest('hex');
function verify(headers, raw) {
if (SECRET().length < 32) return false;
const ts = String(headers['x-hub-ts'] || ''), sig = String(headers['x-hub-sig'] || '');
if (!/^\d{10,16}$/.test(ts) || Math.abs(Date.now() - Number(ts)) > 5 * 60000 || !/^[0-9a-f]{64}$/.test(sig)) return false;
const want = sign(ts, raw);
return crypto.timingSafeEqual(Buffer.from(want), Buffer.from(sig));
}
// the hub person by hub id (null = the hub does not know them); throws when the hub does not answer
async function resolveId(id) {
const raw = JSON.stringify({ id }); const ts = String(Date.now());
const r = await fetch(BASE() + '/v1/resolve', { method: 'POST', body: raw, signal: AbortSignal.timeout(10000),
headers: { 'Content-Type': 'application/json', 'X-Hub-Site': SITE(), 'X-Hub-Ts': ts, 'X-Hub-Sig': sign(ts, raw) } });
if (r.status !== 200) throw new Error('hub resolve ' + r.status);
const j = await r.json(); return j && j.person && typeof j.person === 'object' ? j.person : null;
}
// every wallet the hub holds for a person: the main wallet and each contract's wallet
function walletsOf(p) {
const out = new Set(); if (!p) return [];
if (WALLET_RE.test(lc(p.wallet))) out.add(lc(p.wallet));
for (const w of Object.values(p.contractWallets || {})) if (WALLET_RE.test(lc(w))) out.add(lc(w));
return [...out];
}
// the shared test: does this session / member belong to the person?
function matcher(who) {
const ws = new Set(who.wallets || []), hs = new Set(who.walletHashes || []), eh = who.emailHash || null, id = who.personId || null;
return x => {
if (!x) return false;
for (const w of [x.address, x.wallet, x.hubWallet]) { const v = lc(w); if (WALLET_RE.test(v) && (ws.has(v) || hs.has(sha(v)))) return true; }
if (eh && x.email && sha(x.email) === eh) return true;
if (id && (x.hubId === id || x.key === id)) return true;
return false;
};
}
async function apply(ev) {
if (!ACTS.has(ev.type) || !ev.personId) return 'ignored';
const who = { type: ev.type, personId: String(ev.personId), at: Number(ev.at) || Date.now(), wallets: [], walletHashes: [], emailHash: null };
if (ev.type === 'member.erased') {
const d = ev.data || {};
who.walletHashes = (Array.isArray(d.walletHashes) ? d.walletHashes : []).map(lc).filter(h => HASH_RE.test(h)).slice(0, 50);
who.emailHash = HASH_RE.test(lc(d.emailHash)) ? lc(d.emailHash) : null;
} else {
const p = await resolveId(who.personId); // throws: the hub sends it again
if (!p) return 'ignored';
who.wallets = walletsOf(p);
}
who.before = who.at + SKEW; // sessions made after the event are fresh sign-ins and stay
who.match = matcher(who);
const n = Number(await R.end(who)) || 0;
note({ type: ev.type, seq: ev.seq, sessions: n });
if (n) { load().stats.ended += n; return 'applied'; }
return 'none';
}
function prune() {
const s = load(); const seqs = Object.keys(s.done).map(Number).sort((a, b) => a - b);
for (const q of seqs.slice(0, Math.max(0, seqs.length - KEEP))) delete s.done[q];
}
async function handle(events) {
const s = load(); s.stats.batches++; let failed = null;
for (const ev of Array.isArray(events) ? events : []) {
const seq = Number(ev && ev.seq); if (!seq) continue;
if (s.done[seq]) { s.stats.skipped++; continue; }
s.stats.events++;
try {
const r = await apply(ev);
s.done[seq] = Date.now(); delete s.tries[seq];
if (r === 'ignored') s.stats.ignored++;
} catch (e) {
s.tries[seq] = (s.tries[seq] || 0) + 1;
console.error('hubevents', seq, ev.type, e.message);
if (s.tries[seq] >= TRIES) { s.done[seq] = Date.now(); delete s.tries[seq]; s.stats.gaveUp++; note({ type: 'gave-up', seq, event: ev.type, error: String(e.message).slice(0, 160) }); continue; }
failed = e; break;
}
}
prune(); save();
return failed ? { status: 503, body: { error: 'retry' } } : { status: 200, body: { ok: true } };
}
// the POST /api/hub/events handler -> { status, body }. Batches run one at a time.
function receive(headers, raw) {
if (!R || !on()) return Promise.resolve({ status: 404, body: { error: 'not found' } });
if (!verify(headers || {}, String(raw || ''))) { load().stats.refused++; return Promise.resolve({ status: 401, body: { error: 'unauthorized' } }); }
let b; try { b = JSON.parse(raw || '{}'); } catch (e) { return Promise.resolve({ status: 400, body: { error: 'bad json' } }); }
const run = chain_.then(() => handle(b && b.events)); chain_ = run.catch(() => {}); return run;
}
function view() { const s = load(); return { on: on(), stats: s.stats, waiting: Object.keys(s.tries).length, log: s.log.slice(-20) }; }
module.exports = { init, receive, view, on, verify, walletsOf, matcher, sha, _reset: () => { st = null; chain_ = Promise.resolve(); } };
+55
View File
@@ -0,0 +1,55 @@
// Network deals for this site's "Network Weekend" ribbon (Marty 2026-11-17). One source: the hub's public GET /v1/network-deals
// (HUB_URL). Cached 2 minutes, refreshed in the background, never waits on a slow hub (2.5 s timeout); hub down = no ribbon.
// The same file lives in every network site. Never RM Circle, never the games (the hub list never names them).
// The page (/assets/netweekend.js) switches the ribbon on and off by its own clock at startsAt / endsAt, so a cached copy never
// shows early or late. setLocal(fn) lets a site rewrite its own deal line from live data (for example a price read from chain),
// so the ribbon never shows a number the contract does not charge: fn(deal) returns the deal, a changed copy, or null to drop it.
const TTL = 2 * 60 * 1000;
let cache = { at: 0, body: { events: [] } };
let inflight = null;
let local = null;
const hubUrl = () => String(process.env.HUB_URL || 'https://hub.saasy.top').trim().replace(/\/+$/, '');
const safeUrl = u => (/^https:\/\/[a-z0-9.-]+(\/[^\s"'<>]*)?$/i.test(String(u || '')) ? String(u) : '');
const str = (v, n) => String(v == null ? '' : v).slice(0, n || 300);
function clean(j) {
if (!j || !Array.isArray(j.events)) return null;
return { events: j.events.slice(0, 5).filter(e => e && e.id && !Number.isNaN(Date.parse(e.startsAt)) && !Number.isNaN(Date.parse(e.endsAt))).map(e => ({
id: str(e.id, 60), name: str(e.name, 60), tagline: str(e.tagline, 160), url: safeUrl(e.url), startsAt: e.startsAt, endsAt: e.endsAt,
days: e.days && typeof e.days === 'object' ? Object.fromEntries(Object.entries(e.days).slice(0, 20).map(([k, v]) => [str(k, 10), str(v, 40)])) : {},
deals: (Array.isArray(e.deals) ? e.deals : []).slice(0, 40).map(d => {
const x = { site: str(d.site, 30), name: str(d.name, 80), url: safeUrl(d.url), text: str(d.text), endsAt: Number.isNaN(Date.parse(d.endsAt)) ? e.endsAt : d.endsAt };
if (d.note) x.note = str(d.note, 120);
if (d.byDay && typeof d.byDay === 'object') x.byDay = Object.fromEntries(Object.entries(d.byDay).slice(0, 20).map(([k, v]) => [str(k, 10), str(v)]));
return x;
})
})) };
}
function refresh() {
if (inflight || process.env.NETWORK_DEALS_HUB === '0') return inflight;
const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 2500);
inflight = fetch(hubUrl() + '/v1/network-deals', { signal: ac.signal })
.then(r => (r.ok ? r.json() : null))
.then(j => { const b = clean(j); if (b) cache = { at: Date.now(), body: b }; else cache.at = Date.now(); })
.catch(() => { cache.at = Date.now() - TTL + 30 * 1000; }) // hub down: try again in 30 s, keep the last good copy
.finally(() => { clearTimeout(t); inflight = null; });
return inflight;
}
function current() { if (Date.now() - cache.at > TTL) refresh(); return cache.body; }
function setLocal(fn) { local = typeof fn === 'function' ? fn : null; }
function withLocal(body, self) {
if (!local) return body;
return { events: body.events.map(e => Object.assign({}, e, { deals: e.deals.map(d => {
if (d.site !== self) return d;
try { const r = local(Object.assign({}, d)); return r === undefined ? d : r; } catch (err) { return d; }
}).filter(Boolean) })) };
}
// GET /api/network-deals: public, short cache, the same answer on every page. self = this site's network id (NETWORK_SITE_ID).
async function handle(req, res, self) {
if (!cache.at) { try { await refresh(); } catch (e) {} } // first ask after a boot waits for the hub once (2.5 s cap)
const me = String(self || process.env.NETWORK_SITE_ID || '').trim().toLowerCase();
const body = Object.assign({ self: me }, withLocal(current(), me));
res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'public, max-age=60', 'X-Content-Type-Options': 'nosniff' });
res.end(JSON.stringify(body));
}
module.exports = { current, handle, refresh, setLocal, clean, _set: b => { cache = { at: Date.now(), body: clean(b) || { events: [] } }; } };
+102 -4
View File
@@ -6,6 +6,17 @@
// The merged set is kept in memory and in DATA_DIR/netkb-cache.json (a MySQL document through docstore where the site has // The merged set is kept in memory and in DATA_DIR/netkb-cache.json (a MySQL document through docstore where the site has
// DOCSTORE_URL; written only when the version changes), so a hub outage at boot still answers about the other sites. // DOCSTORE_URL; written only when the version changes), so a hub outage at boot still answers about the other sites.
// Off when HUB_URL or a 32+ character HUB_SECRET is missing, or NETKB=0: the chatbot then answers about this site only. // Off when HUB_URL or a 32+ character HUB_SECRET is missing, or NETKB=0: the chatbot then answers about this site only.
//
// SEMANTIC MATCHING (Marty 2026-11-16): the hub matches a question by meaning against the whole network KB with the free core2
// embeddings model (POST HUB_URL/v1/kb/match). match() asks it with a strict timeout (NETKB_MATCH_MS, default 1500) and fails
// soft: an error or a timeout answers null and the next MATCH_PAUSE_MS skip the hub, so the chat never waits on a slow model and
// the site's own BM25 retrieval (kb.js) answers as before. route() turns a match into the chatbot's decision:
// - this site's own entry, raw score >= SEM.answer with a clear lead (or the instant-answer pattern agrees): the answer itself
// - the instant-answer pattern hit kept when the match agrees (its entry within SEM.agree of the top), or when the match has
// no idea (top below SEM.unsure); this site's own entries rank first unless another site is named or clearly closer
// - otherwise no instant answer (the regex is overruled by meaning); the entries >= SEM.context feed the AI prompt
// suggest() gives the support desk's new-ticket form the closest help answers (KB entries only) the same way, BM25 as the fallback.
// Off with NETKB_MATCH=0. Thresholds measured on bge-large-en-v1.5 over the network KB (2026-11-16). Tests: qa/netkb-semantic.test.mjs
// The SAME file ships in every network site (InstantAdPay, LinkSpin, ViralAdBlitz, DownlineHydra, 5xYourTeam, VBB, Downline // The SAME file ships in every network site (InstantAdPay, LinkSpin, ViralAdBlitz, DownlineHydra, 5xYourTeam, VBB, Downline
// Banners, Stack POL). Keep them identical. // Banners, Stack POL). Keep them identical.
'use strict'; 'use strict';
@@ -24,10 +35,10 @@ const siteName = () => String(process.env.HUB_SITE || (O && O.site) || '').trim(
const enabled = () => process.env.NETKB !== '0' && !!hubUrl() && secret().length >= 32 && !!siteName(); const enabled = () => process.env.NETKB !== '0' && !!hubUrl() && secret().length >= 32 && !!siteName();
const cacheFile = () => (O && O.dataDir ? path.join(O.dataDir, 'netkb-cache.json') : null); const cacheFile = () => (O && O.dataDir ? path.join(O.dataDir, 'netkb-cache.json') : null);
async function call(method, route, body, headers) { async function call(method, route, body, headers, timeoutMs) {
const raw = body === undefined ? '' : JSON.stringify(body); const ts = String(Date.now()); const raw = body === undefined ? '' : JSON.stringify(body); const ts = String(Date.now());
const sig = crypto.createHmac('sha256', secret()).update(ts + '\n' + raw).digest('hex'); const sig = crypto.createHmac('sha256', secret()).update(ts + '\n' + raw).digest('hex');
const r = await fetch(hubUrl() + route, { method, body: method === 'GET' ? undefined : raw, signal: AbortSignal.timeout(15000), const r = await fetch(hubUrl() + route, { method, body: method === 'GET' ? undefined : raw, signal: AbortSignal.timeout(timeoutMs || 15000),
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Hub-Site': siteName(), 'X-Hub-Ts': ts, 'X-Hub-Sig': sig }, headers || {}) }); headers: Object.assign({ 'Content-Type': 'application/json', 'X-Hub-Site': siteName(), 'X-Hub-Ts': ts, 'X-Hub-Sig': sig }, headers || {}) });
let j = null; if (r.status !== 304) { try { j = await r.json(); } catch (e) {} } let j = null; if (r.status !== 304) { try { j = await r.json(); } catch (e) {} }
return { status: r.status, body: j }; return { status: r.status, body: j };
@@ -90,6 +101,92 @@ function sites() {
return Object.entries(merged.sites || {}).filter(([k]) => k !== me).map(([k, s]) => ({ site: k, name: s.name || k, url: s.url || '', go: (O && typeof O.linkFor === 'function' && s.url ? O.linkFor(s.url) : '') || s.url || '', count: s.count || 0 })); return Object.entries(merged.sites || {}).filter(([k]) => k !== me).map(([k, s]) => ({ site: k, name: s.name || k, url: s.url || '', go: (O && typeof O.linkFor === 'function' && s.url ? O.linkFor(s.url) : '') || s.url || '', count: s.count || 0 }));
} }
// ---- semantic matching (2026-11-16)
const SEM = { answer: Number(process.env.NETKB_SEM_ANSWER) || 0.84, margin: 0.02, context: Number(process.env.NETKB_SEM_CONTEXT) || 0.68, unsure: 0.70, band: 0.08, away: 0.06, agree: 0.10, floor: 0.60 };
const MATCH_PAUSE_MS = 30000;
let matchDownUntil = 0;
const mstats = { matches: 0, matchErrors: 0, matchSkipped: 0, matchLastMs: 0, matchLastError: null, semAnswer: 0, semAgree: 0, semRegex: 0, semVeto: 0, semContext: 0 };
const matchOn = () => enabled() && process.env.NETKB_MATCH !== '0';
// -> the hub's answer {confidence, margin, hits: [{site, id, title, answer, score, boosted, home}]} or null (off, down, slow)
async function match(q, o) {
o = o || {};
if (!matchOn()) return null;
if (Date.now() < matchDownUntil) { mstats.matchSkipped++; return null; }
const t0 = Date.now();
try {
const body = { q: String(q || '').slice(0, 600), k: o.k || 6 };
if (o.prefer && o.prefer.length) body.prefer = o.prefer;
if (o.only && o.only.length) body.only = o.only;
const r = await call('POST', '/v1/kb/match', body, undefined, o.timeoutMs || Number(process.env.NETKB_MATCH_MS) || 1500);
mstats.matchLastMs = Date.now() - t0;
if (r.status !== 200 || !r.body || !Array.isArray(r.body.hits)) throw new Error('match ' + r.status + ' ' + ((r.body && r.body.error) || ''));
mstats.matches++;
return r.body;
} catch (e) { mstats.matchErrors++; mstats.matchLastError = e.message; matchDownUntil = Date.now() + MATCH_PAUSE_MS; return null; }
}
// msg + { fast: the instant-answer pattern hit (or null), own: this site's entries, prefer: [site ids the question names] }
// -> null (no match: the caller keeps its old path) or { via, hit: own entry to answer with | null, hits: [{entry, score}] for the prompt }
async function route(msg, o) {
o = o || {};
// a question that names another site but asks about "here" is about this site (e.g. "I am on InstantAdPay, does my team carry over here?")
const prefer = (o.prefer || []).length && !/\b(here|this site|this one)\b/i.test(msg) ? o.prefer : [];
const m = await match(msg, { k: 8, prefer });
if (!m) return null;
const me = siteName();
const own = new Map((o.own || []).map(e => [String(e.id), e]));
const rem = new Map(remote().map(e => [e.id, e]));
const all = m.hits.map(h => ({ entry: h.site === me ? own.get(String(h.id)) : rem.get(h.site + ':' + h.id), score: Number(h.score) || 0, home: h.site === me })).filter(h => h.entry);
let hits = all;
const named = prefer.length > 0, fast = o.fast || null;
if (!named) { // home-site first: this site's own entries lead; another site's ride behind them only when clearly closer (a thing only that site has)
const mine = hits.filter(h => h.home && h.score >= SEM.context);
const homeTop = mine.length ? mine[0].score : 0;
hits = mine.concat(hits.filter(h => !h.home && h.score >= homeTop + SEM.away));
}
const top = hits[0];
const ctx = top ? hits.filter(h => h.score >= SEM.context && (h.score >= top.score - SEM.band || !h.home)).map(h => ({ entry: h.entry, score: Math.round(h.score * 1000) / 1000 })) : [];
const out = (via, hit) => { mstats['sem' + via[0].toUpperCase() + via.slice(1)]++; return { via, hit, hits: ctx, confidence: top ? top.score : 0 }; };
if (top && top.home && !named && top.score >= SEM.answer && (Number(m.margin) >= SEM.margin || (fast && String(fast.id) === String(top.entry.id)))) return out('answer', top.entry);
if (fast) {
const best = all.length ? all[0].score : 0;
if (all.some(h => h.home && String(h.entry.id) === String(fast.id) && h.score >= SEM.floor && h.score >= best - SEM.agree)) return out('agree', fast);
if (!top || top.score < SEM.unsure) return out('regex', fast);
return out('veto', null);
}
return out('context', null);
}
// support desk suggestions (2026-11-16): the help answers closest to what a signed-in member is typing into a new ticket.
// Knowledge-base entries only (published answers, including the ones written from past tickets), never anyone's ticket text.
// text + { own: this site's entries, fallback: async q => [{entry}] (BM25) when the hub is slow or down, max }
const SUGGEST_MIN = Number(process.env.NETKB_SUGGEST_MIN) || 0.70;
const NOT_SUGGESTED = /(^|[-:])support$|^c-refund$/; // the "contact support" entry is no help on the support form itself
function suggestItem(e, home, score) {
return { id: String(e.id), title: e.title, answer: String(e.answer || '').slice(0, 900), site: home ? '' : (e.siteName || e.site || ''),
link: home ? (e.link || '') : (e.go || e.siteUrl || ''), fromTicket: !!(home && e.source === 'ticket'), score: score == null ? null : Math.round(score * 1000) / 1000 };
}
async function suggest(text, o) {
o = o || {};
const q = String(text || '').replace(/\s+/g, ' ').trim().slice(0, 600);
if (q.replace(/[^A-Za-z0-9]/g, '').length < 10) return { items: [], via: 'short' };
const me = siteName(); const own = new Map((o.own || []).map(e => [String(e.id), e]));
const keep = (e, home) => e && !(home && e.handoff) && !NOT_SUGGESTED.test(String(e.id));
let items = [], via = 'none';
const m = await match(q, { k: 8, timeoutMs: o.timeoutMs || 2000 });
if (m) {
via = 'semantic'; const top = m.hits.length ? Number(m.hits[0].score) : 0; const rem = new Map(remote().map(e => [e.id, e]));
for (const h of m.hits) {
if (h.score < SUGGEST_MIN || h.score < top - 0.08) continue;
const home = h.site === me; const e = home ? own.get(String(h.id)) : rem.get(h.site + ':' + h.id);
if (keep(e, home)) items.push(suggestItem(e, home, h.score));
}
} else if (typeof o.fallback === 'function') {
via = 'bm25';
try { for (const x of (await o.fallback(q)) || []) { const e = x && x.entry; const home = !!e && !e.site; if (keep(e, home)) items.push(suggestItem(e, home, null)); } } catch (e) {}
}
return { items: items.slice(0, o.max || 3), via };
}
// opts: { dataDir, site (hub site id), name, url, entries: async () => [...], linkFor: url => tracked link } // opts: { dataDir, site (hub site id), name, url, entries: async () => [...], linkFor: url => tracked link }
function init(opts) { function init(opts) {
O = opts || {}; readCache(); O = opts || {}; readCache();
@@ -99,8 +196,9 @@ function init(opts) {
timer = setInterval(async () => { await refresh().catch(() => {}); if (!publishedHash) await publish().catch(() => {}); }, Math.max(1000, Number(process.env.NETKB_REFRESH_MS) || REFRESH_MS)); timer = setInterval(async () => { await refresh().catch(() => {}); if (!publishedHash) await publish().catch(() => {}); }, Math.max(1000, Number(process.env.NETKB_REFRESH_MS) || REFRESH_MS));
if (timer.unref) timer.unref(); if (timer.unref) timer.unref();
} }
function view() { return Object.assign({ enabled: enabled(), site: siteName(), version: merged.version, sites: Object.keys(merged.sites || {}), entries: (merged.entries || []).length, remote: remote().length, loadedAt }, stats); } function view() { return Object.assign({ enabled: enabled(), site: siteName(), version: merged.version, sites: Object.keys(merged.sites || {}), entries: (merged.entries || []).length, remote: remote().length, loadedAt, semantic: matchOn(), sem: SEM }, stats, mstats); }
function _set(m) { merged = m; } // tests function _set(m) { merged = m; } // tests
const version = () => merged.version || ''; const version = () => merged.version || '';
module.exports = { init, publish, publishSoon, refresh, remote, sites, view, enabled, version, _set }; function _matchReset() { matchDownUntil = 0; } // tests
module.exports = { init, publish, publishSoon, refresh, remote, sites, view, enabled, version, match, route, suggest, SEM, _set, _matchReset };
+1 -1
View File
@@ -36,7 +36,7 @@ function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list;
// entry also gets go = the LinkSpin network link for that site with ?src=<this site>, so a click shows in LinkSpin Reports under the // entry also gets go = the LinkSpin network link for that site with ?src=<this site>, so a click shows in LinkSpin Reports under the
// site that sent it (LinkSpin netlinks.js: fixed codes on the admin account). This site = NETWORK_SITE_ID, else the request host. // site that sent it (LinkSpin netlinks.js: fixed codes on the admin account). This site = NETWORK_SITE_ID, else the request host.
// No go for this site itself, or when this site cannot be told (a test host): the page then uses the plain url. // No go for this site itself, or when this site cannot be told (a test host): the page then uses the plain url.
const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', viraladblitz: 'nwvab', fivex: 'nw5x', downlinehydra: 'nwdh', stackpol: 'nwsp', earnerscorner: 'nwec' }; const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', viraladblitz: 'nwvab', viraladsource: 'nwvas', yourprogrambuilder: 'nwypb', fivex: 'nw5x', downlinehydra: 'nwdh', stackpol: 'nwsp', earnerscorner: 'nwec' };
const linksBase = () => String(process.env.NETWORK_LINKS_BASE || 'https://linkspin.app').trim().replace(/\/+$/, ''); const linksBase = () => String(process.env.NETWORK_LINKS_BASE || 'https://linkspin.app').trim().replace(/\/+$/, '');
const hostOf = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } }; const hostOf = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } };
function selfId(req, l) { function selfId(req, l) {
+111 -14
View File
@@ -37,6 +37,17 @@
// Activity (Marty 2026-11-15, DownlineHydra "Wake it", the CRM score): a signed-in member's page load pings POST <hub>/v1/activity // Activity (Marty 2026-11-15, DownlineHydra "Wake it", the CRM score): a signed-in member's page load pings POST <hub>/v1/activity
// {email|wallet, kind 'visit'} at most once per member per day, fire and forget (HUB_URL + HUB_SECRET; HUB_ACTIVITY=0 turns it off). // {email|wallet, kind 'visit'} at most once per member per day, fire and forget (HUB_URL + HUB_SECRET; HUB_ACTIVITY=0 turns it off).
// signOutEverywhere(session): POST <hub>/v1/sso/signout; the hub ends every hub sign-in of that person and tells hooked sites. // signOutEverywhere(session): POST <hub>/v1/sso/signout; the hub ends every hub sign-in of that person and tells hooked sites.
//
// ONE SITES LIST + THE WAY BACK (Marty 2026-11-17: "I logged in to Instant Ad Pay from Viral Ad Source, and it never had a return
// path back"). Before, each provider (IAP, LinkSpin) kept its own hand-written `wallets` list; a site missing from it (5xYourTeam
// 11-15, ViralAdSource 11-17) was refused at /sso/check and the member was dropped on the provider's dashboard with no way back.
// Sites list: a provider also knows every site in the hub's public GET <hub>/v1/sso-sites (HUB_SSO_SITES there; the same list the
// hub signs in for). Read at start, every 5 minutes, and once more (2 s at most) when an unknown site asks. Hand-written entries win.
// Return links: any provider page with ?return=<site>&to=/path (a known site only, never an open redirect) remembers the way back
// in nsso.ret (1 day) and reloads without the two parameters. Signed in already: straight back. After the email-code sign-in (and
// after the username step for a new account) the provider's dashboard goes to /sso/resume, which finishes it: /go/<site>?to=/path.
// No wallet yet (a wallet site needs one): with C.walletPath the member goes to the provider's wallet step first (nsso.wait), and
// afterWallet(req) gives the wallet-link answer its next hop, /sso/resume. The same holds for a deliberate tap (nsso.back).
'use strict'; 'use strict';
const crypto = require('crypto'); const crypto = require('crypto');
const fs = require('fs'); const fs = require('fs');
@@ -47,8 +58,9 @@ const enabled = () => SECRET().length >= 32;
const TTL = 60 * 1000; // token life const TTL = 60 * 1000; // token life
const SKEW = 30 * 1000; // clock skew allowed between the two servers const SKEW = 30 * 1000; // clock skew allowed between the two servers
const STATE_AGE = 300; // seconds: the state cookie const STATE_AGE = 300; // seconds: the state cookie
const GO_STATE_AGE = 1200; // seconds: the state cookie on a deliberate tap (time to sign in on the provider first, 2026-11-14) const GO_STATE_AGE = 3600; // seconds: the state cookie on a deliberate tap (time to sign in, pick a username and link a wallet on the provider first; 20 minutes until 2026-11-17)
const BACK_AGE = 1200; // seconds: the provider remembers an unfinished deliberate check while the member signs in const BACK_AGE = 3600; // seconds: the provider remembers an unfinished deliberate check while the member signs in (20 minutes until 2026-11-17)
const RET_AGE = 86400; // seconds: a ?return=<site> link remembers the way back (2026-11-17)
const TRIED_AGE = 120; // seconds: one silent check per browser per 2 minutes (loop guard only; 30 minutes until 2026-11-15) const TRIED_AGE = 120; // seconds: one silent check per browser per 2 minutes (loop guard only; 30 minutes until 2026-11-15)
const OFF_AGE = 12 * 3600; // seconds: no silent check after a sign-out on this site const OFF_AGE = 12 * 3600; // seconds: no silent check after a sign-out on this site
const HINT_AGE = 300; // seconds: the email prefill when the member is not here yet const HINT_AGE = 300; // seconds: the email prefill when the member is not here yet
@@ -74,8 +86,25 @@ async function hubUp() {
return Date.now() - hubSeen < 120000; return Date.now() - hubSeen < 120000;
} }
// the hub's sign-in sites {site: base} (2026-11-17): providers answer every site the hub knows, not only their hand-written list
let hubSites = {}, hubSitesAt = 0, hubSitesAsking = null;
const SITE_RE = /^[a-z0-9_-]{1,64}$/, BASE_RE = /^https?:\/\/[a-z0-9.:-]+$/i;
function loadHubSites() {
if (hubSitesAsking) return hubSitesAsking;
if (!BASE_RE.test(HUB_BASE()) || typeof fetch !== 'function' || String(process.env.NSSO_HUB_SITES || '') === '0') return Promise.resolve();
hubSitesAt = Date.now();
const ac = typeof AbortController === 'function' ? new AbortController() : null; const tm = setTimeout(() => { if (ac) ac.abort(); }, 2000);
hubSitesAsking = fetch(HUB_BASE() + '/v1/sso-sites', { signal: ac ? ac.signal : undefined }).then(r => (r.ok ? r.json() : null)).then(j => {
if (!j || !j.sites || typeof j.sites !== 'object') return;
const out = {}; for (const [k, v] of Object.entries(j.sites)) { const b = String(v || '').replace(/\/+$/, ''); if (SITE_RE.test(k) && BASE_RE.test(b)) out[k] = b; }
hubSites = out;
}).catch(() => {}).finally(() => { clearTimeout(tm); hubSitesAsking = null; });
return hubSitesAsking;
}
const freshSites = () => { if (C && C.wallet && Date.now() - hubSitesAt > 5 * 60 * 1000) loadHubSites(); };
let C = null; // { self, peer, peerBase(), isProd, dataDir, db, member(req), accept(email, req, v), signIn(email, req, v), landing(to), signinPath(to), defaultPath, let C = null; // { self, peer, peerBase(), isProd, dataDir, db, member(req), accept(email, req, v), signIn(email, req, v), landing(to), signinPath(to), defaultPath,
// wallets?: { site: base() } + wallet(session) -> { address, name }, from?: { site: base() } } // wallets?: { site: base() } + wallet(session) -> { address, name }, from?: { site: base() }, walletPath?: the provider's wallet step }
const b64u = buf => Buffer.from(buf).toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_'); const b64u = buf => Buffer.from(buf).toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_');
const unb64u = s => Buffer.from(String(s).replace(/-/g, '+').replace(/_/g, '/'), 'base64'); const unb64u = s => Buffer.from(String(s).replace(/-/g, '+').replace(/_/g, '/'), 'base64');
@@ -167,6 +196,17 @@ function activity(w) {
const k = w.email || w.wallet; if (pinged.has(k)) return; pinged.set(k, 1); const k = w.email || w.wallet; if (pinged.has(k)) return; pinged.set(k, 1);
hubCall('/v1/activity', Object.assign({ kind: 'visit' }, w), 5000).then(r => { if (r.status >= 500) pinged.delete(k); }).catch(() => { pinged.delete(k); }); hubCall('/v1/activity', Object.assign({ kind: 'visit' }, w), 5000).then(r => { if (r.status >= 500) pinged.delete(k); }).catch(() => { pinged.delete(k); });
} }
// a signed-in request the site already answers (2026-11-16, Marty: "LinkSpin never reports activity"): /api/me, the dashboard
// heartbeat (/api/my/ping) and the admin portal call this, so a Control Room tab kept open for days, a browser that sends no
// Sec-Fetch headers and a wallet-only session still count the day's visit. The page-load ping in page() only sees full navigations.
// s = {email} and/or {address}. Same once-a-day rule as page(). -> true when a ping was due or already sent today.
function seen(s) {
try {
if (!C || !hubCreds()) return false;
const w = who(s && s.email ? s : s && s.address ? { address: s.address } : null); if (!w) return false;
activity(w); return true;
} catch (e) { return false; }
}
// a real top-level page load of a page (never an API call, an asset, a fetch, a bot or one of our own hops) // a real top-level page load of a page (never an API call, an asset, a fetch, a bot or one of our own hops)
function pageLoad(req, p) { function pageLoad(req, p) {
if (req.method !== 'GET' || isBot(req)) return false; if (req.method !== 'GET' || isBot(req)) return false;
@@ -221,7 +261,25 @@ const ck = (k, v, age, httpOnly) => k + '=' + encodeURIComponent(v) + '; Path=/;
const go = (res, loc, set) => { const h = { Location: loc, 'Cache-Control': 'no-store', 'Referrer-Policy': 'no-referrer', 'X-Robots-Tag': 'noindex' }; if (set && set.length) h['Set-Cookie'] = set; res.writeHead(302, h); res.end(); return true; }; const go = (res, loc, set) => { const h = { Location: loc, 'Cache-Control': 'no-store', 'Referrer-Policy': 'no-referrer', 'X-Robots-Tag': 'noindex' }; if (set && set.length) h['Set-Cookie'] = set; res.writeHead(302, h); res.end(); return true; };
const sendJson = (res, obj, set) => { const h = { 'Content-Type': 'application/json', 'Cache-Control': 'no-store' }; if (set && set.length) h['Set-Cookie'] = set; res.writeHead(200, h); res.end(JSON.stringify(obj)); return true; }; const sendJson = (res, obj, set) => { const h = { 'Content-Type': 'application/json', 'Cache-Control': 'no-store' }; if (set && set.length) h['Set-Cookie'] = set; res.writeHead(200, h); res.end(JSON.stringify(obj)); return true; };
function init(opts) { C = Object.assign({ defaultPath: '/' }, opts); fileLoaded = false; used.clear(); if (hubOn()) { hubSeen = 0; hubChecked = 0; hubUp().catch(() => {}); } } function init(opts) { C = Object.assign({ defaultPath: '/' }, opts); fileLoaded = false; used.clear(); if (hubOn()) { hubSeen = 0; hubChecked = 0; hubUp().catch(() => {}); } hubSites = {}; hubSitesAt = 0; if (C.wallet) loadHubSites(); }
// a site this provider answers for: its own list first, then the hub's (never itself, never the peer, which has its own path)
function siteBase(x) {
if (!C || !C.wallet || !SITE_RE.test(String(x || '')) || x === C.self || x === C.peer) return null;
if (C.wallets && Object.prototype.hasOwnProperty.call(C.wallets, x)) return C.wallets[x];
if (Object.prototype.hasOwnProperty.call(hubSites, x)) { const b = hubSites[x]; return () => b; }
return null;
}
// an unknown site asking: ask the hub once more (at most every 30 s, 2 s at most) before refusing
async function siteBaseFresh(x) { let b = siteBase(x); if (!b && C && C.wallet && SITE_RE.test(String(x || '')) && Date.now() - hubSitesAt > 30000) { await loadHubSites(); b = siteBase(x); } return b; }
const siteName = x => NAMES[x] || ({ viraladsource: 'ViralAdSource', webworthit: 'WebWorthIt', stackpol: 'Stack POL' })[x] || x;
const retOf = req => { const m = /^([a-z0-9_-]{1,64})\|(\/.*)$/.exec(cookies(req)['nsso.ret'] || ''); return m ? { site: m[1], to: safePath(m[2], '/') } : null; };
// signed in here, on the way back to a site: its wallet step first when the site needs a wallet this account does not have yet
async function backHop(s, site, to, set) {
let w = null; try { w = await C.wallet(s); } catch (e) {}
if ((!w || !WALLET_RE.test(String(w.address || '').toLowerCase())) && C.walletPath) { set.push(ck('nsso.wait', '1', BACK_AGE, true)); log('back: wallet step first', s.email, 'for ' + siteName(site)); return C.walletPath; }
return '/go/' + site + '?to=' + encodeURIComponent(to);
}
// the cookie a sign-out adds: no silent check on this site for 12 hours (a deliberate cross-site link still signs in) // the cookie a sign-out adds: no silent check on this site for 12 hours (a deliberate cross-site link still signs in)
const offCookie = () => ck('nsso.off', '1', OFF_AGE, true); const offCookie = () => ck('nsso.off', '1', OFF_AGE, true);
@@ -230,9 +288,24 @@ const offCookie = () => ck('nsso.off', '1', OFF_AGE, true);
async function handle(req, res, u) { async function handle(req, res, u) {
if (!C || req.method !== 'GET') return false; if (!C || req.method !== 'GET') return false;
const p = u.pathname; const p = u.pathname;
if (C.wallet && u.searchParams.has('return') && !/^\/(sso|api|go)(\/|$)/.test(p)) { // a site's "sign in / join on <provider>" link: remember the way back (2026-11-17)
const site = String(u.searchParams.get('return') || '').toLowerCase(); const to = safePath(u.searchParams.get('to'), '/');
const clean = new URL(u.pathname + u.search, 'http://x.invalid'); clean.searchParams.delete('return'); clean.searchParams.delete('to');
const here = safePath(clean.pathname + clean.search, '/');
const base = isBot(req) ? null : await siteBaseFresh(site);
if (!base) return go(res, here); // unknown site (or a bot): the page itself, nothing remembered
let s = null; try { s = await C.member(req); } catch (e) {}
if (s && s.email) { // signed in here already: straight back (wallet step first when the site needs one)
const set = []; const hop = await backHop(s, site, to, set);
set.push(hop === C.walletPath ? ck('nsso.ret', site + '|' + to, RET_AGE, true) : ck('nsso.ret', '', 0, true));
return go(res, hop, set);
}
log('return link remembered', null, 'for ' + siteName(site));
return go(res, here, [ck('nsso.ret', site + '|' + to, RET_AGE, true), ck('nsso.wait', '', 0, true)]);
}
const peerName = NAMES[C.peer] || C.peer; const peerName = NAMES[C.peer] || C.peer;
const goTo = p.startsWith('/go/') ? p.slice(4) : ''; const goTo = p.startsWith('/go/') ? p.slice(4) : '';
const walletBase = x => (C.wallets && Object.prototype.hasOwnProperty.call(C.wallets, x) ? C.wallets[x] : null); const walletBase = siteBase; freshSites(); // the hand-written list, then the hub's sign-in sites (2026-11-17)
if (goTo && (goTo === C.peer || walletBase(goTo))) { if (goTo && (goTo === C.peer || walletBase(goTo))) {
const base = goTo === C.peer ? C.peerBase() : walletBase(goTo)(); const base = goTo === C.peer ? C.peerBase() : walletBase(goTo)();
const to = safePath(u.searchParams.get('to'), '/'); const to = safePath(u.searchParams.get('to'), '/');
@@ -266,17 +339,25 @@ async function handle(req, res, u) {
} }
if (p === '/sso/resume') { // signed in on the provider after a deliberate tap: finish the check it was asked for (2026-11-14) if (p === '/sso/resume') { // signed in on the provider after a deliberate tap: finish the check it was asked for (2026-11-14)
const q = new URLSearchParams(cookies(req)['nsso.back'] || ''); const q = new URLSearchParams(cookies(req)['nsso.back'] || '');
const clear = [ck('nsso.back', '', 0, true)]; const clear = [ck('nsso.back', '', 0, true), ck('nsso.wait', '', 0, true)];
if (!/^[a-f0-9]{32}$/.test(q.get('st') || '')) return go(res, C.defaultPath, clear); if (!/^[a-f0-9]{32}$/.test(q.get('st') || '')) { // no deliberate tap waiting: a ?return=<site> link may be (2026-11-17)
return go(res, '/sso/check?st=' + q.get('st') + (q.get('r') ? '&r=' + encodeURIComponent(q.get('r')) : '') + '&to=' + encodeURIComponent(safePath(q.get('to'), '/')), clear); const ret = retOf(req);
if (!ret || !siteBase(ret.site)) return go(res, C.defaultPath, clear.concat(ck('nsso.ret', '', 0, true)));
let s = null; try { s = await C.member(req); } catch (e) {}
if (!s || !s.email) return go(res, C.signinPath(C.defaultPath)); // not signed in yet: keep it for after the sign-in
const set = clear.slice(); const hop = await backHop(s, ret.site, ret.to, set);
set.push(hop === C.walletPath ? ck('nsso.ret', ret.site + '|' + ret.to, RET_AGE, true) : ck('nsso.ret', '', 0, true));
log('back to ' + siteName(ret.site), s.email); return go(res, hop, set);
}
return go(res, '/sso/check?st=' + q.get('st') + (q.get('r') ? '&r=' + encodeURIComponent(q.get('r')) : '') + '&to=' + encodeURIComponent(safePath(q.get('to'), '/')) + '&m=go', clear); // m=go: still a deliberate tap (the wallet step when one is missing)
} }
if (p === '/sso/check') { if (p === '/sso/check') {
const st = String(u.searchParams.get('st') || ''); const st = String(u.searchParams.get('st') || '');
const to = safePath(u.searchParams.get('to'), '/'); const to = safePath(u.searchParams.get('to'), '/');
const r = String(u.searchParams.get('r') || ''); const r = String(u.searchParams.get('r') || '');
const wb = r && r !== C.peer ? walletBase(r) : null; // a wallet site asking: the token carries the wallet const wb = r && r !== C.peer ? await siteBaseFresh(r) : null; // a wallet site asking: the token carries the wallet (the hub's sign-in sites too, 2026-11-17)
if (r && r !== C.peer && !wb) { log('check: unknown site asking, nothing sent', null, r.slice(0, 20)); return go(res, C.defaultPath); } // never answer an unknown site as if the peer asked (2026-11-15: 5xYourTeam was sent to LinkSpin) if (r && r !== C.peer && !wb) { log('check: unknown site asking, nothing sent', null, r.slice(0, 20)); return go(res, C.defaultPath); } // never answer an unknown site as if the peer asked (2026-11-15: 5xYourTeam was sent to LinkSpin)
const base = wb ? wb() : C.peerBase(), aud = wb ? r : C.peer, forName = NAMES[aud] || aud; const base = wb ? wb() : C.peerBase(), aud = wb ? r : C.peer, forName = siteName(aud);
const none = base + '/sso/in?none=1&to=' + encodeURIComponent(to); const none = base + '/sso/in?none=1&to=' + encodeURIComponent(to);
if (!enabled() || !/^[a-f0-9]{32}$/.test(st)) return go(res, none); if (!enabled() || !/^[a-f0-9]{32}$/.test(st)) return go(res, none);
let s = null; try { s = await C.member(req); } catch (e) {} let s = null; try { s = await C.member(req); } catch (e) {}
@@ -289,7 +370,13 @@ async function handle(req, res, u) {
log('check: not signed in here', null, 'for ' + forName); return go(res, none); log('check: not signed in here', null, 'for ' + forName); return go(res, none);
} }
let w = null; let w = null;
if (wb) { try { w = await C.wallet(s); } catch (e) {} if (!w || !WALLET_RE.test(String(w.address || '').toLowerCase())) { log('check: no wallet on the account', s.email, 'for ' + forName); return go(res, none); } } if (wb) { try { w = await C.wallet(s); } catch (e) {} if (!w || !WALLET_RE.test(String(w.address || '').toLowerCase())) {
if (u.searchParams.get('m') === 'go' && C.walletPath && !isBot(req)) { // a deliberate tap: link a wallet here first, then /sso/resume finishes the trip (2026-11-17)
log('check: no wallet on the account, wallet step first', s.email, 'for ' + forName);
const back = new URLSearchParams({ st, to, m: 'go' }); if (r) back.set('r', r);
return go(res, C.walletPath, [ck('nsso.back', back.toString(), BACK_AGE, true), ck('nsso.wait', '1', BACK_AGE, true)]);
}
log('check: no wallet on the account', s.email, 'for ' + forName); return go(res, none); } }
log('token issued', s.email, 'for ' + forName); log('token issued', s.email, 'for ' + forName);
return go(res, base + '/sso/in?t=' + mint({ iss: C.self, aud, email: s.email, wallet: w && w.address, name: w && w.name, st, to })); return go(res, base + '/sso/in?t=' + mint({ iss: C.self, aud, email: s.email, wallet: w && w.address, name: w && w.name, st, to }));
} }
@@ -349,7 +436,17 @@ async function page(req, res, u) {
return false; return false;
} }
// true when this browser came here from a deliberate network tap and still has to finish it after signing in // true when this browser came here from a deliberate network tap (nsso.back) or a ?return=<site> link (nsso.ret) and still has to
const pendingBack = req => !!cookies(req)['nsso.back']; // finish it after signing in. False while it waits on the wallet step (nsso.wait): the dashboard must not bounce it back and forth.
const pendingBack = req => { const c = cookies(req); return !!(c['nsso.back'] || retOf(req)) && !c['nsso.wait']; };
// the wallet was just linked: the next hop when a way back is waiting (2026-11-17), else null
const afterWallet = req => { const c = cookies(req); return c['nsso.back'] || retOf(req) ? '/sso/resume' : null; };
// the name of the site a member is on the way back to, for a line on the provider's dashboard; null when none
function backName(req) {
const c = cookies(req); const ret = retOf(req);
if (ret) return siteName(ret.site);
if (!c['nsso.back']) return null;
const r = new URLSearchParams(c['nsso.back']).get('r'); return siteName(r || (C && C.peer) || '') || null;
}
module.exports = { init, handle, page, enabled, pendingBack, mint, verify, spend, safePath, isBot, offCookie, mask, TTL, NAMES, hubOn, hubCreds, signOutEverywhere, mintHub, verifyHub, _hubSeen: t => { hubSeen = t == null ? Date.now() : t; hubChecked = Date.now(); }, _pinged: pinged }; module.exports = { init, handle, page, seen, enabled, pendingBack, afterWallet, backName, siteBase, mint, verify, spend, safePath, isBot, offCookie, mask, TTL, NAMES, hubOn, hubCreds, signOutEverywhere, mintHub, verifyHub, _hubSeen: t => { hubSeen = t == null ? Date.now() : t; hubChecked = Date.now(); }, _pinged: pinged, _hubSites: o => { if (o) { hubSites = o; hubSitesAt = Date.now(); } return hubSites; } };
+2 -1
View File
@@ -13,7 +13,8 @@ const netsites = require('./netsites'); // tracked links: LinkSpin network link
const KIT_DIR = path.join(__dirname, 'public', 'art', 'kit'); const KIT_DIR = path.join(__dirname, 'public', 'art', 'kit');
const SHAPES = { tile: [125, 125, 'Square button'], strip: [468, 60, 'Strip (board size)'], leader: [728, 90, 'Leaderboard'], box: [300, 250, 'Box'], panel: [336, 280, 'Large box'], const SHAPES = { tile: [125, 125, 'Square button'], strip: [468, 60, 'Strip (board size)'], leader: [728, 90, 'Leaderboard'], box: [300, 250, 'Box'], panel: [336, 280, 'Large box'],
tower: [160, 600, 'Skyscraper'], pillar: [120, 600, 'Narrow skyscraper'], social: [1200, 630, 'Social share'], square: [1080, 1080, 'Square post'] }; tower: [160, 600, 'Skyscraper'], pillar: [120, 600, 'Narrow skyscraper'], social: [1200, 630, 'Social share'], square: [1080, 1080, 'Square post'],
wide: [600, 300, 'Wide card'], small: [250, 250, 'Small square'] };
const ANGLES = { const ANGLES = {
spot: 'A $5 spot, 300 guaranteed views', spot: 'A $5 spot, 300 guaranteed views',
line: '10 levels pay as spots sell after yours', line: '10 levels pay as spots sell after yours',
+30
View File
@@ -0,0 +1,30 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Admin | Downline Banners</title>
<meta name="description" content="Downline Banners admin.">
<meta name="robots" content="noindex">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=9">
</head>
<body>
<main class="wrap">
<section class="hero"><h1>Admin</h1><p class="lead">Take a spot down or restore it. The contract is never touched: only what this site shows and counts changes.</p></section>
<div class="card" id="tokCard"><div class="field"><label for="tok">Admin token</label><input id="tok" type="password" autocomplete="off"></div><button class="btn small" id="tokBtn">Open</button></div>
<div id="adm" hidden>
<div class="card" id="spCard"><h3>Spots: take down or restore</h3>
<p class="muted small">Find a spot by #number, wallet or network username. A takedown hides it everywhere at once (board, gate, links, Network Ad Space). Its place stays, held by a house banner, so nobody else moves. No views or clicks count while it is down. The owner sees "Taken down" with your reason. Payments already happened on-chain at purchase and are never touched.</p>
<p class="muted small">Credit back: not available yet. A spot is a $5 on-chain purchase and this site has no free replacement spot or post credit, so a takedown is "no credit" until Marty decides what credit back means here.</p>
<div class="row"><input id="spQ" placeholder="#12, 0x... or username" autocomplete="off" aria-label="Find a spot" style="flex:1;min-width:200px"><button class="btn sec small" id="spFind">Find</button></div>
<div id="spList"></div></div>
<div class="card"><h3>Admin ledger (takedowns and restores)</h3><div class="adm-scroll" id="aActions"></div></div>
</div>
<div id="status" class="note" hidden></div>
</main>
<script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/admin.js?v=1"></script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

+65
View File
@@ -0,0 +1,65 @@
// Admin (2026-11-16): spot takedown and restore with a required reason, and the admin ledger. Read with the ADMIN_TOKEN (kept in this tab only).
(function () {
BL.renderNav('');
const $ = BL.$, esc = BL.esc;
let tok = ''; try { tok = sessionStorage.getItem('bl.admin') || ''; } catch (e) {}
const get = u => BL.getJSON(u, { headers: { 'x-admin-token': tok } });
const send = (u, body) => BL.getJSON(u, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-admin-token': tok }, body: JSON.stringify(body) });
const ct = t => t ? new Date(t).toLocaleString('en-US', { timeZone: 'America/Chicago' }) + ' CT' : '';
const who = x => x.username ? '@' + x.username : BL.short(x.owner || '');
async function open() {
const s = await get('/api/admin/actions?n=1');
if (s.error) { BL.status('That token was not accepted.', 'err'); return; }
try { sessionStorage.setItem('bl.admin', tok); } catch (e) {}
$('tokCard').hidden = true; $('adm').hidden = false; BL.status('');
actions();
}
async function actions() {
const a = await get('/api/admin/actions?n=200'); if (a.error) return;
$('aActions').innerHTML = a.actions.length ? '<table class="tbl"><tr><th>When</th><th>Action</th><th>Spot</th><th>Owner</th><th>By</th><th>Reason</th><th>Credit</th></tr>'
+ a.actions.map(e => '<tr><td>' + esc(ct(e.at)) + '</td><td>' + esc(e.action) + '</td><td>#' + e.spotId + '</td><td>' + esc(who(e)) + '</td><td>' + esc(e.by) + '</td><td>' + esc(e.reason || '') + '</td><td>' + esc(e.credit) + '</td></tr>').join('') + '</table>'
: '<p class="muted">No takedowns yet.</p>';
}
async function find() {
const q = $('spQ').value.trim(); if (!q) return;
const d = await get('/api/admin/spots?q=' + encodeURIComponent(q));
if (d.error) { $('spList').innerHTML = '<p class="note err small">' + esc(d.error) + '</p>'; return; }
$('spList').innerHTML = '';
for (const s of d.spots) {
const el = document.createElement('div'); el.className = 'spot-ed adm-spot';
const st = s.down ? 'TAKEN DOWN ' + ct(s.down.at) + ' by ' + s.down.by + ': ' + s.down.reason + ' (no credit)' : 'Showing (' + s.showing.from + ')';
const edits = s.edits.length ? '<details><summary class="small">' + s.edits.length + ' edit' + (s.edits.length === 1 ? '' : 's') + ' (newest first)</summary><table class="tbl"><tr><th>When</th><th>What</th><th>Old</th><th>New</th></tr>'
+ s.edits.map(e => '<tr><td>' + esc(ct(e.at)) + '</td><td>' + esc(e.what) + ' (' + esc(e.via) + ')</td><td class="mono small">' + esc(e.old.link) + '<br>' + esc(e.old.img) + '</td><td class="mono small">' + esc(e.new.link) + '<br>' + esc(e.new.img) + '</td></tr>').join('') + '</table></details>' : '<p class="muted small">No edits yet.</p>';
el.innerHTML = '<div class="row" style="justify-content:space-between"><b>Spot #' + s.id + '</b><span class="small">' + esc(who(s)) + ' <span class="mono">' + esc(s.owner) + '</span></span></div>'
+ '<div class="lots"></div><p class="small">' + esc(st) + '<br>Link: <span class="mono">' + esc(s.link || '(default or none)') + '</span><br><span class="muted">' + s.views + ' of ' + s.owed + ' views, '
+ (s.clicks.organic + s.clicks.gate) + ' clicks. Bought ' + esc(ct(s.boughtAt)) + '.' + (s.downs.length ? ' Restored before: ' + s.downs.length + 'x.' : '') + '</span></p>' + edits + '<div class="act"></div>';
el.querySelector('.lots').appendChild(BL.tile({ t: 'x', img: s.img || s.showing.img, href: '#' }));
const act = el.querySelector('.act');
if (s.down) {
act.innerHTML = '<div class="field"><label class="small muted">Why restore (optional)</label><input class="rs"></div><button class="btn small">Restore this spot</button>';
act.querySelector('button').onclick = async () => {
const r = await send('/api/admin/spots/' + s.id + '/restore', { reason: act.querySelector('.rs').value });
BL.status(r.error || ('Spot #' + s.id + ' restored.'), r.error ? 'err' : 'ok'); find(); actions();
};
} else if (s.kind !== 3) {
act.innerHTML = '<div class="field"><label class="small muted">Reason (the owner sees it)</label><textarea class="why" maxlength="300" rows="2"></textarea></div>'
+ '<div class="row"><label class="small"><input type="radio" name="cr' + s.id + '" value="none" checked> No credit</label><label class="small muted"><input type="radio" name="cr' + s.id + '" value="back" disabled> Credit back (not available yet)</label>'
+ '<button class="btn small">Take down</button></div>';
const bt = act.querySelector('button');
bt.onclick = async () => {
const reason = act.querySelector('.why').value.trim();
if (reason.length < 3) return BL.status('Write the reason first.', 'err');
if (!bt.dataset.armed) { bt.dataset.armed = '1'; bt.textContent = 'Click again to take down #' + s.id; setTimeout(() => { if (bt.isConnected) { delete bt.dataset.armed; bt.textContent = 'Take down'; } }, 8000); return; }
const r = await send('/api/admin/spots/' + s.id + '/takedown', { reason, credit: 'none' });
BL.status(r.error || ('Spot #' + s.id + ' taken down, no credit.'), r.error ? 'err' : 'ok'); find(); actions();
};
}
$('spList').appendChild(el);
}
}
$('spFind').onclick = find;
$('spQ').addEventListener('keydown', e => { if (e.key === 'Enter') find(); });
$('tokBtn').onclick = () => { tok = $('tok').value.trim(); open(); };
$('tok').addEventListener('keydown', e => { if (e.key === 'Enter') $('tokBtn').click(); });
if (tok) open();
})();
+9 -2
View File
@@ -37,10 +37,10 @@ window.BL = (function () {
f.className = 'bl-foot'; f.className = 'bl-foot';
f.innerHTML = '<div class="wrap"><p>Part of the Crypto Team Build Network</p>' f.innerHTML = '<div class="wrap"><p>Part of the Crypto Team Build Network</p>'
+ '<p class="muted small">A spot buys 300 guaranteed views on the board and a place in the line. Nothing is promised: you are paid only when spots sell after yours, and a spot can earn back less than it cost.</p>' + '<p class="muted small">A spot buys 300 guaranteed views on the board and a place in the line. Nothing is promised: you are paid only when spots sell after yours, and a spot can earn back less than it cost.</p>'
+ '<p class="small"><a href="/how">How it works</a> &middot; <a href="/board">Board</a> &middot; <a href="/ledger">Live ledger</a> &middot; <a href="/contract">Contract proof</a> &middot; <a href="/promote">Promote</a> &middot; <a href="/my">My Spots</a></p>' + '<p class="small"><a href="/how">How it works</a> &middot; <a href="/guides">Guides</a> &middot; <a href="/board">Board</a> &middot; <a href="/ledger">Live ledger</a> &middot; <a href="/contract">Contract proof</a> &middot; <a href="/promote">Promote</a> &middot; <a href="/my">My Spots</a></p>'
// trust pack (Marty 2026-11-14): legal + proof links, company line, and the network line served by the hub // trust pack (Marty 2026-11-14): legal + proof links, company line, and the network line served by the hub
+ '<p class="small legal-links"><a href="/terms">Terms</a> &middot; <a href="/disclaimer">Earnings Disclaimer</a> &middot; <a href="/privacy">Privacy</a> &middot; <a href="/contract">Contract</a> &middot; <a href="/ledger">Ledger</a> &middot; <a href="https://instantadpay.com/support" target="_blank" rel="noopener">Support</a></p>' + '<p class="small legal-links"><a href="/terms">Terms</a> &middot; <a href="/disclaimer">Earnings Disclaimer</a> &middot; <a href="/privacy">Privacy</a> &middot; <a href="/contract">Contract</a> &middot; <a href="/ledger">Ledger</a> &middot; <a href="https://instantadpay.com/support" target="_blank" rel="noopener">Support</a></p>'
+ '<p class="muted small">TrustClickz &middot; 615 Green Valley Drive, Moody, AL 35004</p><p class="small netline"></p></div>'; + '<p class="muted small">&copy; 2026 TrustClickz</p><p class="small netline"></p></div>';
document.body.appendChild(f); document.body.appendChild(f);
netLine(f.querySelector('.netline')); netLine(f.querySelector('.netline'));
toasts(); toasts();
@@ -114,3 +114,10 @@ window.BL = (function () {
function withRef(href, sponsor) { if (!sponsor) return href; return href + (href.includes('?') ? '&' : '?') + 'ref=' + encodeURIComponent(sponsor); } function withRef(href, sponsor) { if (!sponsor) return href; return href + (href.includes('?') ? '&' : '?') + 'ref=' + encodeURIComponent(sponsor); }
return { $, esc, getConfig, fmtPol, short, framed, status, getJSON, post, renderNav, renderFooter, tile, withRef, zone }; return { $, esc, getConfig, fmtPol, short, framed, status, getJSON, post, renderNav, renderFooter, tile, withRef, zone };
})(); })();
// Network Weekend ribbon (Marty 2026-11-17): netweekend.js paints it only while a network event is live (dates from the hub through
// /api/network-deals). Not on the admin page, never inside a frame (traffic-exchange views).
(function () {
if (/^\/admin/.test(location.pathname)) return;
try { if (window.top !== window) return; } catch (e) { return; }
var s = document.createElement('script'); s.src = '/assets/netweekend.js?v=20261117'; s.defer = true; s.setAttribute('data-site', 'dlb'); document.head.appendChild(s);
})();
+7
View File
@@ -0,0 +1,7 @@
/* Guides pages (2026-11-17) */
.guides a.guide-link{display:block;color:var(--ink);text-decoration:none}
.guides a.guide-link h3{color:var(--mint)}
.guides a.guide-link:hover{border-color:var(--mint-line);text-decoration:none}
.guides p.mono{word-break:break-all}
.guides .card ul{margin:8px 0 0;padding-left:20px}
.guides .card li{margin:0 0 6px}
+1
View File
@@ -0,0 +1 @@
(async function () { await BL.renderNav("/guides"); BL.renderFooter(); })();
+6
View File
@@ -68,3 +68,9 @@ nav .links a.active{color:var(--mint-ink);background:var(--mint)}
.bl-foot .netline{margin-top:12px;padding-top:12px;border-top:1px solid var(--line);line-height:1.9} .bl-foot .netline{margin-top:12px;padding-top:12px;border-top:1px solid var(--line);line-height:1.9}
.bl-foot .netline .here{color:var(--mint-ink);background:var(--mint);font-weight:700;border-radius:999px;padding:1px 9px} .bl-foot .netline .here{color:var(--mint-ink);background:var(--mint);font-weight:700;border-radius:999px;padding:1px 9px}
.legal .card h2{font-size:21px} .legal .card p,.legal .card li{max-width:760px;color:var(--ink)} .legal .card ul{padding-left:20px} .legal .card li{margin:6px 0} .legal .card h2{font-size:21px} .legal .card p,.legal .card li{max-width:760px;color:var(--ink)} .legal .card ul{padding-left:20px} .legal .card li{margin:6px 0}
/* spot takedown + edit history (2026-11-16) */
.spot-down{border:1px solid var(--line-strong);border-left:4px solid #ff5d6c;border-radius:10px;padding:10px 12px;margin:8px 0}
.spot-down b{color:#ff5d6c}
.adm-scroll{overflow-x:auto}
.adm-spot details{margin:6px 0}
.adm-spot .tbl td{word-break:break-all}
+9 -1
View File
@@ -17,6 +17,7 @@
return; return;
} }
$('outBtn').onclick = async () => { await BL.post('/api/auth/logout'); location.reload(); }; $('outBtn').onclick = async () => { await BL.post('/api/auth/logout'); location.reload(); };
$('outAllBtn').onclick = async () => { $('outAllBtn').disabled = true; await BL.post('/api/auth/logout-everywhere'); location.reload(); };
async function load() { async function load() {
const d = await BL.getJSON('/api/my'); const d = await BL.getJSON('/api/my');
if (d.error) return BL.status(d.error, 'err'); if (d.error) return BL.status(d.error, 'err');
@@ -39,7 +40,14 @@
const el = document.createElement('div'); el.className = 'spot-ed'; const el = document.createElement('div'); el.className = 'spot-ed';
const head = kind === 'spot' ? '<div class="row" style="justify-content:space-between"><b>Spot #' + s.id + '</b><span class="muted small">' + esc(KIND[s.kind] || '') + ' &middot; ' + s.views + ' of ' + s.owed + ' views' const head = kind === 'spot' ? '<div class="row" style="justify-content:space-between"><b>Spot #' + s.id + '</b><span class="muted small">' + esc(KIND[s.kind] || '') + ' &middot; ' + s.views + ' of ' + s.owed + ' views'
+ (s.kind === 3 ? '' : s.delivering ? ' &middot; ' + s.daysLeft + ' days left' : ' &middot; delivery finished') + ' &middot; clicks ' + (s.clicks.organic + s.clicks.gate) + '</span></div>' : ''; + (s.kind === 3 ? '' : s.delivering ? ' &middot; ' + s.daysLeft + ' days left' : ' &middot; delivery finished') + ' &middot; clicks ' + (s.clicks.organic + s.clicks.gate) + '</span></div>' : '';
el.innerHTML = head + '<div class="lots" style="align-items:flex-start"></div>' // taken down by the admin (2026-11-16): the reason, and no edit controls (the spot keeps its place; a house banner shows there)
if (kind === 'spot' && s.down) {
el.innerHTML = head + '<div class="spot-down"><b>Taken down</b> ' + esc(new Date(s.down.at).toLocaleDateString()) + '. Reason: ' + esc(s.down.reason)
+ '<br><span class="small muted">It is hidden everywhere and counts no views while it is down; its place is kept. Questions: use the chat on this page.</span></div>';
return el;
}
const hist = kind === 'spot' && s.edits && s.edits.length ? '<p class="small muted">Last change ' + esc(new Date(s.edits[0].at).toLocaleString()) + ' (' + s.edits.length + (s.edits.length >= 10 ? '+' : '') + ' logged). Every change gets the full link check.</p>' : '';
el.innerHTML = head + hist + '<div class="lots" style="align-items:flex-start"></div>'
+ '<div class="field"><label class="small muted">Target link (https)</label><input data-k="link" placeholder="https://your-site.com/page" value="' + esc(s.link || '') + '"><span class="small muted">Tracking: {clickid}, {spot} and {type} in your link are filled on every click (LinkSpin has a Downline Banners source ready for this).</span></div>' + '<div class="field"><label class="small muted">Target link (https)</label><input data-k="link" placeholder="https://your-site.com/page" value="' + esc(s.link || '') + '"><span class="small muted">Tracking: {clickid}, {spot} and {type} in your link are filled on every click (LinkSpin has a Downline Banners source ready for this).</span></div>'
+ '<div class="field"><label class="small muted">Image address (https), or upload below</label><input data-k="img" placeholder="https://your-site.com/image.png" value="' + esc(String(s.img || '').startsWith('/art/u/') ? '' : s.img || '') + '"></div>' + '<div class="field"><label class="small muted">Image address (https), or upload below</label><input data-k="img" placeholder="https://your-site.com/image.png" value="' + esc(String(s.img || '').startsWith('/art/u/') ? '' : s.img || '') + '"></div>'
+ '<div class="row"><button class="btn small" data-a="save">Save</button><label class="btn sec small">Upload image<input type="file" accept="image/png,image/jpeg,image/gif" hidden></label>' + '<div class="row"><button class="btn small" data-a="save">Save</button><label class="btn sec small">Upload image<input type="file" accept="image/png,image/jpeg,image/gif" hidden></label>'
+67
View File
@@ -0,0 +1,67 @@
// "Network Weekend" ribbon (Marty 2026-11-17): a thin bar at the top of every network site page while a network event is live.
// Data: /api/network-deals (netdeals.js, from the hub). Switches on and off by this page's own clock at the event's exact
// startsAt / endsAt (US Central midnights), so a cached feed never shows it early or late, and it takes itself down at endsAt on
// a page left open. Shows this site's own deal for today (byDay, Central date) and links to the full deals page.
// The same file lives in every network site. Never RM Circle, never the games. No inline styles (CSP): styles go through CSSOM.
// Test clock: window.__NW_NOW (ms) before this script runs; nothing else.
(function () {
if (window.__nwRibbon) return; window.__nwRibbon = 1;
var tag = document.currentScript;
var meAttr = (tag && tag.getAttribute('data-site')) || '';
function now() { return typeof window.__NW_NOW === 'number' ? window.__NW_NOW : Date.now(); }
// late November is CST (UTC-6) for every date this ribbon covers
function ctDay(ms) { return new Date(ms - 6 * 3600 * 1000).toISOString().slice(0, 10); }
function closedKey(id, day) { return 'nw.closed.' + id + '.' + day; }
function isClosed(id, day) { try { return window.localStorage.getItem(closedKey(id, day)) === '1'; } catch (e) { return false; } }
function setClosed(id, day) { try { window.localStorage.setItem(closedKey(id, day), '1'); } catch (e) {} }
var bar = null;
function remove() { if (bar && bar.parentNode) bar.parentNode.removeChild(bar); bar = null; }
function paint(body) {
var me = meAttr || (body && body.self) || '';
var t = now();
var ev = ((body && body.events) || []).filter(function (e) { return t >= Date.parse(e.startsAt) && t < Date.parse(e.endsAt); })[0];
if (!ev) { remove(); return false; }
var day = ctDay(t);
if (isClosed(ev.id, day)) { remove(); return true; }
var mine = (ev.deals || []).filter(function (d) { return d.site === me && t < Date.parse(d.endsAt || ev.endsAt); })[0];
var line = mine ? ((mine.byDay && mine.byDay[day]) || mine.text) : '';
var label = (ev.days && ev.days[day]) || '';
var onDealsPage = !!ev.url && (function () { try { var u = new URL(ev.url); return location.pathname === u.pathname && (location.hostname === u.hostname || me === 'iap'); } catch (e) { return false; } })();
remove();
bar = document.createElement('div');
bar.className = 'nw-ribbon'; bar.setAttribute('role', 'region'); bar.setAttribute('aria-label', ev.name);
bar.style.cssText = 'position:relative;z-index:50;display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;justify-content:center;padding:8px 40px 8px 16px;'
+ 'background:#14161b;color:#f4f1e8;font:600 13.5px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;text-align:center;border-bottom:2px solid #f2c94c';
// built node by node with CSSOM styles: no style attributes, so a strict CSP (style-src 'self') has nothing to block
function el(tagName, css, text) { var n = document.createElement(tagName); if (css) n.style.cssText = css; if (text) n.textContent = text; return n; }
var head = el('span'); head.appendChild(el('b', 'color:#f2c94c', ev.name)); if (label) head.appendChild(document.createTextNode(' · ' + label));
bar.appendChild(head);
var body2 = el('span', 'font-weight:500', line || ev.tagline);
if (line && mine && mine.note) { body2.appendChild(document.createTextNode(' ')); body2.appendChild(el('span', 'opacity:.75', mine.note)); }
bar.appendChild(body2);
if (ev.url && !onDealsPage) { var a = el('a', 'color:#f2c94c;text-decoration:underline', 'See every deal'); a.href = ev.url; a.target = '_blank'; a.rel = 'noopener'; bar.appendChild(a); }
var x = el('button', 'position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:0;color:#f4f1e8;font-size:18px;line-height:1;cursor:pointer;padding:4px 8px', '×');
x.type = 'button'; x.setAttribute('aria-label', 'Hide for today'); bar.appendChild(x);
bar.querySelector('button').addEventListener('click', function () { setClosed(ev.id, day); remove(); });
document.body.insertBefore(bar, document.body.firstChild);
return true;
}
var feed = null, timer = null;
function schedule() {
clearTimeout(timer); if (!feed) return;
// wake at the next switch moment (start, end, a deal ending, the next Central midnight), at least once a minute
var t = now(), next = t + 60 * 1000;
(feed.events || []).forEach(function (e) {
[e.startsAt, e.endsAt].concat((e.deals || []).map(function (d) { return d.endsAt; })).forEach(function (s) { var x = Date.parse(s); if (x > t && x < next) next = x; });
});
timer = setTimeout(function () { if (typeof window.__NW_NOW === 'number') window.__NW_NOW += next - t; paint(feed); schedule(); }, Math.max(250, next - t));
}
function run() {
fetch('/api/network-deals', { credentials: 'omit' }).then(function (r) { return r.ok ? r.json() : null; }).then(function (b) {
if (!b || !Array.isArray(b.events) || !b.events.length) return;
feed = b; paint(b); schedule();
}).catch(function () {});
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();
window.__nwPaint = function (b) { feed = b; return paint(b); }; // tests
})();
+7
View File
@@ -860,3 +860,10 @@ body.hasback #status{bottom:92px}
:root[data-theme="light"] .mockup,:root[data-theme="light"] .modal-card,:root[data-theme="light"] #status,:root[data-theme="light"] #iapChatPanel,:root[data-theme="light"] .chat-drawer{box-shadow:0 18px 50px -20px rgba(11,26,20,.35)} :root[data-theme="light"] .mockup,:root[data-theme="light"] .modal-card,:root[data-theme="light"] #status,:root[data-theme="light"] #iapChatPanel,:root[data-theme="light"] .chat-drawer{box-shadow:0 18px 50px -20px rgba(11,26,20,.35)}
:root[data-theme="light"] .bo.side-open .bo-side{box-shadow:0 0 60px rgba(11,26,20,.25)} :root[data-theme="light"] .bo.side-open .bo-side{box-shadow:0 0 60px rgba(11,26,20,.25)}
:root[data-theme="light"] .plate{box-shadow:0 0 24px rgba(10,107,86,.12),inset 0 1px 0 rgba(255,255,255,.8)} :root[data-theme="light"] .plate{box-shadow:0 0 24px rgba(10,107,86,.12),inset 0 1px 0 rgba(255,255,255,.8)}
/* tutorial video (2026-11-18): home watch link + the player on the how-it-works guide */
.watchp{margin:14px 0 0;text-align:center}
.watchlink{display:inline-flex;align-items:center;gap:8px;font-weight:700;color:var(--mint);text-decoration:underline;text-underline-offset:3px}
.watchlink svg{flex:none}
.howvid video{display:block;width:100%;height:auto;aspect-ratio:16/9;border-radius:12px;border:1px solid var(--mint-line);background:#09080f;margin-top:8px}
.howvid p{margin:10px 0 0}
+3 -3
View File
@@ -20,8 +20,8 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap"> <main class="wrap">
@@ -31,7 +31,7 @@
<div class="card"><h3>The line so far</h3><div id="stats" class="grid2"></div></div> <div class="card"><h3>The line so far</h3><div id="stats" class="grid2"></div></div>
<div id="status" class="note" hidden></div> <div id="status" class="note" hidden></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/board.js?v=1"></script> <script src="/assets/board.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
</body> </body>
+3 -3
View File
@@ -20,8 +20,8 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap"> <main class="wrap">
@@ -35,7 +35,7 @@
<li>Open any sale in the <a href="/ledger">live ledger</a> and look at its <b>Logs</b>: one SpotBought event, then one Paid event per payment.</li></ol></div> <li>Open any sale in the <a href="/ledger">live ledger</a> and look at its <b>Logs</b>: one SpotBought event, then one Paid event per payment.</li></ol></div>
<div id="zContract"></div> <div id="zContract"></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/contract.js?v=z1"></script> <script src="/assets/contract.js?v=z1"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
</body> </body>
+4 -4
View File
@@ -20,8 +20,8 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap legal"> <main class="wrap legal">
@@ -31,9 +31,9 @@
<div class="card"><h2>How any payment happens</h2><p>Any payment to you happens only on the blockchain, when a later purchase happens, and is paid by the smart contract in that same transaction. Nothing is held for you and there is nothing to withdraw. If no later purchase happens, no payment happens.</p></div> <div class="card"><h2>How any payment happens</h2><p>Any payment to you happens only on the blockchain, when a later purchase happens, and is paid by the smart contract in that same transaction. Nothing is held for you and there is nothing to withdraw. If no later purchase happens, no payment happens.</p></div>
<div class="card"><h2>Crypto risk</h2><ul><li>The price of POL moves. The dollar value of a payment can be higher or lower later than when it was paid.</li><li>You are responsible for your wallet and its recovery phrase. Nobody, including us, can recover a lost wallet or reverse a payment sent from it.</li><li>Blockchain transactions are final. Each one costs a small network fee (gas) in POL, paid to the network, not to us.</li><li>Use SafePal or any other crypto wallet you trust, and never share your recovery phrase with anyone. We will never ask for it.</li></ul></div> <div class="card"><h2>Crypto risk</h2><ul><li>The price of POL moves. The dollar value of a payment can be higher or lower later than when it was paid.</li><li>You are responsible for your wallet and its recovery phrase. Nobody, including us, can recover a lost wallet or reverse a payment sent from it.</li><li>Blockchain transactions are final. Each one costs a small network fee (gas) in POL, paid to the network, not to us.</li><li>Use SafePal or any other crypto wallet you trust, and never share your recovery phrase with anyone. We will never ask for it.</li></ul></div>
<div class="card"><h2>Your decision</h2><p>Only spend what you can afford to lose completely. This is not financial, legal or tax advice. You are responsible for any taxes on what you receive.</p></div> <div class="card"><h2>Your decision</h2><p>Only spend what you can afford to lose completely. This is not financial, legal or tax advice. You are responsible for any taxes on what you receive.</p></div>
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div> <div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a> (TrustClickz).</p></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/legal.js?v=1"></script> <script src="/assets/legal.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
</body> </body>
File diff suppressed because one or more lines are too long
+50
View File
@@ -0,0 +1,50 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Getting the most from your free account | Downline Banners</title>
<meta name="description" content="Getting the most from a free Downline Banners account: one network sign-in, the promo kit, the one step to take before you share your link, and keeping your banner working.">
<link rel="canonical" href="https://downlinebanners.com/guides/free-account">
<meta property="og:type" content="article">
<meta property="og:site_name" content="Downline Banners">
<meta property="og:title" content="Getting the most from your free account | Downline Banners">
<meta property="og:description" content="Getting the most from a free Downline Banners account: one network sign-in, the promo kit, the one step to take before you share your link, and keeping your banner working.">
<meta property="og:url" content="https://downlinebanners.com/guides/free-account">
<meta property="og:image" content="https://downlinebanners.com/art/og-share.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Downline Banners: banner real estate in one line, paid instantly on-chain">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Getting the most from your free account | Downline Banners">
<meta name="twitter:description" content="Getting the most from a free Downline Banners account: one network sign-in, the promo kit, the one step to take before you share your link, and keeping your banner working.">
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=9">
<link rel="stylesheet" href="/assets/guides.css?v=1">
</head>
<body>
<main class="wrap guides">
<section class="hero"><h1>Getting the most from your free account</h1><p class="lead">Signing in and looking around costs nothing. Here is how to use it well.</p></section>
<div class="card"><h3>One account across the network</h3><p>Downline Banners is part of the network: one account, username and sponsor across InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, ViralAdBlitz, DownlineHydra, 5xYourTeam, Stack POL and Earners Corner. Sign in to My Spots with your InstantAdPay or LinkSpin account, or with one free wallet signature. The signature cannot move funds. Your sponsor here is your network sponsor.</p></div>
<div class="card"><h3>What costs nothing</h3><ul>
<li>The Look around first tour on the home page (your sponsor's spot, the board, the 3 newest spots).</li>
<li>The <a href="/board">board</a>, the <a href="/ledger">live ledger</a> and the <a href="/contract">contract proof</a>.</li>
<li>The <a href="/promote">promo kit</a>: your referral links, creatives in the common sizes and copy.</li>
</ul></div>
<div class="card"><h3>Own a spot before you share your link</h3><p>This is the one step people miss. The contract records a buyer's sponsor once, with their first spot, and only if that sponsor already owns a spot right then. If you do not own one yet, their sponsor share does not come to you: it goes to someone above you in the network line who owns a spot, or to the momentum fund when nobody does, and it stays that way for their later spots too.</p><p>So get your own spot at <a href="/join">Get a spot</a> before you send people your link. After that, each time someone you referred buys a spot, you receive $1.50 in POL in that same transaction.</p></div>
<div class="card"><h3>Keep your banner working</h3><p>Open <a href="/my">My Spots</a> and add a 468x60 image (150 KB or less) and a link to each spot. You can change them any time, as often as you like. Every change gets the full check: https, a real website, no link shorteners, the link must open and an image address must load as a 468x60 image. A spot shows on the board, newest on top, until it has its 300 views. If a spot is past 30 days with fewer than 300 views, Network Ad Space finishes the views still owed.</p></div>
<div class="card"><h3>Other ways to get a spot</h3><ul>
<li><b>Refuel spots:</b> a counted Monthly Refuel of $50 or more on InstantAdPay or LinkSpin earns one Downline Banners spot, bought for your wallet under your network sponsor and paid by the company. InstantAdPay decides which refuels count. Ad credits buy advertising, not income.</li>
<li><b>Momentum fund gifts:</b> when no spot has sold for 4 hours, the fund buys one and gifts it to an active member who owns a paid spot and has not had a gift in 7 days, members who referred someone recently first. A paid spot is one you bought yourself.</li>
<li><b>Buy for a teammate:</b> on <a href="/join">Get a spot</a>, "Buy a spot for someone else" pays a $5 spot for their wallet. They own the spot and its place in the line.</li>
</ul></div>
<div class="card"><h3>Use SafePal or any other crypto wallet</h3><p>You pay from your own wallet straight to the contract on Polygon; the site never holds your money. Keep a little extra POL for the network fee. Never share your recovery phrase with anyone.</p></div>
<div class="card"><h3>More guides</h3><ul><li><a href="/how">How it works</a></li><li><a href="/guides/is-it-legit">Is Downline Banners legit?</a></li><li><a href="/guides/faq">FAQ</a></li><li><a href="/guides">All guides</a></li></ul></div>
</main>
<script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/guides.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script>
</body>
</html>
+63
View File
@@ -0,0 +1,63 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Is it legit? | Downline Banners</title>
<meta name="description" content="Is Downline Banners legit? The BannerLine contract on Polygon, its verified source on Polygonscan, the live ledger and the exact split of every $5 spot.">
<link rel="canonical" href="https://downlinebanners.com/guides/is-it-legit">
<meta property="og:type" content="article">
<meta property="og:site_name" content="Downline Banners">
<meta property="og:title" content="Is it legit? | Downline Banners">
<meta property="og:description" content="Is Downline Banners legit? The BannerLine contract on Polygon, its verified source on Polygonscan, the live ledger and the exact split of every $5 spot.">
<meta property="og:url" content="https://downlinebanners.com/guides/is-it-legit">
<meta property="og:image" content="https://downlinebanners.com/art/og-share.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Downline Banners: banner real estate in one line, paid instantly on-chain">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Is it legit? | Downline Banners">
<meta name="twitter:description" content="Is Downline Banners legit? The BannerLine contract on Polygon, its verified source on Polygonscan, the live ledger and the exact split of every $5 spot.">
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=9">
<link rel="stylesheet" href="/assets/guides.css?v=1">
</head>
<body>
<main class="wrap guides">
<section class="hero"><h1>Is Downline Banners legit?</h1><p class="lead">Do not take our word for it. Here is where to look, and what you will find.</p></section>
<div class="card"><h3>The contract</h3><p>Downline Banners runs on one smart contract on Polygon, called BannerLine:</p>
<p class="mono small">0x6c77fc0664f58cf17e81966160fc80005a110f9b</p>
<p><a href="https://polygonscan.com/address/0x6c77fc0664f58cf17e81966160fc80005a110f9b#code" target="_blank" rel="noopener">Open it on Polygonscan</a> and choose the Contract tab. The source code is verified there, so you can read the exact rules that run every purchase. Our <a href="/contract">contract proof</a> page reads the owner, the fee wallets, the price feed and the split live from the chain.</p></div>
<div class="card"><h3>What the code says about the money</h3><ul>
<li>The split and the price are constants in the code. There is no function that changes them.</li>
<li>There is no owner withdraw. The contract holds nothing except the momentum fund, and the fund can only buy spots.</li>
<li>Every share is pushed to the owner's wallet in the same transaction as the purchase. Nothing waits to be withdrawn.</li>
<li>The owner can pause new purchases. Pausing cannot change the split or move anyone's money.</li>
<li>If you send more POL than the price, the extra comes back to you in the same transaction.</li>
</ul></div>
<div class="card"><h3>Where every $5 goes</h3>
<p>A spot costs $5, paid in POL at the Chainlink POL/USD price the contract reads when you buy. The contract splits it like this:</p>
<table class="tbl"><tr><th>Share</th><th>Amount</th><th>To</th></tr>
<tr><td>30%</td><td>$1.50</td><td>the buyer's sponsor</td></tr>
<tr><td>55% (5.5% each)</td><td>$0.275 x 10</td><td>the owners of the 10 spots bought just before this one</td></tr>
<tr><td>10% (5% + 5%)</td><td>$0.50</td><td>the company, in two fee wallets</td></tr>
<tr><td>5%</td><td>$0.25</td><td>the momentum fund, which can only buy spots</td></tr></table>
<p class="muted small">Amounts are paid in POL, so the POL you receive depends on the POL price at the time of each sale.</p></div>
<div class="card"><h3>The small print, straight from the code</h3><ul>
<li><b>No sponsor:</b> if the buyer has no sponsor, the 30% goes to the momentum fund.</li>
<li><b>Your sponsor is set once.</b> It is recorded with your first spot and only counts if that sponsor already owns a spot at that moment.</li>
<li><b>A payment that fails to send</b> goes to the momentum fund. It never blocks the buyer's purchase.</li>
<li><b>The first spots in the line</b> had fewer than 10 spots before them. Those missing shares went to the company.</li>
<li><b>A spot the fund keeps</b> (when nobody qualifies for a gift) sends its sponsor share and all its future line money back into the fund.</li>
</ul></div>
<div class="card"><h3>The live ledger</h3><p>The <a href="/ledger">live ledger</a> lists every spot sale and every payment the contract made, read from the Polygon blockchain. Each row links to its transaction, so you can check any payout on Polygonscan.</p></div>
<div class="card"><h3>What is not promised</h3><p>Nothing is promised. A spot buys 300 guaranteed views on the board and a place in the line. You are paid only when spots sell after yours. From the line alone, a member who refers nobody gets back less than the $5 a spot costs. This is advertising with a share of later sales, not an investment. Read the <a href="/disclaimer">Earnings Disclaimer</a>.</p></div>
<div class="card"><h3>More guides</h3><ul><li><a href="/how">How it works</a></li><li><a href="/guides/free-account">Getting the most from your free account</a></li><li><a href="/guides/faq">FAQ</a></li><li><a href="/guides">All guides</a></li></ul></div>
</main>
<script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/guides.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script>
</body>
</html>
+42
View File
@@ -0,0 +1,42 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Guides | Downline Banners</title>
<meta name="description" content="Plain guides to Downline Banners: how the line works, how to check it is legit, getting the most from a free account, and the FAQ.">
<link rel="canonical" href="https://downlinebanners.com/guides">
<meta property="og:type" content="article">
<meta property="og:site_name" content="Downline Banners">
<meta property="og:title" content="Guides | Downline Banners">
<meta property="og:description" content="Plain guides to Downline Banners: how the line works, how to check it is legit, getting the most from a free account, and the FAQ.">
<meta property="og:url" content="https://downlinebanners.com/guides">
<meta property="og:image" content="https://downlinebanners.com/art/og-share.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Downline Banners: banner real estate in one line, paid instantly on-chain">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Guides | Downline Banners">
<meta name="twitter:description" content="Plain guides to Downline Banners: how the line works, how to check it is legit, getting the most from a free account, and the FAQ.">
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=9">
<link rel="stylesheet" href="/assets/guides.css?v=1">
</head>
<body>
<main class="wrap guides">
<section class="hero"><h1>Downline Banners guides</h1><p class="lead">Short, plain pages that explain the line and show you how to check every number yourself.</p></section>
<div class="grid c2">
<a class="card guide-link" href="/how"><h3>How it works</h3><p class="muted">One global line of $5 banner spots: what a spot buys, where the $5 goes, the momentum fund and what is not promised.</p></a>
<a class="card guide-link" href="/guides/is-it-legit"><h3>Is Downline Banners legit?</h3><p class="muted">The contract on Polygonscan, the live ledger and the exact split of every $5, so you can check it yourself.</p></a>
<a class="card guide-link" href="/guides/free-account"><h3>Getting the most from your free account</h3><p class="muted">What costs nothing, the one thing to do before you share your link, and how to keep your banner working.</p></a>
<a class="card guide-link" href="/guides/faq"><h3>FAQ</h3><p class="muted">Short answers to the questions people ask most: price, banners, payouts, the fund, refunds and support.</p></a>
</div>
<div class="card"><h3>Check it yourself</h3><p>Every sale and payment is on the <a href="/ledger">live ledger</a>, and the contract and its verified source are on the <a href="/contract">contract proof</a> page.</p></div>
</main>
<script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/guides.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script>
</body>
</html>
+5 -3
View File
@@ -20,12 +20,13 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap"> <main class="wrap">
<section class="hero"><h1>How Downline Banners works</h1><p class="lead">One global line of 468x60 spots. Plain rules, all on-chain, nothing held by the site.</p></section> <section class="hero"><h1>How Downline Banners works</h1><p class="lead">One global line of 468x60 spots. Plain rules, all on-chain, nothing held by the site.</p></section>
<div class="card howvid" id="watch"><h3 id="watchTitle">Watch how it works</h3><video controls playsinline preload="none" poster="/art/how-it-works.jpg?v=20261118a" width="1920" height="1080" aria-describedby="watchNote"><source src="/art/how-it-works.mp4?v=20261118a" type="video/mp4"></video><p class="muted small" id="watchNote">A short walkthrough in Marty's voice: what a spot buys, where the $5 goes, what is not promised, My Spots, the sponsor rule, and where to start.</p></div>
<div class="card"><h3>What a spot buys</h3><p>A spot costs $5 in POL at the Chainlink POL/USD price. It buys two things: 300 guaranteed views on the board for your image and link (delivered within 30 days, newest spots on top), and a place in the line.</p></div> <div class="card"><h3>What a spot buys</h3><p>A spot costs $5 in POL at the Chainlink POL/USD price. It buys two things: 300 guaranteed views on the board for your image and link (delivered within 30 days, newest spots on top), and a place in the line.</p></div>
<div class="card"><h3>Where the $5 goes, in the same transaction</h3> <div class="card"><h3>Where the $5 goes, in the same transaction</h3>
<table class="tbl"><tr><th>Share</th><th>To</th></tr> <table class="tbl"><tr><th>Share</th><th>To</th></tr>
@@ -37,9 +38,10 @@
<div id="zHow"></div> <div id="zHow"></div>
<div class="card"><h3>What is not promised</h3><p>Nothing is promised. You are paid only when spots sell after yours. From the line alone, a member who refers nobody gets back less than the $5 a spot costs; what you earn depends on spots sold after yours and on the people you bring in. This is advertising with a share of later sales, not an investment.</p></div> <div class="card"><h3>What is not promised</h3><p>Nothing is promised. You are paid only when spots sell after yours. From the line alone, a member who refers nobody gets back less than the $5 a spot costs; what you earn depends on spots sold after yours and on the people you bring in. This is advertising with a share of later sales, not an investment.</p></div>
<div class="card"><h3>The momentum fund</h3><p>When no spot has sold for 4 hours, the fund buys one (at most 12 a day). It gifts the spot to an active member who owns a paid spot and has not had a gift in 7 days, members who referred someone recently first. If nobody qualifies, the fund keeps the spot and its line money goes back into the fund.</p></div> <div class="card"><h3>The momentum fund</h3><p>When no spot has sold for 4 hours, the fund buys one (at most 12 a day). It gifts the spot to an active member who owns a paid spot and has not had a gift in 7 days, members who referred someone recently first. If nobody qualifies, the fund keeps the spot and its line money goes back into the fund.</p></div>
<div class="card"><h3>Guides</h3><p>Want to check it yourself? <a href="/guides/is-it-legit">Is it legit?</a> shows the contract, the ledger and the exact split. <a href="/guides/free-account">Getting the most from your free account</a> and the <a href="/guides/faq">FAQ</a> cover the rest. <a href="/guides">All guides</a></p></div>
<div class="card"><h3>The rest of the network</h3><p>Open board slots show network sites such as InstantAdPay and LinkSpin. On InstantAdPay, ad credits buy advertising, not income.</p></div> <div class="card"><h3>The rest of the network</h3><p>Open board slots show network sites such as InstantAdPay and LinkSpin. On InstantAdPay, ad credits buy advertising, not income.</p></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/how.js?v=z1"></script> <script src="/assets/how.js?v=z1"></script>
<script src="https://polhunter.com/embed.js" data-slots="5" data-selector="main.wrap > .card" async></script> <script src="https://polhunter.com/embed.js" data-slots="5" data-selector="main.wrap > .card" async></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
+4 -3
View File
@@ -21,14 +21,15 @@
<script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebSite","name":"Downline Banners","url":"https://downlinebanners.com/"},{"@type":"Organization","name":"Downline Banners","url":"https://downlinebanners.com/","logo":"https://downlinebanners.com/logo-icon.png","parentOrganization":{"@type":"Organization","name":"Crypto Team Build Network","url":"https://cryptoteambuild.com"}}]}</script> <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebSite","name":"Downline Banners","url":"https://downlinebanners.com/"},{"@type":"Organization","name":"Downline Banners","url":"https://downlinebanners.com/","logo":"https://downlinebanners.com/logo-icon.png","parentOrganization":{"@type":"Organization","name":"Crypto Team Build Network","url":"https://cryptoteambuild.com"}}]}</script>
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap"> <main class="wrap">
<section class="hero"> <section class="hero">
<h1>Banner real estate on every page in your line, <em>paid instantly on&#8209;chain when spots sell.</em></h1> <h1>Banner real estate on every page in your line, <em>paid instantly on&#8209;chain when spots sell.</em></h1>
<p class="lead">A $5 spot buys 300 guaranteed views on the board and a place in the line. When a later spot sells, the contract pays the 10 spots above it and the buyer's sponsor in the same transaction. Nothing is promised.</p> <p class="lead">A $5 spot buys 300 guaranteed views on the board and a place in the line. When a later spot sells, the contract pays the 10 spots above it and the buyer's sponsor in the same transaction. Nothing is promised.</p>
<p class="watchp"><a class="watchlink" href="/how#watch"><svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><circle cx="12" cy="12" r="11" fill="currentColor"/><path d="M10 8l6 4-6 4z" fill="#141a02"/></svg>Watch the 2-minute walkthrough</a></p>
</section> </section>
<section id="gate" class="card" hidden> <section id="gate" class="card" hidden>
@@ -52,7 +53,7 @@
</section> </section>
<div id="status" class="note" hidden></div> <div id="status" class="note" hidden></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/gate.js?v=1"></script> <script src="/assets/gate.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
</body> </body>
+3 -3
View File
@@ -20,8 +20,8 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap"> <main class="wrap">
@@ -48,7 +48,7 @@
<div id="status" class="note" hidden></div> <div id="status" class="note" hidden></div>
<div class="card" id="doneCard" hidden><h3>Your spot is in the line</h3><p>Next: add your image and link in My Spots. One free signature signs you in (it cannot move funds).</p><div class="row"><button class="btn" id="toMyBtn">Open My Spots</button></div><p class="small mono" id="txLink"></p><div id="zBought"></div></div> <div class="card" id="doneCard" hidden><h3>Your spot is in the line</h3><p>Next: add your image and link in My Spots. One free signature signs you in (it cannot move funds).</p><div class="row"><button class="btn" id="toMyBtn">Open My Spots</button></div><p class="small mono" id="txLink"></p><div id="zBought"></div></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/wallet.js?v=1"></script> <script src="/assets/wallet.js?v=1"></script>
<script src="/assets/join.js?v=20261114h"></script> <script src="/assets/join.js?v=20261114h"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
+3 -3
View File
@@ -20,8 +20,8 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap"> <main class="wrap">
@@ -30,7 +30,7 @@
<div class="card"><div class="row" style="justify-content:space-between"><h3 style="margin:0">Spot sales</h3><span class="muted small" id="upd"></span></div> <div class="card"><div class="row" style="justify-content:space-between"><h3 style="margin:0">Spot sales</h3><span class="muted small" id="upd"></span></div>
<div id="rows"><p class="muted">Loading the ledger...</p></div><div id="zLedger"></div><div id="rows2"></div></div> <div id="rows"><p class="muted">Loading the ledger...</p></div><div id="zLedger"></div><div id="rows2"></div></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/ledger.js?v=z1"></script> <script src="/assets/ledger.js?v=z1"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
</body> </body>
+6 -6
View File
@@ -21,19 +21,19 @@
<meta name="robots" content="noindex"> <meta name="robots" content="noindex">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap"> <main class="wrap">
<section class="hero"><h1>My Spots</h1><p class="lead">Your spots, your images and links, and every payment the contract sent you.</p></section> <section class="hero"><h1>My Spots</h1><p class="lead">Your spots, your images and links, and every payment the contract sent you.</p></section>
<div class="card" id="signin" hidden><h3>Sign in with your wallet</h3><p class="muted small">You sign a short message. It is free and cannot move funds or approve anything.</p><button class="btn" id="signBtn">Sign in</button></div> <div class="card" id="signin" hidden><h3>Sign in with your wallet</h3><p class="muted small">You sign a short message. It is free and cannot move funds or approve anything.</p><button class="btn" id="signBtn">Sign in</button></div>
<div id="dash" hidden> <div id="dash" hidden>
<div class="card"><div class="row" style="justify-content:space-between"><div><span class="muted small">Signed in as</span> <span class="mono" id="me"></span></div><button class="btn quiet small" id="outBtn">Sign out</button></div> <div class="card"><div class="row" style="justify-content:space-between"><div><span class="muted small">Signed in as</span> <span class="mono" id="me"></span></div><span class="row" style="gap:8px"><button class="btn quiet small" id="outBtn">Sign out</button><button class="btn quiet small" id="outAllBtn" title="Ends your network sign-in on every network site">Sign out everywhere</button></span></div>
<div class="grid2" style="margin-top:12px" id="stats"></div></div><div id="zMySpots"></div> <div class="grid2" style="margin-top:12px" id="stats"></div></div><div id="zMySpots"></div>
<div class="card"><h3>Your share link</h3><p class="muted small">People who join through this link have you as their sponsor. It is set once, on their first spot.</p> <div class="card"><h3>Your share link</h3><p class="muted small">People who join through this link have you as their sponsor. It is set once, on their first spot.</p>
<div class="field"><input id="share" readonly></div><button class="btn sec small" id="copyBtn">Copy link</button></div> <div class="field"><input id="share" readonly></div><button class="btn sec small" id="copyBtn">Copy link</button></div>
<div class="card"><h3>Spots</h3><p class="muted small">Image: 468x60 PNG, JPG or GIF up to 150 KB, or an https image address. Link: https only. Change them any time. A spot with no image shows your default, or a network image until you add one.</p> <div class="card"><h3>Spots</h3><p class="muted small">Image: 468x60 PNG, JPG or GIF up to 150 KB, or an https image address. Link: https only. Change them any time, as often as you like: every change is checked (the link must open, an image address must load) and logged. A spot with no image shows your default, or a network image until you add one.</p>
<div id="spots"></div></div> <div id="spots"></div></div>
<div class="card"><h3>Default image and link</h3><p class="muted small">Used by any spot you have not set up.</p><div id="defaults"></div></div> <div class="card"><h3>Default image and link</h3><p class="muted small">Used by any spot you have not set up.</p><div id="defaults"></div></div>
<div class="card"><h3>Payments to you</h3><div id="payouts"></div></div> <div class="card"><h3>Payments to you</h3><div id="payouts"></div></div>
@@ -41,9 +41,9 @@
</div> </div>
<div id="status" class="note" hidden></div> <div id="status" class="note" hidden></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/wallet.js?v=1"></script> <script src="/assets/wallet.js?v=1"></script>
<script src="/assets/my.js?v=z1"></script> <script src="/assets/my.js?v=z3"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
</body> </body>
</html> </html>
+5 -5
View File
@@ -20,21 +20,21 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap legal"> <main class="wrap legal">
<section class="hero"><h1>Privacy Policy</h1><p class="lead">What we collect, why, and who sees it.</p><p class="muted small">Last updated November 14, 2026</p></section> <section class="hero"><h1>Privacy Policy</h1><p class="lead">What we collect, why, and who sees it.</p><p class="muted small">Last updated November 14, 2026</p></section>
<div class="card"><h2>Who we are</h2><p>Downline Banners is run by TrustClickz, 615 Green Valley Drive, Moody, AL 35004. This policy says what we collect, why, and who sees it.</p></div> <div class="card"><h2>Who we are</h2><p>Downline Banners is run by TrustClickz. This policy says what we collect, why, and who sees it.</p></div>
<div class="card"><h2>What we collect</h2><ul><li><b>Your wallet address</b>, which you prove by signing a message (signing costs nothing and moves no money).</li><li><b>Your network username and sponsor</b>, looked up from the network hub when you sign in through InstantAdPay or LinkSpin. Downline Banners does not store your email address.</li><li><b>Your banner</b>: the image and the link you post, and how many views and clicks it gets.</li><li><b>Visit verification</b>: your IP address and browser type, combined into a one-way code, to count each viewer once and keep out bots. We do not keep the raw IP address with your views.</li><li><b>Cookies</b>: a sign-in cookie; a referral cookie (90 days) and a welcome-link cookie that remember who sent you; a random visitor code (1 year) and a short-lived pass for the board check, so views are counted fairly.</li></ul></div> <div class="card"><h2>What we collect</h2><ul><li><b>Your wallet address</b>, which you prove by signing a message (signing costs nothing and moves no money).</li><li><b>Your network username and sponsor</b>, looked up from the network hub when you sign in through InstantAdPay or LinkSpin. Downline Banners does not store your email address.</li><li><b>Your banner</b>: the image and the link you post, and how many views and clicks it gets.</li><li><b>Visit verification</b>: your IP address and browser type, combined into a one-way code, to count each viewer once and keep out bots. We do not keep the raw IP address with your views.</li><li><b>Cookies</b>: a sign-in cookie; a referral cookie (90 days) and a welcome-link cookie that remember who sent you; a random visitor code (1 year) and a short-lived pass for the board check, so views are counted fairly.</li></ul></div>
<div class="card"><h2>One account across the network</h2><p>The Crypto Team Build Network shares one account across its sites through the network hub. The hub keeps your email address, username, wallet and sponsor, and each network site (InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, Stack POL, Earners Corner) asks it who you are, so you have one identity and one sponsor everywhere. Sites only see what they need.</p></div> <div class="card"><h2>One account across the network</h2><p>The Crypto Team Build Network shares one account across its sites through the network hub. The hub keeps your email address, username, wallet and sponsor, and each network site (InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, Stack POL, Earners Corner) asks it who you are, so you have one identity and one sponsor everywhere. Sites only see what they need.</p></div>
<div class="card"><h2>What is public</h2><p>Purchases and payments on the blockchain are public and permanent: anyone can see the wallet addresses and amounts, and nobody can delete them. Our live ledger, leaderboards and toasts show your network username or a shortened wallet. When a spot sells, a payment message with the buyer's username (or a shortened wallet) and the amounts paid is posted to the network's Telegram payments topic.</p></div> <div class="card"><h2>What is public</h2><p>Purchases and payments on the blockchain are public and permanent: anyone can see the wallet addresses and amounts, and nobody can delete them. Our live ledger, leaderboards and toasts show your network username or a shortened wallet. When a spot sells, a payment message with the buyer's username (or a shortened wallet) and the amounts paid is posted to the network's Telegram payments topic.</p></div>
<div class="card"><h2>Who else sees it</h2><p>We do not sell your data. We use service providers to run the site (hosting, databases, blockchain connections, and Telegram for the payment messages), and we share data if the law requires it.</p></div> <div class="card"><h2>Who else sees it</h2><p>We do not sell your data. We use service providers to run the site (hosting, databases, blockchain connections, and Telegram for the payment messages), and we share data if the law requires it.</p></div>
<div class="card"><h2>Your choices</h2><p>You can ask us to delete your account data on this site or on the network hub. Records on the blockchain cannot be deleted by anyone. You can clear the cookies in your browser at any time; you will need to sign in again.</p></div> <div class="card"><h2>Your choices</h2><p>You can ask us to delete your account data on this site or on the network hub. Records on the blockchain cannot be deleted by anyone. You can clear the cookies in your browser at any time; you will need to sign in again.</p></div>
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div> <div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a> (TrustClickz).</p></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/legal.js?v=1"></script> <script src="/assets/legal.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
</body> </body>
+3 -3
View File
@@ -20,8 +20,8 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
<link rel="stylesheet" href="/assets/kit.css?v=1"> <link rel="stylesheet" href="/assets/kit.css?v=1">
</head> </head>
<body> <body>
@@ -33,7 +33,7 @@
<div id="status" class="note" hidden></div> <div id="status" class="note" hidden></div>
<div id="kit"><p class="muted">Loading the kit...</p></div> <div id="kit"><p class="muted">Loading the kit...</p></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/kitpage.js?v=2"></script> <script src="/assets/kitpage.js?v=2"></script>
<script src="/assets/promote.js?v=1"></script> <script src="/assets/promote.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
+5 -5
View File
@@ -20,13 +20,13 @@
<meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png"> <meta name="twitter:image" content="https://downlinebanners.com/art/og-share.png">
<link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png"> <link rel="icon" type="image/svg+xml" href="/art/mark.svg"><link rel="icon" type="image/png" href="/logo-icon.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<link rel="stylesheet" href="/assets/site.css?v=2"> <link rel="stylesheet" href="/assets/site.css?v=3">
<link rel="stylesheet" href="/assets/line.css?v=8"> <link rel="stylesheet" href="/assets/line.css?v=9">
</head> </head>
<body> <body>
<main class="wrap legal"> <main class="wrap legal">
<section class="hero"><h1>Terms and Conditions</h1><p class="lead">The rules for using Downline Banners, in plain English.</p><p class="muted small">Last updated November 14, 2026</p></section> <section class="hero"><h1>Terms and Conditions</h1><p class="lead">The rules for using Downline Banners, in plain English.</p><p class="muted small">Last updated November 14, 2026</p></section>
<div class="card"><h2>Who we are</h2><p>Downline Banners (downlinebanners.com) is run by TrustClickz, 615 Green Valley Drive, Moody, AL 35004. It is part of the Crypto Team Build Network: one network account works across InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, Stack POL and Earners Corner. By using Downline Banners you agree to these terms.</p></div> <div class="card"><h2>Who we are</h2><p>Downline Banners (downlinebanners.com) is run by TrustClickz. It is part of the Crypto Team Build Network: one network account works across InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, Stack POL and Earners Corner. By using Downline Banners you agree to these terms.</p></div>
<div class="card"><h2>What Downline Banners is</h2><p>Downline Banners is one global line of 468x60 banner spots on the Polygon blockchain.</p></div> <div class="card"><h2>What Downline Banners is</h2><p>Downline Banners is one global line of 468x60 banner spots on the Polygon blockchain.</p></div>
<div class="card"><h2>What you buy</h2><p>A spot costs $5, paid in POL at the Chainlink POL/USD price the contract reads at the moment you buy. Anything you send above the price comes back to you in the same transaction.</p><p>A spot buys advertising: 300 guaranteed views of your banner and link on the board, delivered within 30 days, and a place in the line. It does not buy income, a share of a business or an investment.</p><p>Every spot is a single, one-time purchase. Nothing renews and nothing is ever billed again. There are no subscriptions.</p></div> <div class="card"><h2>What you buy</h2><p>A spot costs $5, paid in POL at the Chainlink POL/USD price the contract reads at the moment you buy. Anything you send above the price comes back to you in the same transaction.</p><p>A spot buys advertising: 300 guaranteed views of your banner and link on the board, delivered within 30 days, and a place in the line. It does not buy income, a share of a business or an investment.</p><p>Every spot is a single, one-time purchase. Nothing renews and nothing is ever billed again. There are no subscriptions.</p></div>
<div class="card"><h2>How a payment is split</h2><p>The Downline Banners contract splits each $5 in the same transaction it is paid: 30% to the buyer's sponsor (no sponsor: the momentum fund), 55% to the owners of the 10 spots bought just before it (5.5% each), 10% to the company and 5% to the momentum fund.</p><p>The contract holds nothing except the momentum fund, which can only buy spots. When no spot has sold for a while, the fund buys one and gifts it to an active member, following the rules on the How it works page. The split is fixed in the contract code and there is no owner withdraw.</p><p>You are paid only when spots sell after yours. A payment goes straight to your wallet in the transaction of the later purchase. Nothing is held for you and there is nothing to withdraw.</p><p>The sponsor paid for a spot is decided when you buy: the network sponsor the network hub knows for the wallet that will own the spot, else the welcome link or referral link you arrived through. It is recorded on the contract with the purchase.</p></div> <div class="card"><h2>How a payment is split</h2><p>The Downline Banners contract splits each $5 in the same transaction it is paid: 30% to the buyer's sponsor (no sponsor: the momentum fund), 55% to the owners of the 10 spots bought just before it (5.5% each), 10% to the company and 5% to the momentum fund.</p><p>The contract holds nothing except the momentum fund, which can only buy spots. When no spot has sold for a while, the fund buys one and gifts it to an active member, following the rules on the How it works page. The split is fixed in the contract code and there is no owner withdraw.</p><p>You are paid only when spots sell after yours. A payment goes straight to your wallet in the transaction of the later purchase. Nothing is held for you and there is nothing to withdraw.</p><p>The sponsor paid for a spot is decided when you buy: the network sponsor the network hub knows for the wallet that will own the spot, else the welcome link or referral link you arrived through. It is recorded on the contract with the purchase.</p></div>
@@ -37,9 +37,9 @@
<div class="card"><h2>Your account</h2><p>You sign in with your wallet or through InstantAdPay or LinkSpin. Your network account, username and sponsor are shared across the network through the network hub, as described in the <a href="/privacy">Privacy Policy</a>. You must be old enough to make a binding agreement where you live, and using crypto must be legal there.</p></div> <div class="card"><h2>Your account</h2><p>You sign in with your wallet or through InstantAdPay or LinkSpin. Your network account, username and sponsor are shared across the network through the network hub, as described in the <a href="/privacy">Privacy Policy</a>. You must be old enough to make a binding agreement where you live, and using crypto must be legal there.</p></div>
<div class="card"><h2>The service</h2><p>The site is provided as it is. We work to keep it running but cannot promise it will always be available or free of errors. The smart contract runs on Polygon on its own; its rules are public and can be checked on the <a href="/contract">contract page</a>. We may change features, prices of future purchases or these terms; changes apply from the date they are posted here.</p></div> <div class="card"><h2>The service</h2><p>The site is provided as it is. We work to keep it running but cannot promise it will always be available or free of errors. The smart contract runs on Polygon on its own; its rules are public and can be checked on the <a href="/contract">contract page</a>. We may change features, prices of future purchases or these terms; changes apply from the date they are posted here.</p></div>
<div class="card"><h2>Limits</h2><p>As far as the law allows, we are not responsible for losses caused by the blockchain, your wallet, the price of POL, third-party websites in banners, or events outside our control, and our total responsibility to you is limited to what you paid for the purchase in question. These terms are governed by the laws of the State of Alabama, USA.</p></div> <div class="card"><h2>Limits</h2><p>As far as the law allows, we are not responsible for losses caused by the blockchain, your wallet, the price of POL, third-party websites in banners, or events outside our control, and our total responsibility to you is limited to what you paid for the purchase in question. These terms are governed by the laws of the State of Alabama, USA.</p></div>
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div> <div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a> (TrustClickz).</p></div>
</main> </main>
<script src="/assets/common.js?v=20261115nr"></script> <script src="/assets/common.js?v=20261117nw"></script>
<script src="/assets/legal.js?v=1"></script> <script src="/assets/legal.js?v=1"></script>
<script src="/assets/chat.js?v=1" defer></script> <script src="/assets/chat.js?v=1" defer></script>
</body> </body>
+2
View File
@@ -6,6 +6,8 @@
{ "q": "Where does the $5 go?", "kb": "split", "must": ["30%", "55%", "\\$0.275", "10%", "5%"] }, { "q": "Where does the $5 go?", "kb": "split", "must": ["30%", "55%", "\\$0.275", "10%", "5%"] },
{ "q": "What do I get when someone I referred buys?", "kb": "split", "must": ["\\$1.50"] }, { "q": "What do I get when someone I referred buys?", "kb": "split", "must": ["\\$1.50"] },
{ "q": "What size is the banner?", "kb": "banner", "must": ["468x60", "150 KB"] }, { "q": "What size is the banner?", "kb": "banner", "must": ["468x60", "150 KB"] },
{ "q": "How often can I change my image or link?", "kb": "banner", "must": ["as often as you like", "full check", "logged"] },
{ "q": "Why was my spot taken down?", "kb": "takedown", "must": ["Taken down", "reason", "place"] },
{ "q": "What is the momentum fund?", "kb": "fund", "must": ["4 hours", "7 days"] }, { "q": "What is the momentum fund?", "kb": "fund", "must": ["4 hours", "7 days"] },
{ "q": "Why is Join locked?", "kb": "tour", "must": ["timer"] }, { "q": "Why is Join locked?", "kb": "tour", "must": ["timer"] },
{ "q": "Can I buy a spot for someone else?", "kb": "buy-for", "must": ["wallet address"] }, { "q": "Can I buy a spot for someone else?", "kb": "buy-for", "must": ["wallet address"] },
+115
View File
@@ -0,0 +1,115 @@
// Semantic matching, site side (netkb.js route/suggest/match, 2026-11-16) + parity of the shared files: node qa/netkb-semantic.test.mjs
// A stand-in hub answers /v1/kb/match with scripted hits, so no model and no network. Checks: a sure match answers with this site's
// entry, a pattern hit is kept when the match agrees or has no idea and overruled when the match points elsewhere, other sites'
// entries rank behind this site's unless named or clearly closer, a named site that asks about "here" stays home, a slow or down hub
// answers null inside the timeout and is skipped for a while (fail soft), and the support suggestions never offer the contact-support entry.
// Parity: netkb.js is the same file in all eight network sites, chatcore.js + kb.js in the six that share them (checked against the
// sibling checkouts beside this one; a missing sibling is skipped, a different one fails).
// The SAME file ships in every network site (InstantAdPay, LinkSpin, ViralAdBlitz, DownlineHydra, 5xYourTeam, VBB, Downline Banners, Stack POL).
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import http from 'node:http';
import crypto from 'node:crypto';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const ROOT = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1')), '..');
let pass = 0, fail = 0, skip = 0;
const ok = (c, m) => { if (c) pass++; else { fail++; console.log('FAIL', m); } };
// ---- parity with the sibling checkouts
const sha = f => crypto.createHash('sha1').update(fs.readFileSync(f, 'utf8').replace(/\r\n/g, '\n')).digest('hex');
const SIBLINGS = ['onchain-ad-membership/site', 'linkspin/site', 'vbb/app', 'banner-line/app', 'viraladblitz/app', 'downlinehydra/app', '5xyourteam/app', 'stackpol'];
const KIT = new Set(['vbb/app', 'banner-line/app', 'viraladblitz/app', 'downlinehydra/app', '5xyourteam/app', 'stackpol']);
let base = ROOT; for (let i = 0; i < 4 && !SIBLINGS.some(s => path.resolve(base, s) === ROOT); i++) base = path.dirname(base);
const mine = SIBLINGS.find(s => path.resolve(base, s) === ROOT);
for (const s of SIBLINGS) {
if (s === mine) continue;
const dir = path.resolve(base, s);
const files = ['netkb.js'].concat(mine && KIT.has(mine) && KIT.has(s) ? ['chatcore.js', 'kb.js'] : []);
for (const f of files) {
if (!fs.existsSync(path.join(dir, f))) { skip++; continue; }
ok(sha(path.join(dir, f)) === sha(path.join(ROOT, f)), 'parity: ' + f + ' differs from ' + s + '/' + f);
}
}
ok(/The SAME file ships in every network site/.test(fs.readFileSync(path.join(ROOT, 'netkb.js'), 'utf8')), 'netkb.js carries the shared-file header');
// ---- a stand-in hub
let script = () => ({ hits: [], margin: 0 }), delay = 0, status = 200, last = null;
const hub = http.createServer((req, res) => { let b = ''; req.on('data', c => { b += c; }); req.on('end', () => {
last = { path: req.url, body: JSON.parse(b || '{}'), site: req.headers['x-hub-site'] };
setTimeout(() => { res.writeHead(status, { 'Content-Type': 'application/json' }); res.end(JSON.stringify(status === 200 ? Object.assign({ ok: true }, script(last.body)) : { error: 'embeddings_down' })); }, delay);
}); });
await new Promise(r => hub.listen(0, '127.0.0.1', r));
process.env.HUB_URL = 'http://127.0.0.1:' + hub.address().port; process.env.HUB_SECRET = 'q'.repeat(40); process.env.HUB_SITE = 'home'; process.env.NETKB_MATCH_MS = '400';
delete process.env.NETKB; delete process.env.NETKB_MATCH;
process.env.DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'nksem-'));
const netkb = require(path.join(ROOT, 'netkb.js'));
netkb._set({ version: 'v', sites: { home: { name: 'Home', url: 'https://home.example' }, other: { name: 'Other', url: 'https://other.example' } },
entries: [{ site: 'other', id: 'c-split', title: 'Other split', questions: [], answer: 'Other split answer.', tags: [] }] });
const own = [{ id: 'c-split', title: 'Split', answer: 'Home split.' }, { id: 'c-packages', title: 'Packages', answer: 'Home prices.' }, { id: 'c-support', title: 'Support', answer: 'Ask support.', handoff: true }, { id: 'kb-t1', title: 'From a ticket', answer: 'Ticket answer.', source: 'ticket' }];
const H = (site, id, score) => ({ site, id, title: id, answer: '', score, boosted: score + (site === 'home' ? 0.08 : 0), home: site === 'home' });
const set = (hits, margin) => { script = () => ({ hits, margin: margin == null ? 0.1 : margin, confidence: hits.length ? hits[0].score : 0 }); };
// a sure match answers with this site's entry, even over a pattern hit that points elsewhere
set([H('home', 'c-split', 0.93), H('home', 'c-packages', 0.7)]);
let r = await netkb.route('how much do I earn', { fast: own[1], own });
ok(r && r.via === 'answer' && r.hit.id === 'c-split', 'sure match answers (' + JSON.stringify(r && [r.via, r.hit && r.hit.id]) + ')');
ok(last && last.path === '/v1/kb/match' && last.site === 'home' && last.body.k === 8, 'signed match call as this site');
// the pattern hit kept when the match agrees
set([H('home', 'c-split', 0.78), H('home', 'c-packages', 0.72)], 0.01);
r = await netkb.route('what does it cost', { fast: own[1], own });
ok(r && r.via === 'agree' && r.hit.id === 'c-packages', 'pattern kept when the match agrees (' + (r && r.via) + ')');
// the pattern hit kept when the match has no idea
set([H('home', 'c-split', 0.55)]);
r = await netkb.route('zzq', { fast: own[1], own });
ok(r && r.via === 'regex' && r.hit.id === 'c-packages', 'pattern kept when the match has no idea');
// overruled when the match points elsewhere with some confidence
set([H('home', 'c-split', 0.8), H('home', 'kb-t1', 0.75)], 0.05);
r = await netkb.route('what is my cut when my friends buy', { fast: own[1], own });
ok(r && r.via === 'veto' && r.hit === null && r.hits[0].entry.id === 'c-split', 'pattern overruled, the match feeds the prompt (' + (r && r.via) + ')');
// home first: another site's entry stays behind unless clearly closer
set([H('other', 'c-split', 0.82), H('home', 'c-split', 0.79)], 0.02);
r = await netkb.route('my cut', { own });
ok(r && r.via === 'context' && r.hits[0].entry.id === 'c-split' && !r.hits[0].entry.site, 'home entry first when no site is named');
set([H('other', 'c-split', 0.95), H('home', 'c-packages', 0.70)], 0.2);
r = await netkb.route('other thing', { own });
ok(r && !r.hits[0].entry.site && r.hits.some(h => h.entry.site === 'other'), 'another site rides behind this site entry when clearly closer');
set([H('other', 'c-split', 0.95), H('home', 'c-packages', 0.55)], 0.2);
r = await netkb.route('other thing', { own });
ok(r && r.hits[0].entry.site === 'other', 'another site leads when this site has nothing close');
// a named site asked about "here" stays home (no prefer sent)
set([H('home', 'c-split', 0.9)]);
await netkb.route('I am on Other, will my team carry over here?', { own, prefer: ['other'] });
ok(!last.body.prefer, 'named site + "here": no prefer');
await netkb.route('How much is the split on Other?', { own, prefer: ['other'] });
ok(Array.isArray(last.body.prefer) && last.body.prefer[0] === 'other', 'named site: prefer sent');
// remote never answers outright
set([H('other', 'c-split', 0.99)], 0.3);
r = await netkb.route('How much is the split on Other?', { own, prefer: ['other'] });
ok(r && r.hit === null && r.hits[0].entry.site === 'other', 'another site\'s entry rides as context, never the instant answer');
// suggestions: KB entries only, no contact-support entry, ticket-derived entries labelled
set([H('home', 'kb-t1', 0.82), H('home', 'c-support', 0.8), H('home', 'c-split', 0.79), H('home', 'c-packages', 0.5)]);
let s = await netkb.suggest('my payout never arrived after a purchase', { own });
ok(s.via === 'semantic' && s.items.map(i => i.id).join() === 'kb-t1,c-split', 'suggest: closest answers, no support entry, no weak ones (' + s.items.map(i => i.id) + ')');
ok(s.items[0].fromTicket === true && s.items[1].fromTicket === false, 'suggest: past-ticket entries labelled');
s = await netkb.suggest('hi', { own }); ok(s.items.length === 0 && s.via === 'short', 'suggest: too short asks nothing');
// fail soft: slow hub -> null inside the timeout, then skipped for a while; down hub -> null; suggest falls back to BM25
netkb._matchReset(); delay = 2000;
let t0 = Date.now(); r = await netkb.route('anything', { own }); const took = Date.now() - t0;
ok(r === null && took < 1500, 'slow hub: null within the timeout (' + took + ' ms)');
delay = 0; t0 = Date.now(); r = await netkb.route('anything', { own });
ok(r === null && Date.now() - t0 < 50, 'after a failure the hub is skipped for a while (no wait)');
s = await netkb.suggest('my payout never arrived after a purchase', { own, fallback: async () => [{ entry: own[0] }, { entry: own[2] }] });
ok(s.via === 'bm25' && s.items.map(i => i.id).join() === 'c-split', 'suggest falls back to BM25 when the hub is skipped');
netkb._matchReset(); status = 503;
r = await netkb.route('anything', { own }); ok(r === null, 'hub 503: null');
netkb._matchReset(); status = 200;
process.env.NETKB_MATCH = '0'; r = await netkb.route('anything', { own }); ok(r === null, 'NETKB_MATCH=0: off'); delete process.env.NETKB_MATCH;
const v = netkb.view(); ok(v.matchErrors >= 2 && v.semAnswer >= 1 && typeof v.sem.answer === 'number', 'view carries the semantic counters');
hub.close();
console.log((fail ? 'FAILED ' : 'ok ') + pass + ' passed, ' + fail + ' failed' + (skip ? ', ' + skip + ' sibling files not here (skipped)' : ''));
process.exit(fail ? 1 : 0);
+168 -4
View File
@@ -17,6 +17,42 @@ const { ethers } = require('ethers');
const APP = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); const APP = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const OUT = path.join(APP, 'qa', 'out'); fs.mkdirSync(OUT, { recursive: true }); const OUT = path.join(APP, 'qa', 'out'); fs.mkdirSync(OUT, { recursive: true });
// stand-in internet for the link check (2026-11-16): preloaded into the app (NODE_OPTIONS --require), it answers safety.js's https.get
// calls (the ones with a lookup) and the DNS lookups those make, so every edit gets the full check with nothing leaving this machine. Like Node 20,
// the request asks the lookup for every address (all: true) and needs an array back (the VBB/ViralAdBlitz bug of 2026-11-15).
// Hosts: private.* -> 10.0.0.5 (refused), down.* unreachable, e404.* answers 404, redir.* 302 to https://example.org/landed,
// redir-http.* 302 to an http address, small.* a 125x125 image, anything else 200 (an image path gets a real 468x60 PNG).
const PROBE_STUB = `const https = require('https'), dns = require('dns'), fs = require('fs'), zlib = require('zlib'), { EventEmitter } = require('events'), { PassThrough } = require('stream');
const LOG = process.env.PROBE_LOG;
let probing = false; const dnsLookup = dns.lookup; // only lookups made by a link check are answered here; the app's other traffic resolves as usual
dns.lookup = function (h, o, cb) { if (!probing) return dnsLookup.apply(this, arguments); if (typeof o === 'function') { cb = o; o = {}; } const list = [{ address: String(h).startsWith('private.') ? '10.0.0.5' : '93.184.216.34', family: 4 }]; setImmediate(() => o && o.all ? cb(null, list) : cb(null, list[0].address, 4)); };
function png(w, h) {
const T = Array.from({ length: 256 }, (_, n) => { let c = n; for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; return c >>> 0; });
const crc = b => { let c = 0xffffffff; for (const x of b) c = T[(c ^ x) & 255] ^ (c >>> 8); return (c ^ 0xffffffff) >>> 0; };
const ch = (t, d) => { const l = Buffer.alloc(4); l.writeUInt32BE(d.length); const td = Buffer.concat([Buffer.from(t), d]); const c = Buffer.alloc(4); c.writeUInt32BE(crc(td)); return Buffer.concat([l, td, c]); };
const ih = Buffer.alloc(13); ih.writeUInt32BE(w, 0); ih.writeUInt32BE(h, 4); ih[8] = 8; ih[9] = 2;
return Buffer.concat([Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]), ch('IHDR', ih), ch('IDAT', zlib.deflateSync(Buffer.alloc((w * 3 + 1) * h))), ch('IEND', Buffer.alloc(0))]);
}
const orig = https.get;
https.get = function (url, opts, cb) {
if (!opts || typeof opts.lookup !== 'function') return orig.apply(this, arguments);
const u = new URL(url); const req = new EventEmitter(); req.destroy = () => {};
if (LOG) fs.appendFileSync(LOG, u.href + '\\n');
probing = true; try { opts.lookup(u.hostname, { all: true, family: 0 }, (err, list) => {
if (err) return req.emit('error', err);
if (!Array.isArray(list)) return req.emit('error', new Error('lookup answered ' + typeof list + ', not the array Node 20 asks for'));
const h = u.hostname; if (h.startsWith('down.')) return req.emit('error', new Error('ECONNREFUSED'));
const res = new PassThrough(); res.headers = {}; res.statusCode = 200; let body = Buffer.from('<!doctype html><title>ok</title>');
if (h.startsWith('e404.')) res.statusCode = 404;
else if (h.startsWith('redir-http.')) { res.statusCode = 302; res.headers.location = 'http://plain-http.com/'; }
else if (h.startsWith('redir.')) { res.statusCode = 302; res.headers.location = 'https://example.org/landed'; }
else if (/\\.(png|gif|jpe?g)$/i.test(u.pathname)) { body = h.startsWith('small.') ? png(125, 125) : png(468, 60); res.headers['content-type'] = 'image/png'; }
res.location = res.headers.location; const destroy = res.destroy.bind(res); res.destroy = () => destroy();
cb(res); res.end(body);
}); } finally { probing = false; }
return req;
};`;
const PROBE_LOG = path.join(OUT, 'probe-' + Date.now() + '.log'); const PROBE_FILE = path.join(OUT, 'probe-stub.cjs'); fs.writeFileSync(PROBE_FILE, PROBE_STUB);
const ART = path.resolve(APP, '..', 'contracts', 'out'); const ART = path.resolve(APP, '..', 'contracts', 'out');
const ANVIL = process.env.ANVIL || path.join(os.homedir(), '.foundry', 'bin', 'anvil.exe'); const ANVIL = process.env.ANVIL || path.join(os.homedir(), '.foundry', 'bin', 'anvil.exe');
const PW = process.env.PLAYWRIGHT || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright'; const PW = process.env.PLAYWRIGHT || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright';
@@ -27,7 +63,7 @@ let pass = 0, fail = 0; const procs = [];
const ok = (cond, what, extra) => { if (cond) { pass++; console.log(' ok ' + what); } else { fail++; console.log(' FAIL ' + what + (extra !== undefined ? ' -> ' + JSON.stringify(extra).slice(0, 300) : '')); } }; const ok = (cond, what, extra) => { if (cond) { pass++; console.log(' ok ' + what); } else { fail++; console.log(' FAIL ' + what + (extra !== undefined ? ' -> ' + JSON.stringify(extra).slice(0, 300) : '')); } };
// stand-in network hub (POST /v1/resolve, signed as bannerline) and stand-in InstantAdPay member lookup (the fallback when the // stand-in network hub (POST /v1/resolve, signed as bannerline) and stand-in InstantAdPay member lookup (the fallback when the
// hub is unreachable). HUB.people: {id, username, wallet, sponsorId}; HUB.down makes every hub call fail with 503. // hub is unreachable). HUB.people: {id, username, wallet, sponsorId}; HUB.down makes every hub call fail with 503.
const HUB = { people: [], down: false, calls: 0, badSig: 0 }; const HUB_PORT = APP_PORT + 7, HUB_SECRET = 'b'.repeat(40); const HUB = { people: [], down: false, calls: 0, badSig: 0, got: [] }; const HUB_PORT = APP_PORT + 7, HUB_SECRET = 'b'.repeat(40);
const IAPNET = new Map(); const IAP_PORT = APP_PORT + 8; const IAPNET = new Map(); const IAP_PORT = APP_PORT + 8;
const TG = []; const TG_PORT = APP_PORT + 9; // stand-in Telegram Bot API (trust pack 2026-11-14): never the real group const TG = []; const TG_PORT = APP_PORT + 9; // stand-in Telegram Bot API (trust pack 2026-11-14): never the real group
const hubView = p => p ? { id: p.id, username: p.username, wallet: p.wallet, sponsor: (x => x ? { id: x.id, username: x.username } : null)(HUB.people.find(y => y.id === p.sponsorId)), blocked: false, locked: false } : null; const hubView = p => p ? { id: p.id, username: p.username, wallet: p.wallet, sponsor: (x => x ? { id: x.id, username: x.username } : null)(HUB.people.find(y => y.id === p.sponsorId)), blocked: false, locked: false } : null;
@@ -45,6 +81,7 @@ function startStandIns() {
if (HUB.down) { r.statusCode = 503; return r.end('{"error":"superseded"}'); } if (HUB.down) { r.statusCode = 503; return r.end('{"error":"superseded"}'); }
const want = crypto.createHmac('sha256', HUB_SECRET).update(q.headers['x-hub-ts'] + '\n' + b).digest('hex'); const want = crypto.createHmac('sha256', HUB_SECRET).update(q.headers['x-hub-ts'] + '\n' + b).digest('hex');
if (q.headers['x-hub-sig'] !== want || q.headers['x-hub-site'] !== 'bannerline') { HUB.badSig++; r.statusCode = 401; return r.end('{"error":"unauthorized"}'); } if (q.headers['x-hub-sig'] !== want || q.headers['x-hub-site'] !== 'bannerline') { HUB.badSig++; r.statusCode = 401; return r.end('{"error":"unauthorized"}'); }
if (q.url === '/v1/sso/signout') { HUB.got.push({ route: q.url, body: JSON.parse(b || '{}') }); return r.end('{"ok":true,"ended":1}'); } // Sign out everywhere (2026-11-16)
if (q.url !== '/v1/resolve') { r.statusCode = 404; return r.end('{"error":"not_found"}'); } if (q.url !== '/v1/resolve') { r.statusCode = 404; return r.end('{"error":"not_found"}'); }
const j = JSON.parse(b || '{}'); const ref = String(j.ref || '').toLowerCase(); const j = JSON.parse(b || '{}'); const ref = String(j.ref || '').toLowerCase();
const p = j.id ? HUB.people.find(x => x.id === j.id) : j.wallet ? HUB.people.find(x => x.wallet === String(j.wallet).toLowerCase()) : ref ? HUB.people.find(x => x.username === ref || x.wallet === ref) : null; const p = j.id ? HUB.people.find(x => x.id === j.id) : j.wallet ? HUB.people.find(x => x.wallet === String(j.wallet).toLowerCase()) : ref ? HUB.people.find(x => x.username === ref || x.wallet === ref) : null;
@@ -116,7 +153,8 @@ async function main() {
const env = Object.assign({}, process.env, { PORT: String(APP_PORT), DATA_DIR: DATA, CHAIN_ID: '31337', RPC_URLS: 'http://127.0.0.1:' + RPC_PORT, CONTRACT_ADDRESS: CA, const env = Object.assign({}, process.env, { PORT: String(APP_PORT), DATA_DIR: DATA, CHAIN_ID: '31337', RPC_URLS: 'http://127.0.0.1:' + RPC_PORT, CONTRACT_ADDRESS: CA,
DEPLOY_BLOCK: String(deployBlock), POLL_MS: '1000', ADMIN_TOKEN: ADMIN, KEEPER_ENABLED: '1', KEEPER_KEY: W[7].signer.privateKey, KEEPER_STALL_HOURS: '0.01', KEEPER_EVERY_MIN: '0.25', NODE_ENV: 'development', DEPLOY_BLOCK: String(deployBlock), POLL_MS: '1000', ADMIN_TOKEN: ADMIN, KEEPER_ENABLED: '1', KEEPER_KEY: W[7].signer.privateKey, KEEPER_STALL_HOURS: '0.01', KEEPER_EVERY_MIN: '0.25', NODE_ENV: 'development',
HUB_URL: 'http://127.0.0.1:' + HUB_PORT, HUB_SECRET, HUB_SITE: 'bannerline', HUB_ENABLED: '0', NETKB: '0', HUB_DOWN_MS: '400', NETWORK_LOOKUP_URL: 'http://127.0.0.1:' + IAP_PORT + '/api/network/member', HUB_URL: 'http://127.0.0.1:' + HUB_PORT, HUB_SECRET, HUB_SITE: 'bannerline', HUB_ENABLED: '0', NETKB: '0', HUB_DOWN_MS: '400', NETWORK_LOOKUP_URL: 'http://127.0.0.1:' + IAP_PORT + '/api/network/member',
TG_TOKEN: 'standin-token', TG_CHAT: '-100123', TG_PAY_TOPIC: '632242', TG_API: 'http://127.0.0.1:' + TG_PORT }); TG_TOKEN: 'standin-token', TG_CHAT: '-100123', TG_PAY_TOPIC: '632242', TG_API: 'http://127.0.0.1:' + TG_PORT,
PROBE_LOG, NODE_OPTIONS: '--require ' + JSON.stringify(PROBE_FILE).slice(1, -1) }); // the link check runs on every edit against the stand-in internet (probe-stub.cjs)
startStandIns(); startStandIns();
const hid = n => 'h_' + String(n).padStart(16, '0'); const hid = n => 'h_' + String(n).padStart(16, '0');
const ZW = ethers.Wallet.createRandom().address.toLowerCase(); // a network member with no spot here const ZW = ethers.Wallet.createRandom().address.toLowerCase(); // a network member with no spot here
@@ -144,7 +182,7 @@ async function main() {
const r404 = await u.req('/nope'); ok(r404.status === 404, 'unknown path 404'); const r404 = await u.req('/nope'); ok(r404.status === 404, 'unknown path 404');
// trust pack (2026-11-14): legal pages + the network list from the hub // trust pack (2026-11-14): legal pages + the network list from the hub
for (const p of ['/terms', '/disclaimer', '/privacy']) { const r = await u.req(p); const h = await r.text(); for (const p of ['/terms', '/disclaimer', '/privacy']) { const r = await u.req(p); const h = await r.text();
ok(r.status === 200 && h.includes('TrustClickz, 615 Green Valley Drive, Moody, AL 35004') && !h.includes('—') && !/at most 10 times|\$2\.75/.test(h), 'GET ' + p + ' 200 (TrustClickz, no em dash, no cap)'); } ok(r.status === 200 && h.includes('TrustClickz') && !/Green Valley|Moody|35004/.test(h) && !h.includes('—') && !/at most 10 times|\$2\.75/.test(h), 'GET ' + p + ' 200 (TrustClickz, no em dash, no cap)'); }
{ const legal = (await (await u.req('/terms')).text()) + (await (await u.req('/disclaimer')).text()) + (await (await u.req('/privacy')).text()); { const legal = (await (await u.req('/terms')).text()) + (await (await u.req('/disclaimer')).text()) + (await (await u.req('/privacy')).text());
ok(/300 guaranteed views/.test(legal) && /ever billed again/.test(legal) && /final once confirmed/.test(legal) && /momentum fund/.test(legal) && /network hub/.test(legal) && /not an investment/.test(legal), 'legal pages state the real mechanics (advertising, one-time, no refunds on-chain, momentum fund, the hub)'); } ok(/300 guaranteed views/.test(legal) && /ever billed again/.test(legal) && /final once confirmed/.test(legal) && /momentum fund/.test(legal) && /network hub/.test(legal) && /not an investment/.test(legal), 'legal pages state the real mechanics (advertising, one-time, no refunds on-chain, momentum fund, the hub)'); }
{ let ns; for (let i = 0; i < 20; i++) { ns = await (await u.req('/api/network-sites')).json(); if (Array.isArray(ns) && ns.length === 7) break; await sleep(150); } { let ns; for (let i = 0; i < 20; i++) { ns = await (await u.req('/api/network-sites')).json(); if (Array.isArray(ns) && ns.length === 7) break; await sleep(150); }
@@ -323,7 +361,7 @@ async function main() {
if (p === '/join') { await pg.waitForSelector('#buyCard:not([hidden])', { timeout: 8000 }).catch(() => {}); const price = await pg.textContent('#price'); ok(/^0\.0025/.test(price), '/join shows price ' + price); } if (p === '/join') { await pg.waitForSelector('#buyCard:not([hidden])', { timeout: 8000 }).catch(() => {}); const price = await pg.textContent('#price'); ok(/^0\.0025/.test(price), '/join shows price ' + price); }
if (p === '/how') { await pg.waitForFunction(() => /Hub Test Site/.test((document.querySelector('footer .netline') || {}).textContent || ''), null, { timeout: 6000 }).catch(() => {}); if (p === '/how') { await pg.waitForFunction(() => /Hub Test Site/.test((document.querySelector('footer .netline') || {}).textContent || ''), null, { timeout: 6000 }).catch(() => {});
const ft = (await pg.textContent('footer')).replace(/\s+/g, ' '); const hrefs = await pg.$$eval('footer a', as => as.map(a => a.getAttribute('href'))); const ft = (await pg.textContent('footer')).replace(/\s+/g, ' '); const hrefs = await pg.$$eval('footer a', as => as.map(a => a.getAttribute('href')));
ok(['/terms', '/disclaimer', '/privacy', '/contract', '/ledger'].every(h => hrefs.includes(h)) && /Support/.test(ft) && /TrustClickz · 615 Green Valley Drive, Moody, AL 35004/.test(ft) ok(['/terms', '/disclaimer', '/privacy', '/contract', '/ledger'].every(h => hrefs.includes(h)) && /Support/.test(ft) && /© 2026 TrustClickz/.test(ft) && !/Green Valley/.test(ft)
&& /Part of the network · One account across the network: InstantAdPay · LinkSpin · Downline Banners · Viral Banner Blitz · Stack POL · Earners Corner · Hub Test Site/.test(ft) && !/RM Circle|rmcircle/i.test(ft) && /Part of the network · One account across the network: InstantAdPay · LinkSpin · Downline Banners · Viral Banner Blitz · Stack POL · Earners Corner · Hub Test Site/.test(ft) && !/RM Circle|rmcircle/i.test(ft)
&& (await pg.textContent('footer .netline .here')) === 'Downline Banners', 'footer: legal + proof links, company line, the hub network list with DLB as current, never RM Circle', ft.slice(-420)); && (await pg.textContent('footer .netline .here')) === 'Downline Banners', 'footer: legal + proof links, company line, the hub network list with DLB as current, never RM Circle', ft.slice(-420));
await pg.locator('footer').screenshot({ path: path.join(OUT, 'footer-desktop.png') }); await pg.locator('footer').screenshot({ path: path.join(OUT, 'footer-desktop.png') });
@@ -357,6 +395,132 @@ async function main() {
const ours = errors.filter(e => !/example\.(com|net|org)/.test(e)); // gate frames load example.* sites; their own 404s (favicon) are not ours const ours = errors.filter(e => !/example\.(com|net|org)/.test(e)); // gate frames load example.* sites; their own 404s (favicon) are not ours
ok(ours.length === 0, 'no console errors on our pages', ours); ok(ours.length === 0, 'no console errors on our pages', ours);
} }
console.log('9. network hub events (sign out everywhere, block, erase end sessions here)');
{ const crypto = require('node:crypto'); const admin = (p, body) => client().json(p, body, { 'x-admin-token': ADMIN }); let hseq = 900000; let hn = 700;
const signAs = async (w, name) => { const c = client('Mozilla/5.0 hook ' + (hn++)); const a = w.address.toLowerCase(); const xf = { 'X-Forwarded-For': '198.51.100.' + (hn % 250) };
if (name) { c.hubId = hid(hn); HUB.people.push({ id: c.hubId, username: name, wallet: a, sponsorId: null }); }
const ch = await c.json('/api/auth/challenge', { address: w.address }, xf);
const v = await c.json('/api/auth/verify', { address: w.address, signature: await w.signMessage(ch.message) }, xf);
c.address = a; c.wallet = w; c.ok = v.ok === true && !!c.jar['bl.sid']; return c; };
const walletMember = o => signAs((o && o.wallet) || ethers.Wallet.createRandom(), o && o.hub && o.hub.username); const signedIn = async c => (await c.json('/api/me')).signedIn === true;
const hook = async (events, o = {}) => { const raw = JSON.stringify({ events }); const ts = String(o.ts || Date.now());
const sig = o.sig || crypto.createHmac('sha256', o.secret || HUB_SECRET).update(ts + '\n' + raw).digest('hex');
const r = await fetch(BASE + '/api/hub/events', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Hub-Ts': ts, 'X-Hub-Sig': sig }, body: raw }); return r.status; };
const ev = (type, personId, data, at) => ({ seq: ++hseq, at: at || Date.now(), type, personId, data: data || {} });
const H1 = await walletMember({ hub: { username: 'hookone' } }); const H1b = await walletMember({ wallet: H1.wallet }); const H2 = await walletMember({ hub: { username: 'hooktwo' } });
const H3 = await walletMember({ hub: { username: 'hookthree' } }); const H4 = await walletMember({ hub: { username: 'hookfour' } });
ok(H1.ok && H1b.ok && H2.ok && H3.ok && H4.ok && await signedIn(H1) && await signedIn(H1b), 'setup: hub members signed in here (one of them in two browsers)');
ok(await hook([ev('member.signedout', H1.hubId)], { secret: 'x'.repeat(40) }) === 401 && await hook([ev('member.signedout', H1.hubId)], { ts: Date.now() - 600000 }) === 401, 'a hook signed with another key, or 10 minutes old, is refused (401)');
ok(await signedIn(H1), 'a refused hook ends nothing');
const so = ev('member.signedout', H1.hubId);
ok(await hook([so]) === 200 && !(await signedIn(H1)) && !(await signedIn(H1b)) && await signedIn(H2), 'member.signedout: every session of that wallet ends (both browsers), nobody else\'s');
const H1c = await walletMember({ wallet: H1.wallet });
ok(await hook([so]) === 200 && await signedIn(H1c), 'the same event sent twice: applied once, a fresh sign-in stays');
ok(await hook([ev('member.signedout', H1.hubId, {}, Date.now() - 60000)]) === 200 && await signedIn(H1c), 'an event older than a session never ends it (only sessions made before the event)');
ok(await hook([ev('member.blocked', H2.hubId)]) === 200 && !(await signedIn(H2)) && await signedIn(H3), 'member.blocked: that member is signed out here');
const wh = crypto.createHash('sha256').update(H3.address).digest('hex'); HUB.people = HUB.people.filter(x => x.id !== H3.hubId);
ok(await hook([ev('member.erased', H3.hubId, { emailHash: 'a'.repeat(64), walletHashes: [wh] })]) === 200 && !(await signedIn(H3)) && await signedIn(H4), 'member.erased: found by the wallet hash in the event (the hub no longer knows them), signed out');
ok(await hook([ev('member.joined', H4.hubId), ev('member.signedout', 'h_' + 'f'.repeat(16))]) === 200 && await signedIn(H4), 'other events and unknown people are ignored');
HUB.down = true; const late = ev('member.signedout', H4.hubId);
ok(await hook([late]) === 503 && await signedIn(H4), 'the hub lookup failing answers 503 (the hub sends it again), nothing ended');
HUB.down = false; ok(await hook([late]) === 200 && !(await signedIn(H4)), 'resent once the hub answers: signed out');
const E1 = await walletMember({ hub: { username: 'hookfive' } }); const E2 = await walletMember({ wallet: E1.wallet }); const g0 = HUB.got.length;
const eo = await E1.json('/api/auth/logout-everywhere', {});
const call = HUB.got.slice(g0).find(x => x.route === '/v1/sso/signout');
ok(eo.ok && eo.everywhere === true && !(await signedIn(E1)) && !(await signedIn(E2)) && call && call.body.wallet === E1.address, 'Sign out everywhere: the hub is told (signed, by wallet) and every session of that wallet here ends', { eo, call });
ok(/id="outAllBtn"[^>]*>Sign out everywhere</.test(await (await client().req('/my')).text()), '/my has a Sign out everywhere button next to Sign out');
const st2 = await admin('/api/admin/status');
ok(st2.hubEvents && st2.hubEvents.on && st2.hubEvents.stats.ended >= 5 && st2.hubEvents.stats.refused >= 2 && !JSON.stringify(st2.hubEvents).includes(HUB_SECRET), 'admin status shows the hub events (counts only, no secret)', st2.hubEvents);
}
console.log('10. spot edits (unlimited, full check, logged) + admin takedown and restore');
{ const ADM = (q, body) => u.json(q, body, { 'x-admin-token': ADMIN });
const probes = () => { try { return fs.readFileSync(PROBE_LOG, 'utf8').split('\n').filter(Boolean); } catch (e) { return []; } };
// the Node 20 lookup shape (VBB and ViralAdBlitz broke on it 2026-11-15): this copy answers an array when asked for all
const safety = require(path.join(APP, 'safety.js')); const dns = require('node:dns'); const dl = dns.lookup;
dns.lookup = (h, o, cb) => { const list = [{ address: String(h).startsWith('private.') ? '10.0.0.5' : '93.184.216.34', family: 4 }]; cb(null, o && o.all ? list : list[0].address, 4); };
const look = (h, o) => new Promise(r => safety.safeLookup(h, o, (e, a, f) => r({ e: e && e.message, a, f })));
const l1 = await look('pub.com', { all: true }), l2 = await look('pub.com', {}), l3 = await look('private.com', { all: true }); dns.lookup = dl;
ok(Array.isArray(l1.a) && l1.a[0].address === '93.184.216.34' && l2.a === '93.184.216.34' && l2.f === 4 && /private/.test(l3.e || ''), 'safeLookup: an array when asked for every address (Node 20), one address otherwise, a private address refused', { l1, l2, l3 });
const p0 = probes().length; const linkNow = async () => ((await m.json('/api/my')).spots.find(x => x.id === sid) || {}).link;
let e = await m.json('/api/my/spot/' + sid, { link: 'https://edit-one.com/a' });
ok(e.ok && e.edit && e.edit.what === 'link' && e.edit.old.link === 'https://example.org/landing' && e.edit.new.link === 'https://edit-one.com/a' && e.edit.at > 0, 'an edit is logged on the spot: old and new link, time', e.edit);
ok(probes().slice(p0).some(l => l.includes('edit-one.com')), 'the new link was fetched (the full check ran on the edit)');
let all = true; for (let i = 2; i <= 6; i++) { e = await m.json('/api/my/spot/' + sid, { link: 'https://edit-' + i + '.com/p' }); all = all && !!e.ok; }
ok(all && await linkNow() === 'https://edit-6.com/p', 'edits are unlimited: five more in a row all saved');
const refuse = [['https://down.edit-x.com/', /could not reach/], ['https://e404.edit-x.com/', /error \(404\)/], ['https://private.edit-x.com/', /private network/], ['https://redir-http.edit-x.com/', /must start with https/], ['https://bit.ly/abc', /shortener/]];
for (const [l, re] of refuse) { const r = await m.json('/api/my/spot/' + sid, { link: l }); ok(r._status === 400 && re.test(r.error || ''), 'edit refused by the full check: ' + l, r); }
ok(await linkNow() === 'https://edit-6.com/p', 'a refused edit changes nothing');
e = await m.json('/api/my/spot/' + sid, { link: 'https://redir.edit-x.com/go' }); ok(e.ok && probes().some(l => l.startsWith('https://example.org/landed')), 'a redirecting link is followed and its target checked too', e);
e = await m.json('/api/my/spot/' + sid, { img: 'https://img.edit-x.com/b.png' });
ok(e.ok && e.edit.what === 'img' && e.edit.new.img === 'https://img.edit-x.com/b.png' && probes().some(l => l.includes('img.edit-x.com')), 'an image address is downloaded and checked (468x60), then saved and logged', e.edit);
for (const [im, re] of [['https://small.edit-x.com/b.png', /468x60/], ['https://e404.edit-x.com/b.png', /answered 404/], ['https://down.edit-x.com/b.png', /could not download/]]) { const r = await m.json('/api/my/spot/' + sid, { img: im }); ok(r._status === 400 && re.test(r.error || ''), 'image refused: ' + im, r); }
e = await m.json('/api/my/spot/' + sid, { link: 'https://redir.edit-x.com/go' }); ok(e.ok && !e.edit, 'saving the same link again changes nothing and logs nothing', e);
const upE = await (await m.req('/api/my/upload?for=' + sid, { method: 'POST', headers: { 'Content-Type': 'image/png' }, body: png(468, 60) })).json(); ok(upE.ok, 'upload (edit by file)');
const mine = (await m.json('/api/my')).spots.find(x => x.id === sid);
ok(mine.edits.length === 10 && mine.edits[0].via === 'upload' && mine.edits[0].old.img === 'https://img.edit-x.com/b.png' && mine.edits[0].new.img === upE.img, 'the owner sees the newest edits first (an upload is logged too)', mine.edits.slice(0, 2));
const de = await m.json('/api/my/default', { link: 'https://e404.def-x.com/' }); const de2 = await m.json('/api/my/default', { link: 'https://def-ok.com/x' });
ok(de._status === 400 && de2.ok && de2.edit && de2.edit.old.link === 'https://example.org/default', 'the default link gets the same check and log', { de, de2 });
console.log('10b. admin takedown and restore');
const tilesOf = async () => (await v.json('/api/board')).tiles;
const t0 = await tilesOf(); const i0 = t0.findIndex(x => x.id === sid);
ok(i0 >= 0, 'the spot is on the board before', t0.map(x => x.id || x.t));
let r = await u.json('/api/admin/spots?q=%23' + sid); ok(r._status === 401, 'admin find needs the token');
const f1 = await ADM('/api/admin/spots?q=%23' + sid), f2 = await ADM('/api/admin/spots?q=' + addr[A]), f3 = await ADM('/api/admin/spots?q=alpha');
ok(f1.spots && f1.spots[0].id === sid && f1.spots[0].edits.length >= 10 && f1.spots[0].defaultEdits.length >= 1 && [f2, f3].every(f => f.spots && f.spots.some(x => x.id === sid)), 'admin finds the spot by #number, wallet and username, with its edit log', { f2: f2.spots && f2.spots.length, f3: f3.error || f3.spots.length });
ok((await ADM('/api/admin/spots?q=nobodyhere')).error, 'nothing found for an unknown username');
const P = '/api/admin/spots/' + sid;
ok((await u.json(P + '/takedown', { reason: 'test', credit: 'none' }))._status === 401, 'takedown needs the token');
ok((await ADM(P + '/takedown', { reason: '', credit: 'none' }))._status === 400, 'a reason is required');
ok((await ADM(P + '/takedown', { reason: 'Broken landing page' }))._status === 400, 'a credit choice is required');
const cb = await ADM(P + '/takedown', { reason: 'Broken landing page', credit: 'back' });
ok(cb._status === 400 && /Marty decides/.test(cb.error) && !(await ADM('/api/admin/spots?q=%23' + sid)).spots[0].down, 'credit back is refused (not defined for Downline Banners yet) and nothing is taken down', cb.error);
const views0 = f1.spots[0].views;
const td = await ADM(P + '/takedown', { reason: 'Misleading offer on the landing page', credit: 'none', by: 'smoke' });
ok(td.ok && td.down.reason === 'Misleading offer on the landing page' && td.log.action === 'takedown' && td.log.credit === 'none' && td.spot.showing.from === 'down', 'taken down, no credit; the admin view shows it', td);
ok((await ADM(P + '/takedown', { reason: 'again', credit: 'none' }))._status === 400, 'a second takedown is refused');
const t1 = await tilesOf();
ok(!t1.some(x => x.id === sid) && t1.length === t0.length && t1[i0] && t1[i0].t === 'house' && t1[i0].held === true && !t1[i0].owner, 'board: the spot is gone, a house tile holds its place, same number of tiles', t1.map(x => x.id || (x.held ? 'held' : x.t)));
ok(JSON.stringify(t1).indexOf(upE.img) < 0, 'its image shows nowhere on the board');
ok((await v.req('/go/' + sid)).headers.get('location') === '/', '/go/<spot> goes home while it is down');
const gv = client('Mozilla/5.0 gate after takedown'); const gg = await gv.json('/api/gate', undefined, { 'X-Forwarded-For': '198.51.100.240' });
ok(gg.steps && !gg.steps.some(st => st.ref === String(sid) || st.img === upE.img), 'the gate never shows it (a house site takes its step)', gg.steps && gg.steps.map(st => st.ref || st.type));
const bt = await v.json('/api/board'); await sleep(4800); await v.json('/api/board/seen', { token: bt.token });
ok((await ADM('/api/admin/spots?q=%23' + sid)).spots[0].views === views0, 'no views count while it is down');
const mineD = (await m.json('/api/my')).spots.find(x => x.id === sid);
ok(mineD.down && mineD.down.reason === 'Misleading offer on the landing page' && mineD.showing.from === 'down', 'the owner sees "Taken down" with the reason', mineD.down);
const ed = await m.json('/api/my/spot/' + sid, { link: 'https://edit-7.com/' });
const upD = await (await m.req('/api/my/upload?for=' + sid, { method: 'POST', headers: { 'Content-Type': 'image/png' }, body: png(468, 60) })).json();
ok(ed._status === 400 && /taken down/.test(ed.error) && /taken down/.test(upD.error || ''), 'the owner cannot change a spot while it is down', { ed, upD });
if (!process.env.SKIP_UI) { // the pages while it is down: My Spots at phone width, and the admin page
const { chromium } = require(PW); const br = await chromium.launch(); const errs = [];
const cx = await br.newContext({ viewport: { width: 390, height: 844 } }); await cx.addCookies([{ name: 'bl.sid', value: m.jar['bl.sid'], url: BASE }]);
const pg = await cx.newPage(); pg.on('pageerror', x => errs.push(x.message));
await pg.goto(BASE + '/my', { waitUntil: 'networkidle' }); await pg.waitForSelector('.spot-down', { timeout: 8000 }).catch(() => {});
const txt = await pg.textContent('#spots'); const wide = await pg.evaluate(() => { const e = document.getElementById('spots'); return e.scrollWidth - e.clientWidth; }); // the spots card (the payments table further down is wider than a phone on its own)
ok(/Taken down/.test(txt) && txt.includes('Misleading offer on the landing page') && wide <= 1, 'My Spots (phone): "Taken down" with the reason, no sideways scroll', { wide });
ok(await pg.isVisible('#outAllBtn'), 'My Spots: Sign out everywhere button shows'); await pg.screenshot({ path: path.join(OUT, 'my-taken-down.png'), fullPage: true });
const pa = await cx.newPage(); pa.on('pageerror', x => errs.push(x.message)); await pa.goto(BASE + '/admin', { waitUntil: 'networkidle' });
await pa.fill('#tok', ADMIN); await pa.click('#tokBtn'); await pa.waitForSelector('#adm:not([hidden])', { timeout: 8000 }).catch(() => {});
await pa.fill('#spQ', '#' + sid); await pa.click('#spFind'); await pa.waitForSelector('.adm-spot', { timeout: 8000 }).catch(() => {});
const at = await pa.textContent('#spList'); const aw = await pa.evaluate(() => document.documentElement.scrollWidth - window.innerWidth);
ok(/TAKEN DOWN/.test(at) && /Restore this spot/.test(at) && /takedown/.test(await pa.textContent('#aActions')) && aw <= 1, 'admin page (phone): finds the spot, shows it taken down with Restore, ledger row', { aw });
await pa.screenshot({ path: path.join(OUT, 'admin-takedown.png'), fullPage: true });
ok(errs.length === 0, 'no page errors (taken-down views)', errs); await br.close();
}
const acts = await ADM('/api/admin/actions');
ok(acts.actions[0].action === 'takedown' && acts.actions[0].spotId === sid && acts.actions[0].reason === 'Misleading offer on the landing page' && acts.actions[0].credit === 'none' && acts.actions[0].by === 'smoke' && acts.actions[0].username === 'alpha', 'admin ledger: who, when, reason, credit decision', acts.actions[0]);
const rs = await ADM(P + '/restore', { reason: 'Owner fixed the page', by: 'smoke' });
ok(rs.ok && !rs.spot.down && rs.spot.downs.length === 1 && rs.spot.downs[0].restoreReason === 'Owner fixed the page' && rs.log.action === 'restore', 'restore: shows again, the takedown kept in its history', rs);
ok((await ADM(P + '/restore', {}))._status === 400, 'restoring a spot that is not down is refused');
const t2 = await tilesOf(); ok(t2.some(x => x.id === sid && x.img === upE.img), 'board shows the spot again after the restore');
ok((await v.req('/go/' + sid)).headers.get('location') === 'https://redir.edit-x.com/go', '/go/<spot> sends to its link again');
ok((await m.json('/api/my/spot/' + sid, { link: 'https://edit-8.com/' })).ok, 'the owner can edit again after the restore');
ok((await ADM('/api/admin/actions')).actions[0].action === 'restore', 'the restore is on the admin ledger');
const ap = await u.req('/admin'); ok(ap.status === 200 && ap.headers.get('x-frame-options') === 'DENY' && /Take a spot down/.test(await ap.text()), '/admin page served, never framed');
}
console.log('\n' + pass + ' passed, ' + fail + ' failed. Output in ' + OUT); console.log('\n' + pass + ' passed, ' + fail + ' failed. Output in ' + OUT);
cleanup(); process.exit(fail ? 1 : 0); cleanup(); process.exit(fail ? 1 : 0);
} }
+85 -1
View File
@@ -1,6 +1,8 @@
// Link + image checks for My Spots. https only, a real public hostname, no tricks; uploads must be a real // Link + image checks for My Spots. https only, a real public hostname, no tricks; uploads must be a real
// PNG/JPG/GIF at 468x60 (or 936x120 retina) and at most 150 KB. // PNG/JPG/GIF at 468x60 (or 936x120 retina) and at most 150 KB.
const net = require('net'); const net = require('net');
const dns = require('dns');
const https = require('https');
const MAX_UPLOAD = 150 * 1024; const MAX_UPLOAD = 150 * 1024;
const BAD_HOST = /(^|\.)(localhost|local|internal|lan|home|corp|onion|test|invalid|example)$/i; const BAD_HOST = /(^|\.)(localhost|local|internal|lan|home|corp|onion|test|invalid|example)$/i;
@@ -54,4 +56,86 @@ function checkImage(buf) {
return { ok: true, info }; return { ok: true, info };
} }
module.exports = { checkLink, checkImage, imageInfo, MAX_UPLOAD }; // ---- the network part of the check (2026-11-16: every edit gets it, any number of edits) ----
// Outbound requests only to public addresses: the DNS answer used for the connection is the one checked.
function privateIp(ip) {
if (net.isIPv4(ip)) {
const [a, b] = ip.split('.').map(Number);
return a === 0 || a === 10 || a === 127 || (a === 100 && b >= 64 && b <= 127) || (a === 169 && b === 254) || (a === 172 && b >= 16 && b <= 31)
|| (a === 192 && b === 168) || (a === 192 && b === 0) || (a === 198 && (b === 18 || b === 19)) || a >= 224;
}
const s = String(ip).toLowerCase();
if (s.startsWith('::ffff:')) return privateIp(s.slice(7));
return s === '::' || s === '::1' || s.startsWith('fc') || s.startsWith('fd') || s.startsWith('fe80') || s.startsWith('ff');
}
// Node 20's https agent asks for every address (opts.all, for happy eyeballs) and expects an array back; answering with one
// address broke every link check on VBB and ViralAdBlitz (fixed there 2026-11-15). Answer in the shape asked for, private refused.
function safeLookup(host, opts, cb) {
if (typeof opts === 'function') { cb = opts; opts = {}; }
dns.lookup(host, Object.assign({}, opts, { all: true }), (err, list) => {
if (err) return cb(err);
if (!list || !list.length || list.some(a => privateIp(a.address))) return cb(new Error('private address'));
if (opts && opts.all) return cb(null, list);
cb(null, list[0].address, list[0].family);
});
}
// GET with a size cap, a timeout and no redirects followed (a redirect is reported so the caller can decide)
function get(url, maxBytes, timeoutMs) {
return new Promise(resolve => {
let done = false; const fin = v => { if (!done) { done = true; resolve(v); } };
let req;
try {
req = https.get(url, { lookup: safeLookup, timeout: timeoutMs || 5000, headers: { 'User-Agent': 'Mozilla/5.0 (compatible; DLBCheck/1.0; +https://downlinebanners.com)', Accept: '*/*' } }, res => {
const out = { status: res.statusCode, headers: res.headers, location: res.headers.location || null };
if (!maxBytes) { res.destroy(); return fin(out); }
const ch = []; let n = 0;
res.on('data', c => { n += c.length; if (n > maxBytes) { res.destroy(); return fin(Object.assign(out, { tooBig: true })); } ch.push(c); });
res.on('end', () => fin(Object.assign(out, { body: Buffer.concat(ch) })));
res.on('error', () => fin(Object.assign(out, { error: 'read' })));
});
req.on('timeout', () => { req.destroy(); fin({ error: 'timeout' }); });
req.on('error', e => fin({ error: /private address/.test(e.message) ? 'private' : 'unreachable' }));
} catch (e) { fin({ error: 'unreachable' }); }
});
}
// the target link must answer (up to 3 redirects, each one checked like the link itself). Unlike VBB, a site that refuses frames
// is fine here: the gate opens it in a new tab instead (board.frameable).
async function probeLink(url) {
let cur = url;
for (let hop = 0; hop < 4; hop++) {
const r = await get(cur, 0, 6000);
if (r.error === 'private') return { error: 'That link points to a private network address.' };
if (r.error) return { error: 'We could not reach that link. Check it opens in your browser and try again.' };
if (r.status >= 300 && r.status < 400 && r.location) {
let next; try { next = new URL(r.location, cur).toString(); } catch (e) { return { error: 'That link redirects somewhere invalid.' }; }
const c = checkLink(next, 'The page your link redirects to'); if (c.error) return c;
cur = c.url; continue;
}
if (r.status >= 400) return { error: 'That link answered with an error (' + r.status + '). Use a page that loads.' };
return { ok: true };
}
return { error: 'That link redirects too many times.' };
}
// an https image address: downloaded once and checked like an upload (468x60 or 936x120, 150 KB). The spot keeps the address
// (a LinkSpin Banner Spin image rotates, so it is never copied). -> { ok, info } or { error }
async function probeImage(url) {
let cur = url, r = null;
for (let hop = 0; hop < 4; hop++) { // up to 3 redirects, each one checked like the address itself
r = await get(cur, MAX_UPLOAD, 6000);
if (!r.error && r.status >= 300 && r.status < 400 && r.location) {
let next; try { next = new URL(r.location, cur).toString(); } catch (e) { return { error: 'That image address redirects somewhere invalid.' }; }
const c = checkLink(next, 'The address your image redirects to'); if (c.error) return c;
cur = c.url; r = null; continue;
}
break;
}
if (!r) return { error: 'That image address redirects too many times.' };
if (r.error === 'private') return { error: 'That image address points to a private network address.' };
if (r.error) return { error: 'We could not download that image. Check the address or upload the file instead.' };
if (r.tooBig) return { error: 'That image is over 150 KB.' };
if (r.status !== 200) return { error: 'The image address answered ' + r.status + '. Use a direct link to the image file, or upload it.' };
const c = checkImage(r.body); if (c.error) return c;
return { ok: true, info: c.info };
}
module.exports = { checkLink, checkImage, imageInfo, privateIp, safeLookup, probeLink, probeImage, MAX_UPLOAD };
+147 -21
View File
@@ -16,6 +16,7 @@ const { iface } = require('./abi');
const dlbnas = require('./dlbnas'); // Network Ad Space: standing house banner + finishing spots still owed views after 30 days (2026-11-13) const dlbnas = require('./dlbnas'); // Network Ad Space: standing house banner + finishing spots still owed views after 30 days (2026-11-13)
const refuelspots = require('./refuelspots'); // refuel spots: $50+ Monthly Refuels earn a spot, engine wallet pays (2026-11-13) const refuelspots = require('./refuelspots'); // refuel spots: $50+ Monthly Refuels earn a spot, engine wallet pays (2026-11-13)
const netsites = require('./netsites'); // footer network list from the hub (trust pack 2026-11-14) const netsites = require('./netsites'); // footer network list from the hub (trust pack 2026-11-14)
const netdeals = require('./netdeals'); // Network Weekend ribbon feed from the hub (2026-11-17)
const tgproof = require('./tgproof'); // payment proof in the Telegram payments topic, one message per spot sale (2026-11-13) const tgproof = require('./tgproof'); // payment proof in the Telegram payments topic, one message per spot sale (2026-11-13)
const hubreport = require('./hubreport'); // network hub, shadow mode: members reported by wallet (2026-11-13), off unless HUB_ENABLED const hubreport = require('./hubreport'); // network hub, shadow mode: members reported by wallet (2026-11-13), off unless HUB_ENABLED
const chatbot = require('./chatbot'); // the site assistant (2026-11-15): chatcore.js + kb.js + the network knowledge base (netkb.js) const chatbot = require('./chatbot'); // the site assistant (2026-11-15): chatcore.js + kb.js + the network knowledge base (netkb.js)
@@ -40,7 +41,7 @@ const hmac = s => crypto.createHmac('sha256', SECRET).update(s).digest('hex').sl
// ---- http helpers ---- // ---- http helpers ----
const MIME = { '.html': 'text/html; charset=utf-8', '.css': 'text/css', '.js': 'text/javascript', '.png': 'image/png', '.jpg': 'image/jpeg', 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' }; '.gif': 'image/gif', '.svg': 'image/svg+xml', '.ico': 'image/x-icon', '.json': 'application/json', '.txt': 'text/plain; charset=utf-8', '.mp4': 'video/mp4', '.webm': 'video/webm' };
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; " 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 " + "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; " + "https://*.reown.com wss://*.reown.com https://*.reown.org wss://*.reown.org https://*.web3modal.org https://*.drpc.org https://*.publicnode.com https://*.coinbase.com; "
@@ -55,6 +56,19 @@ function sendFile(res, file, extra) {
res.end(data); res.end(data);
}); });
} }
// video needs byte ranges (Safari will not play it without them); tutorial videos 2026-11-18
function sendMedia(req, res, file) {
fs.stat(file, (err, st) => {
if (err || !st.isFile()) { res.writeHead(404, headers({ 'Content-Type': 'text/plain' })); return res.end('Not found'); }
const base = { 'Content-Type': MIME[path.extname(file).toLowerCase()], 'Accept-Ranges': 'bytes', 'Cache-Control': 'public, max-age=86400' };
const m = /^bytes=(\d*)-(\d*)$/.exec(req.headers.range || '');
if (!m || (!m[1] && !m[2])) { res.writeHead(200, headers(Object.assign(base, { 'Content-Length': st.size }))); return fs.createReadStream(file).pipe(res); }
let a = m[1] ? +m[1] : Math.max(0, st.size - +m[2]), b = m[1] && m[2] ? Math.min(+m[2], st.size - 1) : st.size - 1;
if (a > b || a >= st.size) { res.writeHead(416, headers({ 'Content-Range': 'bytes */' + st.size })); return res.end(); }
res.writeHead(206, headers(Object.assign(base, { 'Content-Range': 'bytes ' + a + '-' + b + '/' + st.size, 'Content-Length': b - a + 1 })));
fs.createReadStream(file, { start: a, end: b }).pipe(res);
});
}
function readRaw(req, max) { function readRaw(req, max) {
return new Promise((resolve, reject) => { const ch = []; let n = 0; return new Promise((resolve, reject) => { const ch = []; let n = 0;
// over the limit: keep draining (so the 400 reaches the client) but store nothing; cut the socket only far past it // over the limit: keep draining (so the 400 reaches the client) but store nothing; cut the socket only far past it
@@ -92,6 +106,7 @@ function limited(req, name, max, windowMs) {
// verify membership"; hubpeople.js, cached 5 minutes); InstantAdPay's GET /api/network/member ?u= / ?a= only when the hub is // verify membership"; hubpeople.js, cached 5 minutes); InstantAdPay's GET /api/network/member ?u= / ?a= only when the hub is
// unreachable (cached an hour, misses too; a failed call is not cached). A person the hub does not know is unknown here too. // unreachable (cached an hour, misses too; a failed call is not cached). A person the hub does not know is unknown here too.
const hubpeople = require('./hubpeople'); const hubpeople = require('./hubpeople');
const hubevents = require('./hubevents'); // network hub hook (2026-11-16): sign-out-everywhere, block and erase end sessions here
const netCache = new Map(); const netCache = new Map();
const fromHub = p => { const a = hubpeople.wallet(p); return a ? { address: a, username: p.username ? String(p.username) : null, hubId: p.id || null, via: 'hub' } : null; }; const fromHub = p => { const a = hubpeople.wallet(p); return a ? { address: a, username: p.username ? String(p.username) : null, hubId: p.id || null, via: 'hub' } : null; };
async function netMember(q) { async function netMember(q) {
@@ -221,10 +236,12 @@ async function visitStep(role, ref, img, link, title) {
async function makeGate(req) { async function makeGate(req) {
const vk = visitorKey(req); const steps = []; const vk = visitorKey(req); const steps = [];
const sp = sponsorOf(req); const sSpot = sp && board.newestOf(sp); const sp = sponsorOf(req); const sSpot = sp && board.newestOf(sp);
if (sSpot) { const cr = board.creative(sSpot); steps.push(await visitStep('sponsor', sSpot.id, cr.img, cr.link, 'Your sponsor\'s newest spot')); } // a spot the admin took down (2026-11-16) keeps its step, but the step shows a house site (never the spot's own banner or link)
const stepOf = async (role, s, title) => { const cr = board.creative(s); return cr.from === 'down' ? visitStep(role, 'h-' + cr.key, cr.img, cr.link, cr.title) : visitStep(role, s.id, cr.img, cr.link, title); };
if (sSpot) steps.push(await stepOf('sponsor', sSpot, 'Your sponsor\'s newest spot'));
steps.push({ type: 'board', tiles: board.pick(), seconds: C.gateBoardSeconds }); steps.push({ type: 'board', tiles: board.pick(), seconds: C.gateBoardSeconds });
const nw = board.newest(3, sSpot ? [sSpot.id] : []); const nw = board.newest(3, sSpot ? [sSpot.id] : []);
for (const s of nw) { const cr = board.creative(s); steps.push(await visitStep('newest', s.id, cr.img, cr.link, 'Spot #' + s.id)); } for (const s of nw) steps.push(await stepOf('newest', s, 'Spot #' + s.id));
const house = cfgMod.house().filter(h => h.link.startsWith('https://')); let hi = 0; const house = cfgMod.house().filter(h => h.link.startsWith('https://')); let hi = 0;
while (steps.filter(x => x.role === 'newest' || x.role === 'house').length < 3 && house.length) { const h = house[hi++ % house.length]; steps.push(await visitStep('house', 'h-' + h.key, h.img, h.link, h.title)); if (hi > 6) break; } while (steps.filter(x => x.role === 'newest' || x.role === 'house').length < 3 && house.length) { const h = house[hi++ % house.length]; steps.push(await visitStep('house', 'h-' + h.key, h.img, h.link, h.title)); if (hi > 6) break; }
const gid = crypto.randomBytes(12).toString('hex'); const gid = crypto.randomBytes(12).toString('hex');
@@ -243,7 +260,44 @@ function spotView(s) {
const left = Math.max(0, C.spotDays - Math.floor((now - s.boughtAt) / 86400000)); const left = Math.max(0, C.spotDays - Math.floor((now - s.boughtAt) / 86400000));
return { id: s.id, kind: s.kind, boughtAt: s.boughtAt, tx: s.tx, valueWei: s.valueWei, views: v.total, gateViews: v.gate, owed: C.viewsOwed, return { id: s.id, kind: s.kind, boughtAt: s.boughtAt, tx: s.tx, valueWei: s.valueWei, views: v.total, gateViews: v.gate, owed: C.viewsOwed,
clicks: store.clicks(s.id), daysLeft: left, delivering: s.kind !== 3 && left > 0 && v.total < C.viewsOwed, clicks: store.clicks(s.id), daysLeft: left, delivering: s.kind !== 3 && left > 0 && v.total < C.viewsOwed,
img: m.img || '', link: m.link || '', showing: cr }; img: m.img || '', link: m.link || '', showing: cr,
down: (dn => dn ? { at: dn.at, reason: dn.reason } : null)(store.spotDown(s.id)), // taken down by the admin: the owner sees the reason
edits: store.spotEdits(s.id).slice(-10).reverse() };
}
// ---- spot edits (Marty 2026-11-16): unlimited, every one gets the full check and is logged on the spot ----
// checkLink first; then (LINK_PROBE on) the link must answer (safety.probeLink, up to 3 checked redirects) and an image address
// must download as a real 468x60 image (safety.probeImage). The one exception: the Banner Spin image + click link LinkSpin's signed
// answer just handed this member (/api/my/lsspins/use) are not fetched (fetching the click link would count a click on LinkSpin).
const lsVouched = new Map(); // wallet -> { link, img, at }
async function checkEdit(me, b, linkLabel) {
const out = {};
if (b.link !== undefined) { if (b.link === '') out.link = ''; else { const r = safety.checkLink(b.link, linkLabel); if (r.error) return r; out.link = r.url; } }
if (b.img !== undefined && !String(b.img).startsWith('/art/u/')) { if (b.img === '') out.img = ''; else { const r = safety.checkLink(b.img, 'Image URL'); if (r.error) return r; out.img = r.url; } }
if (C.linkProbe) {
const v = lsVouched.get(me); const vouched = x => !!v && Date.now() - v.at < 30 * 60000 && (x === v.link || x === v.img);
if (out.link && !vouched(out.link)) { const pr = await safety.probeLink(out.link.replace(/\{(clickid|spot|type)\}/g, 'x')); if (pr.error) return pr; }
if (out.img && !vouched(out.img)) { const pr = await safety.probeImage(out.img); if (pr.error) return pr; }
}
return { ok: true, out };
}
// one log row per real change: old and new link and image, when, how (edit, upload)
function logChange(kind, key, before, patch, via) {
const o = { img: (before && before.img) || '', link: (before && before.link) || '' }; const n = Object.assign({}, o, patch);
const what = ['link', 'img'].filter(k => o[k] !== n[k]); if (!what.length) return null;
const row = { what: what.length === 2 ? 'both' : what[0], old: o, new: { img: n.img, link: n.link }, via };
return kind === 'spot' ? store.logSpotEdit(key, row) : store.logDefaultEdit(key, row);
}
const DOWN_EDIT = 'This spot was taken down, so it cannot be changed. The reason is shown on the spot.';
// "credit back" has no meaning on Downline Banners yet (2026-11-16): a spot is a $5 on-chain purchase (POL cannot be refunded) and
// the site has no free replacement spot or post credit. Marty decides; until then a takedown is "no credit" only.
const CREDIT_BACK_PENDING = 'Credit back is not available on Downline Banners yet: a spot is a $5 on-chain purchase and this site has no free replacement spot or post credit. Marty decides what credit back means; until then choose credit: "none".';
// the admin view of a spot: what it shows, its views, every edit, and its takedown history
async function adminSpot(s) {
const m = store.spotMeta(s.id) || {}; const v0 = store.views(s.id);
return { id: s.id, owner: s.owner, username: await nameOf(s.owner).catch(() => null), kind: s.kind, boughtAt: s.boughtAt, tx: s.tx,
img: m.img || '', link: m.link || '', showing: board.creative(s), views: v0.total + dlbnas.spotServed(s.id), owed: C.viewsOwed, clicks: store.clicks(s.id),
down: store.spotDown(s.id), downs: store.spotDowns(s.id), edits: store.spotEdits(s.id).slice(-50).reverse(), defaultEdits: store.defaultEdits(s.owner).slice(-10).reverse() };
} }
async function myData(addr) { async function myData(addr) {
const a = addr.toLowerCase(); const a = addr.toLowerCase();
@@ -267,6 +321,8 @@ networksso.init({ self: 'bannerline', peer: 'iap', peerBase: () => C.iapBase, fr
accept: async (email, req, v) => (v && v.wallet ? { ok: true } : { fallback: 'no wallet in the token' }), accept: async (email, req, v) => (v && v.wallet ? { ok: true } : { fallback: 'no wallet in the token' }),
signIn: async (email, req, v) => { if (v.name) netCache.set('a:' + v.wallet, { at: Date.now(), m: { address: v.wallet, username: v.name } }); return cookie('bl.sid', store.mintSession(v.wallet), store.SESSION_TTL / 1000, true); }, signIn: async (email, req, v) => { if (v.name) netCache.set('a:' + v.wallet, { at: Date.now(), m: { address: v.wallet, username: v.name } }); return cookie('bl.sid', store.mintSession(v.wallet), store.SESSION_TTL / 1000, true); },
landing: to => to, signinPath: to => to }); landing: to => to, signinPath: to => to });
// the hub's member.signedout / member.blocked / member.erased: that person's sessions here end (by any of their wallets)
hubevents.init({ dataDir: C.dataDir, site: 'bannerline', end: who => store.endSessions(x => who.match(x), who.before) });
const server = http.createServer(async (req, res) => { const server = http.createServer(async (req, res) => {
const u = new URL(req.url, 'http://x'); const p = u.pathname; const u = new URL(req.url, 'http://x'); const p = u.pathname;
@@ -289,30 +345,35 @@ const server = http.createServer(async (req, res) => {
// old site links (2026-11-13): referral links were /?<old username> (bare query) and pages were *.php. An old username maps to // old site links (2026-11-13): referral links were /?<old username> (bare query) and pages were *.php. An old username maps to
// the same person's network username (oldrefs.json, matched by email); a page address goes home. // the same person's network username (oldrefs.json, matched by email); a page address goes home.
if (/\.php$/i.test(p) || (p === '/' && /^[A-Za-z0-9_.-]{2,40}$/.test(u.search.slice(1).split('&')[0]))) { // "&fbclid=..." may follow if (/\.php$/i.test(p) || (p === '/' && /^[A-Za-z0-9_.-]{2,40}$/.test(u.search.slice(1).split('&')[0]))) { // "&fbclid=..." may follow
const old = /\.php$/i.test(p) && p !== '/index.php' ? '' : u.search.slice(1).split('&')[0].toLowerCase(); // old splash/landing pages carried the referral as ?r=<old username> (2026-11-17: /splashpg.php?r= kept the ref like VAS)
const lp = p.toLowerCase(); const rq = String(u.searchParams.get('r') || '');
const old = (lp === '/splashpg.php' || lp === '/lcp.php') ? (/^[A-Za-z0-9_.-]{2,40}$/.test(rq) ? rq.toLowerCase() : '')
: /\.php$/i.test(p) && lp !== '/index.php' ? '' : u.search.slice(1).split('&')[0].toLowerCase();
let OR = {}; try { OR = JSON.parse(fs.readFileSync(path.join(C.dataDir, 'oldrefs.json'), 'utf8')); } catch (e) {} let OR = {}; try { OR = JSON.parse(fs.readFileSync(path.join(C.dataDir, 'oldrefs.json'), 'utf8')); } catch (e) {}
const net = old && OR[old]; res.writeHead(301, { Location: net ? '/?ref=' + encodeURIComponent(net) : '/', 'Cache-Control': 'no-store' }); return res.end(); const net = old && OR[old]; res.writeHead(301, { Location: net ? '/?ref=' + encodeURIComponent(net) : '/', 'Cache-Control': 'no-store' }); return res.end();
} }
const PAGES = { '/': 'index.html', '/board': 'board.html', '/join': 'join.html', '/my': 'my.html', '/how': 'how.html', '/ledger': 'ledger.html', '/contract': 'contract.html', const PAGES = { '/': 'index.html', '/board': 'board.html', '/join': 'join.html', '/my': 'my.html', '/how': 'how.html', '/ledger': 'ledger.html', '/contract': 'contract.html',
'/terms': 'terms.html', '/disclaimer': 'disclaimer.html', '/privacy': 'privacy.html' }; // legal pages: trust pack 2026-11-14 '/terms': 'terms.html', '/disclaimer': 'disclaimer.html', '/privacy': 'privacy.html', '/admin': 'admin.html',
'/guides': 'guides.html', '/guides/is-it-legit': 'guides-legit.html', '/guides/free-account': 'guides-free.html', '/guides/faq': 'guides-faq.html' }; // legal pages: trust pack 2026-11-14; /admin 2026-11-16; Guides 2026-11-17
if (PAGES[p]) { if (PAGES[p]) {
const set = []; const set = [];
if (setVid) set.push(setVid); if (setVid) set.push(setVid);
if (u.searchParams.get('ref')) { const a = await resolveRef(u.searchParams.get('ref')); if (a) set.push(cookie('bl.ref', a, 90 * 86400, false)); } if (u.searchParams.get('ref')) { const a = await resolveRef(u.searchParams.get('ref')); if (a) set.push(cookie('bl.ref', a, 90 * 86400, false)); }
const ex = set.length ? { 'Set-Cookie': set } : {}; const ex = set.length ? { 'Set-Cookie': set } : {};
if (p === '/my') ex['X-Frame-Options'] = 'DENY'; // member board: never framed (public pages stay frameable for traffic exchanges) if (p === '/my' || p === '/admin') ex['X-Frame-Options'] = 'DENY'; // member board + admin: never framed (public pages stay frameable for traffic exchanges)
return sendFile(res, path.join(PUB, PAGES[p]), ex); 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 (/^\/r\/[^/]+$/.test(p)) { res.writeHead(302, { Location: '/?ref=' + encodeURIComponent(decodeURIComponent(p.slice(3))) }); return res.end(); }
// sitemap (2026-11-13, SEO): the public pages only // sitemap (2026-11-13, SEO): the public pages only
if (p === '/sitemap.xml') { if (p === '/sitemap.xml') {
const day = new Date().toISOString().slice(0, 10); const day = new Date().toISOString().slice(0, 10);
const urls = ['/', '/board', '/how', '/ledger', '/contract', '/join', '/promote', '/terms', '/disclaimer', '/privacy'].map(u => '<url><loc>https://' + C.site + u + '</loc><lastmod>' + day + '</lastmod></url>').join(''); const urls = ['/', '/board', '/how', '/ledger', '/contract', '/join', '/promote', '/guides', '/guides/is-it-legit', '/guides/free-account', '/guides/faq', '/terms', '/disclaimer', '/privacy'].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' })); 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>'); 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') { if (p.startsWith('/assets/') || p.startsWith('/art/house-') || /^\/art\/how-it-works\.(mp4|jpg)$/.test(p) || 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(); } const f = path.normalize(path.join(PUB, p)); if (!f.startsWith(PUB)) { res.writeHead(400); return res.end(); }
if (/\.(mp4|webm)$/i.test(f)) return sendMedia(req, res, f);
return sendFile(res, f); return sendFile(res, f);
} }
if (p.startsWith('/art/u/')) { if (p.startsWith('/art/u/')) {
@@ -350,6 +411,7 @@ const server = http.createServer(async (req, res) => {
// -- public API // -- public API
if (p === '/api/network-sites' && req.method === 'GET') return netsites.handle(req, res); if (p === '/api/network-sites' && req.method === 'GET') return netsites.handle(req, res);
if (p === '/api/network-deals' && req.method === 'GET') return netdeals.handle(req, res, 'dlb'); // Network Weekend ribbon (2026-11-17)
if (p === '/api/config' && req.method === 'GET') { if (p === '/api/config' && req.method === 'GET') {
return json(res, 200, { site: C.site, chainId: C.chainId, chainName: C.chainName, contract: C.contract, rpc: C.publicRpc, explorer: C.explorer, return json(res, 200, { site: C.site, chainId: C.chainId, chainName: C.chainName, contract: C.contract, rpc: C.publicRpc, explorer: C.explorer,
walletConnectProjectId: C.walletConnectProjectId, viewsOwed: C.viewsOwed, spotDays: C.spotDays, priceUsd: 5, ready: !!C.contract, sel: SEL }, extra); walletConnectProjectId: C.walletConnectProjectId, viewsOwed: C.viewsOwed, spotDays: C.spotDays, priceUsd: 5, ready: !!C.contract, sel: SEL }, extra);
@@ -452,6 +514,17 @@ const server = http.createServer(async (req, res) => {
const s = session(req); if (s) store.dropSession(s.token); const s = session(req); if (s) store.dropSession(s.token);
return json(res, 200, { ok: true }, { 'Set-Cookie': [cookie('bl.sid', '', 0, true), networksso.offCookie()] }); // signed out stays signed out here for 12 hours return json(res, 200, { ok: true }, { 'Set-Cookie': [cookie('bl.sid', '', 0, true), networksso.offCookie()] }); // signed out stays signed out here for 12 hours
} }
// "Sign out everywhere" (2026-11-16): the hub ends every network sign-in of this member and tells every hooked site; every
// session of this wallet here ends now. Same-origin POST only (SameSite=Lax session cookie).
if (p === '/api/auth/logout-everywhere' && req.method === 'POST') {
const s = session(req); let hub = { ok: false };
if (s) { hub = await networksso.signOutEverywhere(s); store.endSessions(x => x.address === s.address, Date.now() + 1000); }
return json(res, 200, { ok: true, everywhere: !!hub.ok }, { 'Set-Cookie': [cookie('bl.sid', '', 0, true), networksso.offCookie()] });
}
if (p === '/api/hub/events' && req.method === 'POST') {
let raw = ''; try { raw = (await readRaw(req, 256 * 1024)).toString('utf8'); } catch (e) { return json(res, 413, { error: 'too big' }); }
const r = await hubevents.receive(req.headers, raw); return json(res, r.status, r.body);
}
if (p === '/api/me' && req.method === 'GET') { if (p === '/api/me' && req.method === 'GET') {
// username / refName (Marty 2026-11-15): the footer's network links carry a referral username, the member's own network // username / refName (Marty 2026-11-15): the footer's network links carry a referral username, the member's own network
// username when signed in, else the sponsor's (usernames only, never the wallet) // username when signed in, else the sponsor's (usernames only, never the wallet)
@@ -468,32 +541,40 @@ const server = http.createServer(async (req, res) => {
const me = s.address; const me = s.address;
if (p === '/api/my' && req.method === 'GET') return json(res, 200, await myData(me)); if (p === '/api/my' && req.method === 'GET') return json(res, 200, await myData(me));
if (p === '/api/my/lsspins' && req.method === 'GET') { const r = await lsSpins({ wallet: me }); return json(res, r.error ? 502 : 200, r); } if (p === '/api/my/lsspins' && req.method === 'GET') { const r = await lsSpins({ wallet: me }); return json(res, r.error ? 502 : 200, r); }
if (p === '/api/my/lsspins/use' && req.method === 'POST') { const b = await readBody(req); const r = await lsSpins({ wallet: me, spinId: Number(b.spinId) || 0 }); return json(res, r.error ? 400 : 200, r); } if (p === '/api/my/lsspins/use' && req.method === 'POST') { const b = await readBody(req); const r = await lsSpins({ wallet: me, spinId: Number(b.spinId) || 0 });
if (!r.error && r.use) { const lk = safety.checkLink(r.use.link, 'link'), im = safety.checkLink(r.use.img, 'img'); if (lk.ok && im.ok) lsVouched.set(me, { link: lk.url, img: im.url, at: Date.now() }); if (lsVouched.size > 20000) lsVouched.clear(); }
return json(res, r.error ? 400 : 200, r); }
let m = /^\/api\/my\/spot\/(\d+)$/.exec(p); let m = /^\/api\/my\/spot\/(\d+)$/.exec(p);
if (m && req.method === 'POST') { if (m && req.method === 'POST') {
const sp = chain.spot(m[1]); if (!sp || sp.owner !== me) return json(res, 403, { error: 'That spot is not yours.' }); const sp = chain.spot(m[1]); if (!sp || sp.owner !== me) return json(res, 403, { error: 'That spot is not yours.' });
const b = await readBody(req); const out = {}; if (store.spotDown(sp.id)) return json(res, 400, { error: DOWN_EDIT });
if (b.link !== undefined) { if (b.link === '') out.link = ''; else { const r = safety.checkLink(b.link, 'Target link'); if (r.error) return json(res, 400, r); out.link = r.url; } } if (limited(req, 'edit', 120, 3600000)) return json(res, 429, { error: 'Too many changes this hour. Try again in a while.' }); // each change fetches the link
if (b.img !== undefined && !String(b.img).startsWith('/art/u/')) { if (b.img === '') out.img = ''; else { const r = safety.checkLink(b.img, 'Image URL'); if (r.error) return json(res, 400, r); out.img = r.url; } } const b = await readBody(req); const ck = await checkEdit(me, b, 'Target link'); if (ck.error) return json(res, 400, ck);
return json(res, 200, { ok: true, meta: store.setSpotMeta(sp.id, out) }); if (store.spotDown(sp.id)) return json(res, 400, { error: DOWN_EDIT }); // re-checked after the fetches
const before = Object.assign({}, store.spotMeta(sp.id) || {});
const meta = store.setSpotMeta(sp.id, ck.out); const edit = logChange('spot', sp.id, before, ck.out, 'edit');
return json(res, 200, { ok: true, meta, edit });
} }
if (p === '/api/my/default' && req.method === 'POST') { if (p === '/api/my/default' && req.method === 'POST') {
const b = await readBody(req); const out = {}; if (limited(req, 'edit', 120, 3600000)) return json(res, 429, { error: 'Too many changes this hour. Try again in a while.' });
if (b.link !== undefined) { if (b.link === '') out.link = ''; else { const r = safety.checkLink(b.link, 'Default link'); if (r.error) return json(res, 400, r); out.link = r.url; } } const b = await readBody(req); const ck = await checkEdit(me, b, 'Default link'); if (ck.error) return json(res, 400, ck);
if (b.img !== undefined && !String(b.img).startsWith('/art/u/')) { if (b.img === '') out.img = ''; else { const r = safety.checkLink(b.img, 'Image URL'); if (r.error) return json(res, 400, r); out.img = r.url; } } const before = Object.assign({}, store.memberDefault(me) || {});
return json(res, 200, { ok: true, defaults: store.setMemberDefault(me, out) }); const defaults = store.setMemberDefault(me, ck.out); const edit = logChange('default', me, before, ck.out, 'edit');
return json(res, 200, { ok: true, defaults, edit });
} }
if (p === '/api/my/upload' && req.method === 'POST') { if (p === '/api/my/upload' && req.method === 'POST') {
if (limited(req, 'upload', 40, 3600000)) return json(res, 429, { error: 'Too many uploads this hour.' }); if (limited(req, 'upload', 40, 3600000)) return json(res, 429, { error: 'Too many uploads this hour.' });
const target = u.searchParams.get('for') || ''; const target = u.searchParams.get('for') || '';
let sp = null; let sp = null;
if (target !== 'default') { sp = chain.spot(target); if (!sp || sp.owner !== me) return json(res, 403, { error: 'That spot is not yours.' }); } if (target !== 'default') { sp = chain.spot(target); if (!sp || sp.owner !== me) return json(res, 403, { error: 'That spot is not yours.' }); if (store.spotDown(sp.id)) return json(res, 400, { error: DOWN_EDIT }); }
let buf; try { buf = await readRaw(req, safety.MAX_UPLOAD + 1); } catch (e) { return json(res, 400, { error: 'The file is over 150 KB.' }); } let buf; try { buf = await readRaw(req, safety.MAX_UPLOAD + 1); } catch (e) { return json(res, 400, { error: 'The file is over 150 KB.' }); }
const r = safety.checkImage(buf); if (r.error) return json(res, 400, r); const r = safety.checkImage(buf); if (r.error) return json(res, 400, r);
const name = (sp ? 's' + sp.id : 'd' + me.slice(2, 10)) + '-' + crypto.randomBytes(5).toString('hex') + r.info.ext; const name = (sp ? 's' + sp.id : 'd' + me.slice(2, 10)) + '-' + crypto.randomBytes(5).toString('hex') + r.info.ext;
fs.writeFileSync(path.join(C.dataDir, 'art', name), buf); fs.writeFileSync(path.join(C.dataDir, 'art', name), buf);
const img = '/art/u/' + name; const img = '/art/u/' + name;
const before = Object.assign({}, (sp ? store.spotMeta(sp.id) : store.memberDefault(me)) || {});
if (sp) store.setSpotMeta(sp.id, { img }); else store.setMemberDefault(me, { img }); if (sp) store.setSpotMeta(sp.id, { img }); else store.setMemberDefault(me, { img });
logChange(sp ? 'spot' : 'default', sp ? sp.id : me, before, { img }, 'upload');
return json(res, 200, { ok: true, img }); return json(res, 200, { ok: true, img });
} }
return json(res, 404, { error: 'Not found' }); return json(res, 404, { error: 'Not found' });
@@ -537,7 +618,7 @@ const server = http.createServer(async (req, res) => {
// -- admin (ADMIN_TOKEN header): keeper preview + index status. No key material is ever returned. // -- admin (ADMIN_TOKEN header): keeper preview + index status. No key material is ever returned.
if (p === '/api/admin/status' && req.method === 'GET') { if (p === '/api/admin/status' && req.method === 'GET') {
const tok = process.env.ADMIN_TOKEN; if (!tok || req.headers['x-admin-token'] !== tok) return json(res, 401, { error: 'no' }); const tok = process.env.ADMIN_TOKEN; if (!tok || req.headers['x-admin-token'] !== tok) return json(res, 401, { error: 'no' });
return json(res, 200, { index: chain.status(), totals: chain.totals(), keeper: keeper.statusInfo(), hub: hubreport.view(), hubLookup: hubpeople.view(), refuelSpots: refuelspots.view(), nas: dlbnas.view() }); return json(res, 200, { index: chain.status(), totals: chain.totals(), keeper: keeper.statusInfo(), hub: hubreport.view(), hubLookup: hubpeople.view(), hubEvents: hubevents.view(), refuelSpots: refuelspots.view(), nas: dlbnas.view() });
} }
// -- admin: the network hub's member lookup (Marty 2026-11-14, read-only). GET ?q=<wallet> | <spot id>. No email lives here. // -- admin: the network hub's member lookup (Marty 2026-11-14, read-only). GET ?q=<wallet> | <spot id>. No email lives here.
@@ -555,6 +636,51 @@ const server = http.createServer(async (req, res) => {
gifted: chain.fundBuys().filter(f => f.giftee === a), contract: C.contract, explorer: C.explorer })); gifted: chain.fundBuys().filter(f => f.giftee === a), contract: C.contract, explorer: C.explorer }));
} }
// -- admin: spot takedown and restore (Marty 2026-11-16, the Viral Banner Blitz way). The spot is a $5 on-chain purchase: the
// contract is never touched; only what this site shows and counts changes. Taken down = hidden everywhere at once (board, gate,
// /go, Network Ad Space), its place held by a house tile so nobody else moves, no views or clicks counted while down; the owner
// sees "Taken down" with the reason; one admin ledger row per takedown and restore.
if (p === '/api/admin/spots' || p === '/api/admin/actions' || /^\/api\/admin\/spots\/\d{1,9}\/(takedown|restore)$/.test(p)) {
const tok = process.env.ADMIN_TOKEN; if (!tok || req.headers['x-admin-token'] !== tok) return json(res, 401, { error: 'no' });
if (p === '/api/admin/actions' && req.method === 'GET') return json(res, 200, { actions: store.adminLogs(Math.min(500, Math.max(1, Number(u.searchParams.get('n')) || 100))) });
// GET ?q=#<id> | <id> | <wallet> | <username>
if (p === '/api/admin/spots' && req.method === 'GET') {
const q = String(u.searchParams.get('q') || '').trim(); let list = [];
if (/^#?\d{1,9}$/.test(q)) { const sp = chain.spot(Number(q.replace('#', ''))); if (sp) list = [sp]; }
else if (ADDR_RE.test(q)) list = chain.spotsOf(q.toLowerCase());
else if (/^@?[a-zA-Z0-9_]{1,20}$/.test(q)) {
const name = q.replace(/^@/, '').toLowerCase(); const al = Object.entries(aliases()).find(([, v]) => v && String(v.username || '').toLowerCase() === name);
const a = al ? al[0] : await resolveRef(name).catch(() => null); if (a) list = chain.spotsOf(a);
}
if (!list.length) return json(res, 404, { error: 'No spot found for that.' });
return json(res, 200, { spots: await Promise.all(list.slice(0, 100).map(adminSpot)) });
}
const tk = /^\/api\/admin\/spots\/(\d{1,9})\/(takedown|restore)$/.exec(p);
if (tk && req.method === 'POST') {
const sp = chain.spot(Number(tk[1])); if (!sp) return json(res, 404, { error: 'No such spot.' });
const b = await readBody(req); const by = String(b.by || 'admin').replace(/[^\w .@-]/g, '').slice(0, 40) || 'admin';
const reason = String(b.reason || '').replace(/[\u0000-\u001f\u007f<>]/g, '').replace(/\s+/g, ' ').trim();
const username = await nameOf(sp.owner).catch(() => null);
if (tk[2] === 'takedown') {
if (store.spotDown(sp.id)) return json(res, 400, { error: 'That spot is already taken down.' });
if (sp.kind === 3) return json(res, 400, { error: 'A fund-kept spot never shows, so there is nothing to take down.' });
if (reason.length < 3 || reason.length > 300) return json(res, 400, { error: 'A reason is required (3 to 300 characters). The owner sees it.' });
if (b.credit === 'back') return json(res, 400, { error: CREDIT_BACK_PENDING });
if (b.credit !== 'none') return json(res, 400, { error: 'Choose credit: "none". (Credit back is not available on Downline Banners yet.)' });
const rec = store.setSpotDown(sp.id, { at: Date.now(), by, reason, credit: 'none', views: store.views(sp.id).total });
const nas = await dlbnas.pause(sp.id).catch(e => 'error: ' + String(e.message).slice(0, 80));
const e = store.adminLog({ action: 'takedown', spotId: sp.id, owner: sp.owner, username, by, reason, credit: 'none', nas });
return json(res, 200, { ok: true, spot: await adminSpot(sp), down: rec, log: e });
}
const was = store.spotDown(sp.id); if (!was) return json(res, 400, { error: 'That spot is not taken down.' });
store.clearSpotDown(sp.id, { restoredAt: Date.now(), restoredBy: by, restoreReason: reason || null });
const nas = await dlbnas.resume(sp.id).catch(e => 'error: ' + String(e.message).slice(0, 80));
const e = store.adminLog({ action: 'restore', spotId: sp.id, owner: sp.owner, username, by, reason: reason || null, credit: 'none given', nas });
return json(res, 200, { ok: true, spot: await adminSpot(sp), log: e });
}
return json(res, 404, { error: 'Not found' });
}
if (p.startsWith('/api/')) return json(res, 404, { error: 'Not found' }); if (p.startsWith('/api/')) return json(res, 404, { error: 'Not found' });
res.writeHead(404, headers({ 'Content-Type': 'text/html; charset=utf-8' })); res.writeHead(404, headers({ 'Content-Type': 'text/html; charset=utf-8' }));
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>' 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>'
@@ -589,7 +715,7 @@ function weekLine() {
hubreport.init({ dataDir: C.dataDir, members: () => chain.allMembers() }); hubreport.init({ dataDir: C.dataDir, members: () => chain.allMembers() });
refuelspots.init({ lock: () => keeper.busy() }); keeper.setOtherBusy(() => refuelspots.busy()); refuelspots.init({ lock: () => keeper.busy() }); keeper.setOtherBusy(() => refuelspots.busy());
keeper.init(); keeper.init();
dlbnas.init({ spots: () => chain.spots(), views: id => store.views(id).total, creative: board.creative }); dlbnas.init({ spots: () => chain.spots(), views: id => store.views(id).total, creative: board.creative, isDown: id => !!store.spotDown(id) });
// members' LinkSpin Banner Spins for empty board slots: one active 468x60 spin per member, refreshed every 10 minutes // members' LinkSpin Banner Spins for empty board slots: one active 468x60 spin per member, refreshed every 10 minutes
const refreshSpins = async () => { const refreshSpins = async () => {
const out = []; const out = [];
+28 -1
View File
@@ -28,12 +28,35 @@ function setSpotMeta(id, m) { S.spotMeta[id] = Object.assign({}, S.spotMeta[id]
function memberDefault(addr) { return S.defaults[String(addr).toLowerCase()] || null; } function memberDefault(addr) { return S.defaults[String(addr).toLowerCase()] || null; }
function setMemberDefault(addr, m) { const a = String(addr).toLowerCase(); S.defaults[a] = Object.assign({}, S.defaults[a] || {}, m, { updatedAt: Date.now() }); save(); return S.defaults[a]; } function setMemberDefault(addr, m) { const a = String(addr).toLowerCase(); S.defaults[a] = Object.assign({}, S.defaults[a] || {}, m, { updatedAt: Date.now() }); save(); return S.defaults[a]; }
// ---- edit history (2026-11-16: unlimited edits, every one logged): { at, what: 'link'|'img'|'both', old: {img, link}, new: {img, link}, via }
const EDIT_KEEP = 200;
function logEdit(bucket, key, e) { const b = S[bucket] || (S[bucket] = {}); const l = b[key] || (b[key] = []); l.push(Object.assign({ at: Date.now() }, e)); if (l.length > EDIT_KEEP) l.splice(0, l.length - EDIT_KEEP); save(); return l[l.length - 1]; }
const logSpotEdit = (id, e) => logEdit('spotEdits', String(id), e);
const logDefaultEdit = (addr, e) => logEdit('defaultEdits', String(addr).toLowerCase(), e);
const spotEdits = id => ((S.spotEdits || {})[String(id)] || []).slice();
const defaultEdits = addr => ((S.defaultEdits || {})[String(addr).toLowerCase()] || []).slice();
// ---- admin takedown (2026-11-16, the Viral Banner Blitz way): a spot taken down is hidden everywhere, keeps its place (a house
// tile shows there) and counts no views while down. { at, by, reason, credit }; restores move it to the spot's history.
function spotDown(id) { return (S.down || {})[String(id)] || null; }
function setSpotDown(id, rec) { (S.down || (S.down = {}))[String(id)] = rec; save(true); return rec; }
function clearSpotDown(id, restored) {
const k = String(id); const was = spotDown(k); if (!was) return null;
delete S.down[k]; const h = S.downs || (S.downs = {}); (h[k] || (h[k] = [])).push(Object.assign({}, was, restored || {})); save(true); return h[k][h[k].length - 1];
}
const spotDowns = id => ((S.downs || {})[String(id)] || []).slice();
const downIds = () => Object.keys(S.down || {});
// the admin ledger: one row per takedown or restore
function adminLog(e) { const L = S.adminLog || (S.adminLog = []); S.adminSeq = (S.adminSeq || 0) + 1; const row = Object.assign({ id: 'a' + S.adminSeq, at: Date.now() }, e); L.push(row); if (L.length > 5000) L.splice(0, L.length - 5000); save(true); return row; }
const adminLogs = n => (S.adminLog || []).slice(-(n || 100)).reverse();
// ---- views + clicks (gate and organic kept apart) ---- // ---- views + clicks (gate and organic kept apart) ----
// Rate limit: one counted view per visitor per spot per hour, one counted click per visitor per spot per hour. // Rate limit: one counted view per visitor per spot per hour, one counted click per visitor per spot per hour.
const seenView = new Map(), seenClick = new Map(); const seenView = new Map(), seenClick = new Map();
const HOUR = 3600000; const HOUR = 3600000;
function prune(m) { if (m.size < 50000) return; const cut = Date.now() - HOUR; for (const [k, t] of m) if (t < cut) m.delete(k); } function prune(m) { if (m.size < 50000) return; const cut = Date.now() - HOUR; for (const [k, t] of m) if (t < cut) m.delete(k); }
function addView(spotId, visitorKey, source) { function addView(spotId, visitorKey, source) {
if (spotDown(spotId)) return false; // taken down: no views count while it is down
const k = visitorKey + ':' + spotId; const t = seenView.get(k); const k = visitorKey + ':' + spotId; const t = seenView.get(k);
if (t && Date.now() - t < HOUR) return false; if (t && Date.now() - t < HOUR) return false;
seenView.set(k, Date.now()); prune(seenView); seenView.set(k, Date.now()); prune(seenView);
@@ -43,6 +66,7 @@ function addView(spotId, visitorKey, source) {
} }
function views(spotId) { const v = S.views[spotId] || { organic: 0, gate: 0 }; return { organic: v.organic, gate: v.gate, total: v.organic + v.gate }; } function views(spotId) { const v = S.views[spotId] || { organic: 0, gate: 0 }; return { organic: v.organic, gate: v.gate, total: v.organic + v.gate }; }
function addClick(spotId, visitorKey, source) { function addClick(spotId, visitorKey, source) {
if (spotDown(spotId)) return false;
const k = visitorKey + ':' + spotId + ':' + source; const t = seenClick.get(k); const k = visitorKey + ':' + spotId + ':' + source; const t = seenClick.get(k);
if (t && Date.now() - t < HOUR) return false; if (t && Date.now() - t < HOUR) return false;
seenClick.set(k, Date.now()); prune(seenClick); seenClick.set(k, Date.now()); prune(seenClick);
@@ -59,6 +83,8 @@ const SESSION_TTL = 7 * 24 * HOUR;
function mintSession(address) { const token = crypto.randomBytes(32).toString('hex'); S.sessions[token] = { address: address.toLowerCase(), expires: Date.now() + SESSION_TTL }; touch(address); save(); return token; } function mintSession(address) { const token = crypto.randomBytes(32).toString('hex'); S.sessions[token] = { address: address.toLowerCase(), expires: Date.now() + SESSION_TTL }; touch(address); save(); return token; }
function session(token) { const s = token && S.sessions[token]; return s && s.expires > Date.now() ? Object.assign({ token }, s) : null; } function session(token) { const s = token && S.sessions[token]; return s && s.expires > Date.now() ? Object.assign({ token }, s) : null; }
function dropSession(token) { delete S.sessions[token]; save(); } function dropSession(token) { delete S.sessions[token]; save(); }
// network hub events (hubevents.js, 2026-11-16): end every session `match` names that was made before `before` -> how many
function endSessions(match, before) { let n = 0; for (const [k, x] of Object.entries(S.sessions)) if (x.expires - SESSION_TTL <= before && match(x)) { delete S.sessions[k]; n++; } if (n) save(); return n; }
function touch(address) { S.seen[String(address).toLowerCase()] = Date.now(); save(); } function touch(address) { S.seen[String(address).toLowerCase()] = Date.now(); save(); }
function lastSeen(address) { return S.seen[String(address).toLowerCase()] || 0; } function lastSeen(address) { return S.seen[String(address).toLowerCase()] || 0; }
@@ -67,4 +93,5 @@ function keeperLog(entry) { S.keeper.log.push(Object.assign({ at: Date.now() },
function keeperEntries() { return S.keeper.log.slice(); } function keeperEntries() { return S.keeper.log.slice(); }
module.exports = { load, flush, spotMeta, setSpotMeta, memberDefault, setMemberDefault, addView, views, addClick, clicks, daily, module.exports = { load, flush, spotMeta, setSpotMeta, memberDefault, setMemberDefault, addView, views, addClick, clicks, daily,
mintSession, session, dropSession, touch, lastSeen, keeperLog, keeperEntries, SESSION_TTL }; logSpotEdit, logDefaultEdit, spotEdits, defaultEdits, spotDown, setSpotDown, clearSpotDown, spotDowns, downIds, adminLog, adminLogs,
mintSession, session, dropSession, endSessions, touch, lastSeen, keeperLog, keeperEntries, SESSION_TTL };
+26 -8
View File
@@ -2,7 +2,8 @@
// the text is crisp, at the exact pixel size of each slot. Same file in both repos (banner-line/app/tools, vbb/app/tools). // the text is crisp, at the exact pixel size of each slot. Same file in both repos (banner-line/app/tools, vbb/app/tools).
// node tools/kit-art.mjs dlb|vbb|all [shape,shape...] (a shape list renders only those shapes, e.g. panel,pillar) // node tools/kit-art.mjs dlb|vbb|all [shape,shape...] (a shape list renders only those shapes, e.g. panel,pillar)
// Env DLB_APP / VBB_APP = the app folder to read the mark from and write into (default the repos under D:/Projects/HighRisk). // Env DLB_APP / VBB_APP = the app folder to read the mark from and write into (default the repos under D:/Projects/HighRisk).
// Shapes per site: DLB also has pillar (120x600, Marty 2026-11-16); panel (336x280) on both. // Shapes per site: DLB also has pillar (120x600, Marty 2026-11-16); panel (336x280) on both; wide (600x300) and small
// (250x250) on both (member request 2026-11-18). sm = the short headline for the small square (6 words max).
// Output: <app>/public/art/kit/<site>-<angle>-<shape>.png. Neutral names on purpose: no IAB size tokens, no "banner"/"ad" // Output: <app>/public/art/kit/<site>-<angle>-<shape>.png. Neutral names on purpose: no IAB size tokens, no "banner"/"ad"
// (EasyList hides those). The copy here must match the facts in each app (DLB SPEC.md + contract, VBB config.js + how.html). // (EasyList hides those). The copy here must match the facts in each app (DLB SPEC.md + contract, VBB config.js + how.html).
import { pathToFileURL } from 'url'; import { pathToFileURL } from 'url';
@@ -12,7 +13,7 @@ const PW = process.env.PLAYWRIGHT || 'D:/Projects/MarketingAgent/qa-tester/node_
const pwm = await import(pathToFileURL(PW).href); const chromium = pwm.chromium || (pwm.default && pwm.default.chromium); const pwm = await import(pathToFileURL(PW).href); const chromium = pwm.chromium || (pwm.default && pwm.default.chromium);
const ROOT = 'D:/Projects/HighRisk'; const ROOT = 'D:/Projects/HighRisk';
const SHAPES = { tile: [125, 125], strip: [468, 60], leader: [728, 90], box: [300, 250], panel: [336, 280], tower: [160, 600], pillar: [120, 600], social: [1200, 630], square: [1080, 1080] }; const SHAPES = { tile: [125, 125], strip: [468, 60], leader: [728, 90], box: [300, 250], panel: [336, 280], tower: [160, 600], pillar: [120, 600], social: [1200, 630], square: [1080, 1080], wide: [600, 300], small: [250, 250] };
const SITE_SHAPES = { dlb: Object.keys(SHAPES), vbb: Object.keys(SHAPES).filter(k => k !== 'pillar') }; const SITE_SHAPES = { dlb: Object.keys(SHAPES), vbb: Object.keys(SHAPES).filter(k => k !== 'pillar') };
const APPS = { dlb: process.env.DLB_APP || ROOT + '/banner-line/app', vbb: process.env.VBB_APP || ROOT + '/vbb/app' }; const APPS = { dlb: process.env.DLB_APP || ROOT + '/banner-line/app', vbb: process.env.VBB_APP || ROOT + '/vbb/app' };
@@ -22,9 +23,9 @@ const SITES = {
mark: fs.readFileSync(APPS.dlb + '/public/art/mark.svg', 'utf8'), mark: fs.readFileSync(APPS.dlb + '/public/art/mark.svg', 'utf8'),
fonts: 'family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Inter:wght@500;600;700', fonts: 'family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Inter:wght@500;600;700',
angles: { angles: {
spot: { eyebrow: '$5 spot', h1: 'A $5 spot.', h2: '300 guaranteed views.', line: 'A $5 spot. 300 guaranteed views.', sub: 'Your banner on the board, paid on-chain on Polygon.', cta: 'Get a spot', tA: '$5 spot', tB: '300 views', chips: ['$5 spot', '300 guaranteed views', 'Paid on-chain'] }, spot: { eyebrow: '$5 spot', h1: 'A $5 spot.', h2: '300 guaranteed views.', line: 'A $5 spot. 300 guaranteed views.', sub: 'Your banner on the board, paid on-chain on Polygon.', cta: 'Get a spot', tA: '$5 spot', tB: '300 views', sm: ['A $5 spot.', '300 guaranteed views.'], chips: ['$5 spot', '300 guaranteed views', 'Paid on-chain'] },
line: { eyebrow: '10 levels', h1: '10 levels pay', h2: 'as spots sell after yours.', line: '10 levels pay as spots sell after yours', sub: 'Sponsor 30%. Each of 10 levels 5.5%. Fixed in the contract.', cta: 'See the line', tA: '10 levels', tB: 'paid on-chain', chips: ['Sponsor 30%', '10 levels x 5.5%', 'Splits fixed on-chain'] }, line: { eyebrow: '10 levels', h1: '10 levels pay', h2: 'as spots sell after yours.', line: '10 levels pay as spots sell after yours', sub: 'Sponsor 30%. Each of 10 levels 5.5%. Fixed in the contract.', cta: 'See the line', tA: '10 levels', tB: 'paid on-chain', sm: ['10 levels', 'paid on chain.'], chips: ['Sponsor 30%', '10 levels x 5.5%', 'Splits fixed on-chain'] },
instant: { eyebrow: 'Nothing to withdraw', h1: 'No withdrawals.', h2: 'Paid in the same transaction.', line: 'No withdrawals. Paid in the same transaction.', sub: 'A Polygon contract splits every $5 spot the moment it sells.', cta: 'See how', tA: 'No withdrawals', tB: 'paid same tx', chips: ['Same-transaction payouts', 'Verified contract', '$5 spot'] } instant: { eyebrow: 'Nothing to withdraw', h1: 'No withdrawals.', h2: 'Paid in the same transaction.', line: 'No withdrawals. Paid in the same transaction.', sub: 'A Polygon contract splits every $5 spot the moment it sells.', cta: 'See how', tA: 'No withdrawals', tB: 'paid same tx', sm: ['No withdrawals.', 'Paid as it sells.'], chips: ['Same-transaction payouts', 'Verified contract', '$5 spot'] }
} }
}, },
vbb: { vbb: {
@@ -32,9 +33,9 @@ const SITES = {
mark: fs.readFileSync(APPS.vbb + '/public/art/mark.svg', 'utf8'), mark: fs.readFileSync(APPS.vbb + '/public/art/mark.svg', 'utf8'),
fonts: 'family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@500;700&family=Space+Mono:wght@700', fonts: 'family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=DM+Sans:wght@500;700&family=Space+Mono:wght@700',
angles: { angles: {
free: { eyebrow: 'Free daily post', h1: 'Post a banner', h2: 'free every day.', line: 'Post a banner free every day', sub: 'InstantAdPay and LinkSpin members get a free post credit each day they sign in.', cta: 'Post yours', tA: 'FREE', tB: 'daily post', chips: ['125x125 banners', 'Free daily post', 'No subscription'] }, free: { eyebrow: 'Free daily post', h1: 'Post a banner', h2: 'free every day.', line: 'Post a banner free every day', sub: 'InstantAdPay and LinkSpin members get a free post credit each day they sign in.', cta: 'Post yours', tA: 'FREE', tB: 'daily post', sm: ['Post a banner', 'free every day.'], chips: ['125x125 banners', 'Free daily post', 'No subscription'] },
loop: { eyebrow: 'Real visitors only', h1: 'Every visitor', h2: 'pushes the loop.', line: 'Every visitor pushes the loop', sub: 'Real visitors move every banner forward. Ride out and earn network ad views.', cta: 'Join the loop', tA: 'Every visit', tB: 'moves it', chips: ['Verified visitors', 'Bots do not count', 'Network ad views'] }, loop: { eyebrow: 'Real visitors only', h1: 'Every visitor', h2: 'pushes the loop.', line: 'Every visitor pushes the loop', sub: 'Real visitors move every banner forward. Ride out and earn network ad views.', cta: 'Join the loop', tA: 'Every visit', tB: 'moves it', sm: ['Every visitor', 'pushes the loop.'], chips: ['Verified visitors', 'Bots do not count', 'Network ad views'] },
prize: { eyebrow: 'Weekly leaderboards', h1: 'Send visitors.', h2: 'Climb the weekly board.', line: 'Weekly prizes, at least $20 a week', sub: 'Prize pot of at least $20 a week, paid in POL to the top three on each board.', cta: 'See the leaders', tA: 'Weekly', tB: 'prizes', chips: ['At least $20 a week', 'Paid in POL', 'Two leaderboards'] } prize: { eyebrow: 'Weekly leaderboards', h1: 'Send visitors.', h2: 'Climb the weekly board.', line: 'Weekly prizes, at least $20 a week', sub: 'Prize pot of at least $20 a week, paid in POL to the top three on each board.', wsub: 'A weekly prize pot, paid in POL to the top three on each board.', cta: 'See the leaders', tA: 'Weekly', tB: 'prizes', sm: ['Send visitors.', 'Climb the board.'], chips: ['At least $20 a week', 'Paid in POL', 'Two leaderboards'] }
} }
} }
}; };
@@ -153,6 +154,23 @@ function body(site, a, shape) {
.v .cta{font-size:15px;padding:11px 14px;margin-top:auto} .v .dom{font-size:10.5px;font-weight:700;opacity:.8} .v .cta{font-size:15px;padding:11px 14px;margin-top:auto} .v .dom{font-size:10.5px;font-weight:700;opacity:.8}
${d ? '' : 'body{--edge:3px;--stroke:.6px;--ts:2px} .v .wm b{display:block}'} ${d ? '' : 'body{--edge:3px;--stroke:.6px;--ts:2px} .v .wm b{display:block}'}
</style><div class="v">${m}${d ? '<span class="wm">Downline<br><span class="g">Banners</span></span>' : '<span class="wm">Viral Banner <b>Blitz</b></span>'}<span class="eb">${esc(a.eyebrow)}</span><div class="h disp fit"><span>${esc(a.h1)}</span>${h2}</div><div class="sub">${esc(a.sub)}</div><span class="cta">${esc(a.cta)}</span><div class="dom">${esc(S.domain)}</div></div>`; </style><div class="v">${m}${d ? '<span class="wm">Downline<br><span class="g">Banners</span></span>' : '<span class="wm">Viral Banner <b>Blitz</b></span>'}<span class="eb">${esc(a.eyebrow)}</span><div class="h disp fit"><span>${esc(a.h1)}</span>${h2}</div><div class="sub">${esc(a.sub)}</div><span class="cta">${esc(a.cta)}</span><div class="dom">${esc(S.domain)}</div></div>`;
case 'wide': return `<style>
.w2{position:absolute;inset:0;display:flex;flex-direction:column;padding:24px 28px;gap:11px;${d ? '' : 'width:420px'}}
.w2 .top{display:flex;align-items:center;gap:10px} .w2 .mark{width:40px;height:40px;flex:none} .w2 .wm{font-size:21px}
.w2 .eb{font-size:11px;padding:4px 11px;align-self:flex-start}
.w2 .h{font-size:40px;width:${d ? 544 : 370}px;white-space:normal;max-height:88px} .w2 .h span{display:block;white-space:nowrap}
.w2 .sub{font-size:15px;line-height:1.35;max-width:${d ? 520 : 360}px}
.w2 .bot{margin-top:auto;display:flex;align-items:center;gap:16px}
.w2 .cta{font-size:17px;padding:10px 18px} .w2 .dom{font-size:12.5px;font-weight:700;opacity:.8;white-space:nowrap}
${d ? '' : 'body{--edge:3px;--stroke:.6px;--ts:2px} .tiles{right:-26px;top:34px;width:200px;--tg:12px} .tiles i{border-radius:10px;box-shadow:4px 4px 0 var(--ink)}'}
</style>${d ? '' : vTiles(9)}<div class="w2"><div class="top">${m}${wm}</div><span class="eb">${esc(a.eyebrow)}</span><div class="h disp fit"><span>${esc(a.h1)}</span>${h2}</div><div class="sub">${esc(a.wsub || a.sub)}</div><div class="bot"><span class="cta">${esc(a.cta)} &rarr;</span><span class="dom">${esc(S.domain)}</span></div></div>`;
case 'small': return `<style>
.q2{position:absolute;inset:0;display:flex;flex-direction:column;padding:16px 17px;gap:12px}
.q2 .top{display:flex;align-items:center;gap:8px} .q2 .mark{width:30px;height:30px;flex:none} .q2 .wm{font-size:16px}
.q2 .h{font-size:29px;width:216px;white-space:normal;margin-top:4px;line-height:1.04} .q2 .h span{display:block}
.q2 .cta{font-size:16px;padding:10px 16px;margin-top:auto;align-self:flex-start}
${d ? '' : 'body{--edge:3px;--stroke:.6px;--ts:2px}'}
</style><div class="q2"><div class="top">${m}${wm}</div><div class="h disp wfit"><span>${esc(a.sm[0])}</span>${d ? '<span class="g">' + esc(a.sm[1]) + '</span>' : '<span class="hot">' + esc(a.sm[1]) + '</span>'}</div><span class="cta">${esc(a.cta)} &rarr;</span></div>`;
case 'social': return d ? `<style> case 'social': return d ? `<style>
.o{position:absolute;inset:0;padding:64px 80px;display:flex;flex-direction:column} .o{position:absolute;inset:0;padding:64px 80px;display:flex;flex-direction:column}
.o .top{display:flex;align-items:center;gap:26px} .o .mark{width:118px;height:118px} .o .wm{font-size:60px} .o .top{display:flex;align-items:center;gap:26px} .o .mark{width:118px;height:118px} .o .wm{font-size:60px}