mirror of
1
Fork 0

Merge pull request #2796 from saboya/custom_app_data_path

Making AppDataPath customizable.
This commit is contained in:
Unknwon 2016-03-12 13:53:37 -05:00
commit 820be19cf5
2 changed files with 4 additions and 1 deletions

View File

@ -93,6 +93,8 @@ KEY_FILE = custom/https/key.pem
; Upper level of template and static file path ; Upper level of template and static file path
; default is the path where Gogs is executed ; default is the path where Gogs is executed
STATIC_ROOT_PATH = STATIC_ROOT_PATH =
; Default path for App data
APP_DATA_PATH = data
; Application level GZIP support ; Application level GZIP support
ENABLE_GZIP = false ENABLE_GZIP = false
; Landing page for non-logged users, can be "home" or "explore" ; Landing page for non-logged users, can be "home" or "explore"

View File

@ -54,7 +54,7 @@ var (
AppSubUrl string AppSubUrl string
AppSubUrlDepth int // Number of slashes AppSubUrlDepth int // Number of slashes
AppPath string AppPath string
AppDataPath = "data" AppDataPath string
// Server settings // Server settings
Protocol Scheme Protocol Scheme
@ -334,6 +334,7 @@ func NewContext() {
OfflineMode = sec.Key("OFFLINE_MODE").MustBool() OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool() DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir) StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir)
AppDataPath = sec.Key("APP_DATA_PATH").MustString("data")
EnableGzip = sec.Key("ENABLE_GZIP").MustBool() EnableGzip = sec.Key("ENABLE_GZIP").MustBool()
switch sec.Key("LANDING_PAGE").MustString("home") { switch sec.Key("LANDING_PAGE").MustString("home") {