Link-farm hardening (2026-10-30 incident: 106 free accounts synced from InstantAdPay carried casino bios and website links; 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 of InstantAdPay's): 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) are refused in bios, social URLs, line banner targets, wall offers and every campaign field, with the refusal logged. The registry ingest from InstantAdPay drops a bio with a link or a prohibited term instead of storing it; iapsync applies the same on the way out.

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 as InstantAdPay): 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 "LinkSpin link-farm scan" Telegram to the private admin chat only when there are candidates. Admin > Members > Link-farm list: rows with "also on InstantAdPay" (local registry mirror), Delete selected (existing DELETE /api/admin/member, on-chain refused, no cascade) and Allow.

Terms section 9 "Prohibited content", bio hint in the profile editor, chatbot canned answer + kb-seed entry "What content is not allowed?", KNOWLEDGE_DATE 2026-10-30. Test: qa/profile-policy.test.cjs (unit + local copy, hash check against the InstantAdPay copies; runs in qa/run.sh member and policy).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-30 07:32:07 -05:00
parent be38f454ef
commit bdf1aab06c
18 changed files with 612 additions and 32 deletions
+5 -2
View File
@@ -30,6 +30,7 @@
// Until InstantAdPay answers proto 2, the hash of a row carrying the new facts is not recorded (sent again later).
'use strict';
const SF = require('./sponsorfollow');
const prohibited = require('./prohibited'); // 2026-10-30: a profile that fails the policy never leaves this site
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
@@ -52,10 +53,12 @@ function save() { try { fs.writeFileSync(FILE(), JSON.stringify(load())); } catc
function init(deps) { R = deps; load(); } // { dataDir, accounts, registry, host, follow (sponsorfollow store), tank: () => tank }
const PUBLIC = () => String(process.env.PUBLIC_URL || ('https://' + (R.host || 'linkspin.app'))).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 }, 'LinkSpin'); // 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;
if (!avatarUrl && !bio && !(socials && Object.keys(socials).length)) return null;
return { avatarUrl, bio, socials: socials && Object.keys(socials).length ? socials : null };
}