My Stack POL: network sign-in through the hub + signed-in member area at /my (Marty approved 2026-11-19)
- networksso.js (shared file, same copy as IAP/LinkSpin/YPB): hub-only sign-in (HUB_SSO=on), silent check on /my, sign-out - my.js: signed session cookie (keyed off HUB_SECRET), sign-outs in the my-signouts.json MySQL document; /my shows the page link + on/off, Pro, join links per program, share kit, own payout rows with Polygonscan links and totals from the ledger - iapswitch.js: the page switch stays in IAP's stack-optin.json; Stack POL calls IAP POST /api/partner/stackpol/switch (signed, STACKPOL_SWITCH_KEY; spec in the file). Until IAP has it, /my links to IAP Promo tools - tools/indexer.py: snapshot gains `my` (every paid member's rows, wallets, page flag, IAP switches, Pro list); public data unchanged - header Sign in / My Stack POL entry; robots keeps /my and /sso/ out - qa/my.test.mjs: 66 checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,3 +10,4 @@ stackpol.com: every POL payout across the network, stacked. Live app since 2026-
|
||||
- Standing rule (Marty 2026-11-15): every rebuilt network site is added here when it goes live: a programs.js entry, its /earn/<slug> page (automatic from the entry, plus public/img/<key>.jpg 800x420) and an indexer source for its member payouts (house/company wallets excluded). ViralAdBlitz, 5xYourTeam and DownlineHydra added 2026-11-15.
|
||||
- Site assistant (2026-11-15): chat widget on every page (`public/assets/chat.js` + `chat.css`, loaded from layout.js). `chatbot.js` holds what it knows (CANNED + FACTS from this repo); `chatcore.js`, `kb.js` (kb.json is a MySQL document, see Storage) and `netkb.js` (the shared network knowledge on the hub, signed as `HUB_SITE=stackpol` with `HUB_SECRET`) are the same files as the rebuilt sites. OpenRouter key: Coolify env `OPENROUTER_API_KEY`. No admin KB editing on Stack POL. Test: `node qa/chatbot.test.mjs`.
|
||||
- Storage (Marty 2026-11-16: "they should live in the database"): MySQL, Coolify `stackpol-mysql` yw404lxgfkbb5n9s3pxu1hxk (db `stackpol`, binlog expiry 3 h persisted, in core's hourly dumps). App env `DOCSTORE_URL`; `docstore.js` (same file as LinkSpin, skips unchanged writes) keeps the data documents of DATA_DIR (/app/data, no volume) in table `docs`: `stack-index.json` (the last indexer snapshot minus `at`), `stack-index-at.json` ({at}), `kb.json` (chatbot entries), `netkb-cache.json` (network knowledge cache). Loaded before the server listens, so a deploy serves the last totals at once. The ingest API is unchanged. Without DOCSTORE_URL (local only) they are plain files in DATA_DIR.
|
||||
- My Stack POL (Marty approved 2026-11-19): signed-in member area at /my (my.js), "Sign in" / "My Stack POL" in the header. Network sign-in through the hub only (networksso.js, the shared file, unchanged copy of IAP's): envs HUB_SSO=on, HUB_URL, HUB_SECRET, HUB_SITE=stackpol (the last three already serve netkb). Needs stackpol in the hub's HUB_SSO_SITES. Session = signed cookie sp.sid (7 days, keyed off HUB_SECRET); sign-out writes my-signouts.json (MySQL document) so older cookies stop working. Shows the page link + switch, Pro (IAP's rule via stack-optin.json pro), join links (programs.js), share kit, and the member's own payout rows from the snapshot's `my` block (tools/indexer.py). The switch stays in IAP's stack-optin.json: iapswitch.js calls IAP POST /api/partner/stackpol/switch (spec in the file header) with STACKPOL_SWITCH_KEY; until IAP has that route and both apps have the key, /my links to IAP Promo tools instead. Test: node qa/my.test.mjs.
|
||||
|
||||
Reference in New Issue
Block a user