Refactor setting.Other and remove unused SHOW_FOOTER_BRANDING (#24270)

The `SHOW_FOOTER_BRANDING` came from year 2015, and it seems nobody ever
uses it. It only shows an GitHub icon which seems unrelated to Gitea, it
doesn't do what document says. So, remove it.

## ⚠️ Breaking

Users can now remove the key `[other].SHOW_FOOTER_BRANDING` from their
app.ini.
This commit is contained in:
wxiaoguang 2023-04-23 07:38:25 +08:00 committed by GitHub
parent f1173d6879
commit d44e1565da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 25 additions and 28 deletions

View file

@ -3,20 +3,25 @@
package setting
var (
// Other settings
ShowFooterBranding bool
import "code.gitea.io/gitea/modules/log"
type OtherConfig struct {
ShowFooterVersion bool
ShowFooterTemplateLoadTime bool
EnableFeed bool
EnableSitemap bool
)
}
var Other = OtherConfig{
ShowFooterVersion: true,
ShowFooterTemplateLoadTime: true,
EnableSitemap: true,
EnableFeed: true,
}
func loadOtherFrom(rootCfg ConfigProvider) {
sec := rootCfg.Section("other")
ShowFooterBranding = sec.Key("SHOW_FOOTER_BRANDING").MustBool(false)
ShowFooterVersion = sec.Key("SHOW_FOOTER_VERSION").MustBool(true)
ShowFooterTemplateLoadTime = sec.Key("SHOW_FOOTER_TEMPLATE_LOAD_TIME").MustBool(true)
EnableSitemap = sec.Key("ENABLE_SITEMAP").MustBool(true)
EnableFeed = sec.Key("ENABLE_FEED").MustBool(true)
if err := sec.MapTo(&Other); err != nil {
log.Fatal("Failed to map [other] settings: %v", err)
}
}