Repository navigation
fix(engine,producer): render-network setting reads like a switch; render-service probes stay on checked inputs - #7807
Conversation
…d restrict on an unknown value true, 1, yes and on turn the render network restriction on and false, 0, no and off leave it off, in any letter case and with surrounding whitespace. Unset or blank stays off for local renders. Any other value now restricts and logs a warning once, instead of leaving the render browser and ffmpeg URL inputs unrestricted.
…n URL from a downloaded copy With PRODUCER_RESTRICT_PAGE_NETWORK on, a video URL the composition names is fetched through the shared downloader (resolved-address check, pinned connection, per-hop redirect checks) before ffprobe reads it, and skipped if the download is refused. In a distributed audio step the copy lands in the mixer's work folder, so the mix reuses it instead of downloading again. Without the flag the probe reads the URL as before.
…t be a self-contained container With PRODUCER_RESTRICT_PAGE_NETWORK on, every https input ffmpeg or ffprobe opens directly (such as a signed storage URL for a project's video or audio sidecar) also gets -format_whitelist with the same self-contained containers the Studio media helpers allow. A playlist, manifest or concat list stored under a media file name can no longer make ffmpeg open other network locations. Local renders are unchanged.
… and downloads once A composition URL is skipped, with one warning, only when the download address rules refuse it. Timeouts, HTTP errors and a cancelled render fail the probe as before. Videos without sound, muted or hidden are not downloaded. The in-process extract stage passes the render's abort signal and the mixer's work folder, so the mix reuses the copy.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Edit accuracy: accurate 267 (base branch 267), smooth 113 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (3)
|
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 60fb369
The network switch preserves the existing unset/blank default, accepts the documented case/whitespace variants, and restricts unknown values. The audio-only probe uses the checked downloader and the mixer's work directory; only address-policy refusals are skipped, while other download failures and cancellation propagate. Existing HTTPS ffmpeg/ffprobe input paths share the new format restriction.
Nit — share the supported demuxer list (packages/engine/src/utils/urlInput.ts:15–16, packages/studio-server/src/helpers/mediaExtensions.ts:35–39). The new list duplicates the existing media-input list byte for byte. Move the list to a lower-level shared module in a follow-up so support changes cannot drift between the renderer and Studio/CLI helpers.
Validation through the shared gate: frozen install/full bun run build passed. Engine config, urlInput, browserManager, ffprobe.remoteIdentity and urlDownloader suites: 361 passed. Producer videoAudioProbe and planAudioCompat: 15 committed tests passed, plus 1 temporary real-ffprobe control passed showing a downloaded list does not reach a second HTTP endpoint on this host. Reverting the config and URL-input changes makes 10 tests fail, 127 pass. Restored all temporary changes. The producer tests cover permitted media with a downloader stand-in and real local probing, refusal, cancellation and work-folder placement; no actual public-network render or Lambda/cloud deployment was exercised.
Commands: bun run --cwd packages/engine test src/config.test.ts src/utils/urlInput.test.ts src/services/browserManager.test.ts src/utils/ffprobe.remoteIdentity.test.ts src/utils/urlDownloader.test.ts --maxWorkers=1; producer: bun test src/services/render/stages/videoAudioProbe.test.ts src/services/distributed/planAudioCompat.test.ts.
Need: yes · Size: ok, three related host-policy fixes · Reuse: checked downloader, audio-work cache and shared URL-input arguments · Simpler: already bounded · Structure: extract the duplicate demuxer list into the existing lower-level media contract
Risk: medium — changes render-host network configuration and remote media probing.
Verdict: APPROVE
Reasoning: The change preserves the default and permitted-media path while closing the intended policy gaps; the duplicate list is a nonblocking maintenance follow-up.
— Rames
…ne size budget audioWorkDir moves to render/shared.ts, so tests that replace the audio stage module still load the orchestrator. The format-whitelist test probe ends its options with -- as the ffprobe argv contract requires. The engine packed size budget rises to 500000 bytes.
|
CI fixes in d5abeb4, on top of a merge of main:
The full producer vitest lane passes 91/91. One plan audio test times out intermittently on |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at d5abeb4
Re-reviewed the delta from 60fb369. The four original commits are preserved, and the main merge has no manual conflict-resolution delta. The new production change moves unchanged audioWorkDir() into render/shared.ts; all three callers use that location, with no new runtime import cycle. The other changes repair the ffprobe test invocation and raise the engine packed-size budget. The prior demuxer-list reuse nit remains nonblocking.
Validation through the shared gate: frozen install/full bun run build passed; engine config/URL-input tests 137 passed, producer probe/plan-audio tests 15 passed. pnpm pack --json measures the engine at 495,980 packed / 1,662,133 unpacked bytes, within the declared 500,000 / 1,742,862 budgets. No real public-network/cloud render or dev walkthrough performed.
Commands: bun run --cwd packages/engine test src/config.test.ts src/utils/urlInput.test.ts --maxWorkers=1; producer bun test src/services/render/stages/videoAudioProbe.test.ts src/services/distributed/planAudioCompat.test.ts; engine pnpm pack --json --pack-destination <temporary-directory>.
Need: yes · Size: focused integration follow-up · Reuse: shared render helper module · Simpler: unchanged helper, one owner · Structure: fine (checked all three imports and the shared module's type-only orchestrator dependency; no split)
Risk: medium — underlying change restricts render-host networking; this delta preserves that policy.
Verdict: APPROVE
Reasoning: The helper relocation integrates cleanly, the tests load the real producer successfully, and the measured package fits its budget.
— Rames
What
Three render-service hardening fixes. Local renders, which don't set the render-network setting, are unchanged.
PRODUCER_RESTRICT_PAGE_NETWORKacceptstrue,1,yesandonto turn on, andfalse,0,noandoffto turn off, in any case and with spaces around them. Unset or blank stays off. Any other value restricts and warns once per distinct value, instead of failing open.srcis downloaded through the shared downloader (pinned DNS, every redirect checked) into the mixer's work folder, and probed from that copy. The mix reuses it. A URL the address rules refuse is skipped, with one warning. Not-found errors, timeouts and cancels fail as before. Videos that are silent, muted or hidden aren't downloaded.-format_whitelistof self-contained formats as fix(cli,studio-server): received-file guard covers subfolders and spellings; playlists named as media never reach ffmpeg #7771. A playlist named.mp4then fails to open instead of steering ffmpeg to other inputs.Why
These are three paths where a composition could make the render host reach addresses, or open inputs, that the render-network setting is meant to keep out:
Related work
Refs #7758, #7764, #7771, #7780.
How
engine/config.ts:resolveRestrictPageNetworkparses the value. Docs are updated.producer/services/render/stages/extractVideosStage.ts: the probe usesdownloadToTempwhen the setting is on, gets the cancel signal and the mixer's work folder, and skips silent, muted and hidden videos.engine/utils/urlInput.ts: adds-format_whitelistfor https inputs when the setting is on.Test plan
Unit tests added/updated
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug
engine vitest (
config,urlInput,browserManager,ffprobe.remoteIdentity): 267 pass, 3 skipped. producer bun:videoAudioProbe10/10, plan audio 12/12. downloader: 91/91.The new tests fail on
main.Manual:
-format_whitelistis accepted by ffprobe 4.0.2 (the same package version Lambda uses), ffprobe 4.4, ffmpeg 6.0 and ffmpeg 8. These all still open: mp4, mov, m4a, webm, mkv, ts, avi, mp3, aac, wav, ogg/opus, flac, aiff, png, jpg, gif, bmp and tiff. An HLS list named.mp4is refused.Not run: a real Lambda or cloud render. The Lambda loader still picks remote files by extension; binding that to checked content is a larger change.