fix: harden provider decode, CDN proxy, security and tests#4
Merged
Conversation
Outcome of a full-codebase review-and-fix pass. Provider clients: tolerate TorBox mylist sending size:-1 / files:null so one bad entry no longer fails the whole library decode; scrub API tokens from logs (.without_url); bound the resolve cache and retry transient 5xx; refuse a malformed delete id instead of deleting torrent 0. dav_fs CDN proxy: reject a Range-ignoring 200 after a seek (was silently serving wrong bytes) and an oversized whole-object 200 (was buffering the whole file into memory). vfs: stop SEASON_RE reading a pixel resolution (1920x1080) as a season; validate parse_rd_date day-of-month and the NFO <premiered> year; sanitize folder names; fix find_deepest_new_dir descending past leaf files. identification: count characters not bytes for short titles; preserve a title that is entirely a metadata word; compute each TMDB score once. main: clean config-error exits for TMDB key and DB; TmdbClient::new returns Result like the other clients. Security: bind the unauthenticated WebDAV/CDN-proxy port to 127.0.0.1. Tests: 161 -> 179 unit; replaced brittle include_str source-string assertions with behavioural HTTP-mock, paused-clock concurrency, and repair-on-playback swap tests. Docs and THIRD-PARTY-NOTICES brought in sync. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ep output)
The `if: ${{ secrets.DOCKERHUB_TOKEN != '' }}` guards made both workflow files invalid (the secrets context is not available in if conditions), so every run failed at 0s with a workflow-file error. Resolve the secret into a step output (secrets are allowed in env/run) and gate the Docker Hub login + tag computation on that output instead.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome of a full-codebase review-and-fix pass.
Real bugs fixed
mylistdecode: toleratesize: -1andfiles: nullso one malformed entry no longer fails the whole library decode (caught by the live lifecycle test).dav_fs): reject a Range-ignoring200after a seek (was silently serving the wrong bytes) and an oversized whole-object200(was buffering the entire file into memory).SEASON_RE: stop reading a pixel resolution (1920x1080) as a season number.parse_rd_date: reject impossible days; NFO<premiered>: only for a valid 4-digit year.delete_torrent: refuse a malformed id instead of deleting torrent 0.Hardening / consistency
.without_url()); TorBox resolve-cache size bound + 5xx retry; rate-limitersaturating_mul.TMDB_API_KEY, DB);TmdbClient::new -> Result(uniform with the other clients).clean_nameno longer empties a title that is a metadata word;is_short_titlecounts characters, not bytes.Security
0.0.0.0— is now bound to127.0.0.1with operator guidance.Tests & docs
include_str!source-string assertions replaced with behavioural tests (local-HTTP-server mocks, recordingMockProvider, paused-clock concurrency) covering the repair-on-playback swap, CDN retry/invalidate, the repair non-cached branch, hash dedup, and rate-limiter serialisation.async-traitattribution, fixed stale tags, documented TorBox decode-robustness and the WebDAV auth caveat).Verification
cargo test(179 unit), the RDintegration_test/repair_integration_testand cross-providerlifecycle_test(RD and TorBox),clippy --all-targets -D warnings, andcargo fmt --checkall pass locally.🤖 Generated with Claude Code