VBB v1: Marty's approved numbers as config defaults (1 free credit/day; packs 10 for $3, 40 for $10; look $2; split 30/70 kept for later; 150 views per cycle; weekly prizes $15/$7/$3 per leaderboard, display only); packages page shows planned prices as coming soon; smoke test (99/99); OG image + icon; env example + compose (not deployed)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
// All runtime config comes from env (Coolify sets these). Read once.
|
||||
// VBB v1 is off-chain: no contract, no prices, no money. Rewards are recorded, not credited yet.
|
||||
// VBB v1 is off-chain: no contract, no payments. Planned prices are shown as "coming soon"; rewards are recorded, not credited yet.
|
||||
const path = require('path');
|
||||
|
||||
let cfg = null;
|
||||
function get() {
|
||||
if (cfg) return cfg;
|
||||
const e = process.env;
|
||||
const list = (v, d) => String(v == null || v === '' ? d : v).split(',').map(x => x.trim()).filter(Boolean);
|
||||
const num = (v, d, min, max) => { const n = Number(v); return Number.isFinite(n) && v !== '' && v != null ? Math.min(max, Math.max(min, Math.round(n))) : d; };
|
||||
cfg = {
|
||||
port: Number(e.PORT || 3000),
|
||||
@@ -26,8 +27,15 @@ function get() {
|
||||
visitWindowHours: 24, // one count per visitor key per 24 h
|
||||
perIpDay: num(e.VISITS_PER_IP_DAY, 3, 1, 100), // distinct user agents counted per IP per 24 h (shared connections, UA rotation)
|
||||
// members
|
||||
freeCreditsPerDay: num(e.FREE_CREDITS_PER_DAY, 1, 0, 10), // Marty 2026-11-13: 1 free post credit a day on sign-in
|
||||
freeCreditCap: num(e.FREE_CREDIT_CAP, 7, 1, 365), // daily free credits bank up to this many
|
||||
maxQueuedPerMember: num(e.MAX_QUEUED_PER_MEMBER, 3, 1, 100), // banners one member may have waiting at once
|
||||
// ---- Marty's approved numbers (2026-11-13). v1 takes no payments: packages show as "coming soon" with these planned prices,
|
||||
// prizes are displayed only (no payout code yet), the split is kept here for the contract step.
|
||||
packs: list(e.CREDIT_PACKS, '10:3,40:10').map(x => { const [credits, usd] = x.split(':').map(Number); return { credits, usd }; }).filter(x => x.credits > 0 && x.usd > 0),
|
||||
lookUsd: Number(e.LOOK_USD || 2), // banner look (border + hover teaser), per banner, one-time
|
||||
split: { sponsorPct: num(e.SPONSOR_PCT, 30, 0, 100), companyPct: 100 - num(e.SPONSOR_PCT, 30, 0, 100) }, // on-chain later, no line
|
||||
prizes: { visitors: list(e.PRIZES_VISITORS, '15,7,3').map(Number).filter(x => x >= 0), sources: list(e.PRIZES_SOURCES, '15,7,3').map(Number).filter(x => x >= 0) }, // USD per place, paid in POL
|
||||
linkProbe: e.LINK_PROBE !== '0', // check the target link answers and allows frames (off in the local smoke test)
|
||||
iapBase: String(e.IAP_URL || 'https://instantadpay.com').replace(/\/+$/, ''),
|
||||
lsBase: String(e.LS_URL || 'https://linkspin.app').replace(/\/+$/, ''),
|
||||
|
||||
Reference in New Issue
Block a user