diff --git a/README.md b/README.md index 03cb070e259..02e624c0a86 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra ![](public/img/gogs-large-resize.png) -##### Current version: 0.7.9 Beta +##### Current version: 0.7.10 Beta diff --git a/cmd/web.go b/cmd/web.go index e51b1bb978c..950c3d48cfd 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -87,6 +87,7 @@ func checkVersion() { {"github.com/go-macaron/csrf", csrf.Version, "0.0.3"}, {"github.com/go-macaron/i18n", i18n.Version, "0.0.7"}, {"github.com/go-macaron/session", session.Version, "0.1.6"}, + {"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"}, {"gopkg.in/ini.v1", ini.Version, "1.3.4"}, } for _, c := range checkers { @@ -463,7 +464,7 @@ func runWeb(ctx *cli.Context) { }) }) - }, reqSignIn, middleware.RepoAssignment(true), reqRepoAdmin) + }, reqSignIn, middleware.RepoAssignment(true), reqRepoAdmin, middleware.RepoRef()) m.Group("/:username/:reponame", func() { m.Get("/action/:action", repo.Action) diff --git a/gogs.go b/gogs.go index 37259d367d3..95b8e931f4d 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.7.9.1114 Beta" +const APP_VER = "0.7.10.1114 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/ssh/ssh.go b/modules/ssh/ssh.go index 5e3761ca19c..706f5e7503e 100644 --- a/modules/ssh/ssh.go +++ b/modules/ssh/ssh.go @@ -7,6 +7,7 @@ package ssh import ( + "fmt" "io" "io/ioutil" "net" @@ -82,14 +83,16 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) { return } - go io.Copy(ch, stdout) - go io.Copy(ch.Stderr(), stderr) - go io.Copy(input, ch) - if err = cmd.Start(); err != nil { log.Error(3, "Start: %v", err) return - } else if err = cmd.Wait(); err != nil { + } + + go io.Copy(input, ch) + io.Copy(ch, stdout) + io.Copy(ch.Stderr(), stderr) + + if err = cmd.Wait(); err != nil { log.Error(3, "Wait: %v", err) return } @@ -142,7 +145,16 @@ func Listen(port int) { }, } - privateBytes, err := ioutil.ReadFile(filepath.Join(models.SSHPath, "id_rsa")) + keyPath := filepath.Join(setting.AppDataPath, "ssh/gogs.rsa") + if !com.IsExist(keyPath) { + os.MkdirAll(filepath.Dir(keyPath), os.ModePerm) + _, stderr, err := com.ExecCmd("ssh-keygen", "-f", keyPath, "-t", "rsa", "-N", "") + if err != nil { + panic(fmt.Sprintf("Fail to generate private key: %v - %s", err, stderr)) + } + } + + privateBytes, err := ioutil.ReadFile(keyPath) if err != nil { panic("Fail to load private key") } diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 101cb5c557c..0c9e7817a2a 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -17,6 +17,8 @@ import ( "github.com/gogits/gogs/modules/setting" ) +import "github.com/davecheney/profile" + const ( COMMITS base.TplName = "repo/commits" DIFF base.TplName = "repo/diff" @@ -43,6 +45,7 @@ func RenderIssueLinks(oldCommits *list.List, repoLink string) *list.List { } func Commits(ctx *middleware.Context) { + defer profile.Start(profile.CPUProfile).Stop() ctx.Data["PageIsCommits"] = true commitsCount, err := ctx.Repo.Commit.CommitsCount() diff --git a/templates/.VERSION b/templates/.VERSION index 548d9a0ea69..32d6c06db86 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.7.9.1114 Beta \ No newline at end of file +0.7.10.1114 Beta \ No newline at end of file diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl index e54c9ed70ed..769841deeae 100644 --- a/templates/repo/commits.tmpl +++ b/templates/repo/commits.tmpl @@ -2,6 +2,7 @@
{{template "repo/header" .}}
+ {{template "repo/sidebar" .}} {{template "repo/commits_table" .}}
diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl index 0574e9d8004..5a6958381b5 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -2,6 +2,7 @@
{{template "repo/header" .}}
+ {{template "repo/sidebar" .}}
{{template "repo/settings/navbar" .}}
diff --git a/templates/repo/settings/githook_edit.tmpl b/templates/repo/settings/githook_edit.tmpl index b9b75a3aa61..2f79481a2ac 100644 --- a/templates/repo/settings/githook_edit.tmpl +++ b/templates/repo/settings/githook_edit.tmpl @@ -2,6 +2,7 @@
{{template "repo/header" .}}
+ {{template "repo/sidebar" .}}
{{template "repo/settings/navbar" .}}
diff --git a/templates/repo/settings/githooks.tmpl b/templates/repo/settings/githooks.tmpl index 8120b80e175..980b98fde98 100644 --- a/templates/repo/settings/githooks.tmpl +++ b/templates/repo/settings/githooks.tmpl @@ -2,6 +2,7 @@
{{template "repo/header" .}}
+ {{template "repo/sidebar" .}}
{{template "repo/settings/navbar" .}}
diff --git a/templates/repo/settings/hook_new.tmpl b/templates/repo/settings/hook_new.tmpl index 7c9a5de1f0b..ac69b02f35b 100644 --- a/templates/repo/settings/hook_new.tmpl +++ b/templates/repo/settings/hook_new.tmpl @@ -2,6 +2,7 @@
{{template "repo/header" .}}
+ {{template "repo/sidebar" .}}
{{template "repo/settings/navbar" .}}
diff --git a/templates/repo/settings/hooks.tmpl b/templates/repo/settings/hooks.tmpl index e3f6f4ddae8..187bd563607 100644 --- a/templates/repo/settings/hooks.tmpl +++ b/templates/repo/settings/hooks.tmpl @@ -2,6 +2,7 @@
{{template "repo/header" .}}
+ {{template "repo/sidebar" .}}
{{template "repo/settings/navbar" .}} {{template "repo/settings/hook_list" .}} diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 474d719eb7a..e109ec11c6e 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -2,6 +2,7 @@
{{template "repo/header" .}}
+ {{template "repo/sidebar" .}}
{{template "repo/settings/navbar" .}}