aboutsummaryrefslogtreecommitdiff
path: root/pkg/setting/setting.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-04-06 17:27:57 -0400
committerUnknwon <u@gogs.io>2017-04-06 17:27:57 -0400
commit90b9f7e08ca2e027cc587199537aa653ddd94d91 (patch)
tree0dbd625cd1eb929250befa07f18a0517ae23a5d1 /pkg/setting/setting.go
parent2c404daca612b43bd6b0b720d3e732d9550c0eab (diff)
pkg/setting: rename {AppUrl, AppSubUrl} -> {AppURL, AppSubURL}
Diffstat (limited to 'pkg/setting/setting.go')
-rw-r--r--pkg/setting/setting.go30
1 files changed, 16 insertions, 14 deletions
diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go
index 6ce716ea..c8902b45 100644
--- a/pkg/setting/setting.go
+++ b/pkg/setting/setting.go
@@ -54,16 +54,17 @@ var (
// App settings
AppVer string
AppName string
- AppUrl string
- AppSubUrl string
- AppSubUrlDepth int // Number of slashes
+ AppURL string
+ AppSubURL string
+ AppSubURLDepth int // Number of slashes
AppPath string
AppDataPath string
// Server settings
Protocol Scheme
Domain string
- HTTPAddr, HTTPPort string
+ HTTPAddr string
+ HTTPPort string
LocalURL string
OfflineMode bool
DisableRouterLog bool
@@ -288,8 +289,9 @@ var (
}
// I18n settings
- Langs, Names []string
- dateLangs map[string]string
+ Langs []string
+ Names []string
+ dateLangs map[string]string
// Highlight settings are loaded in modules/template/hightlight.go
@@ -416,20 +418,20 @@ func NewContext() {
sec := Cfg.Section("server")
AppName = Cfg.Section("").Key("APP_NAME").MustString("Gogs")
- AppUrl = sec.Key("ROOT_URL").MustString("http://localhost:3000/")
- if AppUrl[len(AppUrl)-1] != '/' {
- AppUrl += "/"
+ AppURL = sec.Key("ROOT_URL").MustString("http://localhost:3000/")
+ if AppURL[len(AppURL)-1] != '/' {
+ AppURL += "/"
}
// Check if has app suburl.
- url, err := url.Parse(AppUrl)
+ url, err := url.Parse(AppURL)
if err != nil {
- log.Fatal(2, "Invalid ROOT_URL '%s': %s", AppUrl, err)
+ log.Fatal(2, "Invalid ROOT_URL '%s': %s", AppURL, err)
}
// Suburl should start with '/' and end without '/', such as '/{subpath}'.
// This value is empty if site does not have sub-url.
- AppSubUrl = strings.TrimSuffix(url.Path, "/")
- AppSubUrlDepth = strings.Count(AppSubUrl, "/")
+ AppSubURL = strings.TrimSuffix(url.Path, "/")
+ AppSubURLDepth = strings.Count(AppSubURL, "/")
Protocol = SCHEME_HTTP
if sec.Key("PROTOCOL").String() == "https" {
@@ -771,7 +773,7 @@ func newSessionService() {
[]string{"memory", "file", "redis", "mysql"})
SessionConfig.ProviderConfig = strings.Trim(Cfg.Section("session").Key("PROVIDER_CONFIG").String(), "\" ")
SessionConfig.CookieName = Cfg.Section("session").Key("COOKIE_NAME").MustString("i_like_gogits")
- SessionConfig.CookiePath = AppSubUrl
+ SessionConfig.CookiePath = AppSubURL
SessionConfig.Secure = Cfg.Section("session").Key("COOKIE_SECURE").MustBool()
SessionConfig.Gclifetime = Cfg.Section("session").Key("GC_INTERVAL_TIME").MustInt64(3600)
SessionConfig.Maxlifetime = Cfg.Section("session").Key("SESSION_LIFE_TIME").MustInt64(86400)