Private pages served from private/ (who-gets-paid moved out of public/); new /team-reach training sheet behind the same key

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-29 14:00:59 -05:00
parent 0c9866699c
commit fbdeda68c6
3 changed files with 164 additions and 10 deletions
+15 -10
View File
@@ -1908,16 +1908,21 @@ const server=http.createServer(async(req,res)=>{
}
// /who-gets-paid is PRIVATE (Marty, 2026-09-27): only a link carrying ?k=<privateToolsKey> opens it, which sets a
// 30-day cookie; everyone else gets the site's 404, for the page and for its data. Not linked, not indexed.
if(req.method==='GET'&&(pathname==='/who-gets-paid'||pathname==='/who-gets-paid/')){
const key=String(getConfig().privateToolsKey||'').trim();
const k=new URL(req.url,'http://x').searchParams.get('k');
if(key&&k!==null){
if(k===key){res.writeHead(302,{Location:'/who-gets-paid','Set-Cookie':'rmc.priv='+encodeURIComponent(key)+'; Path=/; Max-Age=2592000; HttpOnly; SameSite=Lax; Secure','Cache-Control':'no-store'});return res.end();}
return staticFile(req,res,path.join(PUBLIC_DIR,'404.html'),404);
}
if(!privateToolsOk(req))return staticFile(req,res,path.join(PUBLIC_DIR,'404.html'),404);
return staticFile(req,res,path.join(PUBLIC_DIR,'who-gets-paid.html'));
}
// Private pages live in private/ (NOT public/, so the bare .html path can never bypass the key; the
// who-gets-paid page moved there 2026-09-29 after /who-gets-paid.html was found to answer 200 without a key).
// /team-reach = the "Two Who Get Two" training sheet Marty shares with the leaders (2026-09-29).
{ const PRIVATE_PAGES={'/who-gets-paid':'who-gets-paid.html','/team-reach':'team-reach.html'};
const pp=pathname.replace(/\/$/,'')||'/';
if(req.method==='GET'&&PRIVATE_PAGES[pp]){
const key=String(getConfig().privateToolsKey||'').trim();
const k=new URL(req.url,'http://x').searchParams.get('k');
if(key&&k!==null){
if(k===key){res.writeHead(302,{Location:pp,'Set-Cookie':'rmc.priv='+encodeURIComponent(key)+'; Path=/; Max-Age=2592000; HttpOnly; SameSite=Lax; Secure','Cache-Control':'no-store'});return res.end();}
return staticFile(req,res,path.join(PUBLIC_DIR,'404.html'),404);
}
if(!privateToolsOk(req))return staticFile(req,res,path.join(PUBLIC_DIR,'404.html'),404);
return staticFile(req,res,path.join(__dirname,'private',PRIVATE_PAGES[pp]));
} }
let file;
if(pathname==='/')file=path.join(PUBLIC_DIR,'index.html');else if(pathname==='/app'||pathname==='/app/')file=path.join(PUBLIC_DIR,'app.html');else if(pathname==='/start'||pathname==='/start/')file=path.join(PUBLIC_DIR,'start.html');else if(pathname==='/training'||pathname==='/training/')file=path.join(PUBLIC_DIR,'training.html');else if(pathname==='/presentation'||pathname==='/presentation/'||pathname==='/webinar'||pathname==='/webinar/')file=path.join(PUBLIC_DIR,'presentation.html');else if(pathname==='/admin'||pathname==='/admin/')file=path.join(PUBLIC_DIR,'admin.html');else if(pathname==='/my'||pathname==='/my/'||/^\/my\/\d{1,15}$/.test(pathname))file=path.join(PUBLIC_DIR,'my.html');else if(pathname==='/contract'||pathname==='/contract/')file=path.join(PUBLIC_DIR,'contract.html');else if(pathname==='/disclaimer'||pathname==='/disclaimer/')file=path.join(PUBLIC_DIR,'disclaimer.html');else if(pathname==='/privacy'||pathname==='/privacy/')file=path.join(PUBLIC_DIR,'privacy.html');else if(pathname==='/refunds'||pathname==='/refunds/')file=path.join(PUBLIC_DIR,'refunds.html');else if(pathname==='/how-pay-works'||pathname==='/how-pay-works/')file=path.join(PUBLIC_DIR,'how-pay-works.html');else if(false)file=null;else if(pathname==='/tools'||pathname==='/tools/')file=path.join(PUBLIC_DIR,'tools.html');else if(pathname==='/fast-start'||pathname==='/fast-start/')file=path.join(PUBLIC_DIR,'fast-start.html');else if(pathname==='/flyers'||pathname==='/flyers/')file=path.join(PUBLIC_DIR,'flyers.html');else if(pathname==='/weekly-rhythm'||pathname==='/weekly-rhythm/')file=path.join(PUBLIC_DIR,'weekly-rhythm.html');else if(pathname==='/generation-pay'||pathname==='/generation-pay/')file=path.join(PUBLIC_DIR,'generation-pay.html');else if(pathname==='/replays'||pathname==='/replays/')file=path.join(PUBLIC_DIR,'replays.html');else if(pathname==='/suite'||pathname==='/suite/')file=path.join(PUBLIC_DIR,'suite.html');else if(pathname==='/suite/copy'||pathname==='/suite/copy/')file=path.join(PUBLIC_DIR,'suite-copy.html');else if(pathname==='/suite/page'||pathname==='/suite/page/')file=path.join(PUBLIC_DIR,'suite-page.html');else if(pathname==='/suite/email'||pathname==='/suite/email/')file=path.join(PUBLIC_DIR,'suite-email.html');else if(pathname==='/suite/video'||pathname==='/suite/video/')file=path.join(PUBLIC_DIR,'suite-video.html');else if(pathname==='/suite/traffic'||pathname==='/suite/traffic/')file=path.join(PUBLIC_DIR,'suite-traffic.html');else if(pathname==='/suite/voice'||pathname==='/suite/voice/')file=path.join(PUBLIC_DIR,'suite-voice.html');else if(pathname==='/suite/split'||pathname==='/suite/split/')file=path.join(PUBLIC_DIR,'suite-split.html');else if(pathname==='/suite/funnel'||pathname==='/suite/funnel/')file=path.join(PUBLIC_DIR,'suite-funnel.html');else if(pathname==='/suite/leader'||pathname==='/suite/leader/')file=path.join(PUBLIC_DIR,'suite-leader.html');else if(pathname==='/suite/founder'||pathname==='/suite/founder/')file=path.join(PUBLIC_DIR,'suite-founder.html');else if(pathname==='/wallet-check'||pathname==='/wallet-check/')file=path.join(PUBLIC_DIR,'wallet-check.html');else if(pathname==='/suite/brand'||pathname==='/suite/brand/')file=path.join(PUBLIC_DIR,'suite-brand.html');else if(pathname==='/suite/grants'||pathname==='/suite/grants/')file=path.join(PUBLIC_DIR,'suite-grants.html');else if(pathname==='/suite/intel'||pathname==='/suite/intel/')file=path.join(PUBLIC_DIR,'suite-intel.html');else if(pathname==='/direct-join'||pathname==='/direct-join/'){if(!getSession(req)){res.writeHead(302,{Location:'/admin'});return res.end();}file=path.join(ROOT,'private','direct-join.html');}else if(pathname==='/join-now'||pathname==='/join-now/'){if(!getConfig().dappFallbackPublic){res.writeHead(302,{Location:'/start'});return res.end();}file=path.join(ROOT,'private','join-now.html');}else if(/^\/join\/\d{1,15}$/.test(pathname))file=path.join(PUBLIC_DIR,'join.html');else if(pathname==='/join'||pathname==='/join/'){res.writeHead(302,{Location:'/join-now'});return res.end();}else{
const safe=path.normalize(pathname).replace(/^([.][.][/\\])+/, '').replace(/^[/\\]+/,'');file=path.join(PUBLIC_DIR,safe);if(!file.startsWith(PUBLIC_DIR))file='';