Skip to content

fix(transcode): allow catalogued symlink media - #644

Merged
Quick104 merged 1 commit into
mainfrom
agent/fix-transcode-symlink-auth
Aug 15, 2026
Merged

Quick104 merged 1 commit into
mainfrom
agent/fix-transcode-symlink-auth

Conversation

@Quick104

Copy link
Copy Markdown
Contributor

Summary

  • Replace remote transcode input authorization based on resolved library-root containment with exact active media-catalog membership.
  • Keep scanner-supported symlink paths playable, including logical library links whose physical target is mounted elsewhere on the node.
  • Continue rejecting protocol inputs, relative or uncatalogued paths, missing files, directories, and authorization repository failures.

Root cause

The scanner follows readable symlinks and intentionally stores the logical path. The remote transcode node instead resolved both the library root and media path and required the physical target to remain under the logical root. Valid catalogued media was therefore rejected before FFmpeg started whenever its symlink target lived on a separate mounted tree.

Closes #643

Security boundary

The exact active media_files.file_path row is now the authorization boundary. A local os.Stat check still requires that path to resolve to a regular file on the worker. Arbitrary control-plane paths remain denied, and database errors fail closed.

A host operator who can retarget a catalogued symlink can change the file read by FFmpeg; that is the same filesystem trust already required for scanner-supported symlink media.

Validation

  • go test -race ./internal/transcodenode ./internal/scanner -count=1
  • Database-backed TestFileRepositoryIsActivePath against local Postgres
  • go vet ./...
  • golangci-lint run --new-from-merge-base=origin/main ./... — 0 issues
  • cd web && pnpm run lint && pnpm run format:check — passes (151 existing warnings, 0 errors)
  • make verify-local-paths
  • make test — every package except internal/jellycompat passes; two unchanged process-lock tests fail on this macOS host (TestBeginWebOperationRecoversDeadProcessLock, TestBeginWebOperationRejectsLiveProcessLock)
  • make lint — full-tree Go lint remains blocked by the repository's existing baseline (305 findings); changed-line CI lint is clean

AI Disclosure

  • Tool(s): T3 Code (Codex)
  • Model(s): gpt-5.6-sol
  • Involvement: fully AI-generated
  • Adversarial review: traced protocol and path-traversal inputs, inactive and missing catalog entries, non-regular files, database failures, symlink retargeting, and the stat-to-open race; the exact active catalog gate and regular-file recheck preserve the intended fail-closed boundary.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 335dcdf8-32be-4232-85e7-749621f02512

📥 Commits

Reviewing files that changed from the base of the PR and between db65625 and ae8b536.

📒 Files selected for processing (6)
  • cmd/silo/main.go
  • internal/scanner/file_repo.go
  • internal/scanner/file_repo_active_path_test.go
  • internal/transcodenode/path_authorizer.go
  • internal/transcodenode/path_authorizer_test.go
  • internal/transcodenode/server_test.go

Comment @coderabbitai help to get the list of available commands.

@Quick104
Quick104 marked this pull request as ready for review August 14, 2026 23:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae8b536095

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1956 to +1957
WHERE file_path = $1
AND missing_since IS NULL

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Revoke paths removed from library configuration

When an administrator removes a library root, HandleUpdateLibrary commits the new roots before merely queueing an asynchronous library_paths_changed scan; if that scan is delayed or enqueueing fails, the old media_files rows remain with missing_since IS NULL. This query therefore continues authorizing files beneath the removed root—unlike the previous authorizer, which checked the current configured roots immediately—and a still-valid reconstruction token can keep reading that content for up to the token lifetime. Require the catalog row's logical path to remain covered by a currently configured root rather than treating missing_since alone as active.

AGENTS.md reference: AGENTS.md:L12-L14

Useful? React with 👍 / 👎.

@Quick104
Quick104 merged commit febf5c4 into main Aug 15, 2026
6 checks passed
@Quick104
Quick104 deleted the agent/fix-transcode-symlink-auth branch August 15, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remote transcode nodes reject catalogued symlink media

1 participant