diff options
author | Unknwon <u@gogs.io> | 2016-08-11 14:55:10 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-11 14:55:10 -0700 |
commit | a47aef546040b5eeb4af84d691c164171aafda08 (patch) | |
tree | 99776439c4e2b8a9b996d4504a55b9f3bc891ab0 /modules/setting | |
parent | 1dd003bd4c88f6125ec49286c9feab1f7d9b5a82 (diff) | |
download | gitea-a47aef546040b5eeb4af84d691c164171aafda08.tar.gz gitea-a47aef546040b5eeb4af84d691c164171aafda08.zip |
#2852 code cleanup
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 559ff088cb..fede3587fb 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -62,7 +62,7 @@ var ( // Server settings Protocol Scheme Domain string - HttpAddr, HttpPort string + HTTPAddr, HTTPPort string LocalURL string OfflineMode bool DisableRouterLog bool @@ -372,17 +372,17 @@ func NewContext() { Protocol = FCGI } else if sec.Key("PROTOCOL").String() == "unix" { Protocol = UNIX_SOCKET + UnixSocketPermissionRaw := sec.Key("UNIX_SOCKET_PERMISSION").MustString("666") + UnixSocketPermissionParsed, err := strconv.ParseUint(UnixSocketPermissionRaw, 8, 32) + if err != nil || UnixSocketPermissionParsed > 0777 { + log.Fatal(4, "Fail to parse unixSocketPermission: %s", UnixSocketPermissionRaw) + } + UnixSocketPermission = uint32(UnixSocketPermissionParsed) } Domain = sec.Key("DOMAIN").MustString("localhost") - HttpAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0") - HttpPort = sec.Key("HTTP_PORT").MustString("3000") - LocalURL = sec.Key("LOCAL_ROOT_URL").MustString(string(Protocol) + "://localhost:" + HttpPort + "/") - UnixSocketPermissionRaw := sec.Key("UNIX_SOCKET_PERMISSION").MustString("666") - UnixSocketPermissionParsed, err := strconv.ParseUint(UnixSocketPermissionRaw, 8, 32) - if err != nil || UnixSocketPermissionParsed > 0777 { - log.Fatal(4, "Fail to parse unixSocketPermission: %s", UnixSocketPermissionRaw) - } - UnixSocketPermission = uint32(UnixSocketPermissionParsed) + HTTPAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0") + HTTPPort = sec.Key("HTTP_PORT").MustString("3000") + LocalURL = sec.Key("LOCAL_ROOT_URL").MustString(string(Protocol) + "://localhost:" + HTTPPort + "/") OfflineMode = sec.Key("OFFLINE_MODE").MustBool() DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool() StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir) |