aboutsummaryrefslogtreecommitdiffstats
path: root/index.ts
Commit message (Collapse)AuthorAgeFilesLines
* users: add authenticated self-delete endpointAdam Soltys2026-06-171-0/+1
| | | | | | | | | | | | Port of master 2548f757, adapted from Express to this stack's Hono handlers (c.get("user"), c.req.json(), setCookie, bail) and TigerBeetle balances (getBalance/getPending instead of the Redis balance:/pending: keys). POST /delete (auth) wipes every key tied to the calling user: user records, payments/invoices, sub-accounts, NWC apps, nostr follow graph + nip5. Gated by typing the username and refuses while balance+pending > 10k sats so funds can't be destroyed by accident. Co-Authored-By: Claude Opus 4.8 <[email protected]>
* payments: guard /replay double-credit race with SET NX idempotencyAdam Soltys2026-06-171-1/+1
| | | | | | | | | | | | Port of master ca28c19f to the staging stack. The getPayment() pre-check in the lightning listener/replay isn't atomic, so concurrent re-credits of the same settlement each ran the credit path. Claim each lightning/bolt12 settlement with an atomic SET NX on credited:<ref> (ref = preimage) and bail if already claimed. Guard sits before tbCredit and the pointer writes so a duplicate bails cleanly. Also disable the /replay route that triggered it. Co-Authored-By: Claude Opus 4.8 <[email protected]>
* ln/lightning: watchdog recycles zombie receive-listener socketAdam Soltys2026-06-081-1/+2
| | | | | | | | | | | | | | | | | | Port of master bd1ece3 to staging. When cl restarts (e.g. autoheal after a healthcheck timeout), the app's waitanyinvoice long-poll can hang on the now-dead listen socket: listenerActive stays true forever, nothing restarts it, and incoming lightning payments silently stop crediting until a manual app restart. The per-call RPC timeout can't catch this — waitanyinvoice is meant to block. ensureListenerAlive (run every 120s) now also detects a stalled listener — active but blocked in waitanyinvoice for >5min — probes cl via the main socket (getinfo), and only if cl is actually alive treats the listen socket as a zombie: bumps a listenerEpoch, calls lnListen.reset() (new: drops the proxy socket so the next call reconnects), and re-arms. The epoch guard makes the wedged invocation bow out when its waitanyinvoice finally rejects, so we never run two listeners or double-credit. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* remove /gateway endpointAdam Soltys2026-05-171-1/+0
| | | | | | | | | | | Unauthenticated arbitrary db.set abuse vector. Exploited on the master deployment to inflate user balances and override safety controls in real time, leading to a hot-wallet drain. Route and handler both fully removed; if a webhook-by-short-channel-id mapping is ever needed again it must be rebuilt with auth + SCID format validation + webhook URL validation + per-user ownership check. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* feat: blocked address protection, LNURL proxy, replay timestampsAdam Soltys2026-03-271-0/+1
| | | | | | | | | | - Add lib/changeid.ts for in-process account rekeying - Block sends to addresses in redis blocked_addresses set, auto-rekey on attempt - Add created param to credit() for accurate replay timestamps - Add paid_at to replay() for correct payment dates - Add /lnurl/proxy endpoint for server-side LNURL callback fetching Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* update migrate scriptAdam Soltys2026-03-161-14/+0
|
* ark delegationAdam Soltys2026-03-131-0/+20
|
* remove bumpestimateAdam Soltys2026-03-111-1/+0
|
* add LNURL-withdraw endpoints for fund-based NFC paymentsAdam Soltys2026-03-081-0/+2
| | | | Co-Authored-By: Claude Opus 4.6 <[email protected]>
* add group registry for MLS push notificationsAdam Soltys2026-03-061-1/+12
| | | | | | | | Server now tracks MLS groups (synced from clients) and subscribes to kind 445 events on group relays, sending push to all members except the sender. Registry persisted to Redis across restarts. Co-Authored-By: Claude Opus 4.6 <[email protected]>
* profile searchAdam Soltys2026-03-061-0/+3
|
* fund authorizationsAdam Soltys2026-03-041-0/+2
|
* funds routeAdam Soltys2026-03-041-0/+1
|
* sync vaultAdam Soltys2026-03-031-0/+1
|
* round feesAdam Soltys2026-03-031-1/+2
|
* fee bumpingAdam Soltys2026-03-021-1/+2
|
* delay startup routinesAdam Soltys2026-03-021-0/+2
|
* message notificationsAdam Soltys2026-03-011-0/+2
|
* delete endpointAdam Soltys2026-03-011-0/+1
|
* fix hono route orderAdam Soltys2026-02-281-2/+2
|
* hash pinsAdam Soltys2026-02-281-0/+2
|
* fix typescript issuesAdam Soltys2026-02-281-1/+1
|
* migrate to honoAdam Soltys2026-02-281-33/+29
|
* map updatesAdam Soltys2026-02-271-0/+1
|
* testAdam Soltys2026-02-261-0/+1
|
* client-side password authAdam Soltys2026-02-261-0/+1
|
* fix ark vault to custodial sendsAdam Soltys2026-02-261-0/+27
|
* formattingAdam Soltys2026-02-241-1/+7
|
* migrate funds to tbAdam Soltys2026-02-181-1/+2
|
* passkey authAdam Soltys2026-02-161-0/+4
|
* account level currency and autowithdraw settingsAdam Soltys2026-02-131-1/+2
|
* fix onchain confirmationsAdam Soltys2026-02-131-1/+2
|
* ark fixesAdam Soltys2026-02-091-0/+2
|
* payment forwardingAdam Soltys2026-02-061-0/+1
|
* microsatsAdam Soltys2026-02-061-1/+2
|
* tigerbeetleAdam Soltys2026-02-061-1/+4
|
* zmq logicAdam Soltys2026-02-061-2/+6
|
* ark syncAdam Soltys2026-02-061-0/+1
|
* arkAdam Soltys2026-02-061-0/+2
|
* health checkAdam Soltys2026-02-061-0/+3
|
* challenge verifyAdam Soltys2025-10-011-1/+0
|
* login challengeAdam Soltys2025-10-011-0/+1
|
* Merge branch 'patch-1'Adam Soltys2025-09-181-1/+1
|\
| * allow invoice owners to modify the webhookAdam Soltys2025-09-181-1/+1
| |
* | sendinvoice supportAdam Soltys2025-09-181-0/+1
|/
* flash routeAdam Soltys2025-09-111-2/+2
|
* remove test routeAdam Soltys2025-09-091-1/+0
|
* create external paymentsquareAdam Soltys2025-09-041-0/+1
|
* support readonly tokensAdam Soltys2025-09-041-0/+1
|
* invoice updateAdam Soltys2025-08-201-0/+1
|