feat(pre_seed): support .tar.gz/.tgz archives#1196
Merged
Conversation
Adds tarball extraction using flate2 + tar crates. Format is detected from the S3 URI extension: - .zip → zip extraction (existing) - .tar.gz / .tgz → gzipped tarball extraction (new) Same safety limits apply: max file count, max extracted bytes, cooperative deadline checks, permission preservation. This enables pre_seed to consume existing home tarballs directly without requiring migration to zip format.
This comment has been minimized.
This comment has been minimized.
- Pin tar >= 0.4.45 (CVE-2026-33056 fix), disable default features - Switch format detection from URI extension to magic bytes (0x1f 0x8b) - Remove uri param from extract_and_apply (no longer needed) - Disable set_preserve_permissions, use manual chmod stripping suid/sgid - Reduce deadline check interval from 100 to 10 files - Add filetime + tar to Cargo.lock - Add tarball-specific unit tests: basic extraction, magic bytes detection, and deadline enforcement
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Collaborator
Author
|
Note LGTM ✅ — All findings from group review addressed in What This PR DoesAdds How It WorksFormat auto-detected via gzip magic bytes ( Review SummaryGroup review identified 2 critical + 5 important findings. All were fixed in commit Findings
Follow-up Suggestions (non-blocking)
Baseline Check
What's Good (🟢)
|
thepagent
previously approved these changes
Jun 25, 2026
- Update hooks.md and config-reference.md to document all supported formats: .zip, .tar.gz, .tgz (auto-detected via magic bytes) - Update examples to show mixed format usage - Document path traversal prevention and permission hardening for both zip and tarball paths
thepagent
approved these changes
Jun 25, 2026
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.
Summary
Adds tarball extraction to the
pre_seedphase, so existing.tar.gzhome backups can be consumed directly without migration to zip.Format Detection
Based on S3 URI extension:
.zip→ zip extraction (existing).tar.gz/.tgz→ gzipped tarball extraction (new)Example
Implementation
flate2(gzip decompression) +tar(archive extraction)pre-seedTests
All 10 existing tests pass. Tarball extraction shares the same budget/deadline infrastructure.