mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-19 20:27:16 +00:00
fix API changes
This commit is contained in:
parent
6a6636d451
commit
81a44e4cd0
|
@ -6,9 +6,8 @@ github.com/beego/memcache = commit:2aea774416
|
||||||
github.com/beego/redigo = commit:856744a0d5
|
github.com/beego/redigo = commit:856744a0d5
|
||||||
github.com/Unknwon/cae = commit:2e70a1351b
|
github.com/Unknwon/cae = commit:2e70a1351b
|
||||||
github.com/Unknwon/com =
|
github.com/Unknwon/com =
|
||||||
github.com/Unknwon/goconfig = commit:0f8d8dc1c0
|
|
||||||
github.com/Unknwon/i18n = commit:aec5f77857
|
github.com/Unknwon/i18n = commit:aec5f77857
|
||||||
github.com/Unknwon/macaron = commit:3d307c1232
|
github.com/Unknwon/macaron =
|
||||||
github.com/codegangsta/cli = commit:7381bc4e62
|
github.com/codegangsta/cli = commit:7381bc4e62
|
||||||
github.com/go-sql-driver/mysql = commit:8111ee3ec3
|
github.com/go-sql-driver/mysql = commit:8111ee3ec3
|
||||||
github.com/go-xorm/core = commit:3e0fa232ab
|
github.com/go-xorm/core = commit:3e0fa232ab
|
||||||
|
@ -20,9 +19,9 @@ github.com/macaron-contrib/binding =
|
||||||
github.com/macaron-contrib/cache = commit:0bb9e6c9ef
|
github.com/macaron-contrib/cache = commit:0bb9e6c9ef
|
||||||
github.com/macaron-contrib/captcha = commit:3567dc48b8
|
github.com/macaron-contrib/captcha = commit:3567dc48b8
|
||||||
github.com/macaron-contrib/csrf = commit:422b79675c
|
github.com/macaron-contrib/csrf = commit:422b79675c
|
||||||
github.com/macaron-contrib/i18n = commit:184bb832f2
|
github.com/macaron-contrib/i18n =
|
||||||
github.com/macaron-contrib/oauth2 = commit:8f394c3629
|
github.com/macaron-contrib/oauth2 = commit:8f394c3629
|
||||||
github.com/macaron-contrib/session = commit:f00d48fd4f
|
github.com/macaron-contrib/session =
|
||||||
github.com/macaron-contrib/toolbox = commit:57127bcc89
|
github.com/macaron-contrib/toolbox = commit:57127bcc89
|
||||||
github.com/mattn/go-sqlite3 = commit:a80c27ba33
|
github.com/mattn/go-sqlite3 = commit:a80c27ba33
|
||||||
github.com/nfnt/resize = commit:581d15cb53
|
github.com/nfnt/resize = commit:581d15cb53
|
||||||
|
|
|
@ -133,10 +133,7 @@ func newMacaron() *macaron.Macaron {
|
||||||
m.Use(captcha.Captchaer(captcha.Options{
|
m.Use(captcha.Captchaer(captcha.Options{
|
||||||
SubURL: setting.AppSubUrl,
|
SubURL: setting.AppSubUrl,
|
||||||
}))
|
}))
|
||||||
m.Use(session.Sessioner(session.Options{
|
m.Use(session.Sessioner(setting.SessionConfig))
|
||||||
Provider: setting.SessionProvider,
|
|
||||||
Config: *setting.SessionConfig,
|
|
||||||
}))
|
|
||||||
m.Use(csrf.Csrfer(csrf.Options{
|
m.Use(csrf.Csrfer(csrf.Options{
|
||||||
Secret: setting.SecretKey,
|
Secret: setting.SecretKey,
|
||||||
SetCookie: true,
|
SetCookie: true,
|
||||||
|
|
|
@ -104,8 +104,7 @@ var (
|
||||||
EnableMemcache bool
|
EnableMemcache bool
|
||||||
|
|
||||||
// Session settings.
|
// Session settings.
|
||||||
SessionProvider string
|
SessionConfig session.Options
|
||||||
SessionConfig *session.Config
|
|
||||||
|
|
||||||
// Git settings.
|
// Git settings.
|
||||||
MaxGitDiffLines int
|
MaxGitDiffLines int
|
||||||
|
@ -412,22 +411,15 @@ func newCacheService() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newSessionService() {
|
func newSessionService() {
|
||||||
SessionProvider = Cfg.MustValueRange("session", "PROVIDER", "memory",
|
SessionConfig.Provider = Cfg.MustValueRange("session", "PROVIDER", "memory",
|
||||||
[]string{"memory", "file", "redis", "mysql"})
|
[]string{"memory", "file", "redis", "mysql"})
|
||||||
|
|
||||||
SessionConfig = new(session.Config)
|
|
||||||
SessionConfig.ProviderConfig = strings.Trim(Cfg.MustValue("session", "PROVIDER_CONFIG"), "\" ")
|
SessionConfig.ProviderConfig = strings.Trim(Cfg.MustValue("session", "PROVIDER_CONFIG"), "\" ")
|
||||||
SessionConfig.CookieName = Cfg.MustValue("session", "COOKIE_NAME", "i_like_gogits")
|
SessionConfig.CookieName = Cfg.MustValue("session", "COOKIE_NAME", "i_like_gogits")
|
||||||
SessionConfig.CookiePath = AppSubUrl
|
SessionConfig.CookiePath = AppSubUrl
|
||||||
SessionConfig.Secure = Cfg.MustBool("session", "COOKIE_SECURE")
|
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.Gclifetime = Cfg.MustInt64("session", "GC_INTERVAL_TIME", 86400)
|
||||||
SessionConfig.Maxlifetime = Cfg.MustInt64("session", "SESSION_LIFE_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")
|
log.Info("Session Service Enabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,6 @@ func Config(ctx *middleware.Context) {
|
||||||
ctx.Data["CacheInternal"] = setting.CacheInternal
|
ctx.Data["CacheInternal"] = setting.CacheInternal
|
||||||
ctx.Data["CacheConn"] = setting.CacheConn
|
ctx.Data["CacheConn"] = setting.CacheConn
|
||||||
|
|
||||||
ctx.Data["SessionProvider"] = setting.SessionProvider
|
|
||||||
ctx.Data["SessionConfig"] = setting.SessionConfig
|
ctx.Data["SessionConfig"] = setting.SessionConfig
|
||||||
|
|
||||||
ctx.Data["PictureService"] = setting.PictureService
|
ctx.Data["PictureService"] = setting.PictureService
|
||||||
|
|
|
@ -169,13 +169,11 @@
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<dl class="dl-horizontal admin-dl-horizontal">
|
<dl class="dl-horizontal admin-dl-horizontal">
|
||||||
<dt>{{.i18n.Tr "admin.config.session_provider"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.session_provider"}}</dt>
|
||||||
<dd>{{.SessionProvider}}</dd>
|
<dd>{{.SessionConfig.Provider}}</dd>
|
||||||
<dt>{{.i18n.Tr "admin.config.provider_config"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.provider_config"}}</dt>
|
||||||
<dd><pre>{{.SessionConfig.ProviderConfig}}</pre></dd>
|
<dd><pre>{{.SessionConfig.ProviderConfig}}</pre></dd>
|
||||||
<dt>{{.i18n.Tr "admin.config.cookie_name"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.cookie_name"}}</dt>
|
||||||
<dd>{{.SessionConfig.CookieName}}</dd>
|
<dd>{{.SessionConfig.CookieName}}</dd>
|
||||||
<dt>{{.i18n.Tr "admin.config.enable_set_cookie"}}</dt>
|
|
||||||
<dd><i class="fa fa{{if .SessionConfig.EnableSetCookie}}-check{{end}}-square-o"></i></dd>
|
|
||||||
<dt>{{.i18n.Tr "admin.config.gc_interval_time"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.gc_interval_time"}}</dt>
|
||||||
<dd>{{.SessionConfig.Gclifetime}} {{.i18n.Tr "tool.raw_seconds"}}</dd>
|
<dd>{{.SessionConfig.Gclifetime}} {{.i18n.Tr "tool.raw_seconds"}}</dd>
|
||||||
<dt>{{.i18n.Tr "admin.config.session_life_time"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.session_life_time"}}</dt>
|
||||||
|
|
Loading…
Reference in a new issue