aboutsummaryrefslogtreecommitdiffstats
path: root/routers/install
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2023-01-03 14:33:41 -0600
committerGitHub <noreply@github.com>2023-01-03 14:33:41 -0600
commit32e863439cc6a12c753675a73b603f878c8e3ff0 (patch)
tree564916a66c4573d09ab406101ea5ec37ef144a59 /routers/install
parentefa708501be70201f048c2936addfd1bcf570d31 (diff)
downloadgitea-32e863439cc6a12c753675a73b603f878c8e3ff0.tar.gz
gitea-32e863439cc6a12c753675a73b603f878c8e3ff0.zip
fix: update settings table on install (#22326)
Related to #22325 Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'routers/install')
-rw-r--r--routers/install/install.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/routers/install/install.go b/routers/install/install.go
index ab37f9ba35..e9fa844a09 100644
--- a/routers/install/install.go
+++ b/routers/install/install.go
@@ -148,8 +148,8 @@ func Install(ctx *context.Context) {
// Server and other services settings
form.OfflineMode = setting.OfflineMode
- form.DisableGravatar = false // when installing, there is no database connection so that given a default value
- form.EnableFederatedAvatar = false // when installing, there is no database connection so that given a default value
+ form.DisableGravatar = setting.DisableGravatar // when installing, there is no database connection so that given a default value
+ form.EnableFederatedAvatar = setting.EnableFederatedAvatar // when installing, there is no database connection so that given a default value
form.EnableOpenIDSignIn = setting.Service.EnableOpenIDSignIn
form.EnableOpenIDSignUp = setting.Service.EnableOpenIDSignUp
@@ -442,10 +442,13 @@ func SubmitInstall(ctx *context.Context) {
cfg.Section("server").Key("OFFLINE_MODE").SetValue(fmt.Sprint(form.OfflineMode))
// if you are reinstalling, this maybe not right because of missing version
if err := system_model.SetSettingNoVersion(system_model.KeyPictureDisableGravatar, strconv.FormatBool(form.DisableGravatar)); err != nil {
- ctx.RenderWithErr(ctx.Tr("install.secret_key_failed", err), tplInstall, &form)
+ ctx.RenderWithErr(ctx.Tr("install.save_config_failed", err), tplInstall, &form)
+ return
+ }
+ if err := system_model.SetSettingNoVersion(system_model.KeyPictureEnableFederatedAvatar, strconv.FormatBool(form.EnableFederatedAvatar)); err != nil {
+ ctx.RenderWithErr(ctx.Tr("install.save_config_failed", err), tplInstall, &form)
return
}
- cfg.Section("picture").Key("ENABLE_FEDERATED_AVATAR").SetValue(fmt.Sprint(form.EnableFederatedAvatar))
cfg.Section("openid").Key("ENABLE_OPENID_SIGNIN").SetValue(fmt.Sprint(form.EnableOpenIDSignIn))
cfg.Section("openid").Key("ENABLE_OPENID_SIGNUP").SetValue(fmt.Sprint(form.EnableOpenIDSignUp))
cfg.Section("service").Key("DISABLE_REGISTRATION").SetValue(fmt.Sprint(form.DisableRegistration))