]> source.dussan.org Git - gitea.git/commit
Avoid polluting config file when "save" (#25395)
authorwxiaoguang <wxiaoguang@gmail.com>
Wed, 21 Jun 2023 02:31:40 +0000 (10:31 +0800)
committerGitHub <noreply@github.com>
Wed, 21 Jun 2023 02:31:40 +0000 (10:31 +0800)
commitdf5cf5ddbd9099a121d5074a0b2a710fd71309fd
tree61844c68b8c38a2d24a90fc62c75aa0ef8522005
parent831db53c214f81e5eaf055716a42865007cb8123
Avoid polluting config file when "save" (#25395)

That's a longstanding INI package problem: the "MustXxx" calls change
the option values, and the following "Save" will save a lot of garbage
options into the user's config file.

Ideally we should refactor the INI package to a clear solution, but it's
a huge work.

A clear workaround is what this PR does: when "Save", load a clear INI
instance and save it.

Partially fix #25377, the "install" page needs more fine tunes.
cmd/web.go
modules/setting/config_provider.go
modules/setting/config_provider_test.go
modules/setting/lfs.go
modules/setting/oauth2.go
modules/setting/security.go
modules/setting/setting.go