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/setting
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
..
config Customizable "Open with" applications for repository clone (#29320) 11 months ago
actions.go Support compression for Actions logs (#31761) 6 months ago
actions_test.go Restrict `[actions].DEFAULT_ACTIONS_URL` to only `github` or `self` (#25581) 2 years ago
admin.go Allow disabling authentication related user features (#31535) 7 months ago
api.go Refactor the setting to make unit test easier (#22405) 2 years ago
asset_dynamic.go Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
asset_static.go Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
attachment.go Update allowed attachment types (#29688) 11 months ago
attachment_test.go Fix all possible setting error related storages and added some tests (#23911) 2 years ago
cache.go Always enable caches (#28527) 1 year ago
camo.go Refactor the setting to make unit test easier (#22405) 2 years ago
config.go Customizable "Open with" applications for repository clone (#29320) 11 months ago
config_env.go Enable `unparam` linter (#31277) 8 months ago
config_env_test.go Fix `environment-to-ini` inherited key bug (#27543) 1 year ago
config_provider.go Initial support for colorblindness-friendly themes (#30625) 9 months ago
config_provider_test.go Fix INI parsing for value with trailing slash (#26995) 1 year ago
cors.go Refactor CORS handler (#28587) 1 year ago
cron.go Replace `interface{}` with `any` (#25686) 2 years ago
cron_test.go Rewrite queue (#24505) 2 years ago
database.go Add slow SQL query warning (#27545) 11 months ago
database_sqlite.go Implement FSFE REUSE for golang files (#21840) 2 years ago
database_test.go Fix incorrect PostgreSQL connection string for Unix sockets (#28865) 1 year ago
federation.go Refactor the setting to make unit test easier (#22405) 2 years ago
git.go Use `[git.config]` for reflog cleaning up (#24958) 2 years ago
git_test.go Use `[git.config]` for reflog cleaning up (#24958) 2 years ago
glob.go Improve grep search (#30843) 9 months ago
global.go Fix duplicate sub-path for avatars (#31365) 8 months ago
highlight.go Refactor the setting to make unit test easier (#22405) 2 years ago
i18n.go Refactor the setting to make unit test easier (#22405) 2 years ago
incoming_email.go Resolve lint for unused parameter and unnecessary type arguments (#30750) 9 months ago
indexer.go Improve grep search (#30843) 9 months ago
indexer_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
lfs.go Use general token signing secret (#29205) 12 months ago
lfs_test.go Display deprecated warning in admin panel pages as well as in the log file (#26094) 2 years ago
log.go Refactor "dump" sub-command (#30240) 10 months ago
log_test.go Replace `interface{}` with `any` (#25686) 2 years ago
mailer.go Add option to change mail from user display name (#31528) 7 months ago
mailer_test.go Remove unnecessary code (#24610) 2 years ago
markup.go Add .livemd as a markdown extension (#22730) 2 years ago
metrics.go Refactor the setting to make unit test easier (#22405) 2 years ago
migrations.go Refactor the setting to make unit test easier (#22405) 2 years ago
mime_type_map.go Refactor the setting to make unit test easier (#22405) 2 years ago
mirror.go Avoid polluting the config (#25345) 2 years ago
oauth2.go Always load or generate oauth2 jwt secret (#30942) 9 months ago
oauth2_test.go Always load or generate oauth2 jwt secret (#30942) 9 months ago
other.go Add `[other].SHOW_FOOTER_POWERED_BY` setting to hide `Powered by` (#30253) 10 months ago
packages.go Add signature support for the RPM module (#27069) 6 months ago
packages_test.go Fix all possible setting error related storages and added some tests (#23911) 2 years ago
path.go Do not allow different storage configurations to point to the same directory (#30169) 10 months ago
path_test.go Refactor path & config system (#25330) 2 years ago
picture.go Fix all possible setting error related storages and added some tests (#23911) 2 years ago
project.go Refactor the setting to make unit test easier (#22405) 2 years ago
proxy.go Refactor the setting to make unit test easier (#22405) 2 years ago
queue.go Increase queue length (#27555) 1 year ago
repository.go Refactor startup deprecation messages (#30305) 10 months ago
repository_archive.go Fix all possible setting error related storages and added some tests (#23911) 2 years ago
repository_archive_test.go Fix all possible setting error related storages and added some tests (#23911) 2 years ago
security.go Remember login for a month by default (#30150) 10 months ago
server.go Fix duplicate sub-path for avatars (#31365) 8 months ago
service.go Add reverseproxy auth for API back with default disabled (#26703) 1 year ago
service_test.go Fix allowed user types setting problem (#26200) 2 years ago
session.go Refactor startup deprecation messages (#30305) 10 months ago
setting.go Fix duplicate sub-path for avatars (#31365) 8 months ago
setting_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
ssh.go Expanded minimum RSA Keylength to 3072 (#26604) 1 year ago
storage.go Enable `unparam` linter (#31277) 8 months ago
storage_test.go Azure blob storage support (#30995) 8 months ago
task.go handle deprecated settings (#22992) 2 years ago
time.go Enable more `revive` linter rules (#30608) 9 months ago
ui.go Add `MAX_ROWS` option for CSV rendering (#30268) 8 months ago
webhook.go Refactor the setting to make unit test easier (#22405) 2 years ago