Commit Graph

34 Commits

Author SHA1 Message Date
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 da1bba2e6b Compare operator key in constant time
resolveIdentity and verifyOperatorKey compared the shared
relay_cloud_operator_key with ===/!==, which short-circuits on the first
differing byte — a timing oracle on a high-value key. Use a
timingSafeEqual-based constantTimeEqual, matching admin-auth.js.
2026-06-13 18:22:00 -05:00
Keysat cbd9748a79 Guard meeting :id against path traversal
saveMeeting/loadMeeting/deleteMeeting built path.join(meetingsDir, id +
'.json') straight from req.params.id, so an admin-authed :id like
'../../etc/passwd' could read/write/delete outside internal-meetings/.
Centralize a meetingPath() helper that strips anything outside
[A-Za-z0-9_-] (mirrors output-store.js) and throws on an empty result;
load/delete catch it as 404/no-op. Add a regression test.
2026-06-13 18:22:00 -05:00
Keysat 54ddaffced Mark P1 work queue done in Current state 2026-06-13 16:23:55 -05:00
Keysat 3a601e166a Bump multer 1.4.5-lts.1 -> ^2.0.1 (DoS CVEs)
multer 1.x is affected by CVE-2025-47944/47935/48997/7338 (malformed
multipart crashes the process / leaks memory). 2.x raises catchable
errors instead. Usage (diskStorage + .single("file")) is unchanged.
Commit the server lockfile so the Dockerfile's npm-ci path pins the fix.
2026-06-13 16:23:26 -05:00
Keysat d2caa98248 Fix credit-counter reset on early subscription renewal
extendUserTier called setUserTier, which unconditionally zeroed
monthly_consumed and re-anchored the cycle. A user who renewed mid-cycle
(or a webhook double-firing across a restart) got their full monthly
allotment back for free. The monthly cycle already rolls on its own
anniversary via ensureRenewalRollover, so renewal must not reset it. Add
resetCycle to setUserTier (default true, preserving operator-grant
behavior); extendUserTier passes false for an in-force subscription and
true only for a brand-new or lapsed one. Add regression tests.
2026-06-13 16:23:26 -05:00
Keysat 8ad7c54da4 Block SSRF on media_url downloads (transcribe-url/summarize-url)
downloadDirect fetched any caller-supplied media_url with redirect-follow
and no host/scheme validation; the route is reachable via a self-chosen
X-Recap-Install-Id, so a caller could probe the operator's LAN or cloud
metadata (169.254.169.254). Add safe-url.js: assertPublicHttpUrl rejects
non-http(s) schemes and hosts resolving to private/loopback/link-local/
reserved ranges, and safeFetch follows redirects manually, re-validating
each hop. Route downloadDirect through it (covers transcribe-url,
summarize-url, and admin-test-run).
2026-06-13 16:23:26 -05:00
Keysat 0b90120b72 Triage full-eval findings into Current state (work queue / known debt / deferred) 2026-06-13 16:14:44 -05:00
Keysat b08e836c15 Add full-eval report (EVALUATION.md) 2026-06-13 15:52:05 -05:00
Keysat 4d5dd2db49 Mark git catch-up done; refresh Current state and ROADMAP 2026-06-13 13:38:09 -05:00
Keysat fb11dd6a04 Trim AGENTS.md; extract internal-meetings guide + lazy-load wiring 2026-06-13 13:36:46 -05:00
Keysat 1243f4414c Package v0.2.12→v0.2.124: manifest, actions, version graph 2026-06-13 13:36:30 -05:00
Keysat 318c6c4b81 Wire new routes; identity, summarize-url, dashboard, admin 2026-06-13 13:36:30 -05:00
Keysat 04dcf86fa4 Add TTS backends (ElevenLabs, Kokoro) and /relay/tts 2026-06-13 13:36:05 -05:00
Keysat 0aa648706e Add self-serve billing: tiers, credits, BTCPay and Zaprite 2026-06-13 13:36:05 -05:00
Keysat 84d56c94c9 Add Spark Control hardware backend (diarize, queue, discovery) 2026-06-13 13:36:04 -05:00
Keysat 705807e286 Add internal-meetings pipeline and post-hoc speaker tools 2026-06-13 13:35:53 -05:00
Keysat 9a2dbf69df Add cross-repo change-impact convention 2026-06-13 12:18:40 -05:00
Keysat 87227a7ca6 Correct agent-doc accuracy: full /admin route list, git-state precision
AGENTS.md: append four real /admin routes the list omitted (job-output/:id, output-store-ids, settings/promote-prompt, test-run-suite); replace the stale HEAD hash with 'last code commit is v0.2.11, docs-only commits on top'. ROADMAP.md: fix the untracked count + HEAD wording; drop the two now-resolved doc-precision follow-ups.
2026-06-13 12:02:36 -05:00
Keysat 7e5a7e3b7e Document server-side endpoint contract; correct Current state precision
- AGENTS.md: add Endpoints section — auth model (cloud operator-key path,
  license/install-id path, admin session cookie, BTCPay HMAC) plus full
  /relay/* surface (public + operator-key-only control plane), the
  /admin/* dashboard, and the /admin/internal-meetings/* API.
- AGENTS.md: rewrite Current state with verified git facts — HEAD is the
  prior docs commit, HEAD~1 is v0.2.11, working tree at v_0_2_124, file
  counts pulled live from git status.
- ROADMAP.md: log two doc-precision follow-ups caught in review (the
  working-tree counts drift fast; the admin-route shortlist silently
  omits three real routes).
2026-06-13 11:13:12 -05:00
Keysat 6fa175adb2 Add agent docs (AGENTS.md, ROADMAP.md, CLAUDE.md symlink) 2026-06-13 10:38:51 -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 0a0fa009ec v0.2.10 hardware backend URL normalization + path fallback 2026-05-12 01:00:48 -05:00
local 8ffc3ffb73 v0.2.9 Gemini model selects + fallback chain 2026-05-12 00:45:41 -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 9af70302b1 v0.2.7 configurable Gemini models + per-pipeline backend preference 2026-05-12 00:15:07 -05:00
local cd377683fb v0.2.6 calendar-anniversary billing 2026-05-11 23:02:57 -05:00
local 45c8462fa2 v0.2.5 grouped actions 2026-05-11 22:12:02 -05:00
local e612e8b8e8 v0.2.4 max-monthly union + /relay/policy 2026-05-11 22:02:38 -05:00
local 6797aae404 v0.2.3 Core tier 10/5/5 split + dynamic health version 2026-05-11 21:53:50 -05:00
local 07fe14010c v0.2.2 balance peek endpoint 2026-05-11 21:34:31 -05:00
local c9f051cd07 v0.2.1 model names config-driven 2026-05-11 20:27:19 -05:00
local cccbee27e4 v0.2 hardware backend 2026-05-11 20:14:50 -05:00
local b9d86fa303 initial relay scaffold 2026-05-11 20:03:27 -05:00