#1891 attempt to fix expected invalid CSRF token
- Remove unused config settings `[picture] service`
This commit is contained in:
parent
434614506e
commit
f946040fa9
10 changed files with 11 additions and 23 deletions
|
@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
|
||||||
|
|
||||||
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
|
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
|
||||||
|
|
||||||
##### Current version: 0.8.51
|
##### Current version: 0.8.52
|
||||||
|
|
||||||
| Web | UI | Preview |
|
| Web | UI | Preview |
|
||||||
|:-------------:|:-------:|:-------:|
|
|:-------------:|:-------:|:-------:|
|
||||||
|
|
|
@ -215,8 +215,6 @@ GC_INTERVAL_TIME = 86400
|
||||||
SESSION_LIFE_TIME = 86400
|
SESSION_LIFE_TIME = 86400
|
||||||
|
|
||||||
[picture]
|
[picture]
|
||||||
; The place to picture data, either "server" or "qiniu", default is "server"
|
|
||||||
SERVICE = server
|
|
||||||
AVATAR_UPLOAD_PATH = data/avatars
|
AVATAR_UPLOAD_PATH = data/avatars
|
||||||
; Chinese users can choose "duoshuo"
|
; Chinese users can choose "duoshuo"
|
||||||
; or a custom avatar source, like: http://cn.gravatar.com/avatar/
|
; or a custom avatar source, like: http://cn.gravatar.com/avatar/
|
||||||
|
|
|
@ -27,6 +27,7 @@ Huimin Wang <wanghm2009 AT hotmail DOT co DOT jp>
|
||||||
ilko <kontact-mr.k AT outlook DOT com">
|
ilko <kontact-mr.k AT outlook DOT com">
|
||||||
Ilya Makarov
|
Ilya Makarov
|
||||||
Robin Hübner <profan AT prfn DOT se>
|
Robin Hübner <profan AT prfn DOT se>
|
||||||
|
Jamie Mansfield <dev AT jamierocks DOT uk>
|
||||||
Jean THOMAS <contact AT tibounise DOT com>
|
Jean THOMAS <contact AT tibounise DOT com>
|
||||||
Juraj Bubniak <contact AT jbub DOT eu>
|
Juraj Bubniak <contact AT jbub DOT eu>
|
||||||
Lafriks <lafriks AT gmail DOT com>
|
Lafriks <lafriks AT gmail DOT com>
|
||||||
|
|
2
gogs.go
2
gogs.go
|
@ -17,7 +17,7 @@ import (
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.8.51.0303"
|
const APP_VER = "0.8.52.0303"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -109,17 +109,11 @@ func Toggle(options *ToggleOptions) macaron.Handler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try auto-signin when not signed in.
|
// Auto-signin info is provided and has not signed in.
|
||||||
if !options.SignOutRequire && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) {
|
if !options.SignOutRequire && !ctx.IsSigned && !auth.IsAPIPath(ctx.Req.URL.Path) &&
|
||||||
succeed, err := AutoSignIn(ctx)
|
len(ctx.GetCookie(setting.CookieUserName)) > 0 {
|
||||||
if err != nil {
|
ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
|
||||||
ctx.Handle(500, "AutoSignIn", err)
|
|
||||||
return
|
|
||||||
} else if succeed {
|
|
||||||
log.Trace("Auto-login succeed: %s", ctx.Session.Get("uname"))
|
|
||||||
ctx.Redirect(setting.AppSubUrl + ctx.Req.RequestURI)
|
ctx.Redirect(setting.AppSubUrl + ctx.Req.RequestURI)
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.AdminRequire {
|
if options.AdminRequire {
|
||||||
|
|
|
@ -131,7 +131,6 @@ var (
|
||||||
}
|
}
|
||||||
|
|
||||||
// Picture settings
|
// Picture settings
|
||||||
PictureService string
|
|
||||||
AvatarUploadPath string
|
AvatarUploadPath string
|
||||||
GravatarSource string
|
GravatarSource string
|
||||||
DisableGravatar bool
|
DisableGravatar bool
|
||||||
|
@ -448,7 +447,6 @@ func NewContext() {
|
||||||
ThemeColorMetaTag = sec.Key("THEME_COLOR_META_TAG").MustString("#ff5343")
|
ThemeColorMetaTag = sec.Key("THEME_COLOR_META_TAG").MustString("#ff5343")
|
||||||
|
|
||||||
sec = Cfg.Section("picture")
|
sec = Cfg.Section("picture")
|
||||||
PictureService = sec.Key("SERVICE").In("server", []string{"server"})
|
|
||||||
AvatarUploadPath = sec.Key("AVATAR_UPLOAD_PATH").MustString(path.Join(AppDataPath, "avatars"))
|
AvatarUploadPath = sec.Key("AVATAR_UPLOAD_PATH").MustString(path.Join(AppDataPath, "avatars"))
|
||||||
forcePathSeparator(AvatarUploadPath)
|
forcePathSeparator(AvatarUploadPath)
|
||||||
if !filepath.IsAbs(AvatarUploadPath) {
|
if !filepath.IsAbs(AvatarUploadPath) {
|
||||||
|
|
|
@ -222,7 +222,6 @@ func Config(ctx *middleware.Context) {
|
||||||
|
|
||||||
ctx.Data["SessionConfig"] = setting.SessionConfig
|
ctx.Data["SessionConfig"] = setting.SessionConfig
|
||||||
|
|
||||||
ctx.Data["PictureService"] = setting.PictureService
|
|
||||||
ctx.Data["DisableGravatar"] = setting.DisableGravatar
|
ctx.Data["DisableGravatar"] = setting.DisableGravatar
|
||||||
|
|
||||||
type logger struct {
|
type logger struct {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.8.51.0303
|
0.8.52.0303
|
|
@ -211,8 +211,6 @@
|
||||||
</h4>
|
</h4>
|
||||||
<div class="ui attached table segment">
|
<div class="ui attached table segment">
|
||||||
<dl class="dl-horizontal admin-dl-horizontal">
|
<dl class="dl-horizontal admin-dl-horizontal">
|
||||||
<dt>{{.i18n.Tr "admin.config.picture_service"}}</dt>
|
|
||||||
<dd>{{.PictureService}}</dd>
|
|
||||||
<dt>{{.i18n.Tr "admin.config.disable_gravatar"}}</dt>
|
<dt>{{.i18n.Tr "admin.config.disable_gravatar"}}</dt>
|
||||||
<dd><i class="fa fa{{if .DisableGravatar}}-check{{end}}-square-o"></i></dd>
|
<dd><i class="fa fa{{if .DisableGravatar}}-check{{end}}-square-o"></i></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
Loading…
Reference in a new issue