mirror of
https://github.com/gogs/gogs.git
synced 2026-07-08 09:23:18 +02:00
conf: overhaul server settings (#5928)
* conf: rename package * Requires Go 1.12 * Fix lint * Fix lint * Overhaul * db: fix tests * Save my work * Fix tests * Server.UnixSocketPermission * Server.LocalRootURL * SSH settings * Server.OfflineMode * Save my work * App.Version * Remove [server] STATIC_ROOT_PATH * Server.LandingURL
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"gogs.io/gogs/internal/setting"
|
||||
"gogs.io/gogs/internal/conf"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -72,7 +72,7 @@ var (
|
||||
)
|
||||
|
||||
func NewContext() {
|
||||
keys := setting.Cfg.Section("highlight.mapping").Keys()
|
||||
keys := conf.File.Section("highlight.mapping").Keys()
|
||||
for i := range keys {
|
||||
highlightMapping[keys[i].Name()] = keys[i].Value()
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ import (
|
||||
"golang.org/x/text/transform"
|
||||
log "unknwon.dev/clog/v2"
|
||||
|
||||
"gogs.io/gogs/internal/conf"
|
||||
"gogs.io/gogs/internal/db"
|
||||
"gogs.io/gogs/internal/markup"
|
||||
"gogs.io/gogs/internal/setting"
|
||||
"gogs.io/gogs/internal/tool"
|
||||
)
|
||||
|
||||
@@ -40,28 +40,28 @@ func FuncMap() []template.FuncMap {
|
||||
return time.Now().Year()
|
||||
},
|
||||
"UseHTTPS": func() bool {
|
||||
return strings.HasPrefix(setting.AppURL, "https")
|
||||
return conf.Server.URL.Scheme == "https"
|
||||
},
|
||||
"AppName": func() string {
|
||||
return setting.AppName
|
||||
return conf.App.BrandName
|
||||
},
|
||||
"AppSubURL": func() string {
|
||||
return setting.AppSubURL
|
||||
return conf.Server.Subpath
|
||||
},
|
||||
"AppURL": func() string {
|
||||
return setting.AppURL
|
||||
return conf.Server.ExternalURL
|
||||
},
|
||||
"AppVer": func() string {
|
||||
return setting.AppVersion
|
||||
return conf.App.Version
|
||||
},
|
||||
"AppDomain": func() string {
|
||||
return setting.Domain
|
||||
return conf.Server.Domain
|
||||
},
|
||||
"DisableGravatar": func() bool {
|
||||
return setting.DisableGravatar
|
||||
return conf.DisableGravatar
|
||||
},
|
||||
"ShowFooterTemplateLoadTime": func() bool {
|
||||
return setting.ShowFooterTemplateLoadTime
|
||||
return conf.ShowFooterTemplateLoadTime
|
||||
},
|
||||
"LoadTimes": func(startTime time.Time) string {
|
||||
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms"
|
||||
@@ -111,7 +111,7 @@ func FuncMap() []template.FuncMap {
|
||||
"EscapePound": EscapePound,
|
||||
"RenderCommitMessage": RenderCommitMessage,
|
||||
"ThemeColorMetaTag": func() string {
|
||||
return setting.UI.ThemeColorMetaTag
|
||||
return conf.UI.ThemeColorMetaTag
|
||||
},
|
||||
"FilenameIsImage": func(filename string) bool {
|
||||
mimeType := mime.TypeByExtension(filepath.Ext(filename))
|
||||
|
||||
Reference in New Issue
Block a user