diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-12-28 20:40:35 +0800 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-12-28 20:40:35 +0800 |
commit | 81a44e4cd0c4f4c2310b59624748ba0df9fcbe87 (patch) | |
tree | 249709802cbf57f476aad4a8ed389f9b4d51c65d /modules | |
parent | 6a6636d4513b93555dd476e6d1883663e036e606 (diff) | |
download | gitea-81a44e4cd0c4f4c2310b59624748ba0df9fcbe87.tar.gz gitea-81a44e4cd0c4f4c2310b59624748ba0df9fcbe87.zip |
fix API changes
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 76e1ab7696..cda50b8e98 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -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") } |