Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Single File Compressed Files #184

Merged
merged 2 commits into from
May 8, 2024

Conversation

NotGeri
Copy link
Contributor

@NotGeri NotGeri commented Apr 1, 2024

This PR should allow single compressed files that aren't archives (such as log.gz) to be uncompressed.

As far as I can tell f1c5bbd made it possible for archiverFileSystem to access the compressed files safely, but only SpaceAvailableForDecompression uses this; DecompressFile does not

This should work with all the compression types mhold/archiver supports

Should fix pterodactyl/panel#5034

@NotGeri
Copy link
Contributor Author

NotGeri commented Apr 3, 2024

Realized that if we just use io's Copy, it won't check quota.

I made it read the stream in chunks and check the quota before writing the next chunk.
This works fine and is far quicker than reading the entire stream, calculating its size and then unarchiving it, but you will only know it failed after a while, and you'll have an incomplete archive.

Any thoughts on this? If it's an issue, I can adjust it to do the same as with other archives, which is slower, but you get a clear warning before it uncompresses anything.

@matthewpi matthewpi merged commit 06614de into pterodactyl:develop May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants