aboutsummaryrefslogtreecommitdiffstats
path: root/lib/register.ts
Commit message (Collapse)AuthorAgeFilesLines
* users: reserve service names on registration and renameAdam Soltys2026-09-211-2/+2
| | | | | | | | | | | | A username is also a lightning address, so a name that reads as the service collects payments meant for it. "mint" was registered days after the ecash redesign freed it and received payments addressed to [email protected]; the reserved list held only "ecash", and was duplicated in two places. One shared list now, checked on both paths, covering the service-sounding names an account should never be able to take. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
* security: drop the admin endpoint surface and land pending hardeningAdam Soltys2026-09-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the admin-gated endpoints and the account flags they set, plus a batch of hardening that had accumulated uncommitted in the tree. These were deployed and verified together, so they land as one change. admin surface: - drop POST /hidepay, POST /unlimit and GET /users, their handlers, and the now-unused admin preValidation export - `unlimited` was only ever written, never read; `hidepay` only appeared in output projections. Both flags go, along with their whitelist, public-fields and type entries. request log: - redactBody now recurses. It only masked top-level keys, so a body that nests credentials one level down wrote them to the log in plaintext, and pin fields were not on the list at all. payments: - sendOnchain/build gate `aid` through requireAccount, so a caller can only spend from an account it owns - sendOnchain signs only a tx we composed, matched against a short-lived per-account build receipt - raise xpay retry_for to 60s; route-finding preferred a drained zero-fee hop and burned the whole budget on it. check()'s reversal window keeps its 2x margin. ecash / invoices / webhooks: - resolve a token's mint through the IP-pinning fetcher instead of plain fetch, closing an unauthenticated SSRF path into the internal network - reject non-positive amounts before the balance write - /sign requires the caller to own the address, rather than signing under any address the hot wallet controls - webhook delivery no longer disables TLS verification; the body carries the merchant's shared secret registration: - refuse a username the v3 registrar holds unless the caller's own nostr key is the holder (lib/names.ts) liquid: - honour the deposit kill switch at invoice generation and at credit elements image: - pin 23.3.4 and verify the release tarball checksum Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0112TGi9GGNWqji1XQ5jZRzc
* auth: hash passwords at bcrypt cost 12 with transparent upgrade (S2)Adam Soltys2026-08-071-1/+1
| | | | | | | | | | Registration, password change, and admin reset all hashed at bcrypt cost 4 (16 rounds, ~1,300 guesses/s/thread) — the single factor gating the custodial balance and the nip49 passphrase for the stored nostr key. Raise all three sites to cost 12, and on successful login re-hash any legacy cost-4 hash now that we hold the verified plaintext. Co-Authored-By: Claude Opus 4.8 <[email protected]>
* analytics: monthly insight reports + signup instrumentationAdam Soltys2026-06-031-0/+3
| | | | | | | | | | | | | | | | | | | | | scripts/analytics.ts — streams live db (SCAN, never KEYS) and reports for a trailing window (default 30d): MAU/WAU, new users, custody total + top holders, network volume by type (lightning/liquid/bitcoin/internal/bolt12/ fund), most-active and highest-volume users, and bolt12 recipients with a "regular" flag for the Ocean mining-reward stream. scripts/analytics-geo.ts — top countries from the request log. Counts only /login + /register events tied to a username (raw cf-ipcountry volume is dominated by datacenter/nostr traffic). Surfaces a distinct-IP-per-country column so proxy/VPN egress is visible, and filters a known credential-test bot IP. Honest result: US #1, then GB/CA/JP/DE/ES/BR. lib/register.ts — stamp `created` (ms epoch) and store `country` (CF/ ipregistry code) on new users, so future reports get real signup timing and geography from the db directly instead of log archaeology. Existing users predate this; backfill is out of scope. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* check usernameAdam Soltys2026-01-191-0/+1
|
* check for syncSquareAdam Soltys2025-09-081-1/+1
|
* reserved usernamesAdam Soltys2025-08-071-0/+2
|
* rm logAdam Soltys2025-07-111-2/+0
|
* fresh attributeAdam Soltys2025-07-101-0/+2
|
* username checksAdam Soltys2025-06-161-1/+1
|
* increase default nwc limitAdam Soltys2025-06-161-1/+1
|
* strip spacesAdam Soltys2025-02-251-2/+2
|
* allow spacesAdam Soltys2025-02-251-1/+1
|
* set app created timeAdam Soltys2025-02-191-0/+1
|
* nwc app prefixAdam Soltys2025-02-131-1/+1
|
* add uid to default appAdam Soltys2025-02-131-2/+4
|
* fix registrationAdam Soltys2025-02-111-3/+2
|
* default app on registerAdam Soltys2025-02-111-1/+12
|
* send nsec on registrationAdam Soltys2025-01-101-1/+3
|
* fix variable scope issueAdam Soltys2024-12-311-1/+1
|
* nostr registrationAdam Soltys2024-12-301-6/+9
|
* fix pubkey registrationAdam Soltys2024-12-301-11/+8
|
* return nwc and token on registrationAdam Soltys2024-12-031-0/+13
|
* biome lintAdam Soltys2024-10-311-6/+6
|
* pubkeys cacheAdam Soltys2024-10-141-0/+1
|
* default followsAdam Soltys2024-10-141-0/+2
|
* reconcile onchain balanceAdam Soltys2024-09-241-5/+15
|
* increase bcrypt roundsAdam Soltys2024-09-031-5/+6
|
* typescriptAdam Soltys2024-08-261-0/+62