You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules/packages
Jason Song 33cc5837a6
Support compression for Actions logs (#31761)
Support compression for Actions logs to save storage space and
bandwidth. Inspired by
https://github.com/go-gitea/gitea/issues/24256#issuecomment-1521153015

The biggest challenge is that the compression format should support
[seekable](https://github.com/facebook/zstd/blob/dev/contrib/seekable_format/zstd_seekable_compression_format.md).
So when users are viewing a part of the log lines, Gitea doesn't need to
download the whole compressed file and decompress it.

That means gzip cannot help here. And I did research, there aren't too
many choices, like bgzip and xz, but I think zstd is the most popular
one. It has an implementation in Golang with
[zstd](https://github.com/klauspost/compress/tree/master/zstd) and
[zstd-seekable-format-go](https://github.com/SaveTheRbtz/zstd-seekable-format-go),
and what is better is that it has good compatibility: a seekable format
zstd file can be read by a regular zstd reader.

This PR introduces a new package `zstd` to combine and wrap the two
packages, to provide a unified and easy-to-use API.

And a new setting `LOG_COMPRESSION` is added to the config, although I
don't see any reason why not to use compression, I think's it's a good
idea to keep the default with `none` to be consistent with old versions.

`LOG_COMPRESSION` takes effect for only new log files, it adds `.zst` as
an extension to the file name, so Gitea can determine if it needs
decompression according to the file name when reading. Old files will
keep the format since it's not worth converting them, as they will be
cleared after #31735.

<img width="541" alt="image"
src="https://github.com/user-attachments/assets/e9598764-a4e0-4b68-8c2b-f769265183c9">
6 months ago
..
alpine Integrate alpine `noarch` packages into other architectures index (#29137) 12 months ago
cargo Add Cargo package registry (#21888) 2 years ago
chef Add Chef package registry (#22554) 2 years ago
composer Extract and display readme and comments for Composer packages (#30927) 8 months ago
conan Use ErrInvalidArgument in packages (#22268) 2 years ago
conda Support compression for Actions logs (#31761) 6 months ago
container Use docs.gitea.com instead of docs.gitea.io (#26739) 1 year ago
cran Enable `unparam` linter (#31277) 8 months ago
debian Support compression for Actions logs (#31761) 6 months ago
goproxy Add Go package registry (#24687) 2 years ago
helm Replace `interface{}` with `any` (#25686) 2 years ago
maven Add support for different Maven POM encoding (#25873) 2 years ago
npm Add support for npm bundleDependencies (#30751) 9 months ago
nuget Support nuspec manifest download for nuget packages (#28921) 10 months ago
pub Use docs.gitea.com instead of docs.gitea.io (#26739) 1 year ago
pypi Implement FSFE REUSE for golang files (#21840) 2 years ago
rpm Use new RPM constants (#28931) 1 year ago
rubygems Enable more `revive` linter rules (#30608) 10 months ago
swift Add Swift package registry (#22404) 2 years ago
vagrant Implement FSFE REUSE for golang files (#21840) 2 years ago
content_store.go Azure blob storage support (#30995) 8 months ago
hashed_buffer.go Close all hashed buffers (#27787) 1 year ago
hashed_buffer_test.go Add Debian package registry (#24426) 2 years ago
multi_hasher.go Implement FSFE REUSE for golang files (#21840) 2 years ago
multi_hasher_test.go Replace fmt.Sprintf with hex.EncodeToString (#21960) 2 years ago