diff --git a/README.md b/README.md index 526cc501b2b..0fb646e5e05 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Please see [Wiki](https://github.com/gogits/gogs/wiki) for project design, devel ## Features +- Activity timeline - SSH protocal support. - Register/delete account. - Create/delete public repository. diff --git a/gogs.go b/gogs.go index e826ab9f360..08421f0055e 100644 --- a/gogs.go +++ b/gogs.go @@ -7,7 +7,7 @@ package main import ( "os" - "os/user" + // "os/user" "runtime" "github.com/codegangsta/cli" @@ -27,14 +27,14 @@ func init() { runtime.GOMAXPROCS(runtime.NumCPU()) } -func checkRunUser() bool { - u, err := user.Current() - if err != nil { - // TODO: log - return false - } - return u.Username == base.Cfg.MustValue("", "RUN_USER") -} +// func checkRunUser() bool { +// u, err := user.Current() +// if err != nil { +// // TODO: log +// return false +// } +// return u.Username == base.Cfg.MustValue("", "RUN_USER") +// } func main() { /*if !checkRunUser() { @@ -50,8 +50,6 @@ func main() { CmdWeb, CmdServ, } - app.Flags = append(app.Flags, []cli.Flag{ - cli.BoolFlag{"noterm", "disable color output"}, - }...) + app.Flags = append(app.Flags, []cli.Flag{}...) app.Run(os.Args) } diff --git a/models/repo.go b/models/repo.go index 125abfc3423..56e286ec4ab 100644 --- a/models/repo.go +++ b/models/repo.go @@ -253,7 +253,7 @@ func GetRepositoryById(id int64) (repo *Repository, err error) { // GetRepositories returns the list of repositories of given user. func GetRepositories(user *User) ([]Repository, error) { repos := make([]Repository, 0, 10) - err := orm.Find(&repos, &Repository{OwnerId: user.Id}) + err := orm.Desc("updated").Find(&repos, &Repository{OwnerId: user.Id}) return repos, err } diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index 948713efe82..8cdc6df718d 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -5,6 +5,8 @@ package middleware import ( + "errors" + "github.com/codegangsta/martini" "github.com/gogits/gogs/models" @@ -31,9 +33,7 @@ func RepoAssignment(redirect bool) martini.Handler { ctx.Render.Redirect("/") return } - //data["ErrorMsg"] = err - //log.Error("repo.Single: %v", err) - //r.HTML(200, "base/error", data) + ctx.Handle(200, "RepoAssignment", err) return } } else { @@ -45,9 +45,7 @@ func RepoAssignment(redirect bool) martini.Handler { ctx.Render.Redirect("/") return } - //data["ErrorMsg"] = "invliad user account for single repository" - //log.Error("repo.Single: %v", err) - //r.HTML(200, "base/error", data) + ctx.Handle(200, "RepoAssignment", errors.New("invliad user account for single repository")) return } @@ -60,9 +58,7 @@ func RepoAssignment(redirect bool) martini.Handler { ctx.Render.Redirect("/") return } - //data["ErrorMsg"] = err - //log.Error("repo.Single: %v", err) - //r.HTML(200, "base/error", data) + ctx.Handle(200, "RepoAssignment", err) return } diff --git a/serve.go b/serve.go index 56105f2f806..68455de3d36 100644 --- a/serve.go +++ b/serve.go @@ -58,7 +58,7 @@ func runServ(*cli.Context) { cmd := os.Getenv("SSH_ORIGINAL_COMMAND") if cmd == "" { - println("Hi ", user.Name, "! You've successfully authenticated, but Gogs does not provide shell access.") + println("Hi", user.Name, "! You've successfully authenticated, but Gogs does not provide shell access.") return } diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 93d33c8744c..2de92f515fd 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -59,7 +59,7 @@
diff --git a/web.go b/web.go index 3f0e0ef7e23..b7138120a3f 100644 --- a/web.go +++ b/web.go @@ -74,8 +74,6 @@ func runWeb(*cli.Context) { middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) m.Get("/:username/:reponame", middleware.SignInRequire(false), middleware.RepoAssignment(true), repo.Single) - //m.Get("/:username/:reponame", repo.Repo) - listenAddr := fmt.Sprintf("%s:%s", base.Cfg.MustValue("server", "HTTP_ADDR"), base.Cfg.MustValue("server", "HTTP_PORT", "3000"))