Free check partly gated behind joining the network (Marty 2026-11-16)
Not signed in: grade, verdict, first finding and the opinion line; the rest (scores, findings, chain facts, screenshot, evidence) stays on the server. Join or sign in by one-time email link (hub /v1/join with the wwi.ref sponsor when HUB_JOIN=1; staging reads only). 1 free check a day without an account, 3 for members. Red flags deduped (deterministic VERIFIED one kept), grade recomputed on read. Privacy: joining and emails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,9 @@ const SCHEMA = [
|
||||
line_json TEXT, split_json TEXT, note VARCHAR(300), real_money TINYINT NOT NULL DEFAULT 0, INDEX (at), INDEX (buyer), INDEX (buyer_username), INDEX (buyer_wallet)) ENGINE=InnoDB`,
|
||||
`CREATE TABLE IF NOT EXISTS members (email VARCHAR(190) PRIMARY KEY, hub_id VARCHAR(40), username VARCHAR(60), wallet CHAR(42), sponsor VARCHAR(60), created BIGINT, last_seen BIGINT,
|
||||
INDEX (username), INDEX (wallet)) ENGINE=InnoDB`,
|
||||
`CREATE TABLE IF NOT EXISTS joins (token_hash CHAR(64) PRIMARY KEY, email VARCHAR(190) NOT NULL, username VARCHAR(40), ref VARCHAR(60), optin TINYINT NOT NULL DEFAULT 0,
|
||||
to_path VARCHAR(200), created BIGINT NOT NULL, expires BIGINT NOT NULL, confirmed_at BIGINT, ip_hash CHAR(24), status VARCHAR(16) NOT NULL DEFAULT 'pending',
|
||||
mailed TINYINT NOT NULL DEFAULT 0, hub_result VARCHAR(300), INDEX (email), INDEX (created)) ENGINE=InnoDB`,
|
||||
`CREATE TABLE IF NOT EXISTS sessions (id CHAR(48) PRIMARY KEY, email VARCHAR(190) NOT NULL, created BIGINT NOT NULL, expires BIGINT NOT NULL, INDEX (email)) ENGINE=InnoDB`
|
||||
];
|
||||
|
||||
@@ -36,6 +39,9 @@ async function init(url) {
|
||||
try { await pool.query('SELECT 1'); break; } catch (e) { if (i === 29) throw e; await new Promise(r => setTimeout(r, 2000)); }
|
||||
}
|
||||
for (const s of SCHEMA) await pool.query(s);
|
||||
for (const a of ['ALTER TABLE members ADD COLUMN optin TINYINT NOT NULL DEFAULT 0', "ALTER TABLE members ADD COLUMN via VARCHAR(20)"]) {
|
||||
try { await pool.query(a); } catch (e) { if (!/Duplicate column/i.test(e.message)) throw e; }
|
||||
}
|
||||
}
|
||||
const q = (sql, args) => pool.query(sql, args).then(r => r[0]);
|
||||
const one = async (sql, args) => (await q(sql, args))[0] || null;
|
||||
|
||||
Reference in New Issue
Block a user