From 337d4f9e8f40012f53cc18df01d4e228a27c2339 Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 30 Oct 2026 07:29:11 -0500 Subject: [PATCH] Link-farm hardening (2026-10-30 incident: 106 free accounts used casino bios and website links as backlinks; Google indexed the text through /wall pages) Public walls: profile fields (bio, avatar, socials, intro video) render only for a paying member (memberId > 0 or a registered position), on /api/wall and in the OG image; a free account's wall shows the name, the line's ads and the join call. The meta/og description is a fixed site sentence with the handle, never the bio. Outbound profile links are rel="sponsored ugc noopener" target="_blank". A deleted or unknown name is a real 404 with X-Robots-Tag noindex (was a bare "Banner wall" page at 200, a soft 404 that stayed indexed). Policy (prohibited.js, byte-for-byte copy on LinkSpin): bios may not carry a URL or a domain token ("Links go in the social fields, not the bio"); gambling, adult, pharma, weapons and link-selling terms (Unicode aware, Vietnamese and Portuguese terms included) are refused in bios, social URLs, line banner targets, wall offers and every campaign field, with the refusal logged. lssync applies it on the way out and lsinbound on ingest. Quarantine rule: a brand-new free account (no wallet, no sponsor, under 24 h) whose first profile save plants a link is saved with profileQuarantined (JSON + MySQL column), never rendered publicly, and told "Your profile links will appear after your first ad package"; the admin member card shows the flag. Daily link-farm scan (spamscan.js, same copy on LinkSpin): in-app job at 06:30 Central, claimOnce per day, lists memberId-0 walletless accounts with a link plus a farm signal (prohibited term, sign-in over within 15 min, no sponsor), skips the spamScanAllow setting (seeded), writes DATA_DIR/wall-spam-scan.json and sends one Telegram to the private admin chat only when there are candidates. Admin > Members > Link-farm list: rows with "also on LinkSpin", Delete selected (existing DELETE /api/admin/member, on-chain refused, no cascade) and Allow. Terms section 8 "Prohibited content", bio hint in the profile editor, chatbot canned answer "What content is not allowed?", KNOWLEDGE_DATE 2026-10-30. Test: qa/profile-policy.test.cjs (unit + local copy; runs in qa/run.sh member and policy). Co-Authored-By: Claude Fable 5.1 --- accounts.js | 11 +- ads.js | Bin 169093 -> 169877 bytes chatbot.js | 6 +- db.js | 1 + lsinbound.js | 7 +- lssync.js | 11 +- prohibited.js | 108 +++++++++++++++++ public/admin.html | 8 +- public/assets/admin.js | 28 ++++- public/assets/my.js | 2 +- public/assets/wall.js | 13 ++- public/my.html | 4 +- public/terms.html | 11 +- public/wall.html | 2 +- qa/profile-policy.test.cjs | 231 +++++++++++++++++++++++++++++++++++++ qa/run.sh | 4 + server.js | 71 ++++++++++-- spamscan.js | 133 +++++++++++++++++++++ 18 files changed, 615 insertions(+), 36 deletions(-) create mode 100644 prohibited.js create mode 100644 qa/profile-policy.test.cjs create mode 100644 spamscan.js diff --git a/accounts.js b/accounts.js index 068063c..7959233 100644 --- a/accounts.js +++ b/accounts.js @@ -37,6 +37,7 @@ const pub = a => a ? { email: a.email, sponsorRef: a.sponsorRef || '', code: a.c lineBannerUrl: a.lineBannerUrl || null, lineTargetUrl: a.lineTargetUrl || null, wallOffers: a.wallOffers || null, avatarUrl: a.avatarUrl || null, bio: a.bio || null, socials: a.socials || null, bixPartnerLink: a.bixPartnerLink || null, // BixPay partner link (bixpay.js, 2026-10-29): one identity, follows the member to LinkSpin/CTB + profileQuarantined: !!a.profileQuarantined, // 2026-10-30: first profile save of a brand-new free account planted a link; stored, never rendered publicly (spamscan.js) chatAvailable: a.chatAvailable === false ? false : true, lastSeen: a.lastSeen || 0, address: a.address || null, created: a.created } : null; const USER_RE = /^[a-zA-Z0-9_]{3,20}$/; @@ -117,12 +118,13 @@ const J = { acct.wallOffers = json || null; this.save(); return { ok: true, account: pub(acct) }; }, - async setProfile(e, avatarUrl, bio, socials) { + async setProfile(e, avatarUrl, bio, socials, quarantined) { const acct = this.db.byEmail[e]; if (!acct) return { error: 'No such account.' }; if (avatarUrl !== undefined) acct.avatarUrl = avatarUrl || null; if (bio !== undefined) acct.bio = bio || null; if (socials !== undefined) acct.socials = socials || null; + if (quarantined !== undefined) acct.profileQuarantined = !!quarantined; this.save(); return { ok: true, account: pub(acct) }; }, @@ -230,7 +232,7 @@ const J = { const rowPub = r => r ? pub({ email: r.email, sponsorRef: r.sponsor_ref, code: r.code, username: r.username, memberId: r.member_id || 0, joinedVia: r.joined_via || null, joinedRef: r.joined_ref || null, lineBannerUrl: r.line_banner_url, lineTargetUrl: r.line_target_url, wallOffers: r.wall_offers || null, - avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials, bixPartnerLink: r.bix_partner_link || null, + avatarUrl: r.avatar_url, bio: r.bio, socials: r.socials, bixPartnerLink: r.bix_partner_link || null, profileQuarantined: !!r.profile_quarantined, chatAvailable: r.chat_available === 0 ? false : true, lastSeen: Number(r.last_seen || 0), address: r.address, created: Number(r.created) }) : null; const D = { @@ -285,10 +287,11 @@ const D = { await db.q('UPDATE accounts SET wall_offers=? WHERE email=?', [json || null, e]); return { ok: true, account: await this.byEmail(e) }; }, - async setProfile(e, avatarUrl, bio, socials) { + async setProfile(e, avatarUrl, bio, socials, quarantined) { if (avatarUrl !== undefined) await db.q('UPDATE accounts SET avatar_url=? WHERE email=?', [avatarUrl || null, e]); if (bio !== undefined) await db.q('UPDATE accounts SET bio=? WHERE email=?', [bio || null, e]); if (socials !== undefined) await db.q('UPDATE accounts SET socials=? WHERE email=?', [socials || null, e]); + if (quarantined !== undefined) await db.q('UPDATE accounts SET profile_quarantined=? WHERE email=?', [quarantined ? 1 : 0, e]); return { ok: true, account: await this.byEmail(e) }; }, async setBixLink(e, link) { const r = await db.q('UPDATE accounts SET bix_partner_link=? WHERE email=?', [link || null, e]); if (!r || !r.affectedRows) return { error: 'No such account.' }; return { ok: true, account: await this.byEmail(e) }; }, @@ -506,7 +509,7 @@ module.exports = { init, signup, login, ensure, onChange, isUnclaimedShell, byEm setUsername, reservedUsername, setMemberId, namesForMembers, listByReferrer, downline, linkWallet, count, setLineBanner: (e, b, t) => impl().setLineBanner(String(e || '').toLowerCase(), b, t), setWallOffers: (e, j) => impl().setWallOffers(String(e || '').toLowerCase(), j), - setProfile: async (e, a, bio, socials) => { const r = await impl().setProfile(String(e || '').toLowerCase(), a, bio, socials); if (!(r && r.error)) changed(String(e || '').toLowerCase()); return r; }, // profile edits reach LinkSpin too + setProfile: async (e, a, bio, socials, quarantined) => { const r = await impl().setProfile(String(e || '').toLowerCase(), a, bio, socials, quarantined); if (!(r && r.error)) changed(String(e || '').toLowerCase()); return r; }, // profile edits reach LinkSpin too setBixLink: async (e, link) => { const r = await impl().setBixLink(normEmail(e), link ? String(link).slice(0, 300) : null); if (!(r && r.error)) changed(normEmail(e)); return r; }, // the BixPay partner link rides to LinkSpin in the profile row (lssync.js) touchSeen: e => impl().touchSeen(String(e || '').toLowerCase()), adminSetAddress: (e, a) => impl().adminSetAddress(String(e || '').toLowerCase(), a ? normAddr(a) : null), diff --git a/ads.js b/ads.js index 8f8ac55342c3dbcdf38b63e0d1647e2311be916f..020e907ff50d379116848e0609c6da8bd41b92ea 100644 GIT binary patch delta 775 zcmb`Ev2N5r5Qb$$fli{KKnfHLm3@+ZcO;0y5d}>YAO#Afp+H*ObM`9hT{9jNP8aJW zB%T1FRCF{{AR&>LpyUO30~&h9cA`s}f^K(q_y52D-}hfeAHR;i{qj~7xk4wJF@uLd z_`1=Afj^n9=l*ybrc>CQZ9a(Z&7!SY47n;3qir67${NEVRE45ag>Zzba<&dZP7k9R zO?L|zsjNkO-qd2FE#MoZg}jCNRgEV5{?og=vl5TBDWuLaT83clJC1=1gjAK4(zykz zN(`Yum5Gb2QdccPNE&8m!KefcD4PK*%8}tkP7Phy1eFU&fJIk7d zL5f&|Owt0=!<`PZ4wk)V46fnH;Le&24ugIv{w`a@@SI7K2i?VP0LRDR`{NIvwl-D* z%4)B}8{VDo!ZXqXIy)G^WeaTx{$qhtmLFx$)S~+mJ%^y82@*LP!}21saru5%wlaZ# z-j*Lq@s;4r+>u4rkQI?$EtcV+3+*Zybs_10h<4vbm}!xdpH051BAZ|&;S4c delta 51 zcmV-30L=fDuL^~!3b51xvtI%kMwbf$0uh5bO1C*m0UQzqX>M?JbeElB0wA}TTmdvn Jw}Ynv67a+h5uX46 diff --git a/chatbot.js b/chatbot.js index db3f165..f0b2f0a 100644 --- a/chatbot.js +++ b/chatbot.js @@ -33,7 +33,7 @@ function key() { function enabled() { return !!key(); } // ---- canned answers: instant, free, always in voice ---- -const KNOWLEDGE_DATE = '2026-10-29'; // bump whenever the canned answers / prompt are brought up to date +const KNOWLEDGE_DATE = '2026-10-30'; // bump whenever the canned answers / prompt are brought up to date const SUPPORT_RE = /(contact|reach|email|e-mail|message|talk to|speak (to|with)|get hold of) (the )?(support|admin|administrator|owner|marty|staff|team at instantadpay|someone|a (human|person|real person))|support (email|address|ticket|team|desk)|help ?desk|(open|send|file|submit|raise) (a )?(support )?ticket|\b(human|real person|live (agent|person|chat|support))\b|customer (service|support)|support@|how (do|can) i get (help|support)/i; const CANNED = [ { id: 'support', title: 'Contact support or open a ticket', q: ['How do I contact support?', 'How do I talk to a real person?', 'How do I open a support ticket?'], tags: ['support', 'help', 'ticket', 'contact', 'help desk'], @@ -191,6 +191,9 @@ const CANNED = [ { id: 'trust-drain', title: 'Trust Wallet "drain your wallet" warning', q: ['Trust Wallet says this transaction will drain my wallet', 'My wallet blocked the purchase'], tags: ['trust wallet', 'drain', 'wallet warning', 'walletconnect'], re: /(drain (my|your) wallet|stop and go back|trust wallet.*(warn|block|red)|wallet (warning|blocked))/i, a: 'That red "this transaction will drain your wallet" screen is the wallet\'s own safety rule, not a problem with the purchase: Trust Wallet blocks any transaction that spends most of the POL in the wallet. Ways through: buy a smaller package first, add some POL so the purchase is well under half the balance, or connect a different wallet (MetaMask, Phantom, SafePal have no such block). Extra POL always stays yours. If the next try says WalletConnect disconnected, open Wallet, tap Disconnect, then Connect again. Phantom, SafePal and MetaMask do not have the hard block.' }, + { id: 'prohibited-content', title: 'What content is not allowed?', q: ['What content is not allowed?', 'Can I put a link in my bio?', 'Can I advertise a casino or CBD?'], tags: ['prohibited content', 'rules', 'bio links', 'gambling', 'adult', 'link farm'], + re: /(not allowed|prohibited|forbidden|banned (content|words|niches?)|content (rules|policy)|what (content|ads|niches?) (is|are) (not )?(allowed|ok|accepted)|can i (post|promote|advertise|run) .*(casino|gambling|betting|adult|porn|cbd|weed|pharma|guns?)|link ?farm|backlinks?|links? in (the |my |your )?bio|bio (link|url)|why was my (bio|profile|link) (refused|rejected|blocked))/i, + a: 'Not allowed anywhere on InstantAdPay (ads, campaigns, line banners, wall offers, bios and social links): gambling, casinos, betting, lotteries and sweepstakes; adult or sexual content; drugs and prescription pharmaceuticals; weapons; hate or harassment; malware, phishing and counterfeit goods; misleading financial promises. The bio is text only: no links and no domain names, links go in the social fields in Profile. Your bio, avatar and social links show on your public wall once you have bought a package; free accounts show only their name and the line’s ads there. Accounts created just to place links in profile fields (link farming) are removed without notice, with their profile text. The full list is in the Terms, section 8: https://instantadpay.com/terms#prohibited' }, { id: 'wall', title: 'Your banner wall and its three positions', q: ['How does my wall work?', 'How do I own wall positions 2 and 3?'], tags: ['wall', 'banner wall', 'positions'], re: /(wall (page|slots?|positions?)|banner wall|my wall|three (ads|slots) on (my|the) wall)/i, a: 'Your wall (instantadpay.com/wall/yourname) shows three ads. Position 1 is always your line banner. Positions 2 and 3 show your upline (or InstantAdPay) until you earn them: 2 qualifying buyers ($20 or more) make position 2 yours, 5 make position 3 yours, so a fully qualified member owns the whole page with their own links and offers. Set them in Profile > Your wall; an unlocked slot you leave empty keeps showing your upline until you fill it.' }, @@ -296,6 +299,7 @@ ${passTiersFact()}${refuelFact()}${synFact()}${polminerFact()}${bixFact()}- ROAD - Ad packages: Micro $5/500 credits, Starter $10/1,000, Activation $20/2,000, Builder $50/5,500, Growth $100/12,000, Leader $250/32,500, Elite $500/70,000. Dollar-priced, settled in POL (Polygon) at the live Chainlink rate. 1 credit = 1 cent of ad delivery. - Live formats: display banners (per impression), text ads (per impression), full-screen LOGIN ADS (per day: right after a member signs in they land on a sponsor interstitial — they click "Open Ad", the advertiser's page opens in a NEW tab, a countdown runs on the interstitial, and at zero a "Go to dashboard" button appears. Just a CTA link is enough; an optional banner image can be the clickable creative. No framing requirement since it opens in its own tab), WATCH-TO-EARN VIDEO ADS (advertiser uploads an MP4/WebM or gives a direct https .mp4/.webm link and picks a required watch length — 10s/30s/60s — which sets the per-view price; viewers watch in an escape-proof player under Earn credits > Watch videos, the watch time is enforced on the server clock, and they earn credits per completed watch; you never see your own videos), and solo ads. Banner ads also require a size (standard IAB sizes like 728x90, 300x250). Video watching is capped at 8 a day per member and pays 1, 2 or 4 credits for a 10, 30 or 60 second watch. FEATURED LINKS (live): a headline + link in the Featured strip at the top of every member's Overview, booked for 1, 2 or 7 days at 40 credits a day, up to 7 days ahead, at most 10 links sharing any day; flat buy paid when booked; the row shows days left and 'runs through ', counts views (one per viewer per hour) and clicks, and offers Extend run. VERIFIED-VISIT PACKS (live): 3 credits per visit, minimum 20 visits, paid up front; each visit is a distinct member who opens the site in a new tab, stays 8 seconds and passes a check, at most 20 visits per member per day; the row shows 'N of M visits delivered' and Buy more visits adds to the pack; the visitor earns 1 credit. - WALLETS + BUYING POL (Training > Wallets and buying POL, /wallets, members only): preferred MetaMask (recommended; extra accounts for Qualified Start), Phantom (PHANTOM GOTCHA: Polygon is OFF by default; Settings > Active Networks > turn on Polygon, otherwise connect/buy fails or shows the wrong network; seen with Jim Watts' EB team 2026-09-13), SafePal, Coinbase Wallet; Trust works but blocks buys spending most of its POL (keep ~2x). MoonPay flow: connect wallet, Buy packages > "Buy POL with a card" opens MoonPay with POL on Polygon + the member's address prefilled; card/Apple Pay/Google Pay; first-time ID check; minimum order ~$30; buy package cost + 2-3 POL for fees; POL arrives in minutes; then buy. Exchanges: withdraw POL on the Polygon network. Never MATIC on Ethereum, never share the recovery phrase. +- PROHIBITED CONTENT (2026-10-30, Terms section 8, /terms#prohibited): gambling, casinos, betting, lotteries, sweepstakes; adult or sexual content; drugs and prescription pharmaceuticals; weapons; hate or harassment; malware, phishing, counterfeit goods; misleading financial promises. Refused at save time in bios, social links, line banners, wall offers and every campaign field. A bio may not contain a URL or a domain (links go in the social fields). Profile text, avatar and social links appear on the public wall ONLY for members who have bought a package; a free account's wall shows the name, the line's ads and the join button. Link-farm accounts (created to plant links in profile fields) are removed without notice with their profile text. - INTRO VIDEO ON THE WALL: Profile > social links has an "Intro video" field (YouTube, Vimeo or direct .mp4 link). It embeds on the member's public wall page (/wall/) right under their bio, above the three-level line and the join button. - HOLDING TANK (Members > My line > Holding tank card): free members who joined with no sponsor wait there; a member who has switched on payouts AND bought their own $20+ package can Adopt one (first come, max 2 open adoptions, 7-day window; if the person never links a wallet or buys, they fall back into the tank; a person can be adopted twice at most). Adopting sets the sponsor, opens a chat and emails the member; their first purchase then binds to the adopter on-chain. Members can also "Release to tank" one of their own free referrals (pay it forward), but NOT someone they adopted less than 3 days ago: an adoption is a commitment, and a dropped adoption still counts toward that person's two-adoption lifetime limit. Releases are posted to the feed and Telegram like pickups. Admin sees the tank under Members. - TANK ACTIVATION HOLD (2026-10-27, Marty: never default a tank member to the company): a tank member (no sponsor, not activated) can NOT switch on payouts on its own yet (a PURCHASE is NEVER held, Marty 2026-10-27: with no sponsor anywhere a buy goes ahead under the catch position #1); the Wallet tab and Getting started card say "You're being matched with a sponsor. Payouts switch on as soon as someone picks you up (within 24 hours)." with the time left, and the activate button is hidden. The 24-hour clock starts when they link a wallet; they then show at the top of every holding tank with a green "Ready to activate" badge and hours left, and a post goes to the team's Telegram payments topic. If nobody adopts them in 24 hours, the site auto-assigns them to the next eligible adopter in rotation (own $20+ package, fewer than 2 open adoptions, signed in within 7 days, not suspended; least recently auto-assigned first); the adopter gets a chat + email and Telegram shows the pickup marked (auto-assigned). If nobody is eligible they stay on hold and the admin is alerted; never the company. Someone whose same email or wallet already has a sponsor on LinkSpin is placed under that sponsor instead (not one they were released or rescued from). A member who arrived through a sponsor link is never held. Once they have a sponsor the hold lifts by itself. ONE-TAP SWITCH ON PAYOUTS (2026-10-27): every tank assignment (manual adoption or the 24-hour auto-assign) sends the member a chat and an email with a Switch on payouts link, https://instantadpay.com/my?activate=1#wallet; it opens the Wallet tab and starts the normal Activate payouts flow with the new sponsor prefilled (after sign-in, and after linking a wallet if none is linked yet). It never starts while the hold applies or when no sponsor resolves. The site cannot activate for anyone: activation is one free transaction from the member's own wallet. Not activated 24 hours after the assignment: one reminder email to the member with the same link and one notice to the sponsor ("@x hasn't switched on payouts yet; a nudge from you helps"); at 72 hours one last email to the member only; both stop once the member switches on payouts or buys. diff --git a/db.js b/db.js index ad8fb27..830d6c9 100644 --- a/db.js +++ b/db.js @@ -344,6 +344,7 @@ async function bootstrap() { await alterSafe('ALTER TABLE accounts ADD COLUMN joined_via VARCHAR(20) NULL'); // ?v= angle the lead came in on await alterSafe('ALTER TABLE accounts ADD COLUMN joined_ref VARCHAR(80) NULL'); // referring domain of the first join-page visit await alterSafe('ALTER TABLE accounts ADD COLUMN wall_offers VARCHAR(2000) NULL'); // JSON [{title,bannerUrl,targetUrl}] for wall positions 2-3 (unlock at 2 / 5 qualifying buyers) + await alterSafe('ALTER TABLE accounts ADD COLUMN profile_quarantined TINYINT NOT NULL DEFAULT 0'); // 2026-10-30 link-farm rule: first profile save of a new free account carried a link (spamscan.js) await alterSafe('ALTER TABLE accounts ADD COLUMN bix_partner_link VARCHAR(300) NULL'); // BixPay partner link (bixpay.js, 2026-10-29); column name checked against MySQL 8 reserved words // help desk (2026-10-16, tickets.js): one shared desk for IAP and, later, LinkSpin; email_message_id threads inbound mail await q(`CREATE TABLE IF NOT EXISTS tickets ( diff --git a/lsinbound.js b/lsinbound.js index fc65bd3..9a462ca 100644 --- a/lsinbound.js +++ b/lsinbound.js @@ -25,6 +25,7 @@ // hides someone adopted on LinkSpin and the two-adoptions limit counts both sites. 'use strict'; const SF = require('./sponsorfollow'); +const prohibited = require('./prohibited'); // 2026-10-30: policy applied on ingest const fs = require('fs'); const path = require('path'); @@ -98,8 +99,10 @@ async function fill(a, r, sum) { } if (r.profile && A.setProfile) { // same rules as LinkSpin's side: https only, known socials, fills only what is empty const pf = r.profile, ok = v => /^https:[/][/][^ ]+$/i.test(v) && v.length <= 300; - const av = String(pf.avatarUrl || '').trim(); const bio = String(pf.bio || '').trim().slice(0, 600); let soc = null; - if (pf.socials && typeof pf.socials === 'object') { const c = {}; for (const k of ['facebook', 'twitter', 'youtube', 'instagram', 'tiktok', 'telegram', 'linkedin', 'website', 'video']) { const v = String(pf.socials[k] || '').trim(); if (ok(v)) c[k] = v; } if (Object.keys(c).length) soc = JSON.stringify(c); } + // prohibited-content policy on ingest (2026-10-30): a bio with a link or a prohibited term, or a social carrying one, is dropped, not stored + const cp = prohibited.cleanProfile(pf, 'InstantAdPay'); if (cp.dropped.length) console.log('lsinbound profile dropped', String(a.email).replace(/^(.).*(@.*)$/, '$1***$2'), cp.dropped.join(',')); + const av = String(pf.avatarUrl || '').trim(); const bio = cp.bio || ''; let soc = null; + if (cp.socials) { const c = {}; for (const k of ['facebook', 'twitter', 'youtube', 'instagram', 'tiktok', 'telegram', 'linkedin', 'website', 'video']) { const v = String(cp.socials[k] || '').trim(); if (ok(v)) c[k] = v; } if (Object.keys(c).length) soc = JSON.stringify(c); } const upd = [!a.avatarUrl && ok(av) ? av : undefined, !a.bio && bio ? bio : undefined, !a.socials && soc ? soc : undefined]; if (upd.some(v => v !== undefined)) { const x = await A.setProfile(a.email, upd[0], upd[1], upd[2]); if (!(x && x.error)) { sum.filled++; wrote = true; } } } diff --git a/lssync.js b/lssync.js index 9feba75..3ba677f 100644 --- a/lssync.js +++ b/lssync.js @@ -14,6 +14,7 @@ 'use strict'; const crypto = require('crypto'); const SF = require('./sponsorfollow'); +const prohibited = require('./prohibited'); // 2026-10-30: a profile that fails the policy never leaves this site const fs = require('fs'); const path = require('path'); @@ -41,10 +42,12 @@ const carriesNew = r => !!(r.sponsorSetBy || r.tank); // absolute https URL so the other property can show it; socials as the parsed {platform: url} object. const PUBLIC = () => String(process.env.PUBLIC_URL || 'https://instantadpay.com').replace(/\/+$/, ''); function profileOf(a) { - let socials = null; try { socials = a.socials ? (typeof a.socials === 'string' ? JSON.parse(a.socials) : a.socials) : null; } catch (e) { socials = null; } + if (a.profileQuarantined) return null; // quarantined (link planted on a brand-new free account): stays here, unseen, until Marty decides + const cp = prohibited.cleanProfile({ avatarUrl: a.avatarUrl, bio: a.bio, socials: a.socials }, 'InstantAdPay'); // policy applied on the way out too + const socials = cp.socials; const av = String(a.avatarUrl || '').trim(); const avatarUrl = !av ? null : /^https:\/\//i.test(av) ? av : av.startsWith('/') ? PUBLIC() + av : null; - const bio = String(a.bio || '').trim().slice(0, 600) || null; + const bio = cp.bio; // the BixPay partner link travels too (2026-10-29): LinkSpin shows it read-only ("Edit on InstantAdPay") and resolves the // same way; only set when there is one, so rows without it keep the hash they had const bixPartnerLink = String(a.bixPartnerLink || '').trim() || null; @@ -109,5 +112,7 @@ async function release(email, sent) { if (pending.has(e) && !timer) { pending.delete(e); touch(e); } // a touch that queued while muted goes now (the hash check drops it when same) return same; } +// does LinkSpin know this email? (its row was pushed and recorded) - used by the link-farm admin list, never for a cascade +function knows(email) { const st = load(); return Object.prototype.hasOwnProperty.call(st.hashes || {}, String(email || '').toLowerCase()); } function adminView() { const st = load(); return { on: on(), url: URL_(), tracked: Object.keys(st.hashes).length, pushed: st.pushed, last: st.last, errors: st.errors, pendingTouches: pending.size }; } -module.exports = { init, touch, tick, adminView, on, mute, release }; +module.exports = { init, touch, tick, adminView, on, mute, release, knows }; diff --git a/prohibited.js b/prohibited.js new file mode 100644 index 0000000..804b365 --- /dev/null +++ b/prohibited.js @@ -0,0 +1,108 @@ +// Prohibited-content policy, one module shared by InstantAdPay and LinkSpin (keep the two copies identical). +// 2026-10-30: an SEO backlink farm opened 106 free accounts, each with a casino or local-business bio and a +// website link, and Google indexed that text under our domains through the public walls. Rules (Marty): +// - profile fields are not a free backlink: a bio may not carry a URL or a domain-looking token; +// - gambling, adult, pharma, weapons and link-selling terms are refused in every member-set text field +// (bio, social links, line banner, wall offers, campaign names, headlines, copy and target URLs); +// - case-insensitive and Unicode aware (NFC, lower-cased, letter/number boundaries, so "Essex" never hits "sex"). +// Pure functions, no state, no dependencies. +'use strict'; + +// One entry per term or phrase; spaces match any run of whitespace. Grouped for the Terms page and the admin. +const LIST = { + gambling: ['casino', 'casinos', 'cassino', 'cassinos', 'slots', 'slot gacor', 'betting', 'sportsbook', 'sportsbooks', 'bookmaker', 'bookmakers', 'bookie', + 'lottery', 'lotteries', 'lotto', 'poker', 'baccarat', 'roulette', 'blackjack', 'jackpot', 'togel', 'judi', 'judi online', 'apostas', 'apuestas', + 'nổ hũ', 'cá cược', 'đổi thưởng', 'xổ số', 'kèo', 'nhà cái', 'soi kèo', 'game bài', 'tài xỉu', 'bắn cá'], + adult: ['porn', 'porno', 'pornography', 'sex', 'sexy', 'escort', 'escorts', 'erotic', 'erotica', 'xxx', 'onlyfans', 'nude', 'nudes', 'hentai', 'cam girl', 'cam girls', 'sex cam', 'hookup', 'hookups'], + pharma: ['viagra', 'cialis', 'levitra', 'pharmacy', 'pharmacies', 'prescription', 'prescriptions', 'steroids', 'anabolic', 'cannabis', 'marijuana', 'weed', 'cbd', 'kratom', 'opioid', 'opioids', + 'xanax', 'adderall', 'tramadol', 'oxycodone', 'ketamine', 'cocaine', 'mdma', 'psilocybin', 'vape', 'vaping'], + weapons: ['firearm', 'firearms', 'guns', 'gun shop', 'gun store', 'ammunition', 'ammo', 'rifle', 'rifles', 'pistol', 'pistols', 'handgun', 'handguns', 'silencer', 'suppressor', 'explosives'], + linkfarm: ['backlink', 'backlinks', 'seo service', 'seo services', 'seo agency', 'link building', 'link-building', 'guest post', 'guest posts', 'guest posting', 'pbn', 'buy links', 'sell links', 'dofollow'] +}; +const ALL = Object.values(LIST).reduce((a, b) => a.concat(b), []); + +const esc = s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +const ZW = /[​-‏⁠]/g; // zero-width joiners hide nothing +const strip = s => String(s == null ? '' : s).normalize('NFC').replace(ZW, ''); +const norm = s => strip(s).toLowerCase(); +// Boundary = anything that is not a letter or a number (works for every script, unlike \b). +const TERM_RE = new RegExp('(? esc(norm(t)).replace(/\s+/g, '\\s+')).join('|') + ')(?![\\p{L}\\p{N}])', 'u'); + +// Common gTLDs plus the ccTLDs link farms actually use. A short two-letter list keeps "Mr.Li" style text out of it. +const TLDS = 'com|net|org|info|biz|io|co|app|xyz|me|tv|us|uk|vn|de|fr|ru|in|id|br|es|it|nl|ca|au|eu|ch|at|be|pt|pl|cz|se|no|fi|dk|ie|nz|za|ng|ke|eg|tr|ua|il|ae|sa|pk|bd|lk|np|kh|la|mm|my|sg|ph|th|jp|kr|cn|tw|hk|mx|ar|cl|pe|to|ly|cc|gg|ai|pw|ws|tk|ml|ga|cf|gq|su|' + + 'site|online|store|shop|club|top|pro|live|link|page|dev|fun|vip|one|tech|space|website|cloud|digital|agency|company|email|news|blog|life|world|today|zone|guru|ninja|game|games|team|network|money|cash|gold|bid|trade|win|bet|casino|poker|mobi|name|tel|travel|jobs|pics|photo|video|press|media|art|design|studio|capital|finance|exchange|solutions|services|systems|tools|works|center|group|global|international|institute|academy|school|education|university|church|community|social|chat|dating|love|wiki|review|reviews|directory|guide|help|support|rocks|ventures|holdings|partners|limited|ltd|llc|inc|asia|africa|london|nyc|tokyo|berlin|paris|best|buzz|click|host|hosting|lol|monster|wtf|ooo|icu|sbs|cfd|cyou|rest|bar|cam|surf|run|fit|health|care|dog|cat|pet|pets|wine|beer|vodka|bio|eco|green|energy|solar|car|cars|auto|bike|tires|taxi|limo|rent|rentals|house|homes|realty|estate|land|city|town|place|map|earth|fund|loans|credit|insure|legal|law|lawyer|attorney|tax|accountant|consulting|marketing|promo|sale|deals|discount|coupons|gift|gifts|toys|baby|kids|mom|family|wedding|party|events|tickets|show|theater|film|movie|music|band|dance|yoga|golf|football|soccer|hockey|tennis|racing'; +// Schemes and www. are matched in any case; a bare domain token (or an email address) only with its TLD in lower case, so a +// missed space after a period ("ads.One day") is not mistaken for a link while real spam domains (typed lower case) are caught. +const SCHEME_RE = /(?:https?:\/\/|ftp:\/\/|(? 'That content is not allowed on ' + (site || 'InstantAdPay/LinkSpin') + ' profiles (see Terms).'; +const blockedAdMsg = site => 'That content is not allowed on ' + (site || 'InstantAdPay/LinkSpin') + ' (see Terms, Prohibited content).'; + +// Bio rule: no links, no prohibited terms. Returns { ok: true } or { error, reason }. +function checkBio(bio, site) { + const t = String(bio || ''); + if (!t.trim()) return { ok: true }; + if (hasUrl(t)) return { error: BIO_LINK_MSG, reason: 'url' }; + const term = match(t); + if (term) return { error: blockedMsg(site), reason: 'term:' + term }; + return { ok: true }; +} +// Any other member-set text (social URL, banner target, campaign name, headline, copy): prohibited terms only. +// Pass profile: true for profile fields (the message names profiles), else the ad message is used. +function checkText(text, site, opts) { + const term = match(text); + if (!term) return { ok: true }; + return { error: (opts && opts.profile) ? blockedMsg(site) : blockedAdMsg(site), reason: 'term:' + term }; +} +// Several fields at once: { name: value, ... } -> first failure, with the field named in `field`. +function checkFields(fields, site, opts) { + for (const k of Object.keys(fields || {})) { + const v = fields[k]; if (v == null || v === '') continue; + const r = checkText(Array.isArray(v) ? v.join(' ') : String(v), site, opts); + if (r.error) return Object.assign({ field: k }, r); + } + return { ok: true }; +} +// Profile ingest (registry sync from the other property, or a saved profile replayed): the parts of a profile that may be +// stored. A bio with a link or a prohibited term is dropped (null); a social URL carrying a prohibited term is dropped. +function cleanProfile(pf, site) { + const out = { avatarUrl: null, bio: null, socials: null, dropped: [] }; + if (!pf || typeof pf !== 'object') return out; + const av = String(pf.avatarUrl || '').trim(); if (/^https:\/\/[^\s]+$/i.test(av) && av.length <= 300) out.avatarUrl = av; + const bio = String(pf.bio || '').trim().slice(0, 600); + if (bio) { const r = checkBio(bio, site); if (r.ok) out.bio = bio; else out.dropped.push('bio:' + r.reason); } + const src = pf.socials && typeof pf.socials === 'object' ? pf.socials : (typeof pf.socials === 'string' ? safeJson(pf.socials) : null); + if (src) { + const c = {}; + for (const k of Object.keys(src)) { + const v = String(src[k] || '').trim(); if (!v) continue; + const r = checkText(v, site, { profile: true }); if (r.ok) c[k] = v; else out.dropped.push('socials.' + k + ':' + r.reason); + } + if (Object.keys(c).length) out.socials = c; + } + return out; +} +function safeJson(s) { try { const o = JSON.parse(s); return o && typeof o === 'object' ? o : null; } catch (e) { return null; } } +// Terms-page wording, one line per group (kept here so both sites say the same thing). +const POLICY = [ + 'gambling, casinos, betting, lotteries and sweepstakes', + 'adult or sexual content', + 'drugs and prescription pharmaceuticals', + 'weapons', + 'hate or harassment', + 'malware, phishing and counterfeit goods', + 'misleading financial promises', + 'accounts created to place links in profile fields (link farming), which are removed without notice together with their profile text' +]; +// One log line per refusal, with the email masked (never the text itself at full length). +function logRefusal(where, email, r) { + try { console.log('prohibited-content refused', where, String(email || '-').replace(/^(.).*(@.*)$/, '$1***$2'), r && r.field ? 'field=' + r.field : '', r && r.reason ? r.reason : ''); } catch (e) {} +} +module.exports = { LIST, ALL, POLICY, match, hasUrl, checkBio, checkText, checkFields, cleanProfile, logRefusal, BIO_LINK_MSG, blockedMsg, blockedAdMsg }; diff --git a/public/admin.html b/public/admin.html index 2be1ed8..3a93048 100644 --- a/public/admin.html +++ b/public/admin.html @@ -293,6 +293,12 @@

Sponsor = the token the account joined under (username, share code, or member #). Editing it re-points free referrals and future purchases. On-chain sponsorship is permanent once activated.

+
+

Link-farm list

daily scan at 06:30 Central
+

Free accounts (no package, no wallet) that carry a link plus a farm signal: a prohibited term in the profile, a sign-in that ended within 15 minutes of the sign-up, or no sponsor. Nothing is deleted on its own. Delete uses the normal member delete (on-chain members are refused) and never touches LinkSpin; the "also on LinkSpin" column is there so you can decide. Allow keeps an email off this list for good.

+

+
+