1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-10-10 19:32:02 +00:00
forgejo/modules/setting
forgejo-backport-action 4dce932690 [v11.0/forgejo] fix: LFS GC is never running because of a bug in the parsing of the INI file (#9222)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/9202

After https://github.com/go-gitea/gitea/pull/22385 introduced LFS GC, it never worked due to a bug in the INI library: fields in structs embedded more than one level deep are not populated from the INI file.

This PR fixes the issue by replacing the multi-level embedded struct with a single-level struct for parsing the cron.gc_lfs configuration.

Added a new test for retrieving cron settings to demonstrate the bug in the INI package.

---

Fix #9048 by cherrypicking the fix from Gitea

Gitea PR: https://github.com/go-gitea/gitea/pull/35198

Confirmed to work on my own instance, I now see the cron schedule for gc_lfs listed in the site admin menu where it was empty before

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Bug fixes
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/9202): <!--number 9202 --><!--line 0 --><!--description TEZTIEdDIGlzIG5ldmVyIHJ1bm5pbmcgYmVjYXVzZSBvZiBhIGJ1ZyBpbiB0aGUgcGFyc2luZyBvZiB0aGUgSU5JIGZpbGU=-->LFS GC is never running because of a bug in the parsing of the INI file<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Andrew Cassidy <drewcassidy@me.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9222
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-09-09 23:39:20 +02:00
..
config [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
actions.go fix: actions move to data.forgejo.org 2024-12-19 10:55:05 +01:00
actions_test.go fix: actions move to data.forgejo.org 2024-12-19 10:55:05 +01:00
admin.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
admin_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
api.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
asset_dynamic.go Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
asset_static.go Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
attachment.go feat: Make AVIF Images work with Forgejo 2024-11-13 19:09:40 +01:00
attachment_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
badges.go [GITEA] Add support for shields.io-based badges 2024-02-05 16:09:42 +01:00
cache.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
camo.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
config.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
config_env.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
config_env_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
config_provider.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
config_provider_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
cors.go Fix settings not being loaded at CLI (#26402) 2025-01-05 12:13:48 +00:00
cron.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
cron_test.go [v11.0/forgejo] fix: LFS GC is never running because of a bug in the parsing of the INI file (#9222) 2025-09-09 23:39:20 +02:00
database.go Limit database max connections by default 2024-04-23 00:47:50 +02:00
database_sqlite.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
database_test.go Fix incorrect PostgreSQL connection string for Unix sockets (#28865) 2024-01-20 16:04:47 +00:00
disposable_email_domain_data.go feat: add setting to block disposable emails 2024-11-20 23:17:37 -06:00
f3.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
federation.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
forgejo_storage_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
git.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
git_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
highlight.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
i18n.go [v11.0/forgejo] fix(UI): i18n: improve naming (#7542) 2025-04-15 06:24:49 +00:00
incoming_email.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
incoming_email_test.go setting: Infer [email.incoming].PORT from .USE_TLS 2024-04-22 16:30:35 +02:00
indexer.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
indexer_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
lfs.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
lfs_test.go Use 8 as default value for git lfs concurrency (#32421) 2024-12-06 00:17:57 +01:00
log.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
log_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
mailer.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
mailer_test.go setting: Allow aliases for some email settings 2024-04-22 16:09:01 +02:00
markup.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
metrics.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
migrations.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
mime_type_map.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
mirror.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
oauth2.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
oauth2_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
other.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
packages.go Alt Linux Apt-Rpm repository support for Forgejo packages. (#6351) 2025-01-22 14:01:49 +00:00
packages_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
path.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
path_test.go [BRANDING] alias {FORGEJO,GITEA}_{CUSTOM,WORK_DIR} 2024-02-05 16:05:01 +01:00
picture.go Fix all possible setting error related storages and added some tests (#23911) 2023-06-14 11:42:38 +08:00
project.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
proxy.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
queue.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
quota.go feat: Trivial default quota configuration 2024-08-26 13:25:34 +02:00
repository.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
repository_archive.go Fix all possible setting error related storages and added some tests (#23911) 2023-06-14 11:42:38 +08:00
repository_archive_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
security.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
server.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
server_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
service.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
service_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
session.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
setting.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
setting_test.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
ssh.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
storage.go Enable unparam linter (#31277) 2024-06-16 13:42:58 +02:00
storage_test.go test: fix test linting 2024-11-11 12:44:36 +01:00
task.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
time.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
ui.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00
webhook.go [v11.0/forgejo] chore: branding import path (#7354) 2025-03-27 20:13:05 +00:00