fix: honor environment variables during install (#38974) (#38976)

backport #38974
This commit is contained in:
wxiaoguang
2026-08-19 18:35:49 +02:00
committed by GitHub
parent 6024280a23
commit 616dbddda4
+3 -1
View File
@@ -312,8 +312,10 @@ func SubmitInstall(ctx *context.Context) {
return
}
// Save settings.
// Some logic also depends on the config values, so EnvironmentToConfig should also be applied first.
// EnvironmentToConfig is applied on each start up, so it also must override the "install form", so it must be applied after (twice).
cfg, err := setting.NewConfigProviderFromFile(setting.CustomConf)
setting.EnvironmentToConfig(cfg, os.Environ())
if err != nil {
log.Error("Failed to load custom conf '%s': %v", setting.CustomConf, err)
}