Share-link domains: ctbgo.com (active, site config shareDomain) and mylinehq.com (spare) 302 /<name> to /join/<name> (query kept, noindex); member invite line and promo tools now hand out https://ctbgo.com/<name>; old instantadpay.com/join links keep working
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -725,6 +725,10 @@ function siteConfig() {
|
||||
supportTelegramChat: '1289244227', // help desk pings: Marty's PRIVATE chat only (a positive user id; group/channel ids are refused). Sent with telegramBotToken, Hermes bot as fallback
|
||||
supportTemplates: '', // help desk saved replies, JSON [{name, body}] (Admin > Support > Saved replies); empty = the built-in set
|
||||
telegramGamesChatId: '', telegramGamesTopicId: '661565', // Game Achievements topic for the weekly Pass Tournament post (chat blank = the shared echo chat)
|
||||
// share-link domain (2026-10-20, Marty): member invite links go out as https://<shareDomain>/<username>, which 302s to
|
||||
// /join/<username> here, so shared links do not carry instantadpay.com (Spamhaus DBL). '' = old instantadpay.com/join links.
|
||||
// Switch to the spare (mylinehq.com) if one gets flagged. Old links keep working either way.
|
||||
shareDomain: 'ctbgo.com',
|
||||
pnlFixedMonthlyUsd: 0
|
||||
}, saved);
|
||||
}
|
||||
@@ -1880,11 +1884,20 @@ async function gameAnswer(g, slug, acct) { // the game token (only once a userna
|
||||
return { ok: true, needUsername, username: acct.username || null, token: needUsername ? null : g.mint(acct, memberId), pass: gamePassMint(acct.email, slug) };
|
||||
}
|
||||
|
||||
const SHARE_HOSTS = String(process.env.SHARE_HOSTS || 'ctbgo.com,mylinehq.com').split(',').map(x => x.trim().toLowerCase()).filter(Boolean);
|
||||
const server = http.createServer(async (req, res) => {
|
||||
{ const t0 = Date.now(); res.on('finish', () => { const ms = Date.now() - t0; if (ms > 3000) console.warn('slow request', req.method, String(req.url || '').split('?')[0].slice(0, 80), ms + 'ms', res.statusCode); }); } // visibility for member-felt delays (2026-10-12)
|
||||
try {
|
||||
const u = new URL(req.url, 'http://x');
|
||||
const p = u.pathname;
|
||||
// share-link domains (ctbgo.com, mylinehq.com): /<ref> goes to that member's join page, anything else to the same path
|
||||
// here. 302 (not 301) so links never get pinned in caches; the query (?v= angle, ?promo=) rides along.
|
||||
{ const sh = String(req.headers.host || '').toLowerCase().replace(/:\d+$/, '').replace(/^www\./, '');
|
||||
if (SHARE_HOSTS.includes(sh)) {
|
||||
const ref = /^\/([A-Za-z0-9_]{1,40})\/?$/.exec(p);
|
||||
const to = 'https://instantadpay.com' + (p === '/' ? '/' : ref ? '/join/' + ref[1] : p) + (u.search || '');
|
||||
res.writeHead(302, { Location: to, 'Cache-Control': 'no-store', 'X-Robots-Tag': 'noindex' }); return res.end();
|
||||
} }
|
||||
|
||||
// -- traffic log: public page views by referring domain (admin > Traffic)
|
||||
if (req.method === 'GET' && (TRAFFIC_PAGES.has(p) || /^\/(join|from|wall|blog)\/[^/]+$/.test(p))) traffic.hit(p.startsWith('/blog/') ? '/blog/*' : p, req.headers.referer, req.headers['user-agent']);
|
||||
|
||||
Reference in New Issue
Block a user