Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Easier unarchiving support with v4? #311

Open
premist opened this issue Jan 17, 2022 · 1 comment
Open

Easier unarchiving support with v4? #311

premist opened this issue Jan 17, 2022 · 1 comment

Comments

@premist
Copy link

premist commented Jan 17, 2022

Hello, thanks for the awesome library. The new version is fantastic since I can use it in conjunction with other network libraries to stream HTTP response right into unarchiving process.

I'm using archiver on Google Cloud Storage caching library for GitHub Actions, and while archiving files was super easy, unarchiving was more involved with some manual file type handling.

Is there a plan to have a shorthand to make unarchival process a bit easier?

What would you like to have changed?

Quick way to unarchive file on v4, similar to how v3 works in some way

Why is this feature a useful, necessary, and/or important addition to this project?

Currently, unarchiving requires a user to manually handle each different Tar type flags which involves a lot of boilerplate.

What alternatives are there, or what are you doing in the meantime to work around the lack of this feature?

I took a look at v3 code and implemented unarchiving in-line, however it's not ideal at least from my perspective.

Please link to any relevant issues, pull requests, or other discussions.

@mholt
Copy link
Owner

mholt commented Jan 17, 2022

Well, unarchiving is quite problematic. The vast majority of issues in v3 and earlier were related to edge cases and security reports, and I was getting hounded by security "researchers" who didn't do their due diligence in the first place. It's true that v3's unarchiving behavior was susceptible to certain attacks from untrusted archive files, but given that no satisfactory solution was presented (literally nothing bulletproof that absolutely solved the problems), we finally just gave up and said, "only use this on archives you trust," basically. But I still kept getting hounded about security problems, which got quite annoying.

You can look through the closed issues (and some open ones, maybe) to see the history there.

So in v4, I solved all these problems by ripping out the code that actually writes to disk and instead I let the user assume that responsibility/burden. Now we have an archives library that is more capable and flexible and useful than ever before (glad you noticed that and appreciate that, btw) -- including letting you unarchive files exactly how you want.

(PS. Upgrade to v4.0.0-alpha.3, slight breaking API change to FilesFromDisk, but also some good bug fixes.)

To clarify, I am very open to implementing a good/simple unarchiving API. It just needs to be done without all the problems v3- had.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants