diff options
Diffstat (limited to 'internal/setting/setting.go')
-rw-r--r-- | internal/setting/setting.go | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/internal/setting/setting.go b/internal/setting/setting.go index 7166f885..1d4bd107 100644 --- a/internal/setting/setting.go +++ b/internal/setting/setting.go @@ -16,18 +16,18 @@ import ( "strings" "time" - "github.com/unknwon/com" _ "github.com/go-macaron/cache/memcache" _ "github.com/go-macaron/cache/redis" "github.com/go-macaron/session" _ "github.com/go-macaron/session/redis" "github.com/mcuadros/go-version" + "github.com/unknwon/com" log "gopkg.in/clog.v1" "gopkg.in/ini.v1" "github.com/gogs/go-libravatar" - "gogs.io/gogs/internal/bindata" + "gogs.io/gogs/internal/assets/conf" "gogs.io/gogs/internal/process" "gogs.io/gogs/internal/user" ) @@ -50,8 +50,8 @@ const ( var ( // Build information should only be set by -ldflags. - BuildTime string - BuildGitHash string + BuildTime string + BuildCommit string // App settings AppVer string @@ -74,6 +74,7 @@ var ( CertFile string KeyFile string TLSMinVersion string + LoadAssetsFromDisk bool StaticRootPath string EnableGzip bool LandingPageURL LandingPage @@ -416,7 +417,7 @@ func NewContext() { Cfg, err = ini.LoadSources(ini.LoadOptions{ IgnoreInlineComment: true, - }, bindata.MustAsset("conf/app.ini")) + }, conf.MustAsset("conf/app.ini")) if err != nil { log.Fatal(2, "Fail to parse 'conf/app.ini': %v", err) } @@ -489,6 +490,7 @@ func NewContext() { LocalURL = sec.Key("LOCAL_ROOT_URL").MustString(string(Protocol) + "://localhost:" + HTTPPort + "/") OfflineMode = sec.Key("OFFLINE_MODE").MustBool() DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool() + LoadAssetsFromDisk = sec.Key("LOAD_ASSETS_FROM_DISK").MustBool() StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir) AppDataPath = sec.Key("APP_DATA_PATH").MustString("data") EnableGzip = sec.Key("ENABLE_GZIP").MustBool() @@ -729,8 +731,8 @@ func newService() { func newLogService() { if len(BuildTime) > 0 { - log.Trace("Build Time: %s", BuildTime) - log.Trace("Build Git Hash: %s", BuildGitHash) + log.Trace("Build time: %s", BuildTime) + log.Trace("Build commit: %s", BuildCommit) } // Because we always create a console logger as primary logger before all settings are loaded, @@ -809,7 +811,7 @@ func newLogService() { } log.New(log.MODE(mode), LogConfigs[i]) - log.Trace("Log Mode: %s (%s)", strings.Title(mode), strings.Title(name)) + log.Trace("Log mode: %s (%s)", strings.Title(mode), strings.Title(name)) } // Make sure everyone gets version info printed. @@ -830,7 +832,7 @@ func newCacheService() { log.Fatal(2, "Unknown cache adapter: %s", CacheAdapter) } - log.Info("Cache Service Enabled") + log.Info("Cache service is enabled") } func newSessionService() { @@ -844,7 +846,7 @@ func newSessionService() { SessionConfig.Maxlifetime = Cfg.Section("session").Key("SESSION_LIFE_TIME").MustInt64(86400) CSRFCookieName = Cfg.Section("session").Key("CSRF_COOKIE_NAME").MustString("_csrf") - log.Info("Session Service Enabled") + log.Info("Session service is enabled") } // Mailer represents mail service. |