diff options
author | 6543 <6543@obermui.de> | 2020-09-03 01:12:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 19:12:24 -0400 |
commit | 69e4b6910b024ec99521c1ca570ed4d232e11247 (patch) | |
tree | 14cc166168bb901a16f9a46d51629a28631c5ab7 /modules | |
parent | 0e9dcc950064fff5823e5bde0d99f42a8f68f2c1 (diff) | |
download | gitea-69e4b6910b024ec99521c1ca570ed4d232e11247.tar.gz gitea-69e4b6910b024ec99521c1ca570ed4d232e11247.zip |
Make default StaticRootPath compile time settable (#12371) (#12652)
Make it possible to compile the default location of StaticRootPath independent from AppWorkPath
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 62ca10a156..45e55a2f94 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -666,7 +666,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() |