summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-08-08 16:02:22 +0200
committerGitHub <noreply@github.com>2020-08-08 15:02:22 +0100
commit78d17b4b432a4d670843e7e1d99a49e8ffea79b5 (patch)
treefd3734307803bc7732ba9be3e7c6de9b6833ab83 /modules
parent0171dda7288b73995f929c7627f7292ae81090f2 (diff)
downloadgitea-78d17b4b432a4d670843e7e1d99a49e8ffea79b5.tar.gz
gitea-78d17b4b432a4d670843e7e1d99a49e8ffea79b5.zip
Make default StaticRootPath compile time settable (#12371)
Make it possible to compile the default location of StaticRootPath independent from AppWorkPath Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/setting.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index f98addb3cd..f4b10feee8 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -652,7 +652,10 @@ func NewContext() {
PortToRedirect = sec.Key("PORT_TO_REDIRECT").MustString("80")
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
- StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(AppWorkPath)
+ if len(StaticRootPath) == 0 {
+ StaticRootPath = AppWorkPath
+ }
+ StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(StaticRootPath)
StaticCacheTime = sec.Key("STATIC_CACHE_TIME").MustDuration(6 * time.Hour)
AppDataPath = sec.Key("APP_DATA_PATH").MustString(path.Join(AppWorkPath, "data"))
EnableGzip = sec.Key("ENABLE_GZIP").MustBool()