Destination reachability: refuse a link whose host has no DNS record at save time; daily sweep pauses live ads whose host is dead two days running, notices the owner (in-app + opt-in email), one admin alert; Admin API /api/admin/reach (+/run, dry) (campaign #163 served lmgnow.co after the domain vanished)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ const releases = require('./releases');
|
||||
const ledger = require('./ledger');
|
||||
const videosweep = require('./videosweep');
|
||||
const sbcheck = require('./sbcheck');
|
||||
const reach = require('./reach');
|
||||
const marks = require('./marks');
|
||||
const feedgroup = require('./feedgroup'); // one proof-feed message per purchase: buyer, package, then the tier payouts // one-time claims shared across running instances (deploy overlap) // Google Safe Browsing screen on advertiser destinations
|
||||
const updates = require('./updates');
|
||||
@@ -567,6 +568,13 @@ async function boot() {
|
||||
// Shares videosweep's alert path on purpose: it names members and their emails, admin only.
|
||||
sbcheck.init({ dataDir: DATA_DIR, fs, path, db, selfHost: 'instantadpay.com', alert: videosweepAlert });
|
||||
sbcheck.start();
|
||||
// Destination reachability (2026-10-07): a link that resolved when saved can die later (campaign #163's
|
||||
// lmgnow.co vanished and 65 members hit a dead end while Safe Browsing read 'cannot resolve' as unknown).
|
||||
// Refuses a host with no DNS record at save time; pauses live ads whose host is dead two days running.
|
||||
reach.init({ dataDir: DATA_DIR, fs, path, db, selfHost: 'instantadpay.com', alert: videosweepAlert, site: 'https://instantadpay.com',
|
||||
message: (to, subject, html) => messages.deliver(1, ADMIN_EMAIL || 'house@instantadpay.com', [to], subject, html, 'notice'),
|
||||
mailer, optedIn: email => updates.optedIn(email) });
|
||||
reach.start();
|
||||
toolkit.init({ dataDir: DATA_DIR, ads, accounts, siteConfig, coach, messages, promos, videomaker, chain });
|
||||
updates.init({ dataDir: DATA_DIR, accounts, releases, mailer, drip, sendy, adminEmail: ADMIN_EMAIL });
|
||||
audit.init({ dataDir: DATA_DIR, notify: text => { const sc = siteConfig(); if (sc.telegramBotToken && sc.telegramAdminChatId) telegramSend(sc.telegramAdminChatId, text).catch(() => {}); else if (ADMIN_EMAIL && mailer.hasKey()) mailer.send(ADMIN_EMAIL, 'InstantAdPay: counter audit', text).catch(() => {}); } });
|
||||
@@ -2717,6 +2725,8 @@ const server = http.createServer(async (req, res) => {
|
||||
return json(res, r.error ? 400 : 200, r);
|
||||
}
|
||||
if (p === '/api/admin/walletnudge' && req.method === 'GET') { if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); return json(res, 200, walletnudge.adminView()); }
|
||||
if (p === '/api/admin/reach' && req.method === 'GET') { if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); return json(res, 200, reach.adminView()); }
|
||||
if (p === '/api/admin/reach/run' && req.method === 'POST') { if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); const b = await readBody(req); return json(res, 200, await reach.run({ dry: !!(b && b.dry) })); }
|
||||
if (p === '/api/admin/walletnudge/run' && req.method === 'POST') { if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); return json(res, 200, await walletnudge.tick()); }
|
||||
if (p === '/api/admin/tank' && req.method === 'GET') {
|
||||
if (!isAdmin(req)) return json(res, 401, { error: 'auth' });
|
||||
@@ -4045,6 +4055,7 @@ const server = http.createServer(async (req, res) => {
|
||||
}
|
||||
if (String(b.type) === 'video') { const vc = await videoCheck(b.videoUrl); if (!vc.ok) return json(res, 400, { error: vc.reason }); }
|
||||
{ const sb = await sbcheck.check(b.targetUrl); if (!sb.ok) return json(res, 400, { error: sb.reason }); }
|
||||
{ const rc = await reach.check(b.targetUrl); if (!rc.ok) return json(res, 400, { error: rc.reason }); }
|
||||
// charge the best-funded of the member's positions (main + Qualified Start
|
||||
// wallets). A campaign burns from one member id, so the budget must fit inside it.
|
||||
const ids = (await myMemberIds(s)).ids;
|
||||
@@ -4235,6 +4246,7 @@ const server = http.createServer(async (req, res) => {
|
||||
// source pasted here would hand every viewer a black player exactly as #146 did.
|
||||
if (String(b.type) === 'video') { const vc = await videoCheck(b.videoUrl); if (!vc.ok) return json(res, 400, { error: vc.reason }); }
|
||||
{ const sb = await sbcheck.check(b.targetUrl); if (!sb.ok) return json(res, 400, { error: sb.reason }); }
|
||||
{ const rc = await reach.check(b.targetUrl); if (!rc.ok) return json(res, 400, { error: rc.reason }); }
|
||||
if (!['login', 'solo', 'video', 'featured'].includes(String(b.type || ''))) {
|
||||
if (b.type === 'banner' || (b.type === 'login' && b.imageUrl)) { const ic = await imageCheck(b.imageUrl); if (!ic.ok) return json(res, 400, { error: ic.reason }); }
|
||||
const fc = await frameCheck(b.targetUrl);
|
||||
|
||||
Reference in New Issue
Block a user