From 513c713292aade1a3c3c8a11025201469e0ff57e Mon Sep 17 00:00:00 2001 From: martbost Date: Thu, 1 Oct 2026 10:11:19 -0500 Subject: [PATCH] PassiveDrip moves from Games to an Earn-tab card (it is an earning site); members see it when site config passivedripLive=on, admin preview until then Co-Authored-By: Claude Opus 5.5 --- public/assets/my.js | 9 ++++++++- public/my.html | 11 ++++++++++- server.js | 14 ++++++++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/public/assets/my.js b/public/assets/my.js index fed15d5..c2b9ea1 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -774,7 +774,7 @@ // member ads: a fresh text ad in the strip under the title, and a banner at the foot of the pane IAP.adSlot('text', 'adStripTop'); if ($('adSlotPane-' + name)) IAP.adSlot('banner', 'adSlotPane-' + name); - if (name === 'earn') setEarnSub(earnSub); // refresh whichever sub-tab is active + if (name === 'earn') { setEarnSub(earnSub); loadPdCard(); } // refresh whichever sub-tab is active; PassiveDrip card (2026-10-01) else if (vidState.token) stopVideo(); if (name === 'profile') loadLineBanner(); if (name === 'line') { buildLineJump(); loadLineage(); loadUplineMessages(); loadCoach(); loadLinkStats(); loadProspects(); } @@ -1639,6 +1639,13 @@ launchReveal(); setInterval(launchReveal, 30000); // came from PolHunter (iap.return cookie): one card at the top of the Overview that sends them back // Games hub (2026-10-01): one card per game, the player's own progress where the game reports it + // PassiveDrip, our earning site: a card on the Earn tab (not a game, Marty 2026-10-01) + async function loadPdCard() { + const card = $('pdCard'); if (!card) return; + let j = null; try { j = await (await fetch('/api/my/passivedrip/card')).json(); } catch (e) {} + if (!j || !j.show) { card.hidden = true; return; } + card.hidden = false; $('pdPre').hidden = !j.preview; $('pdLine').textContent = j.line || ''; + } async function loadGames() { const el = $('gamesGrid'); if (!el) return; let g = null; try { g = await (await fetch('/api/my/games')).json(); } catch (e) {} diff --git a/public/my.html b/public/my.html index 5b00f3d..cafead4 100644 --- a/public/my.html +++ b/public/my.html @@ -613,6 +613,15 @@

+

Earn credits by viewing ads

@@ -1099,7 +1108,7 @@ - + diff --git a/server.js b/server.js index 148bfe5..ae39eaf 100644 --- a/server.js +++ b/server.js @@ -1255,8 +1255,6 @@ function GAMES() { art: DR_URL() + '/badges/ch5.jpg', play: '/api/my/driprunner', pays: 'POL to your wallet at 0.25', progress: drProgress }, { slug: 'polhunter', name: 'PolHunter', tag: 'Scavenger hunt', blurb: 'Hunt hidden codes on sites across the network. Every find drips POL straight to your wallet.', art: 'https://polhunter.com/img/hero-800.webp', play: '/api/my/polhunter', pays: 'POL per find' }, - { slug: 'passivedrip', name: 'PassiveDrip', tag: 'Faucet + games', blurb: 'Claim the faucet, view paid-to-click ads, roll the bonus and play the mini games for coins. One tap signs you in with this account, no new password.', - art: '/assets/passivedrip-card.svg', play: '/api/my/passivedrip', cta: 'Open', pays: 'POL to your wallet at 2,000 coins ($1)', progress: pdProgress }, ]; } // -- PassiveDrip hand-off (2026-10-01): same token shape as Drip Runner, its own secret (PD_SSO_SECRET, also stored in @@ -2469,6 +2467,18 @@ const server = http.createServer(async (req, res) => { sponsorRef: (acct && acct.sponsorRef) || null, joinedRef: (acct && acct.joinedRef) || null, joinedAt: (acct && acct.created) || null }); // the game credits referrals to the IAP sponsor res.writeHead(302, { Location: DR_URL() + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': 'iap.return=; Path=/; SameSite=Lax; Max-Age=0' + (IS_PROD ? '; Secure' : '') }); return res.end(); } + // -- PassiveDrip card on the Earn tab (Marty, 2026-10-01: "It's an earning site", not a game). Members see it when + // site config passivedripLive is 'on'; until then only the admin sees it, marked preview. + if (p === '/api/my/passivedrip/card' && req.method === 'GET') { + const s = await auth.fromRequest(req); + if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' }); + const live = String(siteConfig().passivedripLive || 'off') === 'on'; + const admin = !!(ADMIN_EMAIL && String(s.email).toLowerCase() === ADMIN_EMAIL); + if ((!live && !admin) || PD_SECRET().length < 32) return json(res, 200, { show: false }); + const acct = await accounts.byEmail(s.email); const memberId = (acct && acct.memberId) || s.memberId || 0; + let progress = null; try { progress = await pdProgress(memberId, s.email); } catch (e) {} + return json(res, 200, { show: true, preview: !live, line: progress && progress.line || null }); + } // -- PassiveDrip hand-off (2026-10-01): sign the member across; PassiveDrip verifies with the shared secret. // wallet = the signature-verified main wallet (accounts.linkWallet runs only after /api/auth/verify), offered there, never imposed. if (p === '/api/my/passivedrip' && req.method === 'GET') {