]> source.dussan.org Git - gitea.git/commit
Use InitWorkPathAndCfgProvider for environment-to-ini to avoid unnecessary checks... v1.20.0-rc2
authorGiteabot <teabot@gitea.io>
Sat, 24 Jun 2023 14:04:50 +0000 (10:04 -0400)
committerGitHub <noreply@github.com>
Sat, 24 Jun 2023 14:04:50 +0000 (14:04 +0000)
commit71d2a6a41a7fea7a71efa125f47567b5cb5ba56a
tree97b93375c0e3702ce3f4cbcb84c7c99bdf9d4600
parentd1f1f1142ed6fd58e521587454a36827c320a5f6
Use InitWorkPathAndCfgProvider for environment-to-ini to avoid unnecessary checks (#25480) (#25488)

Backport #25480 by @wxiaoguang

Fix #25481

The `InitWorkPathAndCommonConfig` calls `LoadCommonSettings` which does
many checks like "current user is root or not".

Some commands like "environment-to-ini" shouldn't do such check, because
it might be run with "root" user at the moment (eg: the docker's setup
script)

ps: in the future, the docker's setup script should be improved to avoid
Gitea's command running with "root"

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
contrib/environment-to-ini/environment-to-ini.go
modules/setting/path.go