Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: tie dropped-bytes cap to maxSize, tighten changelog

Adam Eivy710a9d4d2583
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index c9dec57eb3..e454e8ddeb 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -14,7 +14,7 @@
## Changed
-- Video Gen FFLF mode: both the first-frame and last-frame slots now offer the same dual control — pick from your image gallery, OR upload a fresh image. Previously the first frame was upload-only and the last frame was gallery-only.
+- Video Gen FFLF mode now offers the same dual control on both the first-frame and last-frame slots — pick from your image gallery or upload a fresh image — instead of the previous upload-only first frame and gallery-only last frame.
- Release workflow no longer silently skips creating the GitHub Release when something else pushed the version tag before the workflow ran.
- Release-notes style guide tightened — entries should be one sentence per change in user-facing language, not code-review prose with file paths and internal symbols.
- Chief of Staff 3D avatars (Cyber, Sigil, Esoteric, Nexus, Muse) now fill the agent panel as a full-bleed background, with the title, status, and controls overlaying the scene instead of sharing a column with it.
diff --git a/server/lib/multipart.js b/server/lib/multipart.js
index f25f17d984..1a0e71f4fb 100644
--- a/server/lib/multipart.js
+++ b/server/lib/multipart.js
@@ -103,12 +103,16 @@ function streamMultipart(req, boundary, acceptedNames, maxSize, fileFilter, next
let endSeen = false; // 'end' event fired but we may still be flushing
let textCharCount = 0;
const TEXT_FIELD_TOTAL_CAP = 1024 * 1024; // 1MB cap on aggregate text fields
- // Cap the bytes we'll silently consume from non-matching file parts. Without
- // this, a client could keep the connection busy by streaming a huge file
- // under an unaccepted field name (we just discard the bytes, but the parser
- // would happily read forever). 50MB matches the typical accepted-file cap.
+ // Cap the bytes we'll silently consume from non-matching file parts.
+ // Without this, a client could keep the connection busy by streaming a huge
+ // file under an unaccepted field name (we just discard the bytes, but the
+ // parser would happily read forever). Tie the cap to the endpoint's own
+ // per-file `maxSize` so an endpoint configured for 1MB uploads doesn't
+ // accept ~50MB of dropped bytes before 413-ing — the effective DoS surface
+ // matches the declared upload limit. Endpoints with no limit (Infinity)
+ // get a safety default so the dropped-bytes path isn't itself unbounded.
let droppedFileBytes = 0;
- const DROPPED_FILE_TOTAL_CAP = 50 * 1024 * 1024;
+ const DROPPED_FILE_TOTAL_CAP = Number.isFinite(maxSize) ? maxSize : 50 * 1024 * 1024;
// Per-part state
let currentName = null;