diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-06-24 11:13:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-24 11:13:35 +0200 |
commit | cc1d61f1f5d4b2e60135186e44550745f0e13f0f (patch) | |
tree | 045c7dfd007eb94109b8661c05e4b022a036ca1b /contrib | |
parent | Fix wrong warn messages in migration steps (#25475) (diff) | |
download | forgejo-cc1d61f1f5d4b2e60135186e44550745f0e13f0f.tar.xz forgejo-cc1d61f1f5d4b2e60135186e44550745f0e13f0f.zip |
Use InitWorkPathAndCfgProvider for environment-to-ini to avoid unnecessary checks (#25480)
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"
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/environment-to-ini/environment-to-ini.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/environment-to-ini/environment-to-ini.go b/contrib/environment-to-ini/environment-to-ini.go index 2cdf4e3943..230ed58269 100644 --- a/contrib/environment-to-ini/environment-to-ini.go +++ b/contrib/environment-to-ini/environment-to-ini.go @@ -88,7 +88,7 @@ func main() { } func runEnvironmentToIni(c *cli.Context) error { - setting.InitWorkPathAndCommonConfig(os.Getenv, setting.ArgWorkPathAndCustomConf{ + setting.InitWorkPathAndCfgProvider(os.Getenv, setting.ArgWorkPathAndCustomConf{ WorkPath: c.String("work-path"), CustomPath: c.String("custom-path"), CustomConf: c.String("config"), |