fix API changes

This commit is contained in:
Unknwon 2014-12-28 20:40:35 +08:00
parent 6a6636d451
commit 81a44e4cd0
5 changed files with 7 additions and 22 deletions

View file

@ -104,8 +104,7 @@ var (
EnableMemcache bool
// Session settings.
SessionProvider string
SessionConfig *session.Config
SessionConfig session.Options
// Git settings.
MaxGitDiffLines int
@ -412,22 +411,15 @@ func newCacheService() {
}
func newSessionService() {
SessionProvider = Cfg.MustValueRange("session", "PROVIDER", "memory",
SessionConfig.Provider = Cfg.MustValueRange("session", "PROVIDER", "memory",
[]string{"memory", "file", "redis", "mysql"})
SessionConfig = new(session.Config)
SessionConfig.ProviderConfig = strings.Trim(Cfg.MustValue("session", "PROVIDER_CONFIG"), "\" ")
SessionConfig.CookieName = Cfg.MustValue("session", "COOKIE_NAME", "i_like_gogits")
SessionConfig.CookiePath = AppSubUrl
SessionConfig.Secure = Cfg.MustBool("session", "COOKIE_SECURE")
SessionConfig.EnableSetCookie = Cfg.MustBool("session", "ENABLE_SET_COOKIE", true)
SessionConfig.Gclifetime = Cfg.MustInt64("session", "GC_INTERVAL_TIME", 86400)
SessionConfig.Maxlifetime = Cfg.MustInt64("session", "SESSION_LIFE_TIME", 86400)
if SessionProvider == "file" {
os.MkdirAll(path.Dir(SessionConfig.ProviderConfig), os.ModePerm)
}
log.Info("Session Service Enabled")
}