diff options
Diffstat (limited to 'cmd/web.go')
-rw-r--r-- | cmd/web.go | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -34,7 +34,6 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" - "github.com/gogits/gogs/modules/avatar" "github.com/gogits/gogs/modules/bindata" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" @@ -81,7 +80,7 @@ func checkVersion() { // Check dependency version. checkers := []VerChecker{ {"github.com/go-xorm/xorm", func() string { return xorm.Version }, "0.4.4.1029"}, - {"github.com/go-macaron/binding", binding.Version, "0.1.0"}, + {"github.com/go-macaron/binding", binding.Version, "0.2.1"}, {"github.com/go-macaron/cache", cache.Version, "0.1.2"}, {"github.com/go-macaron/csrf", csrf.Version, "0.0.3"}, {"github.com/go-macaron/i18n", i18n.Version, "0.2.0"}, @@ -89,8 +88,8 @@ func checkVersion() { {"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"}, {"gopkg.in/ini.v1", ini.Version, "1.8.4"}, {"gopkg.in/macaron.v1", macaron.Version, "0.8.0"}, - {"github.com/gogits/git-module", git.Version, "0.2.4"}, - {"github.com/gogits/go-gogs-client", gogs.Version, "0.7.2"}, + {"github.com/gogits/git-module", git.Version, "0.2.5"}, + {"github.com/gogits/go-gogs-client", gogs.Version, "0.7.3"}, } for _, c := range checkers { if !version.Compare(c.Version(), c.Expected, ">=") { @@ -245,11 +244,6 @@ func runWeb(ctx *cli.Context) { }) // ***** END: User ***** - // Gravatar service. - avt := avatar.CacheServer("public/img/avatar/", "public/img/avatar_default.jpg") - os.MkdirAll("public/img/avatar/", os.ModePerm) - m.Get("/avatar/:hash", avt.ServeHTTP) - adminReq := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true, AdminRequire: true}) // ***** START: Admin ***** @@ -350,11 +344,14 @@ func runWeb(ctx *cli.Context) { m.Get("/members/action/:action", org.MembersAction) m.Get("/teams", org.Teams) + }, middleware.OrgAssignment(true)) + + m.Group("/:org", func() { m.Get("/teams/:team", org.TeamMembers) m.Get("/teams/:team/repositories", org.TeamRepositories) m.Route("/teams/:team/action/:action", "GET,POST", org.TeamsAction) m.Route("/teams/:team/action/repo/:action", "GET,POST", org.TeamsRepoAction) - }, middleware.OrgAssignment(true)) + }, middleware.OrgAssignment(true, false, true)) m.Group("/:org", func() { m.Get("/teams/new", org.NewTeam) @@ -473,7 +470,7 @@ func runWeb(ctx *cli.Context) { m.Post("/delete", repo.DeleteRelease) }, reqRepoAdmin, middleware.RepoRef()) - m.Combo("/compare/*", repo.MustEnablePulls).Get(repo.CompareAndPullRequest). + m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest). Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost) }, reqSignIn, middleware.RepoAssignment(), repo.MustBeNotBare) @@ -506,7 +503,7 @@ func runWeb(ctx *cli.Context) { m.Get("/commits", middleware.RepoRef(), repo.ViewPullCommits) m.Get("/files", middleware.RepoRef(), repo.ViewPullFiles) m.Post("/merge", reqRepoAdmin, repo.MergePullRequest) - }, repo.MustEnablePulls) + }, repo.MustAllowPulls) m.Group("", func() { m.Get("/src/*", repo.Home) @@ -516,7 +513,7 @@ func runWeb(ctx *cli.Context) { m.Get("/forks", repo.Forks) }, middleware.RepoRef()) - m.Get("/compare/:before([a-z0-9]{40})...:after([a-z0-9]{40})", repo.CompareDiff) + m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.CompareDiff) }, ignSignIn, middleware.RepoAssignment(), repo.MustBeNotBare) m.Group("/:username/:reponame", func() { m.Get("/stars", repo.Stars) |