Commit Graph

8 Commits

Author SHA1 Message Date
Keysat 238689ddcc Persist payment-webhook dedup; declare BTCPay required; scope CORS
Replace the in-memory dedup Sets in the BTCPay and Zaprite webhook
handlers (and the BTCPay rescan path) with a persistent JSON-backed
store (server/webhook-dedup.js). The in-memory sets were cleared on
restart, so a duplicate webhook delivery straddling a relay restart
could double-credit (BTCPay) or double-extend a subscription (Zaprite).
The store atomically writes /data/processed-webhooks.json, namespaces
keys per rail (storeId|invoiceId vs zaprite:orderId), and prunes
entries older than 180 days (safely beyond any retry window).

Also:
- BTCPay is a required running dependency (operator decision). Config
  was already optional:false/kind:'running'; corrected the contradictory
  "optional" comment in the manifest to match.
- Scope cors() to /relay/* only — off /admin/* and the same-origin
  dashboard, which don't need permissive CORS.
- Add money-path unit tests (commitCredit/refundCredit/applyTierPromotion)
  and webhook-dedup tests (incl. the survives-a-restart guarantee).
- Fix two AGENTS.md auth-doc drifts; refresh Current state.

Version 0.2.125 -> 0.2.126.
2026-06-15 18:15:00 -05:00
Keysat 693d72431b Return clean JSON for body-parser/unhandled errors
Malformed JSON request bodies fell through to Express's default error
handler, which renders an HTML page including the local-filesystem stack
trace (info leak). Add a final error-handling middleware: JSON 400 for
entity.parse.failed, 413 for entity.too.large, generic 500 otherwise —
closing the stack-trace leak on every propagated error, not just JSON.
2026-06-13 18:22:00 -05:00
Keysat 318c6c4b81 Wire new routes; identity, summarize-url, dashboard, admin 2026-06-13 13:36:30 -05:00
local b7f75904bb v0.2.11 /relay/capabilities + /relay/transcribe-url (yt-dlp in container) 2026-05-12 01:33:34 -05:00
local 05ebeb5d51 v0.2.8 operator dashboard with per-call audit log + cost tracking 2026-05-12 00:26:59 -05:00
local e612e8b8e8 v0.2.4 max-monthly union + /relay/policy 2026-05-11 22:02:38 -05:00
local 07fe14010c v0.2.2 balance peek endpoint 2026-05-11 21:34:31 -05:00
local b9d86fa303 initial relay scaffold 2026-05-11 20:03:27 -05:00