mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
routers/install.go: able to keep previous custom settings for 2nd time install
- .gopmfile: update all commits
This commit is contained in:
1 parent
def39d191b
commit
a38e4a0b02
2 files changed
+26
-21
No files matched your search
@@ -189,6 +189,12 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
|
||||
|
||||
// Save settings.
|
||||
cfg := ini.Empty()
|
||||
if com.IsFile(setting.CustomConf) {
|
||||
// Keeps custom settings if there is already something.
|
||||
if err := cfg.Append(setting.CustomConf); err != nil {
|
||||
log.Error(4, "Fail to load custom conf '%s': %v", setting.CustomConf, err)
|
||||
}
|
||||
}
|
||||
cfg.Section("database").Key("DB_TYPE").SetValue(models.DbCfg.Type)
|
||||
cfg.Section("database").Key("HOST").SetValue(models.DbCfg.Host)
|
||||
cfg.Section("database").Key("NAME").SetValue(models.DbCfg.Name)
|
||||
|
||||
Reference in new issue
Block a user