Link-domain pool by channel + safety checks, hosted page images + provider allowlist, Reports pages and zones sections
Item 1 (domains.js): every short link domain in linkDomains gets a channel (email / messaging / social / reserve)
via the new linkDomainChannels site setting ("host:channel,..."; default order email, messaging, social, email,
reserve). Checks every 6 h + Admin > Link domains "Check now": Google Safe Browsing v4 when GSB_API_KEY is set
(unknown otherwise), URIBL + SURBL DNS lists (answer = listed, NXDOMAIN = clean, 127.0.0.1 or errors = unknown),
and a TelegramBot-UA reachability probe. Flagged or listed = BURNED: out of domains.live() (no new links or
pages on it, existing /r/ codes still resolve), admin told once via telegramAdminChatId or ADMIN_EMAIL.
State in DATA_DIR/domains.json. New: GET /api/my/link-hosts, GET+POST /api/admin/domains, admin pane.
/api/my/pages now hands out hosts from domains.live().
Item 2 (pages.js, formrestyle.js): POST /api/my/pages/upload (raw image body, multipart, or JSON base64) for
png/jpg/webp up to 2 MB, 50 per member, magic bytes checked, sharp re-encode when installed, stored under
DATA_DIR/uploads/pages/<owner-hash>/<id>.<ext>, served at /u/pages/... immutable for a year; delete via
POST /api/my/pages/images/<id> {remove}. Pages editor: Upload image button beside the image field + a strip of
the member's images. Provider allowlist (17 autoresponders, Sendy by /subscribe path) exposed as `providers`;
the editor says "Recognised: AWeber" or "Unknown provider: plain post to <host>" at paste time; pub() carries
formProvider. Unknown hosts still allowed when parse-or-refuse passes.
Item 3 (zonereport.js, pages.summary): /api/my/reports returns {spins, pages, zones} (spins still spread at the
top level) for the chosen days; Pages and Zones sections on /reports with 30-day bars, totals, per-item tables,
phone width checked. Zone numbers are a read-only view over zones.json (zones.js untouched).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+40
-1
@@ -62,4 +62,43 @@ function html(parsed, defaultButton) {
|
||||
const inputs = parsed.fields.map(f => '<input class="lsin" type="' + f.type + '" name="' + escAttr(f.name) + '" placeholder="' + escAttr(f.placeholder) + '"' + (f.value ? ' value="' + escAttr(f.value) + '"' : '') + (f.required || f.type === 'email' ? ' required' : '') + '>').join('\n');
|
||||
return [open, hidden, inputs, '<button type="submit" class="cta">' + escAttr((parsed.buttonText || '').trim() || defaultButton) + '</button>', '</form>'].join('\n');
|
||||
}
|
||||
module.exports = { EMBED_MAX_CHARS, problem, parse, html };
|
||||
// -- known autoresponder providers (2026-10-10): the allowlist is about CLARITY, not blocking. A recognised action host
|
||||
// gets "Recognised: AWeber"; anything else is kept as a plain post to <host> with a note that we cannot vouch for it.
|
||||
// Hosts match the action host or any subdomain of it; `path` (a regex source) narrows by action path, e.g. Sendy on any host.
|
||||
const PROVIDERS = [
|
||||
{ name: 'AWeber', hosts: ['aweber.com'] },
|
||||
{ name: 'GetResponse', hosts: ['getresponse.com', 'getresponse.net', 'gr8.com'] },
|
||||
{ name: 'Mailchimp', hosts: ['list-manage.com', 'mailchimp.com'] },
|
||||
{ name: 'Kit (ConvertKit)', hosts: ['convertkit.com', 'kit.com', 'ck.page'] },
|
||||
{ name: 'ActiveCampaign', hosts: ['activehosted.com', 'activecampaign.com'] },
|
||||
{ name: 'MailerLite', hosts: ['mailerlite.com', 'mailerlite.io'] },
|
||||
{ name: 'SendFox', hosts: ['sendfox.com'] },
|
||||
{ name: 'systeme.io', hosts: ['systeme.io'] },
|
||||
{ name: 'Drip', hosts: ['getdrip.com'] },
|
||||
{ name: 'Sendy', hosts: [], path: '(^|/)subscribe/?$' },
|
||||
{ name: 'Brevo', hosts: ['sibforms.com', 'brevo.com', 'sendinblue.com'] },
|
||||
{ name: 'Constant Contact', hosts: ['constantcontact.com', 'constantcontactpages.com'] },
|
||||
{ name: 'Klaviyo', hosts: ['klaviyo.com'] },
|
||||
{ name: 'Moosend', hosts: ['moosend.com'] },
|
||||
{ name: 'Benchmark Email', hosts: ['benchmarkemail.com'] },
|
||||
{ name: 'beehiiv', hosts: ['beehiiv.com'] },
|
||||
{ name: 'Substack', hosts: ['substack.com'] }
|
||||
];
|
||||
function actionOf(embed) {
|
||||
const forms = String(embed || '').match(/<form\b[\s\S]*?<\/form>/gi); if (!forms || !forms.length) return null;
|
||||
const tag = forms[0].match(/<form\b[^>]*>/i); const a = tag ? attr(tag[0], 'action') : null;
|
||||
if (!a || !/^https?:\/\//i.test(a)) return null;
|
||||
try { return new URL(a); } catch (e) { return null; }
|
||||
}
|
||||
// { host, known, name, label, note } for a pasted form, or null when there is no usable action
|
||||
function provider(embed) {
|
||||
const u = actionOf(embed); if (!u) return null;
|
||||
const host = u.hostname.toLowerCase().replace(/^www\./, '');
|
||||
for (const pr of PROVIDERS) {
|
||||
const hostHit = pr.hosts.some(h => host === h || host.endsWith('.' + h));
|
||||
const pathHit = pr.path ? new RegExp(pr.path, 'i').test(u.pathname) : false;
|
||||
if ((pr.hosts.length && hostHit) || (!pr.hosts.length && pathHit)) return { host, known: true, name: pr.name, label: 'Recognised: ' + pr.name, note: 'Submissions go to ' + host + '.' };
|
||||
}
|
||||
return { host, known: false, name: '', label: 'Unknown provider', note: 'The form is kept as a plain post to ' + host + '; we cannot vouch for it.' };
|
||||
}
|
||||
module.exports = { EMBED_MAX_CHARS, PROVIDERS, problem, parse, html, provider };
|
||||
|
||||
Reference in New Issue
Block a user