Browse Source

Merge branch 'master' of github.com:gogits/gogs

pull/35/head
skyblue 11 years ago
parent
commit
3070c5513d
  1. 3
      .gitignore
  2. 1
      .gopmfile
  3. 2
      conf/app.ini
  4. 4
      modules/base/conf.go
  5. 0
      public/img/avatar_default.jpg
  6. 1
      routers/admin/admin.go
  7. 1
      templates/admin/config.tmpl
  8. 2
      web.go

3
.gitignore vendored

@ -8,4 +8,5 @@ custom/
data/ data/
.vendor/ .vendor/
.idea/ .idea/
*.iml *.iml
public/img/avatar/

1
.gopmfile

@ -8,6 +8,7 @@ github.com/Unknwon/com=
github.com/Unknwon/cae= github.com/Unknwon/cae=
github.com/Unknwon/goconfig= github.com/Unknwon/goconfig=
github.com/dchest/scrypt= github.com/dchest/scrypt=
github.com/nfnt/resize=
github.com/lunny/xorm= github.com/lunny/xorm=
github.com/gogits/logs= github.com/gogits/logs=
github.com/gogits/binding= github.com/gogits/binding=

2
conf/app.ini

@ -105,8 +105,6 @@ SESSION_ID_HASHKEY =
[picture] [picture]
; The place to picture data, either "server" or "qiniu", default is "server" ; The place to picture data, either "server" or "qiniu", default is "server"
SERVICE = server SERVICE = server
; For "server" only, root path of picture data, default is "data/pictures"
PATH = data/pictures
[log] [log]
; Either "console", "file", "conn", "smtp" or "database", default is "console" ; Either "console", "file", "conn", "smtp" or "database", default is "console"

4
modules/base/conf.go

@ -58,8 +58,7 @@ var (
SessionConfig *session.Config SessionConfig *session.Config
SessionManager *session.Manager SessionManager *session.Manager
PictureService string PictureService string
PictureRootPath string
) )
var Service struct { var Service struct {
@ -269,7 +268,6 @@ func NewConfigContext() {
CookieRememberName = Cfg.MustValue("security", "COOKIE_REMEMBER_NAME") CookieRememberName = Cfg.MustValue("security", "COOKIE_REMEMBER_NAME")
PictureService = Cfg.MustValue("picture", "SERVICE") PictureService = Cfg.MustValue("picture", "SERVICE")
PictureRootPath = Cfg.MustValue("picture", "PATH")
// Determine and create root git reposiroty path. // Determine and create root git reposiroty path.
RepoRootPath = Cfg.MustValue("repository", "ROOT") RepoRootPath = Cfg.MustValue("repository", "ROOT")

0
public/img/avatar/default.jpg → public/img/avatar_default.jpg

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

1
routers/admin/admin.go

@ -161,7 +161,6 @@ func Config(ctx *middleware.Context) {
ctx.Data["SessionConfig"] = base.SessionConfig ctx.Data["SessionConfig"] = base.SessionConfig
ctx.Data["PictureService"] = base.PictureService ctx.Data["PictureService"] = base.PictureService
ctx.Data["PictureRootPath"] = base.PictureRootPath
ctx.Data["LogMode"] = base.LogMode ctx.Data["LogMode"] = base.LogMode
ctx.Data["LogConfig"] = base.LogConfig ctx.Data["LogConfig"] = base.LogConfig

1
templates/admin/config.tmpl

@ -104,7 +104,6 @@
<div class="panel-body"> <div class="panel-body">
<div><b>Picture Service:</b> {{.PictureService}}</div> <div><b>Picture Service:</b> {{.PictureService}}</div>
<div><b>Picture Root Path:</b> {{.PictureRootPath}}</div>
</div> </div>
</div> </div>

2
web.go

@ -94,7 +94,7 @@ func runWeb(*cli.Context) {
m.Get("/stars", reqSignIn, user.Stars) m.Get("/stars", reqSignIn, user.Stars)
m.Get("/help", routers.Help) m.Get("/help", routers.Help)
avatarCache := avatar.HttpHandler("public/img/avatar/", "public/img/avatar/default.jpg") avatarCache := avatar.HttpHandler("public/img/avatar/", "public/img/avatar_default.jpg")
m.Get("/avatar/:hash", avatarCache.ServeHTTP) m.Get("/avatar/:hash", avatarCache.ServeHTTP)
m.Group("/user", func(r martini.Router) { m.Group("/user", func(r martini.Router) {

Loading…
Cancel
Save