|
|
@ -31,6 +31,13 @@ const ( |
|
|
|
FCGI Scheme = "fcgi" |
|
|
|
FCGI Scheme = "fcgi" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type LandingPage string |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
|
|
|
|
LANDING_PAGE_HOME LandingPage = "/" |
|
|
|
|
|
|
|
LANDING_PAGE_EXPLORE LandingPage = "/explore" |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
var ( |
|
|
|
// App settings.
|
|
|
|
// App settings.
|
|
|
|
AppVer string |
|
|
|
AppVer string |
|
|
@ -48,6 +55,7 @@ var ( |
|
|
|
CertFile, KeyFile string |
|
|
|
CertFile, KeyFile string |
|
|
|
StaticRootPath string |
|
|
|
StaticRootPath string |
|
|
|
EnableGzip bool |
|
|
|
EnableGzip bool |
|
|
|
|
|
|
|
LandingPageUrl LandingPage |
|
|
|
|
|
|
|
|
|
|
|
// Security settings.
|
|
|
|
// Security settings.
|
|
|
|
InstallLock bool |
|
|
|
InstallLock bool |
|
|
@ -197,6 +205,13 @@ func NewConfigContext() { |
|
|
|
LogRootPath = Cfg.MustValue("log", "ROOT_PATH", path.Join(workDir, "log")) |
|
|
|
LogRootPath = Cfg.MustValue("log", "ROOT_PATH", path.Join(workDir, "log")) |
|
|
|
EnableGzip = Cfg.MustBool("server", "ENABLE_GZIP") |
|
|
|
EnableGzip = Cfg.MustBool("server", "ENABLE_GZIP") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch Cfg.MustValue("server", "LANDING_PAGE", "home") { |
|
|
|
|
|
|
|
case "explore": |
|
|
|
|
|
|
|
LandingPageUrl = LANDING_PAGE_EXPLORE |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
LandingPageUrl = LANDING_PAGE_HOME |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
InstallLock = Cfg.MustBool("security", "INSTALL_LOCK") |
|
|
|
InstallLock = Cfg.MustBool("security", "INSTALL_LOCK") |
|
|
|
SecretKey = Cfg.MustValue("security", "SECRET_KEY") |
|
|
|
SecretKey = Cfg.MustValue("security", "SECRET_KEY") |
|
|
|
LogInRememberDays = Cfg.MustInt("security", "LOGIN_REMEMBER_DAYS") |
|
|
|
LogInRememberDays = Cfg.MustInt("security", "LOGIN_REMEMBER_DAYS") |
|
|
|