From eaa7d71fc7967161dfd79987ed94f01bc8a7b88a Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Jun 2014 21:59:56 -0400 Subject: [PATCH 01/55] Fix #232 --- gogs.go | 2 +- models/issue.go | 2 +- templates/VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gogs.go b/gogs.go index 963cd5878e..8e8c161a5c 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.1.0601 Alpha" +const APP_VER = "0.4.1.0602 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/issue.go b/models/issue.go index 18057985f0..7db728ec3d 100644 --- a/models/issue.go +++ b/models/issue.go @@ -771,7 +771,7 @@ type Comment struct { IssueId int64 CommitId int64 Line int64 - Content string + Content string `xorm:"TEXT"` Created time.Time `xorm:"CREATED"` } diff --git a/templates/VERSION b/templates/VERSION index 81b6032124..6e7780b2e4 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.1.0601 Alpha \ No newline at end of file +0.4.1.0602 Alpha \ No newline at end of file From 32c5fa514c92f9b29e41f86e765d25890e6d9bb8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Jun 2014 23:17:21 -0400 Subject: [PATCH 02/55] Fix #230 --- models/repo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/repo.go b/models/repo.go index d13c349f11..5d28174b01 100644 --- a/models/repo.go +++ b/models/repo.go @@ -12,6 +12,7 @@ import ( "os/exec" "path" "path/filepath" + "sort" "strings" "time" "unicode/utf8" @@ -75,6 +76,8 @@ func LoadRepoConfig() { LanguageIgns = typeFiles[0] Licenses = typeFiles[1] + sort.Strings(LanguageIgns) + sort.Strings(Licenses) } func NewRepoContext() { From 9c3aa6936acc16a4b127874dea5a5519d20e44e1 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 3 Jun 2014 12:16:44 -0400 Subject: [PATCH 03/55] Fix #223 --- routers/repo/setting.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/routers/repo/setting.go b/routers/repo/setting.go index fe2489923e..0232dbcfe3 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -7,6 +7,7 @@ package repo import ( "fmt" "strings" + "time" "github.com/go-martini/martini" @@ -72,6 +73,7 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) { if ctx.Repo.Repository.IsMirror { if form.Interval > 0 { ctx.Repo.Mirror.Interval = form.Interval + ctx.Repo.Mirror.NextUpdate = time.Now().Add(time.Duration(form.Interval) * time.Hour) if err := models.UpdateMirror(ctx.Repo.Mirror); err != nil { log.Error("setting.SettingPost(UpdateMirror): %v", err) } From 63baf76ab2f4a510b4fb981e81feb5ae533b1639 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 3 Jun 2014 12:51:53 -0400 Subject: [PATCH 04/55] Fix #214 --- gogs.go | 2 +- modules/mailer/mail.go | 2 +- modules/setting/setting.go | 2 ++ templates/VERSION | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gogs.go b/gogs.go index 8e8c161a5c..cf35af7543 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.1.0602 Alpha" +const APP_VER = "0.4.1.0603 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/mailer/mail.go b/modules/mailer/mail.go index 6e34439e15..4ebabae818 100644 --- a/modules/mailer/mail.go +++ b/modules/mailer/mail.go @@ -26,7 +26,7 @@ func NewMailMessageFrom(To []string, from, subject, body string) Message { // Create New mail message use MailFrom and MailUser func NewMailMessage(To []string, subject, body string) Message { - return NewMailMessageFrom(To, setting.MailService.User, subject, body) + return NewMailMessageFrom(To, setting.MailService.From, subject, body) } func GetMailTmplData(user *models.User) map[interface{}]interface{} { diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 8cca57efed..2f64511a12 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -330,6 +330,7 @@ func newSessionService() { type Mailer struct { Name string Host string + From string User, Passwd string } @@ -363,6 +364,7 @@ func newMailService() { User: Cfg.MustValue("mailer", "USER"), Passwd: Cfg.MustValue("mailer", "PASSWD"), } + MailService.From = Cfg.MustValue("mailer", "FROM", MailService.User) log.Info("Mail Service Enabled") } diff --git a/templates/VERSION b/templates/VERSION index 6e7780b2e4..7f97ea1c45 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.1.0602 Alpha \ No newline at end of file +0.4.1.0603 Alpha \ No newline at end of file From 11f9d738e8a1bce4c35bc5e1c37f5a7d1bcded5c Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 3 Jun 2014 21:51:25 -0400 Subject: [PATCH 05/55] Fix #237 --- models/repo.go | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/models/repo.go b/models/repo.go index 5d28174b01..869059fa2e 100644 --- a/models/repo.go +++ b/models/repo.go @@ -489,22 +489,40 @@ func initRepository(f string, user *User, repo *Repository, initReadme bool, rep // .gitignore if repoLang != "" { filePath := "conf/gitignore/" + repoLang - if com.IsFile(filePath) { - if err := com.Copy(filePath, - filepath.Join(tmpDir, fileName["gitign"])); err != nil { + targetPath := path.Join(tmpDir, fileName["gitign"]) + data, err := bin.Asset(filePath) + if err == nil { + if err = ioutil.WriteFile(targetPath, data, os.ModePerm); err != nil { return err } + } else { + // Check custom files. + filePath = path.Join(setting.CustomPath, "conf/gitignore", repoLang) + if com.IsFile(filePath) { + if err := com.Copy(filePath, targetPath); err != nil { + return err + } + } } } // LICENSE if license != "" { filePath := "conf/license/" + license - if com.IsFile(filePath) { - if err := com.Copy(filePath, - filepath.Join(tmpDir, fileName["license"])); err != nil { + targetPath := path.Join(tmpDir, fileName["license"]) + data, err := bin.Asset(filePath) + if err == nil { + if err = ioutil.WriteFile(targetPath, data, os.ModePerm); err != nil { return err } + } else { + // Check custom files. + filePath = path.Join(setting.CustomPath, "conf/license", license) + if com.IsFile(filePath) { + if err := com.Copy(filePath, targetPath); err != nil { + return err + } + } } } From 925ccc2608839e34d30849a310e06af600db1604 Mon Sep 17 00:00:00 2001 From: Baiju Muthukadan Date: Thu, 5 Jun 2014 21:46:46 +0530 Subject: [PATCH 06/55] use 'docker.io' command instead of 'docker' --- dockerfiles/build.sh | 12 ++++++------ dockerfiles/run.sh | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dockerfiles/build.sh b/dockerfiles/build.sh index 83f7e9a566..0b7cc2ff11 100755 --- a/dockerfiles/build.sh +++ b/dockerfiles/build.sh @@ -36,22 +36,22 @@ if [ $MEM_TYPE != "" ] sed -i "${GOGS_BUILD_LINE}s/$/ -tags $MEM_TYPE/" images/gogits/Dockerfile cd images/$MEM_TYPE - docker build -t gogits/$MEM_TYPE . - docker run -d --name $MEM_RUN_NAME gogits/$MEM_TYPE + docker.io build -t gogits/$MEM_TYPE . + docker.io run -d --name $MEM_RUN_NAME gogits/$MEM_TYPE MEM_LINK=" --link $MEM_RUN_NAME:mem " cd ../../ fi # Build the database image cd images/$DB_TYPE -docker build -t gogits/$DB_TYPE . +docker.io build -t gogits/$DB_TYPE . # ## Build the gogits image cd ../gogits -docker build -t gogits/gogs . +docker.io build -t gogits/gogs . #sed -i "s#RUN go get -u -tags $MEM_TYPE github.com/gogits/gogs#RUN go get -u github.com/gogits/gogs#g" Dockerfile @@ -60,9 +60,9 @@ sed -i "s/ -tags $MEM_TYPE//" Dockerfile # ## Run MySQL image with name -docker run -d --name $DB_RUN_NAME gogits/$DB_TYPE +docker.io run -d --name $DB_RUN_NAME gogits/$DB_TYPE # ## Run gogits image and link it to the database image echo "Now we have the $DB_TYPE image(running) and gogs image, use the follow command to start gogs service:" -echo -e "\033[33m docker run -i -t --link $DB_RUN_NAME:db $MEM_LINK -p $HOST_PORT:3000 gogits/gogs \033[0m" +echo -e "\033[33m docker.io run -i -t --link $DB_RUN_NAME:db $MEM_LINK -p $HOST_PORT:3000 gogits/gogs \033[0m" diff --git a/dockerfiles/run.sh b/dockerfiles/run.sh index 7721ab41d4..a199442453 100755 --- a/dockerfiles/run.sh +++ b/dockerfiles/run.sh @@ -6,8 +6,8 @@ MYSQL_ALIAS="db" HOST_PORT="3000" ## Run MySQL image with name -docker run -d --name $MYSQL_RUN_NAME gogs/mysql +docker.io run -d --name $MYSQL_RUN_NAME gogs/mysql # ## Run gogits image and link it to the MySQL image -docker run --link $MYSQL_RUN_NAME:$MYSQL_ALIAS -p $HOST_PORT:3000 gogs/gogits +docker.io run --link $MYSQL_RUN_NAME:$MYSQL_ALIAS -p $HOST_PORT:3000 gogs/gogits From 4f2f3c285717eff7a2f4ae2b79fbb0809e786dc8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 5 Jun 2014 22:07:35 -0400 Subject: [PATCH 07/55] Code convention --- README.md | 2 +- README_ZH.md | 2 +- cmd/web.go | 8 +++-- gogs.go | 2 +- models/login.go | 4 +-- models/user.go | 27 ++++++++------- modules/auth/user.go | 34 +++++++++---------- modules/mailer/mail.go | 58 ++++++++++++++++----------------- routers/user/user.go | 18 +++++----- templates/VERSION | 2 +- templates/admin/auths/edit.tmpl | 6 ++-- 11 files changed, 83 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index 2de797afd2..8887081911 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language ![Demo](http://gowalker.org/public/gogs_demo.gif) -##### Current version: 0.4.0 Alpha +##### Current version: 0.4.2 Alpha ### NOTICES diff --git a/README_ZH.md b/README_ZH.md index f3be4418d1..84af15a6a5 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -5,7 +5,7 @@ Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。 ![Demo](http://gowalker.org/public/gogs_demo.gif) -##### 当前版本:0.4.0 Alpha +##### 当前版本:0.4.2 Alpha ## 开发目的 diff --git a/cmd/web.go b/cmd/web.go index dc4daca085..30db037a2c 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -89,9 +89,11 @@ func runWeb(*cli.Context) { m.Get("/", ignSignIn, routers.Home) m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install) m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost) - m.Get("/issues", reqSignIn, user.Issues) - m.Get("/pulls", reqSignIn, user.Pulls) - m.Get("/stars", reqSignIn, user.Stars) + m.Group("", func(r martini.Router) { + r.Get("/issues", user.Issues) + r.Get("/pulls", user.Pulls) + r.Get("/stars", user.Stars) + }, reqSignIn) m.Group("/api", func(r martini.Router) { m.Group("/v1", func(r martini.Router) { diff --git a/gogs.go b/gogs.go index cf35af7543..aabcbe82e1 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.1.0603 Alpha" +const APP_VER = "0.4.2.0605 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/login.go b/models/login.go index 3efef2f78f..984a9f8c30 100644 --- a/models/login.go +++ b/models/login.go @@ -150,8 +150,8 @@ func DelLoginSource(source *LoginSource) error { return err } -// login a user -func LoginUser(uname, passwd string) (*User, error) { +// UserSignIn validates user name and password. +func UserSignIn(uname, passwd string) (*User, error) { var u *User if strings.Contains(uname, "@") { u = &User{Email: uname} diff --git a/models/user.go b/models/user.go index f95f303b2b..78ab464249 100644 --- a/models/user.go +++ b/models/user.go @@ -72,7 +72,7 @@ func (user *User) HomeLink() string { return "/user/" + user.Name } -// AvatarLink returns the user gravatar link. +// AvatarLink returns user gravatar link. func (user *User) AvatarLink() string { if setting.DisableGravatar { return "/img/avatar_default.jpg" @@ -268,17 +268,17 @@ func ChangeUserName(user *User, newUserName string) (err error) { } // UpdateUser updates user's information. -func UpdateUser(user *User) (err error) { - user.LowerName = strings.ToLower(user.Name) +func UpdateUser(u *User) (err error) { + u.LowerName = strings.ToLower(u.Name) - if len(user.Location) > 255 { - user.Location = user.Location[:255] + if len(u.Location) > 255 { + u.Location = u.Location[:255] } - if len(user.Website) > 255 { - user.Website = user.Website[:255] + if len(u.Website) > 255 { + u.Website = u.Website[:255] } - _, err = orm.Id(user.Id).AllCols().Update(user) + _, err = orm.Id(u.Id).AllCols().Update(u) return err } @@ -356,17 +356,16 @@ func GetUserByKeyId(keyId int64) (*User, error) { return user, nil } -// GetUserById returns the user object by given id if exists. +// GetUserById returns the user object by given ID if exists. func GetUserById(id int64) (*User, error) { - user := new(User) - has, err := orm.Id(id).Get(user) + u := new(User) + has, err := orm.Id(id).Get(u) if err != nil { return nil, err - } - if !has { + } else if !has { return nil, ErrUserNotExist } - return user, nil + return u, nil } // GetUserByName returns the user object by given name if exists. diff --git a/modules/auth/user.go b/modules/auth/user.go index e672a9c10f..3763c0fc64 100644 --- a/modules/auth/user.go +++ b/modules/auth/user.go @@ -19,54 +19,54 @@ import ( ) // SignedInId returns the id of signed in user. -func SignedInId(session session.SessionStore) int64 { +func SignedInId(sess session.SessionStore) int64 { if !models.HasEngine { return 0 } - userId := session.Get("userId") - if userId == nil { + uid := sess.Get("userId") + if uid == nil { return 0 } - if s, ok := userId.(int64); ok { - if _, err := models.GetUserById(s); err != nil { + if id, ok := uid.(int64); ok { + if _, err := models.GetUserById(id); err != nil { return 0 } - return s + return id } return 0 } // SignedInName returns the name of signed in user. -func SignedInName(session session.SessionStore) string { - userName := session.Get("userName") - if userName == nil { +func SignedInName(sess session.SessionStore) string { + uname := sess.Get("userName") + if uname == nil { return "" } - if s, ok := userName.(string); ok { + if s, ok := uname.(string); ok { return s } return "" } // SignedInUser returns the user object of signed user. -func SignedInUser(session session.SessionStore) *models.User { - id := SignedInId(session) - if id <= 0 { +func SignedInUser(sess session.SessionStore) *models.User { + uid := SignedInId(sess) + if uid <= 0 { return nil } - user, err := models.GetUserById(id) + u, err := models.GetUserById(uid) if err != nil { log.Error("user.SignedInUser: %v", err) return nil } - return user + return u } // IsSignedIn check if any user has signed in. -func IsSignedIn(session session.SessionStore) bool { - return SignedInId(session) > 0 +func IsSignedIn(sess session.SessionStore) bool { + return SignedInId(sess) > 0 } type FeedsForm struct { diff --git a/modules/mailer/mail.go b/modules/mailer/mail.go index 4ebabae818..e212d0066f 100644 --- a/modules/mailer/mail.go +++ b/modules/mailer/mail.go @@ -29,7 +29,7 @@ func NewMailMessage(To []string, subject, body string) Message { return NewMailMessageFrom(To, setting.MailService.From, subject, body) } -func GetMailTmplData(user *models.User) map[interface{}]interface{} { +func GetMailTmplData(u *models.User) map[interface{}]interface{} { data := make(map[interface{}]interface{}, 10) data["AppName"] = setting.AppName data["AppVer"] = setting.AppVer @@ -37,29 +37,29 @@ func GetMailTmplData(user *models.User) map[interface{}]interface{} { data["AppLogo"] = setting.AppLogo data["ActiveCodeLives"] = setting.Service.ActiveCodeLives / 60 data["ResetPwdCodeLives"] = setting.Service.ResetPwdCodeLives / 60 - if user != nil { - data["User"] = user + if u != nil { + data["User"] = u } return data } // create a time limit code for user active -func CreateUserActiveCode(user *models.User, startInf interface{}) string { +func CreateUserActiveCode(u *models.User, startInf interface{}) string { minutes := setting.Service.ActiveCodeLives - data := base.ToStr(user.Id) + user.Email + user.LowerName + user.Passwd + user.Rands + data := base.ToStr(u.Id) + u.Email + u.LowerName + u.Passwd + u.Rands code := base.CreateTimeLimitCode(data, minutes, startInf) // add tail hex username - code += hex.EncodeToString([]byte(user.LowerName)) + code += hex.EncodeToString([]byte(u.LowerName)) return code } // Send user register mail with active code -func SendRegisterMail(r *middleware.Render, user *models.User) { - code := CreateUserActiveCode(user, nil) +func SendRegisterMail(r *middleware.Render, u *models.User) { + code := CreateUserActiveCode(u, nil) subject := "Register success, Welcome" - data := GetMailTmplData(user) + data := GetMailTmplData(u) data["Code"] = code body, err := r.HTMLString("mail/auth/register_success", data) if err != nil { @@ -67,19 +67,19 @@ func SendRegisterMail(r *middleware.Render, user *models.User) { return } - msg := NewMailMessage([]string{user.Email}, subject, body) - msg.Info = fmt.Sprintf("UID: %d, send register mail", user.Id) + msg := NewMailMessage([]string{u.Email}, subject, body) + msg.Info = fmt.Sprintf("UID: %d, send register mail", u.Id) SendAsync(&msg) } // Send email verify active email. -func SendActiveMail(r *middleware.Render, user *models.User) { - code := CreateUserActiveCode(user, nil) +func SendActiveMail(r *middleware.Render, u *models.User) { + code := CreateUserActiveCode(u, nil) subject := "Verify your e-mail address" - data := GetMailTmplData(user) + data := GetMailTmplData(u) data["Code"] = code body, err := r.HTMLString("mail/auth/active_email", data) if err != nil { @@ -87,19 +87,19 @@ func SendActiveMail(r *middleware.Render, user *models.User) { return } - msg := NewMailMessage([]string{user.Email}, subject, body) - msg.Info = fmt.Sprintf("UID: %d, send active mail", user.Id) + msg := NewMailMessage([]string{u.Email}, subject, body) + msg.Info = fmt.Sprintf("UID: %d, send active mail", u.Id) SendAsync(&msg) } // Send reset password email. -func SendResetPasswdMail(r *middleware.Render, user *models.User) { - code := CreateUserActiveCode(user, nil) +func SendResetPasswdMail(r *middleware.Render, u *models.User) { + code := CreateUserActiveCode(u, nil) subject := "Reset your password" - data := GetMailTmplData(user) + data := GetMailTmplData(u) data["Code"] = code body, err := r.HTMLString("mail/auth/reset_passwd", data) if err != nil { @@ -107,14 +107,14 @@ func SendResetPasswdMail(r *middleware.Render, user *models.User) { return } - msg := NewMailMessage([]string{user.Email}, subject, body) - msg.Info = fmt.Sprintf("UID: %d, send reset password email", user.Id) + msg := NewMailMessage([]string{u.Email}, subject, body) + msg.Info = fmt.Sprintf("UID: %d, send reset password email", u.Id) SendAsync(&msg) } // SendIssueNotifyMail sends mail notification of all watchers of repository. -func SendIssueNotifyMail(user, owner *models.User, repo *models.Repository, issue *models.Issue) ([]string, error) { +func SendIssueNotifyMail(u, owner *models.User, repo *models.Repository, issue *models.Issue) ([]string, error) { ws, err := models.GetWatchers(repo.Id) if err != nil { return nil, errors.New("mail.NotifyWatchers(GetWatchers): " + err.Error()) @@ -123,7 +123,7 @@ func SendIssueNotifyMail(user, owner *models.User, repo *models.Repository, issu tos := make([]string, 0, len(ws)) for i := range ws { uid := ws[i].UserId - if user.Id == uid { + if u.Id == uid { continue } u, err := models.GetUserById(uid) @@ -141,14 +141,14 @@ func SendIssueNotifyMail(user, owner *models.User, repo *models.Repository, issu content := fmt.Sprintf("%s
-
View it on Gogs.", base.RenderSpecialLink([]byte(issue.Content), owner.Name+"/"+repo.Name), setting.AppUrl, owner.Name, repo.Name, issue.Index) - msg := NewMailMessageFrom(tos, user.Email, subject, content) + msg := NewMailMessageFrom(tos, u.Email, subject, content) msg.Info = fmt.Sprintf("Subject: %s, send issue notify emails", subject) SendAsync(&msg) return tos, nil } // SendIssueMentionMail sends mail notification for who are mentioned in issue. -func SendIssueMentionMail(r *middleware.Render, user, owner *models.User, +func SendIssueMentionMail(r *middleware.Render, u, owner *models.User, repo *models.Repository, issue *models.Issue, tos []string) error { if len(tos) == 0 { @@ -166,14 +166,14 @@ func SendIssueMentionMail(r *middleware.Render, user, owner *models.User, return fmt.Errorf("mail.SendIssueMentionMail(fail to render): %v", err) } - msg := NewMailMessageFrom(tos, user.Email, subject, body) + msg := NewMailMessageFrom(tos, u.Email, subject, body) msg.Info = fmt.Sprintf("Subject: %s, send issue mention emails", subject) SendAsync(&msg) return nil } // SendCollaboratorMail sends mail notification to new collaborator. -func SendCollaboratorMail(r *middleware.Render, user, owner *models.User, +func SendCollaboratorMail(r *middleware.Render, u, owner *models.User, repo *models.Repository) error { subject := fmt.Sprintf("%s added you to %s", owner.Name, repo.Name) @@ -187,8 +187,8 @@ func SendCollaboratorMail(r *middleware.Render, user, owner *models.User, return fmt.Errorf("mail.SendCollaboratorMail(fail to render): %v", err) } - msg := NewMailMessage([]string{user.Email}, subject, body) - msg.Info = fmt.Sprintf("UID: %d, send register mail", user.Id) + msg := NewMailMessage([]string{u.Email}, subject, body) + msg.Info = fmt.Sprintf("UID: %d, send register mail", u.Id) SendAsync(&msg) return nil diff --git a/routers/user/user.go b/routers/user/user.go index a5b3e79253..8fcbeb6a46 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -32,8 +32,8 @@ func SignIn(ctx *middleware.Context) { } // Check auto-login. - userName := ctx.GetCookie(setting.CookieUserName) - if len(userName) == 0 { + uname := ctx.GetCookie(setting.CookieUserName) + if len(uname) == 0 { ctx.HTML(200, "user/signin") return } @@ -41,14 +41,14 @@ func SignIn(ctx *middleware.Context) { isSucceed := false defer func() { if !isSucceed { - log.Trace("user.SignIn(auto-login cookie cleared): %s", userName) + log.Trace("user.SignIn(auto-login cookie cleared): %s", uname) ctx.SetCookie(setting.CookieUserName, "", -1) ctx.SetCookie(setting.CookieRememberName, "", -1) return } }() - user, err := models.GetUserByName(userName) + user, err := models.GetUserByName(uname) if err != nil { ctx.Handle(500, "user.SignIn(GetUserByName)", err) return @@ -90,7 +90,7 @@ func SignInPost(ctx *middleware.Context, form auth.LogInForm) { return } - user, err := models.LoginUser(form.UserName, form.Password) + user, err := models.UserSignIn(form.UserName, form.Password) if err != nil { if err == models.ErrUserNotExist { log.Trace("%s Log in failed: %s", ctx.Req.RequestURI, form.UserName) @@ -98,7 +98,7 @@ func SignInPost(ctx *middleware.Context, form auth.LogInForm) { return } - ctx.Handle(500, "user.SignIn", err) + ctx.Handle(500, "user.SignInPost(UserSignIn)", err) return } @@ -220,17 +220,18 @@ func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) { if u, err = models.RegisterUser(u); err != nil { switch err { case models.ErrUserAlreadyExist: + ctx.Data["Err_UserName"] = true ctx.RenderWithErr("Username has been already taken", "user/signup", &form) case models.ErrEmailAlreadyUsed: + ctx.Data["Err_Email"] = true ctx.RenderWithErr("E-mail address has been already used", "user/signup", &form) case models.ErrUserNameIllegal: ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), "user/signup", &form) default: - ctx.Handle(500, "user.SignUp(RegisterUser)", err) + ctx.Handle(500, "user.SignUpPost(RegisterUser)", err) } return } - log.Trace("%s User created: %s", ctx.Req.RequestURI, form.UserName) // Bind social account. @@ -256,6 +257,7 @@ func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) { } return } + ctx.Redirect("/user/login") } diff --git a/templates/VERSION b/templates/VERSION index 7f97ea1c45..7ba2c25f9a 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.1.0603 Alpha \ No newline at end of file +0.4.2.0605 Alpha \ No newline at end of file diff --git a/templates/admin/auths/edit.tmpl b/templates/admin/auths/edit.tmpl index deea447c89..a2c2ddc698 100644 --- a/templates/admin/auths/edit.tmpl +++ b/templates/admin/auths/edit.tmpl @@ -71,21 +71,21 @@
- +
- +
- +
{{else if eq $type 3}} From c6058e5ea84503925ca2ac323ee411acc3206ad5 Mon Sep 17 00:00:00 2001 From: Baiju Muthukadan Date: Fri, 6 Jun 2014 14:22:54 +0530 Subject: [PATCH 08/55] locate docker command during running time --- dockerfiles/build.sh | 18 ++++++++++++------ dockerfiles/run.sh | 10 ++++++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dockerfiles/build.sh b/dockerfiles/build.sh index 0b7cc2ff11..b658db4ecd 100755 --- a/dockerfiles/build.sh +++ b/dockerfiles/build.sh @@ -10,6 +10,12 @@ HOST_PORT="YOUR_HOST_PORT" # The port on host, which will be redirected t # apt source, you can select 'nchc'(mirror in Taiwan) or 'aliyun'(best for mainlance China users) according to your network, if you could connect to the official unbunt mirror in a fast speed, just leave it to "". APT_SOURCE="" +DOCKER_BIN=$(which docker.io || which docker) +if [ -z "$DOCKER_BIN" ] ; then + echo "Please install docker. You can install docker by running \"wget -qO- https://get.docker.io/ | sh\"." + exit 1 +fi + # Replace the database root password in database image Dockerfile. sed -i "s/THE_DB_PASSWORD/$DB_PASSWORD/g" images/$DB_TYPE/Dockerfile # Replace the database root password in gogits image deploy.sh file. @@ -36,22 +42,22 @@ if [ $MEM_TYPE != "" ] sed -i "${GOGS_BUILD_LINE}s/$/ -tags $MEM_TYPE/" images/gogits/Dockerfile cd images/$MEM_TYPE - docker.io build -t gogits/$MEM_TYPE . - docker.io run -d --name $MEM_RUN_NAME gogits/$MEM_TYPE + $DOCKER_BIN build -t gogits/$MEM_TYPE . + $DOCKER_BIN run -d --name $MEM_RUN_NAME gogits/$MEM_TYPE MEM_LINK=" --link $MEM_RUN_NAME:mem " cd ../../ fi # Build the database image cd images/$DB_TYPE -docker.io build -t gogits/$DB_TYPE . +$DOCKER_BIN build -t gogits/$DB_TYPE . # ## Build the gogits image cd ../gogits -docker.io build -t gogits/gogs . +$DOCKER_BIN build -t gogits/gogs . #sed -i "s#RUN go get -u -tags $MEM_TYPE github.com/gogits/gogs#RUN go get -u github.com/gogits/gogs#g" Dockerfile @@ -60,9 +66,9 @@ sed -i "s/ -tags $MEM_TYPE//" Dockerfile # ## Run MySQL image with name -docker.io run -d --name $DB_RUN_NAME gogits/$DB_TYPE +$DOCKER_BIN run -d --name $DB_RUN_NAME gogits/$DB_TYPE # ## Run gogits image and link it to the database image echo "Now we have the $DB_TYPE image(running) and gogs image, use the follow command to start gogs service:" -echo -e "\033[33m docker.io run -i -t --link $DB_RUN_NAME:db $MEM_LINK -p $HOST_PORT:3000 gogits/gogs \033[0m" +echo -e "\033[33m $DOCKER_BIN run -i -t --link $DB_RUN_NAME:db $MEM_LINK -p $HOST_PORT:3000 gogits/gogs \033[0m" diff --git a/dockerfiles/run.sh b/dockerfiles/run.sh index a199442453..cef2ebb81f 100755 --- a/dockerfiles/run.sh +++ b/dockerfiles/run.sh @@ -5,9 +5,15 @@ typeset -u MYSQL_ALIAS MYSQL_ALIAS="db" HOST_PORT="3000" +DOCKER_BIN=$(which docker.io || which docker) +if [ -z "$DOCKER_BIN" ] ; then + echo "Please install docker. You can install docker by running \"wget -qO- https://get.docker.io/ | sh\"." + exit 1 +fi + ## Run MySQL image with name -docker.io run -d --name $MYSQL_RUN_NAME gogs/mysql +$DOCKER_BIN run -d --name $MYSQL_RUN_NAME gogs/mysql # ## Run gogits image and link it to the MySQL image -docker.io run --link $MYSQL_RUN_NAME:$MYSQL_ALIAS -p $HOST_PORT:3000 gogs/gogits +$DOCKER_BIN run --link $MYSQL_RUN_NAME:$MYSQL_ALIAS -p $HOST_PORT:3000 gogs/gogits From 4fcbf553aa9b451bc461e09a98711966668e1889 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Sat, 7 Jun 2014 13:27:24 +0800 Subject: [PATCH 09/55] organisation main page ui --- cmd/web.go | 5 +++ public/css/gogs.css | 94 +++++++++++++++++++++++++++++++++++++++++- routers/org/org.go | 11 +++++ templates/org/org.tmpl | 85 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 routers/org/org.go create mode 100644 templates/org/org.tmpl diff --git a/cmd/web.go b/cmd/web.go index 30db037a2c..2b14b0778e 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -27,6 +27,7 @@ import ( "github.com/gogits/gogs/routers/admin" "github.com/gogits/gogs/routers/api/v1" "github.com/gogits/gogs/routers/dev" + "github.com/gogits/gogs/routers/org" "github.com/gogits/gogs/routers/repo" "github.com/gogits/gogs/routers/user" ) @@ -186,6 +187,10 @@ func runWeb(*cli.Context) { reqOwner := middleware.RequireOwner() + m.Group("/o", func(r martini.Router) { + r.Get("/:org", org.Organization) + }) + m.Group("/:username/:reponame", func(r martini.Router) { r.Get("/settings", repo.Setting) r.Post("/settings", bindIgnErr(auth.RepoSettingForm{}), repo.SettingPost) diff --git a/public/css/gogs.css b/public/css/gogs.css index 79fd4bf908..09249811a2 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1643,7 +1643,7 @@ html, body { vertical-align: top; } -#label-color-change-ipt2{ +#label-color-change-ipt2 { margin-top: 1px; } @@ -1814,4 +1814,96 @@ html, body { #release-preview { margin: 6px 0; +} + +/* organization */ + +#body-nav.org-nav { + height: 140px; + padding: 16px 0; +} + +.org-nav .org-logo { + margin-right: 16px; + width: 100px; + height: 100px; +} + +.org-nav .org-name { + margin-top: 0; +} + +.org-description { + font-size: 16px; +} + +.org-meta li, .org-meta li a, .org-repo-update, .org-repo-status, .org-team-meta { + color: #888; +} + +.org-meta li { + margin-right: 12px; +} + +.org-meta li a:hover { + text-decoration: underline; +} + +.org-meta .fa { + margin-left: 0; +} + +.org-sidebar { + margin-top: -100px; +} + +.org-panel .panel-heading { + font-size: 18px; +} + +.org-repo-status { + font-family: Verdana, Arial, Helvetica, sans-serif; +} + +.org-repo-item { + border-bottom: 1px solid #DDD; + padding-bottom: 18px; +} + +.org-member img { + width: 60px; + height: 60px; + border-radius: 4px; +} + +.org-member { + display: inline-block; + padding: 2px; +} + +.org-team-name { + font-size: 15px; + margin-bottom: 0; + color: #444; +} + +.org-team { + border-bottom: 1px solid #DDD; + margin-bottom: 12px; +} + +.org-team:last-child { + border: none; +} + +.org-team a { + display: block; +} + +.org-team a:hover { + text-decoration: none; +} + +.org-team a:hover .org-team-name { + color: #0079bc !important; } \ No newline at end of file diff --git a/routers/org/org.go b/routers/org/org.go new file mode 100644 index 0000000000..1c02e77332 --- /dev/null +++ b/routers/org/org.go @@ -0,0 +1,11 @@ +package org + +import ( + "github.com/go-martini/martini" + "github.com/gogits/gogs/modules/middleware" +) + +func Organization(ctx *middleware.Context, params martini.Params) { + ctx.Data["Title"] = "Organization Name" + params["org"] + ctx.HTML(200, "org/org") +} diff --git a/templates/org/org.tmpl b/templates/org/org.tmpl new file mode 100644 index 0000000000..872e50be86 --- /dev/null +++ b/templates/org/org.tmpl @@ -0,0 +1,85 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +
+
+
+ +
+

Organization Name

+

Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language.

+ +
+
+
+
+
+
+
+
+ +
+
+
+
+
+
    +
  • Go
  • +
  • 6
  • +
  • 2
  • +
+
+

gogs

+

Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language.

+

Updated 17 hours ago

+
+
+
+
    +
  • Go
  • +
  • 6
  • +
  • 2
  • +
+
+

gogs

+

Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language.

+

Updated 17 hours ago

+
+
+
+ +
+
+{{template "base/footer" .}} From 302c863cda651130286838309d3d897cace93534 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 8 Jun 2014 04:45:34 -0400 Subject: [PATCH 10/55] Fix #242 --- conf/app.ini | 6 + gogs.go | 2 +- models/action.go | 23 +- models/models.go | 2 +- models/webhook.go | 130 +++++++++- modules/bin/conf.go | 494 ++++++++++++++++++------------------ modules/cron/cron.go | 4 + modules/hooks/hooks.go | 95 ------- modules/setting/setting.go | 12 +- routers/admin/admin.go | 3 + routers/install.go | 3 +- routers/repo/setting.go | 16 +- templates/VERSION | 2 +- templates/admin/config.tmpl | 15 ++ 14 files changed, 432 insertions(+), 375 deletions(-) delete mode 100644 modules/hooks/hooks.go diff --git a/conf/app.ini b/conf/app.ini index 1fc88757d8..c792c0fb4b 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -66,6 +66,12 @@ ENABLE_CACHE_AVATAR = false ; Mail notification ENABLE_NOTIFY_MAIL = false +[webhook] +; Cron task interval in minutes +TASK_INTERVAL = 1 +; Deliver timeout in seconds +DELIVER_TIMEOUT = 5 + [mailer] ENABLED = false ; Buffer length of channel, keep it as it is if you don't know what it is. diff --git a/gogs.go b/gogs.go index aabcbe82e1..8a633a305b 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.2.0605 Alpha" +const APP_VER = "0.4.2.0608 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/action.go b/models/action.go index 9fc9d89b9f..e39b04a1ad 100644 --- a/models/action.go +++ b/models/action.go @@ -15,7 +15,6 @@ import ( qlog "github.com/qiniu/log" "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/hooks" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/setting" ) @@ -131,35 +130,35 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string, } repoLink := fmt.Sprintf("%s%s/%s", setting.AppUrl, repoUserName, repoName) - commits := make([]*hooks.PayloadCommit, len(commit.Commits)) + commits := make([]*PayloadCommit, len(commit.Commits)) for i, cmt := range commit.Commits { - commits[i] = &hooks.PayloadCommit{ + commits[i] = &PayloadCommit{ Id: cmt.Sha1, Message: cmt.Message, Url: fmt.Sprintf("%s/commit/%s", repoLink, cmt.Sha1), - Author: &hooks.PayloadAuthor{ + Author: &PayloadAuthor{ Name: cmt.AuthorName, Email: cmt.AuthorEmail, }, } } - p := &hooks.Payload{ + p := &Payload{ Ref: refFullName, Commits: commits, - Repo: &hooks.PayloadRepo{ + Repo: &PayloadRepo{ Id: repo.Id, Name: repo.LowerName, Url: repoLink, Description: repo.Description, Website: repo.Website, Watchers: repo.NumWatches, - Owner: &hooks.PayloadAuthor{ + Owner: &PayloadAuthor{ Name: repoUserName, Email: actEmail, }, Private: repo.IsPrivate, }, - Pusher: &hooks.PayloadAuthor{ + Pusher: &PayloadAuthor{ Name: repo.Owner.LowerName, Email: repo.Owner.Email, }, @@ -172,7 +171,13 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string, } p.Secret = w.Secret - hooks.AddHookTask(&hooks.HookTask{hooks.HTT_WEBHOOK, w.Url, p, w.ContentType, w.IsSsl}) + CreateHookTask(&HookTask{ + Type: WEBHOOK, + Url: w.Url, + Payload: p, + ContentType: w.ContentType, + IsSsl: w.IsSsl, + }) } return nil } diff --git a/models/models.go b/models/models.go index fa65ef30f6..dca77e00e1 100644 --- a/models/models.go +++ b/models/models.go @@ -35,7 +35,7 @@ func init() { tables = append(tables, new(User), new(PublicKey), new(Repository), new(Watch), new(Action), new(Access), new(Issue), new(Comment), new(Oauth2), new(Follow), new(Mirror), new(Release), new(LoginSource), new(Webhook), new(IssueUser), - new(Milestone), new(Label)) + new(Milestone), new(Label), new(HookTask)) } func LoadModelsConfig() { diff --git a/models/webhook.go b/models/webhook.go index f10fa2131e..e68edc813d 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -7,29 +7,35 @@ package models import ( "encoding/json" "errors" + "time" + "github.com/gogits/gogs/modules/httplib" "github.com/gogits/gogs/modules/log" + "github.com/gogits/gogs/modules/setting" ) var ( ErrWebhookNotExist = errors.New("Webhook does not exist") ) -// Content types. +type HookContentType int + const ( - CT_JSON = iota + 1 - CT_FORM + JSON HookContentType = iota + 1 + FORM ) +// HookEvent represents events that will delivery hook. type HookEvent struct { PushOnly bool `json:"push_only"` } +// Webhook represents a web hook object. type Webhook struct { Id int64 RepoId int64 Url string `xorm:"TEXT"` - ContentType int + ContentType HookContentType Secret string `xorm:"TEXT"` Events string `xorm:"TEXT"` *HookEvent `xorm:"-"` @@ -44,7 +50,7 @@ func (w *Webhook) GetEvent() { } } -func (w *Webhook) SaveEvent() error { +func (w *Webhook) UpdateEvent() error { data, err := json.Marshal(w.HookEvent) w.Events = string(data) return err @@ -57,18 +63,12 @@ func (w *Webhook) HasPushEvent() bool { return false } -// CreateWebhook creates new webhook. +// CreateWebhook creates a new web hook. func CreateWebhook(w *Webhook) error { _, err := orm.Insert(w) return err } -// UpdateWebhook updates information of webhook. -func UpdateWebhook(w *Webhook) error { - _, err := orm.AllCols().Update(w) - return err -} - // GetWebhookById returns webhook by given ID. func GetWebhookById(hookId int64) (*Webhook, error) { w := &Webhook{Id: hookId} @@ -93,8 +93,114 @@ func GetWebhooksByRepoId(repoId int64) (ws []*Webhook, err error) { return ws, err } +// UpdateWebhook updates information of webhook. +func UpdateWebhook(w *Webhook) error { + _, err := orm.AllCols().Update(w) + return err +} + // DeleteWebhook deletes webhook of repository. func DeleteWebhook(hookId int64) error { _, err := orm.Delete(&Webhook{Id: hookId}) return err } + +// ___ ___ __ ___________ __ +// / | \ ____ ____ | | _\__ ___/____ _____| | __ +// / ~ \/ _ \ / _ \| |/ / | | \__ \ / ___/ |/ / +// \ Y ( <_> | <_> ) < | | / __ \_\___ \| < +// \___|_ / \____/ \____/|__|_ \ |____| (____ /____ >__|_ \ +// \/ \/ \/ \/ \/ + +type HookTaskType int + +const ( + WEBHOOK = iota + 1 + SERVICE +) + +type PayloadAuthor struct { + Name string `json:"name"` + Email string `json:"email"` +} + +type PayloadCommit struct { + Id string `json:"id"` + Message string `json:"message"` + Url string `json:"url"` + Author *PayloadAuthor `json:"author"` +} + +type PayloadRepo struct { + Id int64 `json:"id"` + Name string `json:"name"` + Url string `json:"url"` + Description string `json:"description"` + Website string `json:"website"` + Watchers int `json:"watchers"` + Owner *PayloadAuthor `json:"author"` + Private bool `json:"private"` +} + +// Payload represents payload information of hook. +type Payload struct { + Secret string `json:"secret"` + Ref string `json:"ref"` + Commits []*PayloadCommit `json:"commits"` + Repo *PayloadRepo `json:"repository"` + Pusher *PayloadAuthor `json:"pusher"` +} + +// HookTask represents hook task. +type HookTask struct { + Id int64 + Type int + Url string + *Payload `xorm:"-"` + PayloadContent string `xorm:"TEXT"` + ContentType HookContentType + IsSsl bool + IsDeliveried bool +} + +// CreateHookTask creates a new hook task, +// it handles conversion from Payload to PayloadContent. +func CreateHookTask(t *HookTask) error { + data, err := json.Marshal(t.Payload) + if err != nil { + return err + } + t.PayloadContent = string(data) + _, err = orm.Insert(t) + return err +} + +// UpdateHookTask updates information of hook task. +func UpdateHookTask(t *HookTask) error { + _, err := orm.AllCols().Update(t) + return err +} + +// DeliverHooks checks and delivers undelivered hooks. +func DeliverHooks() { + timeout := time.Duration(setting.WebhookDeliverTimeout) * time.Second + orm.Where("is_deliveried=?", false).Iterate(new(HookTask), + func(idx int, bean interface{}) error { + t := bean.(*HookTask) + // Only support JSON now. + if _, err := httplib.Post(t.Url).SetTimeout(timeout, timeout). + Body([]byte(t.PayloadContent)).Response(); err != nil { + log.Error("webhook.DeliverHooks(Delivery): %v", err) + return nil + } + + t.IsDeliveried = true + if err := UpdateHookTask(t); err != nil { + log.Error("webhook.DeliverHooks(UpdateHookTask): %v", err) + return nil + } + + log.Trace("Hook delivered: %s", t.PayloadContent) + return nil + }) +} diff --git a/modules/bin/conf.go b/modules/bin/conf.go index f2b3fb8723..c07f87b747 100644 --- a/modules/bin/conf.go +++ b/modules/bin/conf.go @@ -1,11 +1,11 @@ package bin import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "strings" + "bytes" + "compress/gzip" + "fmt" + "io" + "strings" ) func bindata_read(data []byte, name string) ([]byte, error) { @@ -29,225 +29,230 @@ func conf_app_ini() ([]byte, error) { return bindata_read([]byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb4, 0x58, 0xed, 0x72, 0xdb, 0xb8, 0xd5, 0xfe, 0xcf, 0xab, 0x40, 0xf4, 0xee, 0xbe, - 0x9b, 0x74, 0x6c, 0x49, 0x76, 0x1a, 0x27, 0x6b, 0x6f, 0x66, 0x56, 0x96, - 0x28, 0x9b, 0x8d, 0xf5, 0x11, 0x92, 0x76, 0x9a, 0x66, 0x3c, 0x1c, 0x9a, - 0x84, 0x24, 0xd4, 0x24, 0x41, 0x13, 0x90, 0x15, 0xf5, 0x5f, 0x6f, 0xa1, - 0xd3, 0xab, 0xe9, 0xf5, 0xf4, 0x47, 0x2f, 0xa3, 0xcf, 0x01, 0x49, 0x99, - 0x52, 0xb4, 0xd9, 0xf4, 0x6b, 0x76, 0x27, 0x16, 0x81, 0x83, 0x83, 0x73, - 0x9e, 0xf3, 0x8d, 0x33, 0xd6, 0xcb, 0x73, 0x96, 0x85, 0x29, 0x67, 0x7a, - 0x11, 0x6a, 0xa6, 0x16, 0x72, 0xa5, 0x98, 0xcc, 0x18, 0x7f, 0xe4, 0xc5, - 0x9a, 0xe5, 0xe1, 0x1c, 0x1b, 0x42, 0x27, 0xdc, 0xea, 0x4d, 0xa7, 0xc1, - 0xb8, 0x37, 0xb2, 0xd9, 0x5b, 0x76, 0x21, 0xe7, 0xea, 0x14, 0xff, 0xb2, - 0x0b, 0xa1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 0x14, 0xcb, 0x45, - 0xa4, 0x97, 0x05, 0xb7, 0xec, 0xb1, 0xb9, 0xb7, 0xdf, 0xeb, 0x5f, 0xda, - 0x41, 0xef, 0x06, 0xc6, 0x77, 0x1b, 0xa7, 0x46, 0x84, 0x01, 0x94, 0x11, - 0x33, 0x11, 0x95, 0xfa, 0x57, 0xf4, 0xe3, 0x89, 0xef, 0x0c, 0x3f, 0x06, - 0x84, 0xc1, 0x86, 0xdc, 0xfa, 0x44, 0x90, 0x51, 0x16, 0x2f, 0x89, 0x06, - 0x0d, 0x46, 0xe7, 0xcb, 0xd9, 0xcc, 0xe4, 0x87, 0x6c, 0x8e, 0x48, 0x47, - 0x82, 0x88, 0x50, 0x89, 0x32, 0x9e, 0x1c, 0xb0, 0x7b, 0xce, 0x73, 0x2a, - 0x48, 0x90, 0x49, 0x98, 0x7c, 0x50, 0x55, 0xa6, 0x58, 0x66, 0x3f, 0x68, - 0x76, 0x9f, 0x01, 0xc3, 0x15, 0x55, 0x44, 0xb3, 0xd9, 0x86, 0x4b, 0x8e, - 0x07, 0xc1, 0xf9, 0xf5, 0x70, 0x48, 0x39, 0xd6, 0x26, 0x8c, 0x8e, 0xc8, - 0x86, 0x63, 0xaa, 0x9c, 0x88, 0x1b, 0x24, 0x9d, 0x35, 0x0c, 0x09, 0x80, - 0x8c, 0xf9, 0xca, 0x92, 0xe9, 0x5d, 0x9f, 0xff, 0xce, 0xee, 0xfb, 0xa6, - 0x60, 0xd4, 0xe5, 0xf3, 0x85, 0xaa, 0xd5, 0x2b, 0x4b, 0x0f, 0x25, 0x69, - 0x3a, 0x72, 0xca, 0x54, 0xaa, 0xf3, 0xf6, 0x9c, 0x7e, 0x53, 0x72, 0x3c, - 0x7d, 0xf5, 0xe6, 0x35, 0xf6, 0xde, 0xbf, 0xaf, 0x36, 0x1e, 0x1e, 0xcc, - 0xea, 0xf1, 0xab, 0x3a, 0x57, 0xd4, 0x6c, 0x66, 0x85, 0x4c, 0x61, 0xe0, - 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8f, 0x7a, 0xbf, - 0x0f, 0xe8, 0x95, 0xcb, 0xab, 0x4d, 0x60, 0x8c, 0x40, 0x8c, 0x14, 0x32, - 0x35, 0x02, 0x4d, 0xcc, 0xf4, 0xd7, 0xf8, 0x1c, 0xbf, 0x41, 0x39, 0x09, - 0x33, 0x30, 0x64, 0x3f, 0xfd, 0x84, 0xaf, 0x03, 0x86, 0x78, 0x1e, 0x9d, - 0x1b, 0xbe, 0x9e, 0xf3, 0x07, 0x64, 0xa8, 0x4b, 0x67, 0x68, 0x9e, 0xdc, - 0xde, 0x98, 0x80, 0x9d, 0xa7, 0xd4, 0xef, 0x91, 0xd6, 0x31, 0x3a, 0xeb, - 0xf5, 0x97, 0x7a, 0x0d, 0x30, 0x6b, 0x7e, 0xfc, 0x42, 0x33, 0xfb, 0x73, - 0x2e, 0x50, 0x51, 0xcc, 0xc3, 0x03, 0x89, 0x43, 0x0c, 0x48, 0x96, 0xe7, - 0x31, 0x4f, 0x38, 0x4d, 0xd9, 0x33, 0x1a, 0xbe, 0x53, 0x88, 0x4d, 0x14, - 0xdb, 0x70, 0xbd, 0x36, 0xc2, 0x6c, 0x9e, 0x27, 0x1a, 0x1e, 0x90, 0xed, - 0x33, 0x7f, 0xd6, 0xb0, 0xe7, 0x19, 0x73, 0x79, 0x55, 0xf5, 0xcb, 0x92, - 0x4f, 0x0f, 0x05, 0xe5, 0x5b, 0x6d, 0x05, 0x48, 0x8a, 0x14, 0x14, 0xce, - 0xf9, 0x9e, 0xe4, 0xee, 0xda, 0x28, 0x2e, 0x63, 0x0c, 0xa4, 0x01, 0x52, - 0xce, 0xc8, 0x6b, 0xbe, 0x13, 0xfa, 0x38, 0x8f, 0x38, 0x2c, 0x36, 0xbc, - 0x57, 0x0b, 0x9e, 0x35, 0xdb, 0x0b, 0x30, 0x49, 0x70, 0xdd, 0xd7, 0xb8, - 0x36, 0xcb, 0x45, 0x15, 0x32, 0x3a, 0xca, 0x29, 0x1c, 0x96, 0x99, 0xf8, -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0x42, 0x11, 0x37, 0xe0, 0x55, 0x43, + 0xb5, 0x49, 0x93, 0x9d, 0xd6, 0x14, 0xff, 0x55, 0xc2, 0x27, 0x63, 0xfd, + 0xf6, 0x94, 0xfe, 0xed, 0x93, 0x78, 0x65, 0x61, 0x4e, 0x1d, 0x05, 0xf2, + 0x5f, 0x1c, 0xe5, 0xec, 0x96, 0xd4, 0xe4, 0x04, 0x1f, 0x9a, 0x24, 0x5e, + 0xe7, 0xc4, 0x4f, 0x9d, 0x83, 0x9f, 0x5b, 0x0f, 0xb7, 0x9d, 0xbd, 0xce, + 0xe1, 0xd6, 0xf7, 0x0d, 0xd9, 0xc5, 0xa1, 0xa7, 0x12, 0xbf, 0x0d, 0xdd, + 0x26, 0x2f, 0x3f, 0x85, 0xef, 0xf1, 0x11, 0x75, 0x03, 0xe1, 0xd0, 0xa3, + 0xe3, 0xa6, 0x59, 0x87, 0x81, 0xe9, 0xef, 0x3f, 0x03, 0x00, 0x00, 0xff, + 0xff, 0x20, 0xc7, 0xce, 0x30, 0x9b, 0x18, 0x00, 0x00, + }, "conf/app.ini", ) } @@ -893,7 +898,7 @@ func conf_content_git_bare_zip() ([]byte, error) { 0x28, 0x3f, 0xfe, 0xba, 0x0a, 0x40, 0x72, 0xf5, 0xcf, 0xf9, 0x6a, 0x9b, 0x11, 0xa6, 0xf9, 0x31, 0xfa, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x01, 0x81, 0x55, 0x99, 0xb6, 0x26, 0x00, 0x00, - }, + }, "conf/content/git-bare.zip", ) } @@ -946,7 +951,7 @@ func conf_etc_supervisord_conf() ([]byte, error) { 0x8d, 0x88, 0x90, 0x28, 0xbf, 0x3f, 0xd4, 0xfe, 0xe7, 0x05, 0xbd, 0x28, 0xc2, 0x24, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x75, 0xb0, 0x31, 0xf7, 0x04, 0x00, 0x00, - }, + }, "conf/etc/supervisord.conf", ) } @@ -970,7 +975,7 @@ func conf_gitignore_android() ([]byte, error) { 0xb8, 0xa3, 0xb5, 0xe2, 0x2c, 0x81, 0x0c, 0xe2, 0x75, 0xc9, 0xf2, 0x07, 0x2f, 0x5e, 0x58, 0x0b, 0x39, 0x3d, 0xa4, 0xf9, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x96, 0x67, 0x2c, 0x0e, 0x01, 0x00, 0x00, - }, + }, "conf/gitignore/Android", ) } @@ -989,7 +994,7 @@ func conf_gitignore_c() ([]byte, error) { 0xeb, 0x8e, 0x79, 0xeb, 0x31, 0x1d, 0x73, 0xb8, 0xa3, 0x8d, 0x6e, 0xdd, 0xea, 0xd7, 0xf5, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xca, 0x54, 0xa9, 0x22, 0x8f, 0x00, 0x00, 0x00, - }, + }, "conf/gitignore/C", ) } @@ -1065,7 +1070,7 @@ func conf_gitignore_c_sharp() ([]byte, error) { 0x8b, 0x52, 0xd1, 0xf6, 0x63, 0x0e, 0x6e, 0xd8, 0x98, 0xaa, 0x6a, 0xd8, 0xb4, 0xfb, 0xc9, 0x76, 0x55, 0xfd, 0xd7, 0x1f, 0x9f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xac, 0xdb, 0x69, 0xf1, 0x05, 0x00, 0x00, - }, + }, "conf/gitignore/C Sharp", ) } @@ -1081,7 +1086,7 @@ func conf_gitignore_c_() ([]byte, error) { 0x5c, 0x92, 0x58, 0x82, 0xa6, 0x32, 0x27, 0x31, 0x13, 0x4c, 0x02, 0x89, 0x44, 0x2e, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa4, 0xe6, 0x21, 0x26, 0x7e, 0x00, 0x00, 0x00, - }, + }, "conf/gitignore/C++", ) } @@ -1106,7 +1111,7 @@ func conf_gitignore_google_go() ([]byte, error) { 0x22, 0xd5, 0x42, 0x03, 0xe7, 0x8f, 0xcc, 0x91, 0xf3, 0x76, 0xe7, 0x08, 0x5a, 0xe9, 0x27, 0x00, 0x00, 0xff, 0xff, 0x3c, 0xab, 0x59, 0x6f, 0xfb, 0x00, 0x00, 0x00, - }, + }, "conf/gitignore/Google Go", ) } @@ -1128,7 +1133,7 @@ func conf_gitignore_java() ([]byte, error) { 0xc4, 0xd9, 0x51, 0x29, 0x52, 0x96, 0x20, 0x55, 0xb3, 0x54, 0x7b, 0x4f, 0x6c, 0x82, 0x2e, 0x7d, 0x5c, 0x72, 0x5c, 0xc7, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xd6, 0xf7, 0xa4, 0xbc, 0x00, 0x00, 0x00, - }, + }, "conf/gitignore/Java", ) } @@ -1153,7 +1158,7 @@ func conf_gitignore_objective_c() ([]byte, error) { 0xc9, 0x07, 0xae, 0xa1, 0xb9, 0x4c, 0x22, 0x3f, 0x5b, 0x4d, 0x65, 0x7b, 0x3d, 0x9f, 0x60, 0x5c, 0x71, 0xf9, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x17, 0x4f, 0x2a, 0x18, 0x01, 0x00, 0x00, - }, + }, "conf/gitignore/Objective-C", ) } @@ -1180,7 +1185,7 @@ func conf_gitignore_python() ([]byte, error) { 0x78, 0xeb, 0xf6, 0x9c, 0x58, 0x85, 0x7f, 0x28, 0x58, 0x2b, 0xb6, 0xa6, 0x1c, 0xdd, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x02, 0xf0, 0xe2, 0xc0, 0x3a, 0x01, 0x00, 0x00, - }, + }, "conf/gitignore/Python", ) } @@ -1200,7 +1205,7 @@ func conf_gitignore_ruby() ([]byte, error) { 0x41, 0xb1, 0xbc, 0x23, 0x4d, 0xdf, 0x7d, 0xf0, 0x88, 0x6c, 0xbf, 0x3b, 0xf1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb1, 0xca, 0xf7, 0x91, 0x9e, 0x00, 0x00, 0x00, - }, + }, "conf/gitignore/Ruby", ) } @@ -2189,7 +2194,7 @@ func conf_license_affero_gpl() ([]byte, error) { 0x42, 0xc2, 0x5f, 0x88, 0x57, 0x1b, 0xd8, 0x89, 0x3e, 0x15, 0x0e, 0xb8, 0x30, 0xdf, 0x60, 0x88, 0xff, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x0c, 0xd2, 0xa8, 0x4c, 0xc3, 0x86, 0x00, 0x00, - }, + }, "conf/license/Affero GPL", ) } @@ -2527,7 +2532,7 @@ func conf_license_apache_v2_license() ([]byte, error) { 0x37, 0x23, 0x02, 0x0e, 0x94, 0x00, 0x65, 0xa1, 0x3f, 0x7d, 0xb3, 0x2f, 0x4c, 0x4b, 0x32, 0x5f, 0x77, 0xe7, 0xe7, 0x9a, 0xff, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x76, 0x8d, 0x12, 0x3b, 0x2c, 0x00, 0x00, - }, + }, "conf/license/Apache v2 License", ) } @@ -2809,7 +2814,7 @@ func conf_license_artistic_license_2_0() ([]byte, error) { 0xdd, 0x89, 0x97, 0xd6, 0xcf, 0xf7, 0x8f, 0x92, 0x0f, 0xb9, 0xfb, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x26, 0x8b, 0xf2, 0xb7, 0x22, 0x00, 0x00, - }, + }, "conf/license/Artistic License 2.0", ) } @@ -2883,7 +2888,7 @@ func conf_license_bsd_3_clause_license() ([]byte, error) { 0x95, 0xb8, 0xec, 0x49, 0x8a, 0xac, 0xd8, 0xd0, 0x39, 0xee, 0xdb, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x84, 0xcd, 0xba, 0x22, 0xc1, 0x05, 0x00, 0x00, - }, + }, "conf/license/BSD (3-Clause) License", ) } @@ -3459,7 +3464,7 @@ func conf_license_gpl_v2() ([]byte, error) { 0x4d, 0xee, 0x25, 0x41, 0xb2, 0x70, 0x4f, 0xe6, 0xf0, 0xef, 0xb7, 0x30, 0xc7, 0xff, 0x7e, 0x8b, 0x83, 0x22, 0xe6, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x82, 0x4d, 0xf9, 0x2b, 0x69, 0x46, 0x00, 0x00, - }, + }, "conf/license/GPL v2", ) } @@ -3521,7 +3526,7 @@ func conf_license_mit_license() ([]byte, error) { 0x42, 0x26, 0x78, 0x8e, 0x5c, 0x15, 0x81, 0x29, 0xe2, 0xdb, 0xf0, 0xd3, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0x86, 0xab, 0x31, 0x29, 0x04, 0x00, 0x00, - }, + }, "conf/license/MIT License", ) } @@ -3537,7 +3542,7 @@ func conf_mysql_sql() ([]byte, error) { 0xa1, 0xe0, 0xec, 0xef, 0xe3, 0x03, 0xd2, 0x06, 0xe2, 0xc4, 0xa7, 0xa7, 0xe6, 0xa5, 0x16, 0x25, 0xe6, 0xc4, 0x27, 0x67, 0x5a, 0x73, 0x01, 0x02, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xf5, 0x53, 0x80, 0x6d, 0x00, 0x00, 0x00, - }, + }, "conf/mysql.sql", ) } @@ -3557,12 +3562,11 @@ func conf_supervisor_ini() ([]byte, error) { 0xa1, 0xed, 0x82, 0x8e, 0x38, 0x6f, 0x11, 0x92, 0x13, 0x67, 0x75, 0xe7, 0xeb, 0xe5, 0xe4, 0x86, 0xef, 0xd7, 0xc1, 0x18, 0xfa, 0x04, 0x00, 0x00, 0xff, 0xff, 0x61, 0x60, 0x15, 0x6f, 0xc9, 0x00, 0x00, 0x00, - }, + }, "conf/supervisor.ini", ) } - // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. @@ -3584,7 +3588,7 @@ func AssetNames() []string { } // _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string] func() ([]byte, error) { +var _bindata = map[string]func() ([]byte, error){ "conf/app.ini": conf_app_ini, "conf/content/git-bare.zip": conf_content_git_bare_zip, "conf/etc/supervisord.conf": conf_etc_supervisord_conf, diff --git a/modules/cron/cron.go b/modules/cron/cron.go index 27b1fc41bb..c06e649bb7 100644 --- a/modules/cron/cron.go +++ b/modules/cron/cron.go @@ -5,13 +5,17 @@ package cron import ( + "fmt" + "github.com/robfig/cron" "github.com/gogits/gogs/models" + "github.com/gogits/gogs/modules/setting" ) func NewCronContext() { c := cron.New() c.AddFunc("@every 1h", models.MirrorUpdate) + c.AddFunc(fmt.Sprintf("@every %dm", setting.WebhookTaskInterval), models.DeliverHooks) c.Start() } diff --git a/modules/hooks/hooks.go b/modules/hooks/hooks.go deleted file mode 100644 index 6ae4418b35..0000000000 --- a/modules/hooks/hooks.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2014 The Gogs Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - -package hooks - -import ( - "encoding/json" - "time" - - "github.com/gogits/gogs/modules/httplib" - "github.com/gogits/gogs/modules/log" -) - -// Hook task types. -const ( - HTT_WEBHOOK = iota + 1 - HTT_SERVICE -) - -type PayloadAuthor struct { - Name string `json:"name"` - Email string `json:"email"` -} - -type PayloadCommit struct { - Id string `json:"id"` - Message string `json:"message"` - Url string `json:"url"` - Author *PayloadAuthor `json:"author"` -} - -type PayloadRepo struct { - Id int64 `json:"id"` - Name string `json:"name"` - Url string `json:"url"` - Description string `json:"description"` - Website string `json:"website"` - Watchers int `json:"watchers"` - Owner *PayloadAuthor `json:"author"` - Private bool `json:"private"` -} - -// Payload represents payload information of hook. -type Payload struct { - Secret string `json:"secret"` - Ref string `json:"ref"` - Commits []*PayloadCommit `json:"commits"` - Repo *PayloadRepo `json:"repository"` - Pusher *PayloadAuthor `json:"pusher"` -} - -// HookTask represents hook task. -type HookTask struct { - Type int - Url string - *Payload - ContentType int - IsSsl bool -} - -var ( - taskQueue = make(chan *HookTask, 1000) -) - -// AddHookTask adds new hook task to task queue. -func AddHookTask(t *HookTask) { - taskQueue <- t -} - -func init() { - go handleQueue() -} - -func handleQueue() { - for { - select { - case t := <-taskQueue: - // Only support JSON now. - data, err := json.MarshalIndent(t.Payload, "", "\t") - if err != nil { - log.Error("hooks.handleQueue(json): %v", err) - continue - } - - _, err = httplib.Post(t.Url).SetTimeout(5*time.Second, 5*time.Second). - Body(data).Response() - if err != nil { - log.Error("hooks.handleQueue: Fail to deliver hook: %v", err) - continue - } - log.Info("Hook delivered: %s", string(data)) - } - } -} diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 2f64511a12..35c9165139 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -53,6 +53,10 @@ var ( CookieUserName string CookieRememberName string + // Webhook settings. + WebhookTaskInterval int + WebhookDeliverTimeout int + // Repository settings. RepoRootPath string ScriptType string @@ -187,9 +191,9 @@ var Service struct { RequireSignInView bool EnableCacheAvatar bool NotifyMail bool + LdapAuth bool ActiveCodeLives int ResetPwdCodeLives int - LdapAuth bool } func newService() { @@ -390,6 +394,11 @@ func newNotifyMailService() { log.Info("Notify Mail Service Enabled") } +func newWebhookService() { + WebhookTaskInterval = Cfg.MustInt("webhook", "TASK_INTERVAL", 1) + WebhookDeliverTimeout = Cfg.MustInt("webhook", "DELIVER_TIMEOUT", 5) +} + func NewServices() { newService() newLogService() @@ -398,4 +407,5 @@ func NewServices() { newMailService() newRegisterMailService() newNotifyMailService() + newWebhookService() } diff --git a/routers/admin/admin.go b/routers/admin/admin.go index 6f8868a659..56eba88a2b 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -193,6 +193,9 @@ func Config(ctx *middleware.Context) { ctx.Data["DbCfg"] = models.DbCfg + ctx.Data["WebhookTaskInterval"] = setting.WebhookTaskInterval + ctx.Data["WebhookDeliverTimeout"] = setting.WebhookDeliverTimeout + ctx.Data["MailerEnabled"] = false if setting.MailService != nil { ctx.Data["MailerEnabled"] = true diff --git a/routers/install.go b/routers/install.go index f44391a46c..eb0fc199cf 100644 --- a/routers/install.go +++ b/routers/install.go @@ -14,7 +14,6 @@ import ( "github.com/Unknwon/goconfig" "github.com/go-martini/martini" "github.com/go-xorm/xorm" - qlog "github.com/qiniu/log" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth" @@ -56,7 +55,7 @@ func GlobalInit() { if setting.InstallLock { if err := models.NewEngine(); err != nil { - qlog.Fatal(err) + log.Fatal("Fail to initialize ORM engine: %v", err) } models.HasEngine = true diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 0232dbcfe3..ac9ce7c77c 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -244,9 +244,9 @@ func WebHooksAddPost(ctx *middleware.Context, form auth.NewWebhookForm) { return } - ct := models.CT_JSON + ct := models.JSON if form.ContentType == "2" { - ct = models.CT_FORM + ct = models.FORM } w := &models.Webhook{ @@ -259,8 +259,8 @@ func WebHooksAddPost(ctx *middleware.Context, form auth.NewWebhookForm) { }, IsActive: form.Active, } - if err := w.SaveEvent(); err != nil { - ctx.Handle(500, "setting.WebHooksAddPost(SaveEvent)", err) + if err := w.UpdateEvent(); err != nil { + ctx.Handle(500, "setting.WebHooksAddPost(UpdateEvent)", err) return } else if err := models.CreateWebhook(w); err != nil { ctx.Handle(500, "setting.WebHooksAddPost(CreateWebhook)", err) @@ -311,9 +311,9 @@ func WebHooksEditPost(ctx *middleware.Context, params martini.Params, form auth. return } - ct := models.CT_JSON + ct := models.JSON if form.ContentType == "2" { - ct = models.CT_FORM + ct = models.FORM } w := &models.Webhook{ @@ -327,8 +327,8 @@ func WebHooksEditPost(ctx *middleware.Context, params martini.Params, form auth. }, IsActive: form.Active, } - if err := w.SaveEvent(); err != nil { - ctx.Handle(500, "setting.WebHooksEditPost(SaveEvent)", err) + if err := w.UpdateEvent(); err != nil { + ctx.Handle(500, "setting.WebHooksEditPost(UpdateEvent)", err) return } else if err := models.UpdateWebhook(w); err != nil { ctx.Handle(500, "setting.WebHooksEditPost(WebHooksEditPost)", err) diff --git a/templates/VERSION b/templates/VERSION index 7ba2c25f9a..cf75962a83 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.2.0605 Alpha \ No newline at end of file +0.4.2.0608 Alpha \ No newline at end of file diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index a8e9d1ae99..583ee25e35 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -89,6 +89,21 @@ +
+
+ Webhook Configuration +
+ +
+
+
Task Interval
+
{{.WebhookTaskInterval}} minutes
+
Deliver Timeout
+
{{.WebhookDeliverTimeout}} seconds
+
+
+
+
Mailer Configuration From 1f58d6f5d912187653db442e17d20261fc970b7b Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 8 Jun 2014 04:54:52 -0400 Subject: [PATCH 11/55] Mirror fix on #242 --- models/webhook.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/models/webhook.go b/models/webhook.go index e68edc813d..ffd47c8f9b 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -43,6 +43,7 @@ type Webhook struct { IsActive bool } +// GetEvent handles conversion from Events to HookEvent. func (w *Webhook) GetEvent() { w.HookEvent = &HookEvent{} if err := json.Unmarshal([]byte(w.Events), w.HookEvent); err != nil { @@ -50,12 +51,14 @@ func (w *Webhook) GetEvent() { } } +// UpdateEvent handles conversion from HookEvent to Events. func (w *Webhook) UpdateEvent() error { data, err := json.Marshal(w.HookEvent) w.Events = string(data) return err } +// HasPushEvent returns true if hook enbaled push event. func (w *Webhook) HasPushEvent() bool { if w.PushOnly { return true @@ -115,7 +118,7 @@ func DeleteWebhook(hookId int64) error { type HookTaskType int const ( - WEBHOOK = iota + 1 + WEBHOOK HookTaskType = iota + 1 SERVICE ) @@ -142,7 +145,7 @@ type PayloadRepo struct { Private bool `json:"private"` } -// Payload represents payload information of hook. +// Payload represents a payload information of hook. type Payload struct { Secret string `json:"secret"` Ref string `json:"ref"` @@ -151,10 +154,10 @@ type Payload struct { Pusher *PayloadAuthor `json:"pusher"` } -// HookTask represents hook task. +// HookTask represents a hook task. type HookTask struct { Id int64 - Type int + Type HookTaskType Url string *Payload `xorm:"-"` PayloadContent string `xorm:"TEXT"` From f160b4f33ca69df13b071648aad09e561dafec26 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 8 Jun 2014 17:53:53 -0400 Subject: [PATCH 12/55] Add tar.gz download button and other mirror updates --- models/login.go | 83 +++++++++++++++++++---------------------- models/repo.go | 57 +++++++++++++--------------- models/user.go | 2 +- public/css/gogs.css | 2 +- routers/admin/auths.go | 18 ++++----- routers/admin/user.go | 5 ++- templates/repo/nav.tmpl | 1 + 7 files changed, 79 insertions(+), 89 deletions(-) diff --git a/models/login.go b/models/login.go index 984a9f8c30..863ba44e20 100644 --- a/models/login.go +++ b/models/login.go @@ -1,4 +1,4 @@ -// Copyright github.com/juju2013. All rights reserved. +// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. @@ -20,12 +20,13 @@ import ( "github.com/gogits/gogs/modules/log" ) -// Login types. +type LoginType int + const ( - LT_NOTYPE = iota - LT_PLAIN - LT_LDAP - LT_SMTP + NOTYPE LoginType = iota + PLAIN + LDAP + SMTP ) var ( @@ -34,9 +35,9 @@ var ( ErrAuthenticationUserUsed = errors.New("Authentication has been used by some users") ) -var LoginTypes = map[int]string{ - LT_LDAP: "LDAP", - LT_SMTP: "SMTP", +var LoginTypes = map[LoginType]string{ + LDAP: "LDAP", + SMTP: "SMTP", } // Ensure structs implmented interface. @@ -49,7 +50,6 @@ type LDAPConfig struct { ldap.Ldapsource } -// implement func (cfg *LDAPConfig) FromDB(bs []byte) error { return json.Unmarshal(bs, &cfg.Ldapsource) } @@ -65,7 +65,6 @@ type SMTPConfig struct { TLS bool } -// implement func (cfg *SMTPConfig) FromDB(bs []byte) error { return json.Unmarshal(bs, cfg) } @@ -76,13 +75,13 @@ func (cfg *SMTPConfig) ToDB() ([]byte, error) { type LoginSource struct { Id int64 - Type int - Name string `xorm:"unique"` - IsActived bool `xorm:"not null default false"` + Type LoginType + Name string `xorm:"UNIQUE"` + IsActived bool `xorm:"NOT NULL DEFAULT false"` Cfg core.Conversion `xorm:"TEXT"` - Created time.Time `xorm:"created"` - Updated time.Time `xorm:"updated"` - AllowAutoRegister bool `xorm:"not null default false"` + AllowAutoRegister bool `xorm:"NOT NULL DEFAULT false"` + Created time.Time `xorm:"CREATED"` + Updated time.Time `xorm:"UPDATED"` } func (source *LoginSource) TypeString() string { @@ -97,21 +96,25 @@ func (source *LoginSource) SMTP() *SMTPConfig { return source.Cfg.(*SMTPConfig) } -// for xorm callback func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) { if colName == "type" { ty := (*val).(int64) - switch ty { - case LT_LDAP: + switch LoginType(ty) { + case LDAP: source.Cfg = new(LDAPConfig) - case LT_SMTP: + case SMTP: source.Cfg = new(SMTPConfig) } } } +func CreateSource(source *LoginSource) error { + _, err := orm.Insert(source) + return err +} + func GetAuths() ([]*LoginSource, error) { - var auths = make([]*LoginSource, 0) + var auths = make([]*LoginSource, 0, 5) err := orm.Find(&auths) return auths, err } @@ -121,18 +124,12 @@ func GetLoginSourceById(id int64) (*LoginSource, error) { has, err := orm.Id(id).Get(source) if err != nil { return nil, err - } - if !has { + } else if !has { return nil, ErrAuthenticationNotExist } return source, nil } -func AddSource(source *LoginSource) error { - _, err := orm.Insert(source) - return err -} - func UpdateSource(source *LoginSource) error { _, err := orm.Id(source.Id).AllCols().Update(source) return err @@ -164,14 +161,14 @@ func UserSignIn(uname, passwd string) (*User, error) { return nil, err } - if u.LoginType == LT_NOTYPE { + if u.LoginType == NOTYPE { if has { - u.LoginType = LT_PLAIN + u.LoginType = PLAIN } } // for plain login, user must have existed. - if u.LoginType == LT_PLAIN { + if u.LoginType == PLAIN { if !has { return nil, ErrUserNotExist } @@ -191,22 +188,20 @@ func UserSignIn(uname, passwd string) (*User, error) { } for _, source := range sources { - if source.Type == LT_LDAP { + if source.Type == LDAP { u, err := LoginUserLdapSource(nil, uname, passwd, source.Id, source.Cfg.(*LDAPConfig), true) if err == nil { return u, nil - } else { - log.Warn("Fail to login(%s) by LDAP(%s): %v", uname, source.Name, err) } - } else if source.Type == LT_SMTP { + log.Warn("Fail to login(%s) by LDAP(%s): %v", uname, source.Name, err) + } else if source.Type == SMTP { u, err := LoginUserSMTPSource(nil, uname, passwd, source.Id, source.Cfg.(*SMTPConfig), true) if err == nil { return u, nil - } else { - log.Warn("Fail to login(%s) by SMTP(%s): %v", uname, source.Name, err) } + log.Warn("Fail to login(%s) by SMTP(%s): %v", uname, source.Name, err) } } @@ -224,10 +219,10 @@ func UserSignIn(uname, passwd string) (*User, error) { } switch u.LoginType { - case LT_LDAP: + case LDAP: return LoginUserLdapSource(u, u.LoginName, passwd, source.Id, source.Cfg.(*LDAPConfig), false) - case LT_SMTP: + case SMTP: return LoginUserSMTPSource(u, u.LoginName, passwd, source.Id, source.Cfg.(*SMTPConfig), false) } @@ -252,7 +247,7 @@ func LoginUserLdapSource(user *User, name, passwd string, sourceId int64, cfg *L user = &User{ LowerName: strings.ToLower(name), Name: strings.ToLower(name), - LoginType: LT_LDAP, + LoginType: LDAP, LoginSource: sourceId, LoginName: name, IsActive: true, @@ -320,9 +315,8 @@ func SmtpAuth(host string, port int, a smtp.Auth, useTls bool) error { return err } return nil - } else { - return ErrUnsupportedLoginType } + return ErrUnsupportedLoginType } // Query if name/passwd can login against the LDAP direcotry pool @@ -358,13 +352,12 @@ func LoginUserSMTPSource(user *User, name, passwd string, sourceId int64, cfg *S user = &User{ LowerName: strings.ToLower(loginName), Name: strings.ToLower(loginName), - LoginType: LT_SMTP, + LoginType: SMTP, LoginSource: sourceId, LoginName: name, IsActive: true, Passwd: passwd, Email: name, } - return RegisterUser(user) } diff --git a/models/repo.go b/models/repo.go index 869059fa2e..deb25b2a9a 100644 --- a/models/repo.go +++ b/models/repo.go @@ -109,11 +109,11 @@ func NewRepoContext() { // Repository represents a git repository. type Repository struct { Id int64 - OwnerId int64 `xorm:"unique(s)"` + OwnerId int64 `xorm:"UNIQUE(s)"` Owner *User `xorm:"-"` ForkId int64 - LowerName string `xorm:"unique(s) index not null"` - Name string `xorm:"index not null"` + LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"` + Name string `xorm:"INDEX NOT NULL"` Description string Website string NumWatches int @@ -131,8 +131,8 @@ type Repository struct { IsBare bool IsGoget bool DefaultBranch string - Created time.Time `xorm:"created"` - Updated time.Time `xorm:"updated"` + Created time.Time `xorm:"CREATED"` + Updated time.Time `xorm:"UPDATED"` } func (repo *Repository) GetOwner() (err error) { @@ -184,6 +184,25 @@ type Mirror struct { NextUpdate time.Time } +// MirrorRepository creates a mirror repository from source. +func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) error { + _, stderr, err := com.ExecCmd("git", "clone", "--mirror", url, repoPath) + if err != nil { + return errors.New("git clone --mirror: " + stderr) + } + + if _, err = orm.InsertOne(&Mirror{ + RepoId: repoId, + RepoName: strings.ToLower(userName + "/" + repoName), + Interval: 24, + NextUpdate: time.Now().Add(24 * time.Hour), + }); err != nil { + return err + } + + return git.UnpackRefs(repoPath) +} + func GetMirror(repoId int64) (*Mirror, error) { m := &Mirror{RepoId: repoId} has, err := orm.Get(m) @@ -223,25 +242,6 @@ func MirrorUpdate() { } } -// MirrorRepository creates a mirror repository from source. -func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) error { - _, stderr, err := com.ExecCmd("git", "clone", "--mirror", url, repoPath) - if err != nil { - return errors.New("git clone --mirror: " + stderr) - } - - if _, err = orm.InsertOne(&Mirror{ - RepoId: repoId, - RepoName: strings.ToLower(userName + "/" + repoName), - Interval: 24, - NextUpdate: time.Now().Add(24 * time.Hour), - }); err != nil { - return err - } - - return git.UnpackRefs(repoPath) -} - // MigrateRepository migrates a existing repository from other project hosting. func MigrateRepository(user *User, name, desc string, private, mirror bool, url string) (*Repository, error) { repo, err := CreateRepository(user, name, desc, "", "", private, mirror, false) @@ -746,16 +746,11 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) { sess.Rollback() return err } - if err = sess.Commit(); err != nil { + if err = os.RemoveAll(RepoPath(userName, repo.Name)); err != nil { sess.Rollback() return err } - if err = os.RemoveAll(RepoPath(userName, repo.Name)); err != nil { - // TODO: log and delete manully - log.Error("delete repo %s/%s failed: %v", userName, repo.Name, err) - return err - } - return nil + return sess.Commit() } // GetRepositoryByName returns the repository by given name under user if exists. diff --git a/models/user.go b/models/user.go index 78ab464249..04ea1fd692 100644 --- a/models/user.go +++ b/models/user.go @@ -47,7 +47,7 @@ type User struct { FullName string Email string `xorm:"unique not null"` Passwd string `xorm:"not null"` - LoginType int + LoginType LoginType LoginSource int64 `xorm:"not null default 0"` LoginName string Type int diff --git a/public/css/gogs.css b/public/css/gogs.css index 09249811a2..1e29eeba5f 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -10,7 +10,7 @@ body { html, body { height: 100%; - font-family: Helvetica, Arial, sans-serif; + font-family: Arial, Helvetica, sans-serif; } /* override bs3 */ diff --git a/routers/admin/auths.go b/routers/admin/auths.go index c4702afc81..e0b9971481 100644 --- a/routers/admin/auths.go +++ b/routers/admin/auths.go @@ -38,8 +38,8 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var u core.Conversion - switch form.Type { - case models.LT_LDAP: + switch models.LoginType(form.Type) { + case models.LDAP: u = &models.LDAPConfig{ Ldapsource: ldap.Ldapsource{ Host: form.Host, @@ -53,7 +53,7 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Name: form.AuthName, }, } - case models.LT_SMTP: + case models.SMTP: u = &models.SMTPConfig{ Auth: form.SmtpAuth, Host: form.SmtpHost, @@ -66,14 +66,14 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var source = &models.LoginSource{ - Type: form.Type, + Type: models.LoginType(form.Type), Name: form.AuthName, IsActived: true, AllowAutoRegister: form.AllowAutoRegister, Cfg: u, } - if err := models.AddSource(source); err != nil { + if err := models.CreateSource(source); err != nil { ctx.Handle(500, "admin.auths.NewAuth", err) return } @@ -116,8 +116,8 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var config core.Conversion - switch form.Type { - case models.LT_LDAP: + switch models.LoginType(form.Type) { + case models.LDAP: config = &models.LDAPConfig{ Ldapsource: ldap.Ldapsource{ Host: form.Host, @@ -131,7 +131,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Name: form.AuthName, }, } - case models.LT_SMTP: + case models.SMTP: config = &models.SMTPConfig{ Auth: form.SmtpAuth, Host: form.SmtpHost, @@ -147,7 +147,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Id: form.Id, Name: form.AuthName, IsActived: form.IsActived, - Type: form.Type, + Type: models.LoginType(form.Type), AllowAutoRegister: form.AllowAutoRegister, Cfg: config, } diff --git a/routers/admin/user.go b/routers/admin/user.go index fa98bd32ea..596fe7b1d8 100644 --- a/routers/admin/user.go +++ b/routers/admin/user.go @@ -51,12 +51,13 @@ func NewUserPost(ctx *middleware.Context, form auth.RegisterForm) { Email: form.Email, Passwd: form.Password, IsActive: true, - LoginType: models.LT_PLAIN, + LoginType: models.PLAIN, } if len(form.LoginType) > 0 { fields := strings.Split(form.LoginType, "-") - u.LoginType, _ = strconv.Atoi(fields[0]) + tp, _ := strconv.Atoi(fields[0]) + u.LoginType = models.LoginType(tp) u.LoginSource, _ = strconv.ParseInt(fields[1], 10, 64) u.LoginName = form.LoginName fmt.Println(u.LoginType, u.LoginSource, u.LoginName) diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl index 70e1745fff..ea7799b351 100644 --- a/templates/repo/nav.tmpl +++ b/templates/repo/nav.tmpl @@ -27,6 +27,7 @@
From a3e1383cac3dfa2a71b04b47a295e9836fcb0d50 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 10 Jun 2014 19:11:53 -0400 Subject: [PATCH 13/55] Add gogs fix location command --- README.md | 2 +- README_ZH.md | 2 +- cmd/fix.go | 170 ++++++++++++++++++++++++++++++++----- cmd/serve.go | 1 - gogs.go | 6 +- models/models.go | 5 +- models/publickey.go | 14 +-- models/repo.go | 6 +- modules/setting/setting.go | 11 ++- templates/VERSION | 2 +- 10 files changed, 179 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 8887081911..d34aa5a683 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language ![Demo](http://gowalker.org/public/gogs_demo.gif) -##### Current version: 0.4.2 Alpha +##### Current version: 0.4.3 Alpha ### NOTICES diff --git a/README_ZH.md b/README_ZH.md index 84af15a6a5..ebffa33efb 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -5,7 +5,7 @@ Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。 ![Demo](http://gowalker.org/public/gogs_demo.gif) -##### 当前版本:0.4.2 Alpha +##### 当前版本:0.4.3 Alpha ## 开发目的 diff --git a/cmd/fix.go b/cmd/fix.go index 3c2278ba90..95ab3ae66f 100644 --- a/cmd/fix.go +++ b/cmd/fix.go @@ -5,10 +5,16 @@ package cmd import ( + "bufio" "fmt" + "io" + "io/ioutil" "os" + "path" + "strings" "github.com/codegangsta/cli" + "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/setting" ) @@ -16,28 +22,152 @@ import ( var CmdFix = cli.Command{ Name: "fix", Usage: "This command for upgrade from old version", - Description: `Fix provide upgrade from old version`, Action: runFix, + Subcommands: fixCommands, Flags: []cli.Flag{}, } -func runFix(k *cli.Context) { - workDir, _ := setting.WorkDir() - newLogger(workDir) - - setting.NewConfigContext() - models.LoadModelsConfig() - - if models.UseSQLite3 { - os.Chdir(workDir) - } - - models.SetEngine() - - err := models.Fix() - if err != nil { - fmt.Println(err) - } else { - fmt.Println("Fix successfully!") - } +func runFix(ctx *cli.Context) { +} + +var fixCommands = []cli.Command{ + { + Name: "location", + Usage: "Change Gogs app location", + Description: `Command location fixes location change of Gogs + +gogs fix location +`, + Action: runFixLocation, + }, +} + +// rewriteAuthorizedKeys replaces old Gogs path to the new one. +func rewriteAuthorizedKeys(sshPath, oldPath, newPath string) error { + fr, err := os.Open(sshPath) + if err != nil { + return err + } + defer fr.Close() + + tmpPath := sshPath + ".tmp" + fw, err := os.Create(tmpPath) + if err != nil { + return err + } + defer fw.Close() + + oldPath = "command=\"" + oldPath + " serv" + newPath = "command=\"" + newPath + " serv" + buf := bufio.NewReader(fr) + for { + line, errRead := buf.ReadString('\n') + line = strings.TrimSpace(line) + + if errRead != nil { + if errRead != io.EOF { + return errRead + } + + // Reached end of file, if nothing to read then break, + // otherwise handle the last line. + if len(line) == 0 { + break + } + } + + // Still finding the line, copy the line that currently read. + if _, err = fw.WriteString(strings.Replace(line, oldPath, newPath, 1) + "\n"); err != nil { + return err + } + + if errRead == io.EOF { + break + } + } + + if err = os.Remove(sshPath); err != nil { + return err + } + return os.Rename(tmpPath, sshPath) +} + +func rewriteUpdateHook(path, appPath string) error { + rp := strings.NewReplacer("\\", "/", " ", "\\ ") + if err := ioutil.WriteFile(path, []byte(fmt.Sprintf(models.TPL_UPDATE_HOOK, + setting.ScriptType, rp.Replace(appPath))), os.ModePerm); err != nil { + return err + } + return nil +} + +func walkDir(rootPath, recPath, appPath string, depth int) error { + depth++ + if depth > 3 { + return nil + } else if depth == 3 { + if err := rewriteUpdateHook(path.Join(rootPath, "hooks/update"), appPath); err != nil { + return err + } + } + + dir, err := os.Open(rootPath) + if err != nil { + return err + } + defer dir.Close() + + fis, err := dir.Readdir(0) + if err != nil { + return err + } + + for _, fi := range fis { + if strings.Contains(fi.Name(), ".DS_Store") { + continue + } + + relPath := path.Join(recPath, fi.Name()) + curPath := path.Join(rootPath, fi.Name()) + if fi.IsDir() { + if err = walkDir(curPath, relPath, appPath, depth); err != nil { + return err + } + } + } + return nil +} + +func runFixLocation(ctx *cli.Context) { + if len(ctx.Args()) != 1 { + fmt.Println("Incorrect arguments number, expect 1") + os.Exit(2) + } + + execPath, _ := setting.ExecPath() + + oldPath := ctx.Args().First() + fmt.Printf("Old location: %s\n", oldPath) + fmt.Println("This command should be executed in the new Gogs path") + fmt.Printf("Do you want to change Gogs app path from old location to:\n") + fmt.Printf("-> %s?\n", execPath) + fmt.Print("Press to continue, use to exit.") + fmt.Scanln() + + // Fix in authorized_keys file. + sshPath := path.Join(models.SshPath, "authorized_keys") + fmt.Printf("Fixing pathes in file: %s\n", sshPath) + if err := rewriteAuthorizedKeys(sshPath, oldPath, execPath); err != nil { + fmt.Println(err) + os.Exit(1) + } + + // Fix position in gogs-repositories. + setting.NewConfigContext() + fmt.Printf("Fixing pathes in repositories: %s\n", setting.RepoRootPath) + if err := walkDir(setting.RepoRootPath, "", execPath, 0); err != nil { + fmt.Println(err) + os.Exit(1) + } + fmt.Println("Fix position finished!") } diff --git a/cmd/serve.go b/cmd/serve.go index 302f8568e1..3a17bf9f97 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -36,7 +36,6 @@ func newLogger(logPath string) { } qlog.SetOutput(f) - //qlog.SetOutputLevel(qlog.Ldebug) qlog.Info("Start logging serv...") } diff --git a/gogs.go b/gogs.go index 8a633a305b..41a71c72e3 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.2.0608 Alpha" +const APP_VER = "0.4.3.0610 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) @@ -31,10 +31,10 @@ func main() { app.Version = APP_VER app.Commands = []cli.Command{ cmd.CmdWeb, - // cmd.CmdFix, - cmd.CmdDump, cmd.CmdServ, cmd.CmdUpdate, + cmd.CmdFix, + cmd.CmdDump, } app.Flags = append(app.Flags, []cli.Flag{}...) app.Run(os.Args) diff --git a/models/models.go b/models/models.go index dca77e00e1..a59c051712 100644 --- a/models/models.go +++ b/models/models.go @@ -46,7 +46,9 @@ func LoadModelsConfig() { DbCfg.Host = setting.Cfg.MustValue("database", "HOST") DbCfg.Name = setting.Cfg.MustValue("database", "NAME") DbCfg.User = setting.Cfg.MustValue("database", "USER") - DbCfg.Pwd = setting.Cfg.MustValue("database", "PASSWD") + if len(DbCfg.Pwd) == 0 { + DbCfg.Pwd = setting.Cfg.MustValue("database", "PASSWD") + } DbCfg.SslMode = setting.Cfg.MustValue("database", "SSL_MODE") DbCfg.Path = setting.Cfg.MustValue("database", "PATH", "data/gogs.db") } @@ -67,7 +69,6 @@ func NewTestEngine(x *xorm.Engine) (err error) { } cnnstr := fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s", DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode) - //fmt.Println(cnnstr) x, err = xorm.NewEngine("postgres", cnnstr) case "sqlite3": if !EnableSQLite3 { diff --git a/models/publickey.go b/models/publickey.go index 556db96491..76dc0cc740 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -37,7 +37,7 @@ var ( var sshOpLocker = sync.Mutex{} var ( - sshPath string // SSH directory. + SshPath string // SSH directory. appPath string // Execution(binary) path. ) @@ -67,9 +67,9 @@ func init() { } // Determine and create .ssh path. - sshPath = filepath.Join(homeDir(), ".ssh") - if err = os.MkdirAll(sshPath, os.ModePerm); err != nil { - qlog.Fatalf("publickey.init(fail to create sshPath(%s)): %v\n", sshPath, err) + SshPath = filepath.Join(homeDir(), ".ssh") + if err = os.MkdirAll(SshPath, os.ModePerm); err != nil { + qlog.Fatalf("publickey.init(fail to create SshPath(%s)): %v\n", SshPath, err) } } @@ -94,7 +94,7 @@ func saveAuthorizedKeyFile(key *PublicKey) error { sshOpLocker.Lock() defer sshOpLocker.Unlock() - fpath := filepath.Join(sshPath, "authorized_keys") + fpath := filepath.Join(SshPath, "authorized_keys") f, err := os.OpenFile(fpath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600) if err != nil { return err @@ -216,8 +216,8 @@ func DeletePublicKey(key *PublicKey) error { return err } - fpath := filepath.Join(sshPath, "authorized_keys") - tmpPath := filepath.Join(sshPath, "authorized_keys.tmp") + fpath := filepath.Join(SshPath, "authorized_keys") + tmpPath := filepath.Join(SshPath, "authorized_keys.tmp") log.Trace("publickey.DeletePublicKey(authorized_keys): %s", fpath) if err = rewriteAuthorizedKeys(key, fpath, tmpPath); err != nil { diff --git a/models/repo.go b/models/repo.go index deb25b2a9a..3eca78c4b9 100644 --- a/models/repo.go +++ b/models/repo.go @@ -28,6 +28,10 @@ import ( "github.com/gogits/gogs/modules/setting" ) +const ( + TPL_UPDATE_HOOK = "#!/usr/bin/env %s\n%s update $1 $2 $3\n" +) + var ( ErrRepoAlreadyExist = errors.New("Repository already exist") ErrRepoNotExist = errors.New("Repository does not exist") @@ -450,7 +454,7 @@ func initRepository(f string, user *User, repo *Repository, initReadme bool, rep rp := strings.NewReplacer("\\", "/", " ", "\\ ") // hook/post-update if err := createHookUpdate(filepath.Join(repoPath, "hooks", "update"), - fmt.Sprintf("#!/usr/bin/env %s\n%s update $1 $2 $3\n", setting.ScriptType, + fmt.Sprintf(TPL_UPDATE_HOOK, setting.ScriptType, rp.Replace(appPath))); err != nil { return err } diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 35c9165139..73ec8ddd1b 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -90,8 +90,7 @@ var ( RunUser string ) -// WorkDir returns absolute path of work directory. -func WorkDir() (string, error) { +func ExecPath() (string, error) { file, err := exec.LookPath(os.Args[0]) if err != nil { return "", err @@ -100,7 +99,13 @@ func WorkDir() (string, error) { if err != nil { return "", err } - return path.Dir(strings.Replace(p, "\\", "/", -1)), nil + return p, nil +} + +// WorkDir returns absolute path of work directory. +func WorkDir() (string, error) { + execPath, err := ExecPath() + return path.Dir(strings.Replace(execPath, "\\", "/", -1)), err } // NewConfigContext initializes configuration context. diff --git a/templates/VERSION b/templates/VERSION index cf75962a83..dc83da7866 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.2.0608 Alpha \ No newline at end of file +0.4.3.0610 Alpha \ No newline at end of file From a13a6b14ec4ab8e9660fd59d7abe00e3d3666f9f Mon Sep 17 00:00:00 2001 From: "toby.zxj" Date: Wed, 11 Jun 2014 16:54:25 +0800 Subject: [PATCH 14/55] Using strings.HasPrefix(...) will misjudgement `strings.HasPrefix(access.RepoName, uname)` can't handle the situation which like following in access table. user_name | repo_name ----------+------------- toby | toby/blog toby | toby/test toby | tobyzxj/blog toby | tobyzxj/test --- models/repo.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/repo.go b/models/repo.go index 3eca78c4b9..7eab83c217 100644 --- a/models/repo.go +++ b/models/repo.go @@ -831,11 +831,11 @@ func GetCollaborativeRepos(uname string) ([]*Repository, error) { repos := make([]*Repository, 0, 10) for _, access := range accesses { - if strings.HasPrefix(access.RepoName, uname) { + infos := strings.Split(access.RepoName, "/") + if infos[0] == uname { continue } - - infos := strings.Split(access.RepoName, "/") + u, err := GetUserByName(infos[0]) if err != nil { return nil, err From 29561acb43a51a89f274d3348a09d3dde29cd02e Mon Sep 17 00:00:00 2001 From: codeskyblue Date: Thu, 12 Jun 2014 16:58:56 +0800 Subject: [PATCH 15/55] fix gobuld.yml conf missing --- .gobuild.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gobuild.yml b/.gobuild.yml index 2570717edb..6a2a3ebe75 100644 --- a/.gobuild.yml +++ b/.gobuild.yml @@ -1,5 +1,6 @@ filesets: includes: + - conf - templates - public - LICENSE From 1161c71ac1f6f2030c9e21633aa127c0cbfbdccb Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 12 Jun 2014 07:45:33 -0400 Subject: [PATCH 16/55] Mirror fix --- .gobuild.yml | 1 - models/release.go | 2 -- 2 files changed, 3 deletions(-) diff --git a/.gobuild.yml b/.gobuild.yml index 6a2a3ebe75..2570717edb 100644 --- a/.gobuild.yml +++ b/.gobuild.yml @@ -1,6 +1,5 @@ filesets: includes: - - conf - templates - public - LICENSE diff --git a/models/release.go b/models/release.go index e6c3d56152..314b7a91a9 100644 --- a/models/release.go +++ b/models/release.go @@ -61,8 +61,6 @@ func CreateRelease(gitRepo *git.Repository, rel *Release) error { if !gitRepo.IsTagExist(rel.TagName) { _, stderr, err := com.ExecCmdDir(gitRepo.Path, "git", "tag", rel.TagName, "-m", rel.Title) if err != nil { - return err - } else if strings.Contains(stderr, "fatal:") { return errors.New(stderr) } } else { From 9961f9a53c4e3be1b224ad618b35c175143a0daa Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 12 Jun 2014 09:10:39 -0400 Subject: [PATCH 17/55] Fix #197 --- models/release.go | 13 +++++++++---- modules/auth/repo.go | 2 ++ routers/repo/release.go | 10 ++++++++-- templates/release/list.tmpl | 6 +++--- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/models/release.go b/models/release.go index 314b7a91a9..e5e81b9b67 100644 --- a/models/release.go +++ b/models/release.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Unknwon/com" + // "github.com/Unknwon/com" "github.com/gogits/git" ) @@ -26,7 +26,8 @@ type Release struct { Title string TagName string LowerTagName string - SHA1 string + Target string + Sha1 string `xorm:"VARCHAR(40)"` NumCommits int NumCommitsBehind int `xorm:"-"` Note string `xorm:"TEXT"` @@ -59,9 +60,13 @@ func CreateRelease(gitRepo *git.Repository, rel *Release) error { } if !gitRepo.IsTagExist(rel.TagName) { - _, stderr, err := com.ExecCmdDir(gitRepo.Path, "git", "tag", rel.TagName, "-m", rel.Title) + commit, err := gitRepo.GetCommitOfBranch(rel.Target) if err != nil { - return errors.New(stderr) + return err + } + + if err = gitRepo.CreateTag(rel.TagName, commit.Id.String()); err != nil { + return err } } else { commit, err := gitRepo.GetCommitOfTag(rel.TagName) diff --git a/modules/auth/repo.go b/modules/auth/repo.go index 82cd078613..26ab7551ca 100644 --- a/modules/auth/repo.go +++ b/modules/auth/repo.go @@ -205,6 +205,7 @@ func (f *CreateLabelForm) Validate(errors *binding.Errors, req *http.Request, co type NewReleaseForm struct { TagName string `form:"tag_name" binding:"Required"` + Target string `form:"tag_target" binding:"Required"` Title string `form:"title" binding:"Required"` Content string `form:"content" binding:"Required"` Prerelease bool `form:"prerelease"` @@ -213,6 +214,7 @@ type NewReleaseForm struct { func (f *NewReleaseForm) Name(field string) string { names := map[string]string{ "TagName": "Tag name", + "Target": "Target", "Title": "Release title", "Content": "Release content", } diff --git a/routers/repo/release.go b/routers/repo/release.go index 14a14656d4..3e2449ecf3 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -79,7 +79,7 @@ func Releases(ctx *middleware.Context) { tags.rels[i] = &models.Release{ Title: rawTag, TagName: rawTag, - SHA1: commit.Id.String(), + Sha1: commit.Id.String(), } tags.rels[i].NumCommits, err = ctx.Repo.GitRepo.CommitsCount(commit.Id.String()) if err != nil { @@ -129,12 +129,18 @@ func ReleasesNewPost(ctx *middleware.Context, form auth.NewReleaseForm) { return } + if !ctx.Repo.GitRepo.IsBranchExist(form.Target) { + ctx.RenderWithErr("Target branch does not exist", "release/new", &form) + return + } + rel := &models.Release{ RepoId: ctx.Repo.Repository.Id, PublisherId: ctx.User.Id, Title: form.Title, TagName: form.TagName, - SHA1: ctx.Repo.Commit.Id.String(), + Target: form.Target, + Sha1: ctx.Repo.Commit.Id.String(), NumCommits: commitsCount, Note: form.Content, IsPrerelease: form.Prerelease, diff --git a/templates/release/list.tmpl b/templates/release/list.tmpl index edbc7467b4..2607dfacd9 100644 --- a/templates/release/list.tmpl +++ b/templates/release/list.tmpl @@ -11,12 +11,12 @@ \ No newline at end of file diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index e7759c2985..a58299f8cf 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -14,7 +14,7 @@ {{if CdnMode}} - + diff --git a/templates/user/signin.tmpl b/templates/user/signin.tmpl index 09ce249f7f..9a8aa1992d 100644 --- a/templates/user/signin.tmpl +++ b/templates/user/signin.tmpl @@ -62,7 +62,7 @@ {{if .OauthService.GitHub}}GitHub{{end}} {{if .OauthService.Google}}Google{{end}} {{if .OauthService.Twitter}}Twitter{{end}} - {{if .OauthService.Tencent}}Tencent QQ{{end}} + {{if not .OauthService.Tencent}}Tencent QQ{{end}} {{if .OauthService.Weibo}}Weibo{{end}} {{end}}{{end}} From 8d3276cab0bb554d63a38ddf3d065f247cf9b3d8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 16 Jun 2014 23:19:25 -0400 Subject: [PATCH 21/55] Fix test cases --- modules/cron/cron_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/cron/cron_test.go b/modules/cron/cron_test.go index 9822e8eda7..417247a05a 100644 --- a/modules/cron/cron_test.go +++ b/modules/cron/cron_test.go @@ -154,9 +154,9 @@ func TestRunningMultipleSchedules(t *testing.T) { cron.AddFunc("", "0 0 0 1 1 ?", func() {}) cron.AddFunc("", "0 0 0 31 12 ?", func() {}) cron.AddFunc("", "* * * * * ?", func() { wg.Done() }) - cron.Schedule("", Every(time.Minute), FuncJob(func() {})) - cron.Schedule("", Every(time.Second), FuncJob(func() { wg.Done() })) - cron.Schedule("", Every(time.Hour), FuncJob(func() {})) + cron.Schedule("", "", Every(time.Minute), FuncJob(func() {})) + cron.Schedule("", "", Every(time.Second), FuncJob(func() { wg.Done() })) + cron.Schedule("", "", Every(time.Hour), FuncJob(func() {})) cron.Start() defer cron.Stop() @@ -208,8 +208,8 @@ func TestJob(t *testing.T) { cron.AddJob("", "0 0 0 1 1 ?", testJob{wg, "job1"}) cron.AddJob("", "* * * * * ?", testJob{wg, "job2"}) cron.AddJob("", "1 0 0 1 1 ?", testJob{wg, "job3"}) - cron.Schedule("", Every(5*time.Second+5*time.Nanosecond), testJob{wg, "job4"}) - cron.Schedule("", Every(5*time.Minute), testJob{wg, "job5"}) + cron.Schedule("", "", Every(5*time.Second+5*time.Nanosecond), testJob{wg, "job4"}) + cron.Schedule("", "", Every(5*time.Minute), testJob{wg, "job5"}) cron.Start() defer cron.Stop() From f147ad619a68440ef6c30d797a8217e687e8d51d Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 19 Jun 2014 01:08:03 -0400 Subject: [PATCH 22/55] Basic process manager --- cmd/serve.go | 6 +- gogs.go | 2 +- models/fix.go | 6 - models/git_diff.go | 13 +- models/publickey.go | 3 +- models/repo.go | 342 ++++++++++++++------------- modules/process/manager.go | 89 +++++++ routers/admin/admin.go | 5 +- templates/VERSION | 2 +- templates/admin/monitor/process.tmpl | 38 +++ 10 files changed, 326 insertions(+), 180 deletions(-) delete mode 100644 models/fix.go create mode 100644 modules/process/manager.go create mode 100644 templates/admin/monitor/process.tmpl diff --git a/cmd/serve.go b/cmd/serve.go index 3a17bf9f97..a21500c775 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -32,7 +32,7 @@ func newLogger(logPath string) { f, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, os.ModePerm) if err != nil { - qlog.Fatal(err) + qlog.Fatal("Fail to open log file(%s): %v", logPath, err) } qlog.SetOutput(f) @@ -185,8 +185,8 @@ func runServ(k *cli.Context) { gitcmd.Stdout = os.Stdout gitcmd.Stdin = os.Stdin gitcmd.Stderr = os.Stderr - - if err = gitcmd.Run(); err != nil { + err = gitcmd.Run() + if err != nil { println("Gogs: internal error:", err) qlog.Fatalf("Fail to execute git command: %v", err) } diff --git a/gogs.go b/gogs.go index b4129e90fe..7e1459e54c 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.4.0613 Alpha" +const APP_VER = "0.4.4.0619 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/fix.go b/models/fix.go deleted file mode 100644 index 9fc141bd26..0000000000 --- a/models/fix.go +++ /dev/null @@ -1,6 +0,0 @@ -package models - -func Fix() error { - _, err := orm.Exec("alter table repository drop column num_releases") - return err -} diff --git a/models/git_diff.go b/models/git_diff.go index 5b5a46a120..ed114b7504 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -6,6 +6,7 @@ package models import ( "bufio" + "fmt" "io" "os" "os/exec" @@ -15,6 +16,7 @@ import ( "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" + "github.com/gogits/gogs/modules/process" ) // Diff line types. @@ -67,7 +69,7 @@ func (diff *Diff) NumFiles() int { const DIFF_HEAD = "diff --git " -func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) { +func ParsePatch(pid int64, cmd *exec.Cmd, reader io.Reader) (*Diff, error) { scanner := bufio.NewScanner(reader) var ( curFile *DiffFile @@ -169,11 +171,8 @@ func ParsePatch(cmd *exec.Cmd, reader io.Reader) (*Diff, error) { } // In case process became zombie. - if !cmd.ProcessState.Exited() { - log.Debug("git_diff.ParsePatch: process doesn't exit and now will be killed") - if err := cmd.Process.Kill(); err != nil { - log.Error("git_diff.ParsePatch: fail to kill zombie process: %v", err) - } + if err := process.Kill(pid); err != nil { + log.Error("git_diff.ParsePatch(Kill): %v", err) } return diff, nil } @@ -207,5 +206,5 @@ func GetDiff(repoPath, commitid string) (*Diff, error) { wr.Close() }() defer rd.Close() - return ParsePatch(cmd, rd) + return ParsePatch(process.Add(fmt.Sprintf("GetDiff(%s)", repoPath), cmd), cmd, rd) } diff --git a/models/publickey.go b/models/publickey.go index 76dc0cc740..72b45c5b89 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -22,6 +22,7 @@ import ( qlog "github.com/qiniu/log" "github.com/gogits/gogs/modules/log" + "github.com/gogits/gogs/modules/process" ) const ( @@ -121,7 +122,7 @@ func AddPublicKey(key *PublicKey) (err error) { if err = ioutil.WriteFile(tmpPath, []byte(key.Content), os.ModePerm); err != nil { return err } - stdout, stderr, err := com.ExecCmd("ssh-keygen", "-l", "-f", tmpPath) + stdout, stderr, err := process.Exec("AddPublicKey", "ssh-keygen", "-l", "-f", tmpPath) if err != nil { return errors.New("ssh-keygen -l -f: " + stderr) } else if len(stdout) < 2 { diff --git a/models/repo.go b/models/repo.go index 0f01813536..6b98d0e409 100644 --- a/models/repo.go +++ b/models/repo.go @@ -9,7 +9,6 @@ import ( "fmt" "io/ioutil" "os" - "os/exec" "path" "path/filepath" "sort" @@ -25,6 +24,7 @@ import ( "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/bin" "github.com/gogits/gogs/modules/log" + "github.com/gogits/gogs/modules/process" "github.com/gogits/gogs/modules/setting" ) @@ -88,13 +88,13 @@ func NewRepoContext() { zip.Verbose = false // Check if server has basic git setting. - stdout, stderr, err := com.ExecCmd("git", "config", "--get", "user.name") + stdout, stderr, err := process.Exec("NewRepoContext(get setting)", "git", "config", "--get", "user.name") if strings.Contains(stderr, "fatal:") { log.Fatal("repo.NewRepoContext(fail to get git user.name): %s", stderr) } else if err != nil || len(strings.TrimSpace(stdout)) == 0 { - if _, stderr, err = com.ExecCmd("git", "config", "--global", "user.email", "gogitservice@gmail.com"); err != nil { + if _, stderr, err = process.Exec("NewRepoContext(set email)", "git", "config", "--global", "user.email", "gogitservice@gmail.com"); err != nil { log.Fatal("repo.NewRepoContext(fail to set git user.email): %s", stderr) - } else if _, stderr, err = com.ExecCmd("git", "config", "--global", "user.name", "Gogs"); err != nil { + } else if _, stderr, err = process.Exec("NewRepoContext(set name)", "git", "config", "--global", "user.name", "Gogs"); err != nil { log.Fatal("repo.NewRepoContext(fail to set git user.name): %s", stderr) } } @@ -190,7 +190,9 @@ type Mirror struct { // MirrorRepository creates a mirror repository from source. func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) error { - _, stderr, err := com.ExecCmd("git", "clone", "--mirror", url, repoPath) + // TODO: need timeout. + _, stderr, err := process.Exec(fmt.Sprintf("MirrorRepository: %s/%s", userName, repoName), + "git", "clone", "--mirror", url, repoPath) if err != nil { return errors.New("git clone --mirror: " + stderr) } @@ -231,9 +233,11 @@ func MirrorUpdate() { return nil } + // TODO: need timeout. repoPath := filepath.Join(setting.RepoRootPath, m.RepoName+".git") - _, stderr, err := com.ExecCmdDir(repoPath, "git", "remote", "update") - if err != nil { + if _, stderr, err := process.ExecDir( + repoPath, fmt.Sprintf("MirrorUpdate: %s", repoPath), + "git", "remote", "update"); err != nil { return errors.New("git remote update: " + stderr) } else if err = git.UnpackRefs(repoPath); err != nil { return err @@ -268,26 +272,188 @@ func MigrateRepository(user *User, name, desc string, private, mirror bool, url return repo, UpdateRepository(repo) } + // TODO: need timeout. // Clone from local repository. - _, stderr, err := com.ExecCmd("git", "clone", repoPath, tmpDir) + _, stderr, err := process.Exec( + fmt.Sprintf("MigrateRepository(git clone): %s", repoPath), + "git", "clone", repoPath, tmpDir) if err != nil { return repo, errors.New("git clone: " + stderr) } + // TODO: need timeout. // Pull data from source. - _, stderr, err = com.ExecCmdDir(tmpDir, "git", "pull", url) - if err != nil { + if _, stderr, err = process.ExecDir( + tmpDir, fmt.Sprintf("MigrateRepository(git pull): %s", repoPath), + "git", "pull", url); err != nil { return repo, errors.New("git pull: " + stderr) } + // TODO: need timeout. // Push data to local repository. - if _, stderr, err = com.ExecCmdDir(tmpDir, "git", "push", "origin", "master"); err != nil { + if _, stderr, err = process.ExecDir( + tmpDir, fmt.Sprintf("MigrateRepository(git push): %s", repoPath), + "git", "push", "origin", "master"); err != nil { return repo, errors.New("git push: " + stderr) } return repo, UpdateRepository(repo) } +// extractGitBareZip extracts git-bare.zip to repository path. +func extractGitBareZip(repoPath string) error { + z, err := zip.Open(path.Join(setting.RepoRootPath, "git-bare.zip")) + if err != nil { + return err + } + defer z.Close() + + return z.ExtractTo(repoPath) +} + +// initRepoCommit temporarily changes with work directory. +func initRepoCommit(tmpPath string, sig *git.Signature) (err error) { + var stderr string + if _, stderr, err = process.ExecDir( + tmpPath, fmt.Sprintf("initRepoCommit(git add): %s", tmpPath), + "git", "add", "--all"); err != nil { + return errors.New("git add: " + stderr) + } + + if _, stderr, err = process.ExecDir( + tmpPath, fmt.Sprintf("initRepoCommit(git commit): %s", tmpPath), + "git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email), + "-m", "Init commit"); err != nil { + return errors.New("git commit: " + stderr) + } + + if _, stderr, err = process.ExecDir( + tmpPath, fmt.Sprintf("initRepoCommit(git push): %s", tmpPath), + "git", "push", "origin", "master"); err != nil { + return errors.New("git push: " + stderr) + } + return nil +} + +func createHookUpdate(hookPath, content string) error { + pu, err := os.OpenFile(hookPath, os.O_CREATE|os.O_WRONLY, 0777) + if err != nil { + return err + } + defer pu.Close() + + _, err = pu.WriteString(content) + return err +} + +// SetRepoEnvs sets environment variables for command update. +func SetRepoEnvs(userId int64, userName, repoName, repoUserName string) { + os.Setenv("userId", base.ToStr(userId)) + os.Setenv("userName", userName) + os.Setenv("repoName", repoName) + os.Setenv("repoUserName", repoUserName) +} + +// InitRepository initializes README and .gitignore if needed. +func initRepository(f string, user *User, repo *Repository, initReadme bool, repoLang, license string) error { + repoPath := RepoPath(user.Name, repo.Name) + + // Create bare new repository. + if err := extractGitBareZip(repoPath); err != nil { + return err + } + + rp := strings.NewReplacer("\\", "/", " ", "\\ ") + // hook/post-update + if err := createHookUpdate(filepath.Join(repoPath, "hooks", "update"), + fmt.Sprintf(TPL_UPDATE_HOOK, setting.ScriptType, + rp.Replace(appPath))); err != nil { + return err + } + + // Initialize repository according to user's choice. + fileName := map[string]string{} + if initReadme { + fileName["readme"] = "README.md" + } + if repoLang != "" { + fileName["gitign"] = ".gitignore" + } + if license != "" { + fileName["license"] = "LICENSE" + } + + // Clone to temprory path and do the init commit. + tmpDir := filepath.Join(os.TempDir(), base.ToStr(time.Now().Nanosecond())) + os.MkdirAll(tmpDir, os.ModePerm) + + _, stderr, err := process.Exec( + fmt.Sprintf("initRepository(git clone): %s", repoPath), + "git", "clone", repoPath, tmpDir) + if err != nil { + return errors.New("initRepository(git clone): " + stderr) + } + + // README + if initReadme { + defaultReadme := repo.Name + "\n" + strings.Repeat("=", + utf8.RuneCountInString(repo.Name)) + "\n\n" + repo.Description + if err := ioutil.WriteFile(filepath.Join(tmpDir, fileName["readme"]), + []byte(defaultReadme), 0644); err != nil { + return err + } + } + + // .gitignore + if repoLang != "" { + filePath := "conf/gitignore/" + repoLang + targetPath := path.Join(tmpDir, fileName["gitign"]) + data, err := bin.Asset(filePath) + if err == nil { + if err = ioutil.WriteFile(targetPath, data, os.ModePerm); err != nil { + return err + } + } else { + // Check custom files. + filePath = path.Join(setting.CustomPath, "conf/gitignore", repoLang) + if com.IsFile(filePath) { + if err := com.Copy(filePath, targetPath); err != nil { + return err + } + } + } + } + + // LICENSE + if license != "" { + filePath := "conf/license/" + license + targetPath := path.Join(tmpDir, fileName["license"]) + data, err := bin.Asset(filePath) + if err == nil { + if err = ioutil.WriteFile(targetPath, data, os.ModePerm); err != nil { + return err + } + } else { + // Check custom files. + filePath = path.Join(setting.CustomPath, "conf/license", license) + if com.IsFile(filePath) { + if err := com.Copy(filePath, targetPath); err != nil { + return err + } + } + } + } + + if len(fileName) == 0 { + return nil + } + + SetRepoEnvs(user.Id, user.Name, repo.Name, user.Name) + + // Apply changes and commit. + return initRepoCommit(tmpDir, user.NewGitSig()) +} + // CreateRepository creates a repository for given user or orgnaziation. func CreateRepository(user *User, name, desc, lang, license string, private, mirror, initReadme bool) (*Repository, error) { if !IsLegalName(name) { @@ -386,160 +552,16 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir return nil, err } - c := exec.Command("git", "update-server-info") - c.Dir = repoPath - if err = c.Run(); err != nil { - log.Error("repo.CreateRepository(exec update-server-info): %v", err) + _, stderr, err := process.ExecDir( + repoPath, fmt.Sprintf("CreateRepository(git update-server-info): %s", repoPath), + "git", "update-server-info") + if err != nil { + return nil, errors.New("CreateRepository(git update-server-info): " + stderr) } return repo, nil } -// extractGitBareZip extracts git-bare.zip to repository path. -func extractGitBareZip(repoPath string) error { - z, err := zip.Open(path.Join(setting.RepoRootPath, "git-bare.zip")) - if err != nil { - return err - } - defer z.Close() - - return z.ExtractTo(repoPath) -} - -// initRepoCommit temporarily changes with work directory. -func initRepoCommit(tmpPath string, sig *git.Signature) (err error) { - var stderr string - if _, stderr, err = com.ExecCmdDir(tmpPath, "git", "add", "--all"); err != nil { - return errors.New("git add: " + stderr) - } - if _, stderr, err = com.ExecCmdDir(tmpPath, "git", "commit", fmt.Sprintf("--author='%s <%s>'", sig.Name, sig.Email), - "-m", "Init commit"); err != nil { - return errors.New("git commit: " + stderr) - } - - if _, stderr, err = com.ExecCmdDir(tmpPath, "git", "push", "origin", "master"); err != nil { - return errors.New("git push: " + stderr) - } - return nil -} - -func createHookUpdate(hookPath, content string) error { - pu, err := os.OpenFile(hookPath, os.O_CREATE|os.O_WRONLY, 0777) - if err != nil { - return err - } - defer pu.Close() - - _, err = pu.WriteString(content) - return err -} - -// SetRepoEnvs sets environment variables for command update. -func SetRepoEnvs(userId int64, userName, repoName, repoUserName string) { - os.Setenv("userId", base.ToStr(userId)) - os.Setenv("userName", userName) - os.Setenv("repoName", repoName) - os.Setenv("repoUserName", repoUserName) -} - -// InitRepository initializes README and .gitignore if needed. -func initRepository(f string, user *User, repo *Repository, initReadme bool, repoLang, license string) error { - repoPath := RepoPath(user.Name, repo.Name) - - // Create bare new repository. - if err := extractGitBareZip(repoPath); err != nil { - return err - } - - rp := strings.NewReplacer("\\", "/", " ", "\\ ") - // hook/post-update - if err := createHookUpdate(filepath.Join(repoPath, "hooks", "update"), - fmt.Sprintf(TPL_UPDATE_HOOK, setting.ScriptType, - rp.Replace(appPath))); err != nil { - return err - } - - // Initialize repository according to user's choice. - fileName := map[string]string{} - if initReadme { - fileName["readme"] = "README.md" - } - if repoLang != "" { - fileName["gitign"] = ".gitignore" - } - if license != "" { - fileName["license"] = "LICENSE" - } - - // Clone to temprory path and do the init commit. - tmpDir := filepath.Join(os.TempDir(), base.ToStr(time.Now().Nanosecond())) - os.MkdirAll(tmpDir, os.ModePerm) - - _, stderr, err := com.ExecCmd("git", "clone", repoPath, tmpDir) - if err != nil { - return errors.New("git clone: " + stderr) - } - - // README - if initReadme { - defaultReadme := repo.Name + "\n" + strings.Repeat("=", - utf8.RuneCountInString(repo.Name)) + "\n\n" + repo.Description - if err := ioutil.WriteFile(filepath.Join(tmpDir, fileName["readme"]), - []byte(defaultReadme), 0644); err != nil { - return err - } - } - - // .gitignore - if repoLang != "" { - filePath := "conf/gitignore/" + repoLang - targetPath := path.Join(tmpDir, fileName["gitign"]) - data, err := bin.Asset(filePath) - if err == nil { - if err = ioutil.WriteFile(targetPath, data, os.ModePerm); err != nil { - return err - } - } else { - // Check custom files. - filePath = path.Join(setting.CustomPath, "conf/gitignore", repoLang) - if com.IsFile(filePath) { - if err := com.Copy(filePath, targetPath); err != nil { - return err - } - } - } - } - - // LICENSE - if license != "" { - filePath := "conf/license/" + license - targetPath := path.Join(tmpDir, fileName["license"]) - data, err := bin.Asset(filePath) - if err == nil { - if err = ioutil.WriteFile(targetPath, data, os.ModePerm); err != nil { - return err - } - } else { - // Check custom files. - filePath = path.Join(setting.CustomPath, "conf/license", license) - if com.IsFile(filePath) { - if err := com.Copy(filePath, targetPath); err != nil { - return err - } - } - } - } - - if len(fileName) == 0 { - return nil - } - - SetRepoEnvs(user.Id, user.Name, repo.Name, user.Name) - - // Apply changes and commit. - return initRepoCommit(tmpDir, user.NewGitSig()) -} - // GetRepositoriesWithUsers returns given number of repository objects with offset. // It also auto-gets corresponding users. func GetRepositoriesWithUsers(num, offset int) ([]*Repository, error) { diff --git a/modules/process/manager.go b/modules/process/manager.go new file mode 100644 index 0000000000..173b2aa4ee --- /dev/null +++ b/modules/process/manager.go @@ -0,0 +1,89 @@ +// Copyright 2014 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package process + +import ( + "bytes" + "fmt" + "os/exec" + "time" + + "github.com/gogits/gogs/modules/log" +) + +// Process represents a working process inherit from Gogs. +type Process struct { + Pid int64 // Process ID, not system one. + Description string + Start time.Time + Cmd *exec.Cmd +} + +// List of existing processes. +var ( + curPid int64 = 1 + Processes []*Process +) + +// Add adds a existing process and returns its PID. +func Add(desc string, cmd *exec.Cmd) int64 { + pid := curPid + Processes = append(Processes, &Process{ + Pid: pid, + Description: desc, + Start: time.Now(), + Cmd: cmd, + }) + curPid++ + return pid +} + +func ExecDir(dir, desc, cmdName string, args ...string) (string, string, error) { + bufOut := new(bytes.Buffer) + bufErr := new(bytes.Buffer) + + cmd := exec.Command(cmdName, args...) + cmd.Dir = dir + cmd.Stdout = bufOut + cmd.Stderr = bufErr + + pid := Add(desc, cmd) + err := cmd.Run() + if errKill := Kill(pid); errKill != nil { + log.Error("Exec: %v", pid, desc, errKill) + } + return bufOut.String(), bufErr.String(), err +} + +// Exec starts executing a command and record its process. +func Exec(desc, cmdName string, args ...string) (string, string, error) { + return ExecDir("", desc, cmdName, args...) +} + +// Remove removes a process from list. +func Remove(pid int64) { + for i, proc := range Processes { + if proc.Pid == pid { + Processes = append(Processes[:i], Processes[i+1:]...) + return + } + } +} + +// Kill kills and removes a process from list. +func Kill(pid int64) error { + for i, proc := range Processes { + if proc.Pid == pid { + if proc.Cmd.Process != nil && proc.Cmd.ProcessState != nil && !proc.Cmd.ProcessState.Exited() { + if err := proc.Cmd.Process.Kill(); err != nil { + return fmt.Errorf("fail to kill process(%d/%s): %v", proc.Pid, proc.Description, err) + } + } + Processes = append(Processes[:i], Processes[i+1:]...) + return nil + } + } + return nil +} diff --git a/routers/admin/admin.go b/routers/admin/admin.go index d4b49a9e15..a14ffae0e5 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -16,6 +16,7 @@ import ( "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/cron" "github.com/gogits/gogs/modules/middleware" + "github.com/gogits/gogs/modules/process" "github.com/gogits/gogs/modules/setting" ) @@ -238,10 +239,12 @@ func Monitor(ctx *middleware.Context) { switch tab { case "process": ctx.Data["PageIsMonitorProcess"] = true + ctx.Data["Processes"] = process.Processes + ctx.HTML(200, "admin/monitor/process") default: ctx.Data["PageIsMonitorCron"] = true ctx.Data["Entries"] = cron.ListEntries() + ctx.HTML(200, "admin/monitor/cron") } - ctx.HTML(200, "admin/monitor/cron") } diff --git a/templates/VERSION b/templates/VERSION index c2606e903b..d86ece1559 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.4.0613 Alpha \ No newline at end of file +0.4.4.0619 Alpha \ No newline at end of file diff --git a/templates/admin/monitor/process.tmpl b/templates/admin/monitor/process.tmpl new file mode 100644 index 0000000000..2d60ff6895 --- /dev/null +++ b/templates/admin/monitor/process.tmpl @@ -0,0 +1,38 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +
+ {{template "admin/nav" .}} +
+ +
+
+ {{if .PageIsMonitorProcess}} + + + + + + + + + + + {{range .Processes}} + + + + + + + {{end}} + +
PidDescriptionStart TimeExecution Time
{{.Pid}}{{.Description}}{{.Start}}{{TimeSince .Start}}
+ {{end}} +
+
+
+
+{{template "base/footer" .}} \ No newline at end of file From 6c8d630bef3a58860237856c648e56f4b9cea97d Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 20 Jun 2014 00:25:23 -0400 Subject: [PATCH 23/55] Add database log adapter --- conf/app.ini | 2 + gogs.go | 2 +- modules/bin/conf.go | 454 +++++++++++++++++++------------------ modules/log/log.go | 4 +- modules/setting/setting.go | 6 +- templates/VERSION | 2 +- 6 files changed, 239 insertions(+), 231 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index c792c0fb4b..52f0c7ed5a 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -233,5 +233,7 @@ RECEIVERS = ; For "database" mode only [log.database] LEVEL = +; Either "mysql" or "postgres" DRIVER = +; Based on xorm, e.g.: root:root@localhost/gogs?charset=utf8 CONN = diff --git a/gogs.go b/gogs.go index 7e1459e54c..f8b31c9f68 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.4.0619 Alpha" +const APP_VER = "0.4.4.0620 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/bin/conf.go b/modules/bin/conf.go index c07f87b747..801395365d 100644 --- a/modules/bin/conf.go +++ b/modules/bin/conf.go @@ -27,231 +27,235 @@ func bindata_read(data []byte, name string) ([]byte, error) { func conf_app_ini() ([]byte, error) { return bindata_read([]byte{ - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb4, 0x58, - 0xed, 0x72, 0xdb, 0xb8, 0xd5, 0xfe, 0xcf, 0xab, 0x40, 0xf4, 0xee, 0xbe, - 0x9b, 0x74, 0x6c, 0x49, 0x76, 0x1a, 0x27, 0x6b, 0x6f, 0x66, 0x96, 0x96, - 0x28, 0x9b, 0x8d, 0x25, 0x39, 0x24, 0xed, 0x34, 0xcd, 0x78, 0x38, 0x34, - 0x09, 0x49, 0xa8, 0x49, 0x82, 0x26, 0x20, 0x2b, 0xea, 0xbf, 0xde, 0x42, - 0xa7, 0x57, 0xd3, 0xeb, 0xe9, 0x8f, 0x5e, 0x46, 0x9f, 0x03, 0x92, 0x32, - 0xe5, 0x68, 0xb3, 0xe9, 0xd7, 0xec, 0x4e, 0x2c, 0x02, 0x07, 0x07, 0xe7, - 0x3c, 0xe7, 0x1b, 0x27, 0xcc, 0x2e, 0x0a, 0x96, 0x47, 0x19, 0x67, 0x7a, - 0x11, 0x69, 0xa6, 0x16, 0x72, 0xa5, 0x98, 0xcc, 0x19, 0x7f, 0xe0, 0xe5, - 0x9a, 0x15, 0xd1, 0x1c, 0x1b, 0x42, 0xa7, 0xdc, 0xb2, 0x2f, 0x2f, 0xc3, - 0x89, 0x3d, 0x76, 0xd8, 0x5b, 0x76, 0x26, 0xe7, 0xea, 0x18, 0xff, 0xb2, - 0x33, 0xa1, 0x99, 0xcf, 0xcb, 0x07, 0x11, 0x57, 0xfb, 0x17, 0xd3, 0xb3, - 0x29, 0xf6, 0x45, 0x36, 0xef, 0xcd, 0x22, 0xac, 0xca, 0xbc, 0x5b, 0xe4, - 0x73, 0xeb, 0x84, 0x0d, 0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, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb4, 0x59, + 0xdd, 0x72, 0xdb, 0xc8, 0xb1, 0xbe, 0xc7, 0x53, 0x8c, 0x79, 0x76, 0xcf, + 0xda, 0xa7, 0x24, 0x92, 0x92, 0x8f, 0x65, 0xad, 0xb4, 0xae, 0x98, 0x22, + 0x41, 0x09, 0xb1, 0x48, 0x6a, 0x01, 0x48, 0x8e, 0xe3, 0x52, 0xa1, 0x20, + 0x60, 0x48, 0x4e, 0x04, 0x60, 0x20, 0xcc, 0x50, 0x14, 0x73, 0x97, 0x57, + 0x48, 0xe5, 0x69, 0xf2, 0x3c, 0xb9, 0xc8, 0x63, 0xe4, 0xeb, 0x01, 0x40, + 0x81, 0x34, 0xd7, 0xeb, 0xfc, 0x55, 0x52, 0x16, 0x31, 0xd3, 0xd3, 0xd3, + 0xfd, 0xf5, 0xff, 0xec, 0x29, 0xeb, 0xe5, 0x39, 0xcb, 0xc2, 0x94, 0x33, + 0x3d, 0x0f, 0x35, 0x53, 0x73, 0xb9, 0x54, 0x4c, 0x66, 0x8c, 0x3f, 0xf2, + 0x62, 0xc5, 0xf2, 0x70, 0x86, 0x0d, 0xa1, 0x13, 0x6e, 0xf5, 0xae, 0xae, + 0x82, 0x71, 0x6f, 0x64, 0xb3, 0x77, 0xec, 0x5c, 0xce, 0xd4, 0x09, 0xfe, + 0x65, 0xe7, 0x42, 0x33, 0x8f, 0x17, 0x8f, 0x22, 0x2a, 0xf7, 0x2f, 0x27, + 0xe7, 0x13, 0xec, 0x8b, 0x74, 0xd6, 0x99, 0x86, 0x58, 0x95, 0x59, 0x3b, + 0xcf, 0x66, 0xd6, 0x29, 0xeb, 0xcf, 0xc3, 0x0c, 0x9c, 0x40, 0x2e, 0xa6, + 0x6c, 0x25, 0x17, 0xac, 0x58, 0x64, 0x2c, 0x91, 0x51, 0x98, 0x24, 0x2b, + 0xcb, 0xbd, 0x1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4, 0x77, 0x73, 0x29, + 0xef, 0x29, 0x26, 0xfb, 0x05, 0x8a, 0x97, 0x0e, 0xd5, 0x3d, 0x84, 0x85, + 0xfa, 0x8f, 0x61, 0x42, 0x52, 0x43, 0x7d, 0xc4, 0xb4, 0xb2, 0xfc, 0x9e, + 0xf7, 0x21, 0x70, 0xc6, 0xc0, 0xf1, 0xa6, 0x47, 0x0c, 0x0e, 0x08, 0x38, + 0x9e, 0x08, 0x44, 0x04, 0xca, 0x5c, 0xca, 0xe5, 0x42, 0x13, 0x39, 0x9c, + 0x59, 0x66, 0xb1, 0xb2, 0x06, 0x36, 0x19, 0xce, 0x0d, 0x7c, 0x67, 0x64, + 0x23, 0xbd, 0xe2, 0xc0, 0x1b, 0xdc, 0x46, 0x06, 0xa2, 0x9a, 0x51, 0x8a, + 0x34, 0x68, 0x88, 0x7d, 0xb6, 0x98, 0x4e, 0x4d, 0x36, 0xca, 0x66, 0xc8, + 0x2b, 0x48, 0x47, 0x11, 0xea, 0x5e, 0xc6, 0x93, 0x3d, 0x76, 0xcf, 0x79, + 0x4e, 0xe5, 0x0f, 0x08, 0x08, 0x93, 0x7d, 0xaa, 0x3a, 0x18, 0xcb, 0xec, + 0x07, 0xcd, 0xee, 0x33, 0x58, 0x6c, 0x49, 0xf5, 0xd7, 0x6c, 0xb6, 0x11, + 0x00, 0xe3, 0x41, 0x70, 0x76, 0x3d, 0x1c, 0x52, 0x46, 0xb7, 0xc9, 0x22, + 0x07, 0xe4, 0x31, 0x63, 0xaa, 0xd3, 0x88, 0x52, 0xa4, 0xb8, 0x15, 0xdc, + 0x86, 0x14, 0x23, 0xa0, 0xca, 0x02, 0xed, 0x5d, 0x9f, 0xfd, 0xd6, 0xee, + 0xfb, 0xa6, 0x3c, 0xd5, 0xc5, 0xfa, 0x95, 0xaa, 0xc1, 0x2c, 0x0b, 0x1d, + 0x95, 0x04, 0x3a, 0x72, 0xc2, 0x54, 0xaa, 0xf3, 0xf6, 0x8c, 0x7e, 0x53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0xc8, 0xce, 0x05, 0x3a, 0x89, 0x77, 0x0b, 0x3d, 0x3d, 0xb6, 0xc8, + 0x79, 0x88, 0xc9, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x1e, 0x92, + 0x4d, 0xf7, 0x18, 0x00, 0x00, }, "conf/app.ini", ) diff --git a/modules/log/log.go b/modules/log/log.go index f83ec0ad4f..a62baad16e 100644 --- a/modules/log/log.go +++ b/modules/log/log.go @@ -33,7 +33,9 @@ func NewLogger(bufLen int64, mode, config string) { loggers = append(loggers, logger) } logger.SetLogFuncCallDepth(3) - logger.SetLogger(mode, config) + if err := logger.SetLogger(mode, config); err != nil { + Fatal("Fail to set logger(%s): %v", mode, err) + } } func Trace(format string, v ...interface{}) { diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 73ec8ddd1b..93e02210cc 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -255,20 +255,20 @@ func newLogService() { Cfg.MustBool(modeSec, "DAILY_ROTATE", true), Cfg.MustInt(modeSec, "MAX_DAYS", 7)) case "conn": - LogConfigs[i] = fmt.Sprintf(`{"level":"%s","reconnectOnMsg":%v,"reconnect":%v,"net":"%s","addr":"%s"}`, level, + LogConfigs[i] = fmt.Sprintf(`{"level":%s,"reconnectOnMsg":%v,"reconnect":%v,"net":"%s","addr":"%s"}`, level, Cfg.MustBool(modeSec, "RECONNECT_ON_MSG"), Cfg.MustBool(modeSec, "RECONNECT"), Cfg.MustValueRange(modeSec, "PROTOCOL", "tcp", []string{"tcp", "unix", "udp"}), Cfg.MustValue(modeSec, "ADDR", ":7020")) case "smtp": - LogConfigs[i] = fmt.Sprintf(`{"level":"%s","username":"%s","password":"%s","host":"%s","sendTos":"%s","subject":"%s"}`, level, + LogConfigs[i] = fmt.Sprintf(`{"level":%s,"username":"%s","password":"%s","host":"%s","sendTos":"%s","subject":"%s"}`, level, Cfg.MustValue(modeSec, "USER", "example@example.com"), Cfg.MustValue(modeSec, "PASSWD", "******"), Cfg.MustValue(modeSec, "HOST", "127.0.0.1:25"), Cfg.MustValue(modeSec, "RECEIVERS", "[]"), Cfg.MustValue(modeSec, "SUBJECT", "Diagnostic message from serve")) case "database": - LogConfigs[i] = fmt.Sprintf(`{"level":"%s","driver":"%s","conn":"%s"}`, level, + LogConfigs[i] = fmt.Sprintf(`{"level":%s,"driver":"%s","conn":"%s"}`, level, Cfg.MustValue(modeSec, "DRIVER"), Cfg.MustValue(modeSec, "CONN")) } diff --git a/templates/VERSION b/templates/VERSION index d86ece1559..0848cb02d0 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.4.0619 Alpha \ No newline at end of file +0.4.4.0620 Alpha \ No newline at end of file From 8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 20 Jun 2014 01:14:54 -0400 Subject: [PATCH 24/55] Remove qiniu/log --- cmd/serve.go | 58 ++++++++++++++------------------------------ cmd/update.go | 20 +++------------ models/action.go | 3 +-- models/publickey.go | 7 +++--- models/update.go | 23 +++++++++--------- modules/log/log.go | 11 ++++++++- routers/install.go | 1 + routers/repo/http.go | 16 ++++++------ 8 files changed, 56 insertions(+), 83 deletions(-) diff --git a/cmd/serve.go b/cmd/serve.go index a21500c775..62e290d82a 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -13,9 +13,9 @@ import ( "strings" "github.com/codegangsta/cli" - qlog "github.com/qiniu/log" "github.com/gogits/gogs/models" + "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/setting" ) @@ -27,26 +27,13 @@ var CmdServ = cli.Command{ Flags: []cli.Flag{}, } -func newLogger(logPath string) { - os.MkdirAll(path.Dir(logPath), os.ModePerm) - - f, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, os.ModePerm) - if err != nil { - qlog.Fatal("Fail to open log file(%s): %v", logPath, err) - } - - qlog.SetOutput(f) - qlog.Info("Start logging serv...") -} - func setup(logPath string) { - workDir, _ := setting.WorkDir() - newLogger(path.Join(workDir, logPath)) - setting.NewConfigContext() + log.NewGitLogger(path.Join(setting.LogRootPath, logPath)) models.LoadModelsConfig() if models.UseSQLite3 { + workDir, _ := setting.WorkDir() os.Chdir(workDir) } @@ -87,27 +74,27 @@ func In(b string, sl map[string]int) bool { } func runServ(k *cli.Context) { - setup(path.Join(setting.LogRootPath, "serv.log")) + setup("serv.log") keys := strings.Split(os.Args[2], "-") if len(keys) != 2 { println("Gogs: auth file format error") - qlog.Fatal("Invalid auth file format: %s", os.Args[2]) + log.GitLogger.Fatal("Invalid auth file format: %s", os.Args[2]) } keyId, err := strconv.ParseInt(keys[1], 10, 64) if err != nil { println("Gogs: auth file format error") - qlog.Fatalf("Invalid auth file format: %v", err) + log.GitLogger.Fatal("Invalid auth file format: %v", err) } user, err := models.GetUserByKeyId(keyId) if err != nil { if err == models.ErrUserNotKeyOwner { println("Gogs: you are not the owner of SSH key") - qlog.Fatalf("Invalid owner of SSH key: %d", keyId) + log.GitLogger.Fatal("Invalid owner of SSH key: %d", keyId) } println("Gogs: internal error:", err) - qlog.Fatalf("Fail to get user by key ID(%d): %v", keyId, err) + log.GitLogger.Fatal("Fail to get user by key ID(%d): %v", keyId, err) } cmd := os.Getenv("SSH_ORIGINAL_COMMAND") @@ -121,7 +108,7 @@ func runServ(k *cli.Context) { rr := strings.SplitN(repoPath, "/", 2) if len(rr) != 2 { println("Gogs: unavailable repository", args) - qlog.Fatalf("Unavailable repository: %v", args) + log.GitLogger.Fatal("Unavailable repository: %v", args) } repoUserName := rr[0] repoName := strings.TrimSuffix(rr[1], ".git") @@ -133,10 +120,10 @@ func runServ(k *cli.Context) { if err != nil { if err == models.ErrUserNotExist { println("Gogs: given repository owner are not registered") - qlog.Fatalf("Unregistered owner: %s", repoUserName) + log.GitLogger.Fatal("Unregistered owner: %s", repoUserName) } println("Gogs: internal error:", err) - qlog.Fatalf("Fail to get repository owner(%s): %v", repoUserName, err) + log.GitLogger.Fatal("Fail to get repository owner(%s): %v", repoUserName, err) } // Access check. @@ -145,20 +132,20 @@ func runServ(k *cli.Context) { has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.AU_WRITABLE) if err != nil { println("Gogs: internal error:", err) - qlog.Fatal("Fail to check write access:", err) + log.GitLogger.Fatal("Fail to check write access:", err) } else if !has { println("You have no right to write this repository") - qlog.Fatalf("User %s has no right to write repository %s", user.Name, repoPath) + log.GitLogger.Fatal("User %s has no right to write repository %s", user.Name, repoPath) } case isRead: repo, err := models.GetRepositoryByName(repoUser.Id, repoName) if err != nil { if err == models.ErrRepoNotExist { println("Gogs: given repository does not exist") - qlog.Fatalf("Repository does not exist: %s/%s", repoUser.Name, repoName) + log.GitLogger.Fatal("Repository does not exist: %s/%s", repoUser.Name, repoName) } println("Gogs: internal error:", err) - qlog.Fatalf("Fail to get repository: %v", err) + log.GitLogger.Fatal("Fail to get repository: %v", err) } if !repo.IsPrivate { @@ -168,10 +155,10 @@ func runServ(k *cli.Context) { has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.AU_READABLE) if err != nil { println("Gogs: internal error:", err) - qlog.Fatal("Fail to check read access:", err) + log.GitLogger.Fatal("Fail to check read access:", err) } else if !has { println("You have no right to access this repository") - qlog.Fatalf("User %s has no right to read repository %s", user.Name, repoPath) + log.GitLogger.Fatal("User %s has no right to read repository %s", user.Name, repoPath) } default: println("Unknown command") @@ -188,15 +175,6 @@ func runServ(k *cli.Context) { err = gitcmd.Run() if err != nil { println("Gogs: internal error:", err) - qlog.Fatalf("Fail to execute git command: %v", err) + log.GitLogger.Fatal("Fail to execute git command: %v", err) } - - //refName := os.Getenv("refName") - //oldCommitId := os.Getenv("oldCommitId") - //newCommitId := os.Getenv("newCommitId") - - //qlog.Error("get envs:", refName, oldCommitId, newCommitId) - - // update - //models.Update(refName, oldCommitId, newCommitId, repoUserName, repoName, user.Id) } diff --git a/cmd/update.go b/cmd/update.go index b8686a3e6e..d0e0acded9 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -6,14 +6,12 @@ package cmd import ( "os" - "path" "strconv" "github.com/codegangsta/cli" - qlog "github.com/qiniu/log" "github.com/gogits/gogs/models" - "github.com/gogits/gogs/modules/setting" + "github.com/gogits/gogs/modules/log" ) var CmdUpdate = cli.Command{ @@ -24,33 +22,23 @@ var CmdUpdate = cli.Command{ Flags: []cli.Flag{}, } -func updateEnv(refName, oldCommitId, newCommitId string) { - os.Setenv("refName", refName) - os.Setenv("oldCommitId", oldCommitId) - os.Setenv("newCommitId", newCommitId) - qlog.Info("set envs:", refName, oldCommitId, newCommitId) -} - func runUpdate(c *cli.Context) { cmd := os.Getenv("SSH_ORIGINAL_COMMAND") if cmd == "" { return } - setup(path.Join(setting.LogRootPath, "update.log")) + setup("update.log") args := c.Args() if len(args) != 3 { - qlog.Fatal("received less 3 parameters") + log.GitLogger.Fatal("received less 3 parameters") } else if args[0] == "" { - qlog.Fatal("refName is empty, shouldn't use") + log.GitLogger.Fatal("refName is empty, shouldn't use") } - //updateEnv(args[0], args[1], args[2]) - userName := os.Getenv("userName") userId, _ := strconv.ParseInt(os.Getenv("userId"), 10, 64) - //repoId := os.Getenv("repoId") repoUserName := os.Getenv("repoUserName") repoName := os.Getenv("repoName") diff --git a/models/action.go b/models/action.go index e39b04a1ad..2846823386 100644 --- a/models/action.go +++ b/models/action.go @@ -12,7 +12,6 @@ import ( "time" "github.com/gogits/git" - qlog "github.com/qiniu/log" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" @@ -115,7 +114,7 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string, return errors.New("action.CommitRepoAction(NotifyWatchers): " + err.Error()) } - qlog.Info("action.CommitRepoAction(end): %d/%s", repoUserId, repoName) + //qlog.Info("action.CommitRepoAction(end): %d/%s", repoUserId, repoName) // New push event hook. if err := repo.GetOwner(); err != nil { diff --git a/models/publickey.go b/models/publickey.go index 72b45c5b89..b0021a6880 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -19,7 +19,6 @@ import ( "time" "github.com/Unknwon/com" - qlog "github.com/qiniu/log" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/process" @@ -55,7 +54,7 @@ func exePath() (string, error) { func homeDir() string { home, err := com.HomeDir() if err != nil { - qlog.Fatalln(err) + log.Fatal("Fail to get home directory: %v", err) } return home } @@ -64,13 +63,13 @@ func init() { var err error if appPath, err = exePath(); err != nil { - qlog.Fatalf("publickey.init(fail to get app path): %v\n", err) + log.Fatal("publickey.init(fail to get app path): %v\n", err) } // Determine and create .ssh path. SshPath = filepath.Join(homeDir(), ".ssh") if err = os.MkdirAll(SshPath, os.ModePerm); err != nil { - qlog.Fatalf("publickey.init(fail to create SshPath(%s)): %v\n", SshPath, err) + log.Fatal("publickey.init(fail to create SshPath(%s)): %v\n", SshPath, err) } } diff --git a/models/update.go b/models/update.go index b7242cde85..5675a94cf4 100644 --- a/models/update.go +++ b/models/update.go @@ -9,18 +9,17 @@ import ( "os/exec" "strings" - qlog "github.com/qiniu/log" - "github.com/gogits/git" "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/log" ) func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName string, userId int64) { isNew := strings.HasPrefix(oldCommitId, "0000000") if isNew && strings.HasPrefix(newCommitId, "0000000") { - qlog.Fatal("old rev and new rev both 000000") + log.GitLogger.Fatal("old rev and new rev both 000000") } f := RepoPath(repoUserName, repoName) @@ -31,18 +30,18 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName isDel := strings.HasPrefix(newCommitId, "0000000") if isDel { - qlog.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId) + log.GitLogger.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId) return } repo, err := git.OpenRepository(f) if err != nil { - qlog.Fatalf("runUpdate.Open repoId: %v", err) + log.GitLogger.Fatal("runUpdate.Open repoId: %v", err) } newCommit, err := repo.GetCommit(newCommitId) if err != nil { - qlog.Fatalf("runUpdate GetCommit of newCommitId: %v", err) + log.GitLogger.Fatal("runUpdate GetCommit of newCommitId: %v", err) return } @@ -51,28 +50,28 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName if isNew { l, err = newCommit.CommitsBefore() if err != nil { - qlog.Fatalf("Find CommitsBefore erro: %v", err) + log.GitLogger.Fatal("Find CommitsBefore erro: %v", err) } } else { l, err = newCommit.CommitsBeforeUntil(oldCommitId) if err != nil { - qlog.Fatalf("Find CommitsBeforeUntil erro: %v", err) + log.GitLogger.Fatal("Find CommitsBeforeUntil erro: %v", err) return } } if err != nil { - qlog.Fatalf("runUpdate.Commit repoId: %v", err) + log.GitLogger.Fatal("runUpdate.Commit repoId: %v", err) } ru, err := GetUserByName(repoUserName) if err != nil { - qlog.Fatalf("runUpdate.GetUserByName: %v", err) + log.GitLogger.Fatal("runUpdate.GetUserByName: %v", err) } repos, err := GetRepositoryByName(ru.Id, repoName) if err != nil { - qlog.Fatalf("runUpdate.GetRepositoryByName userId: %v", err) + log.GitLogger.Fatal("runUpdate.GetRepositoryByName userId: %v", err) } commits := make([]*base.PushCommit, 0) @@ -96,6 +95,6 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName //commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()}) if err = CommitRepoAction(userId, ru.Id, userName, actEmail, repos.Id, repoUserName, repoName, refName, &base.PushCommits{l.Len(), commits}); err != nil { - qlog.Fatalf("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err) + log.GitLogger.Fatal("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err) } } diff --git a/modules/log/log.go b/modules/log/log.go index a62baad16e..24f0442d1e 100644 --- a/modules/log/log.go +++ b/modules/log/log.go @@ -6,13 +6,16 @@ package log import ( + "fmt" "os" + "path" "github.com/gogits/logs" ) var ( - loggers []*logs.BeeLogger + loggers []*logs.BeeLogger + GitLogger *logs.BeeLogger ) func init() { @@ -38,6 +41,12 @@ func NewLogger(bufLen int64, mode, config string) { } } +func NewGitLogger(logPath string) { + os.MkdirAll(path.Dir(logPath), os.ModePerm) + GitLogger = logs.NewLogger(0) + GitLogger.SetLogger("file", fmt.Sprintf(`{"level":0,"filename":"%s","rotate":false}`, logPath)) +} + func Trace(format string, v ...interface{}) { for _, logger := range loggers { logger.Trace(format, v...) diff --git a/routers/install.go b/routers/install.go index eb0fc199cf..c2eee88a5a 100644 --- a/routers/install.go +++ b/routers/install.go @@ -60,6 +60,7 @@ func GlobalInit() { models.HasEngine = true cron.NewCronContext() + log.NewGitLogger(path.Join(setting.LogRootPath, "http.log")) } if models.EnableSQLite3 { log.Info("SQLite3 Enabled") diff --git a/routers/repo/http.go b/routers/repo/http.go index c5856d603c..5915e8761e 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -9,7 +9,6 @@ import ( "fmt" "io" "io/ioutil" - "log" "net/http" "os" "os/exec" @@ -22,6 +21,7 @@ import ( "github.com/go-martini/martini" "github.com/gogits/gogs/models" + "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/setting" ) @@ -190,7 +190,7 @@ var routes = []route{ // Request handling function func HttpBackend(config *Config) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - //log.Printf("%s %s %s %s", r.RemoteAddr, r.Method, r.URL.Path, r.Proto) + //log.GitLogger.Printf("%s %s %s %s", r.RemoteAddr, r.Method, r.URL.Path, r.Proto) for _, route := range routes { if m := route.cr.FindStringSubmatch(r.URL.Path); m != nil { if route.method != r.Method { @@ -202,7 +202,7 @@ func HttpBackend(config *Config) http.HandlerFunc { dir, err := getGitDir(config, m[1]) if err != nil { - log.Print(err) + log.GitLogger.Error(err.Error()) renderNotFound(w) return } @@ -246,19 +246,19 @@ func serviceRpc(rpc string, hr handler) { cmd.Dir = dir in, err := cmd.StdinPipe() if err != nil { - log.Print(err) + log.GitLogger.Error(err.Error()) return } stdout, err := cmd.StdoutPipe() if err != nil { - log.Print(err) + log.GitLogger.Error(err.Error()) return } err = cmd.Start() if err != nil { - log.Print(err) + log.GitLogger.Error(err.Error()) return } @@ -345,7 +345,7 @@ func getGitDir(config *Config, fPath string) (string, error) { cwd, err := os.Getwd() if err != nil { - log.Print(err) + log.GitLogger.Error(err.Error()) return "", err } @@ -422,7 +422,7 @@ func gitCommand(gitBinPath, dir string, args ...string) []byte { out, err := command.Output() if err != nil { - log.Print(err) + log.GitLogger.Error(err.Error()) } return out From ad5ec45dd63aa2563d113e6a9ce31180246aa5f2 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 21 Jun 2014 00:51:41 -0400 Subject: [PATCH 25/55] Fix #165 --- .gopmfile | 1 - conf/app.ini | 4 + gogs.go | 2 +- models/access.go | 8 +- models/action.go | 2 +- models/issue.go | 84 +++--- models/login.go | 18 +- models/models.go | 48 ++-- models/oauth2.go | 32 +-- models/publickey.go | 12 +- models/release.go | 10 +- models/repo.go | 64 ++--- models/user.go | 54 ++-- models/webhook.go | 18 +- modules/auth/user.go | 42 +-- modules/bin/conf.go | 462 +++++++++++++++++---------------- modules/middleware/context.go | 2 +- modules/setting/setting.go | 32 ++- modules/social/social.go | 10 +- routers/admin/admin.go | 13 +- routers/repo/issue.go | 4 +- routers/repo/setting.go | 2 +- templates/VERSION | 2 +- templates/admin/config.tmpl | 4 +- templates/admin/dashboard.tmpl | 4 + 25 files changed, 484 insertions(+), 450 deletions(-) diff --git a/.gopmfile b/.gopmfile index 3a0f3fc2c3..b8aa02372a 100644 --- a/.gopmfile +++ b/.gopmfile @@ -19,7 +19,6 @@ github.com/gogits/session = `commit:7ab78d4` github.com/juju2013/goldap = `commit:f4a7f67` github.com/lib/pq = `commit:529edd9` github.com/nfnt/resize = `commit:8aee0d9` -github.com/qiniu/log = `commit:891d1cb` [res] include = templates|public diff --git a/conf/app.ini b/conf/app.ini index 52f0c7ed5a..111261db98 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -51,6 +51,8 @@ SECRET_KEY = !#@FDEWREWR&*( LOGIN_REMEMBER_DAYS = 7 COOKIE_USERNAME = gogs_awesome COOKIE_REMEMBER_NAME = gogs_incredible +; Reverse proxy authentication header name of user ID +REVERSE_PROXY_AUTHENTICATION_UID = X-WEBAUTH-UID [service] ACTIVE_CODE_LIVE_MINUTES = 180 @@ -65,6 +67,8 @@ REQUIRE_SIGNIN_VIEW = false ENABLE_CACHE_AVATAR = false ; Mail notification ENABLE_NOTIFY_MAIL = false +; More detail: https://github.com/gogits/gogs/issues/165 +ENABLE_REVERSE_PROXY_AUTHENTICATION = false [webhook] ; Cron task interval in minutes diff --git a/gogs.go b/gogs.go index f8b31c9f68..7719ee0af4 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.4.0620 Alpha" +const APP_VER = "0.4.5.0621 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/access.go b/models/access.go index 4a202dc6bc..cf31fc137b 100644 --- a/models/access.go +++ b/models/access.go @@ -30,7 +30,7 @@ type Access struct { func AddAccess(access *Access) error { access.UserName = strings.ToLower(access.UserName) access.RepoName = strings.ToLower(access.RepoName) - _, err := orm.Insert(access) + _, err := x.Insert(access) return err } @@ -38,13 +38,13 @@ func AddAccess(access *Access) error { func UpdateAccess(access *Access) error { access.UserName = strings.ToLower(access.UserName) access.RepoName = strings.ToLower(access.RepoName) - _, err := orm.Id(access.Id).Update(access) + _, err := x.Id(access.Id).Update(access) return err } // DeleteAccess deletes access record. func DeleteAccess(access *Access) error { - _, err := orm.Delete(access) + _, err := x.Delete(access) return err } @@ -67,7 +67,7 @@ func HasAccess(uname, repoName string, mode int) (bool, error) { UserName: strings.ToLower(uname), RepoName: strings.ToLower(repoName), } - has, err := orm.Get(access) + has, err := x.Get(access) if err != nil { return false, err } else if !has { diff --git a/models/action.go b/models/action.go index 2846823386..8ecdf1de16 100644 --- a/models/action.go +++ b/models/action.go @@ -209,7 +209,7 @@ func TransferRepoAction(user, newUser *User, repo *Repository) (err error) { // GetFeeds returns action list of given user in given context. func GetFeeds(userid, offset int64, isProfile bool) ([]*Action, error) { actions := make([]*Action, 0, 20) - sess := orm.Limit(20, int(offset)).Desc("id").Where("user_id=?", userid) + sess := x.Limit(20, int(offset)).Desc("id").Where("user_id=?", userid) if isProfile { sess.Where("is_private=?", false).And("act_user_id=?", userid) } else { diff --git a/models/issue.go b/models/issue.go index 7db728ec3d..11f6dd4ef9 100644 --- a/models/issue.go +++ b/models/issue.go @@ -92,7 +92,7 @@ func (i *Issue) GetAssignee() (err error) { // CreateIssue creates new issue for repository. func NewIssue(issue *Issue) (err error) { - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -114,7 +114,7 @@ func NewIssue(issue *Issue) (err error) { // GetIssueByIndex returns issue by given index in repository. func GetIssueByIndex(rid, index int64) (*Issue, error) { issue := &Issue{RepoId: rid, Index: index} - has, err := orm.Get(issue) + has, err := x.Get(issue) if err != nil { return nil, err } else if !has { @@ -126,7 +126,7 @@ func GetIssueByIndex(rid, index int64) (*Issue, error) { // GetIssueById returns an issue by ID. func GetIssueById(id int64) (*Issue, error) { issue := &Issue{Id: id} - has, err := orm.Get(issue) + has, err := x.Get(issue) if err != nil { return nil, err } else if !has { @@ -137,7 +137,7 @@ func GetIssueById(id int64) (*Issue, error) { // GetIssues returns a list of issues by given conditions. func GetIssues(uid, rid, pid, mid int64, page int, isClosed bool, labelIds, sortType string) ([]Issue, error) { - sess := orm.Limit(20, (page-1)*20) + sess := x.Limit(20, (page-1)*20) if rid > 0 { sess.Where("repo_id=?", rid).And("is_closed=?", isClosed) @@ -193,13 +193,13 @@ const ( // GetIssuesByLabel returns a list of issues by given label and repository. func GetIssuesByLabel(repoId int64, label string) ([]*Issue, error) { issues := make([]*Issue, 0, 10) - err := orm.Where("repo_id=?", repoId).And("label_ids like '%$" + label + "|%'").Find(&issues) + err := x.Where("repo_id=?", repoId).And("label_ids like '%$" + label + "|%'").Find(&issues) return issues, err } // GetIssueCountByPoster returns number of issues of repository by poster. func GetIssueCountByPoster(uid, rid int64, isClosed bool) int64 { - count, _ := orm.Where("repo_id=?", rid).And("poster_id=?", uid).And("is_closed=?", isClosed).Count(new(Issue)) + count, _ := x.Where("repo_id=?", rid).And("poster_id=?", uid).And("is_closed=?", isClosed).Count(new(Issue)) return count } @@ -241,7 +241,7 @@ func NewIssueUserPairs(rid, iid, oid, pid, aid int64, repoName string) (err erro isNeedAddPoster = false } iu.IsAssigned = iu.Uid == aid - if _, err = orm.Insert(iu); err != nil { + if _, err = x.Insert(iu); err != nil { return err } } @@ -249,7 +249,7 @@ func NewIssueUserPairs(rid, iid, oid, pid, aid int64, repoName string) (err erro iu.Uid = pid iu.IsPoster = true iu.IsAssigned = iu.Uid == aid - if _, err = orm.Insert(iu); err != nil { + if _, err = x.Insert(iu); err != nil { return err } } @@ -270,7 +270,7 @@ func PairsContains(ius []*IssueUser, issueId int64) int { // GetIssueUserPairs returns issue-user pairs by given repository and user. func GetIssueUserPairs(rid, uid int64, isClosed bool) ([]*IssueUser, error) { ius := make([]*IssueUser, 0, 10) - err := orm.Where("is_closed=?", isClosed).Find(&ius, &IssueUser{RepoId: rid, Uid: uid}) + err := x.Where("is_closed=?", isClosed).Find(&ius, &IssueUser{RepoId: rid, Uid: uid}) return ius, err } @@ -285,7 +285,7 @@ func GetIssueUserPairsByRepoIds(rids []int64, isClosed bool, page int) ([]*Issue cond := strings.TrimSuffix(buf.String(), " OR ") ius := make([]*IssueUser, 0, 10) - sess := orm.Limit(20, (page-1)*20).Where("is_closed=?", isClosed) + sess := x.Limit(20, (page-1)*20).Where("is_closed=?", isClosed) if len(cond) > 0 { sess.And(cond) } @@ -296,7 +296,7 @@ func GetIssueUserPairsByRepoIds(rids []int64, isClosed bool, page int) ([]*Issue // GetIssueUserPairsByMode returns issue-user pairs by given repository and user. func GetIssueUserPairsByMode(uid, rid int64, isClosed bool, page, filterMode int) ([]*IssueUser, error) { ius := make([]*IssueUser, 0, 10) - sess := orm.Limit(20, (page-1)*20).Where("uid=?", uid).And("is_closed=?", isClosed) + sess := x.Limit(20, (page-1)*20).Where("uid=?", uid).And("is_closed=?", isClosed) if rid > 0 { sess.And("repo_id=?", rid) } @@ -335,7 +335,7 @@ func GetIssueStats(rid, uid int64, isShowClosed bool, filterMode int) *IssueStat issue := new(Issue) tmpSess := &xorm.Session{} - sess := orm.Where("repo_id=?", rid) + sess := x.Where("repo_id=?", rid) *tmpSess = *sess stats.OpenCount, _ = tmpSess.And("is_closed=?", false).Count(issue) *tmpSess = *sess @@ -347,7 +347,7 @@ func GetIssueStats(rid, uid int64, isShowClosed bool, filterMode int) *IssueStat } if filterMode != FM_MENTION { - sess = orm.Where("repo_id=?", rid) + sess = x.Where("repo_id=?", rid) switch filterMode { case FM_ASSIGN: sess.And("assignee_id=?", uid) @@ -361,16 +361,16 @@ func GetIssueStats(rid, uid int64, isShowClosed bool, filterMode int) *IssueStat *tmpSess = *sess stats.ClosedCount, _ = tmpSess.And("is_closed=?", true).Count(issue) } else { - sess := orm.Where("repo_id=?", rid).And("uid=?", uid).And("is_mentioned=?", true) + sess := x.Where("repo_id=?", rid).And("uid=?", uid).And("is_mentioned=?", true) *tmpSess = *sess stats.OpenCount, _ = tmpSess.And("is_closed=?", false).Count(new(IssueUser)) *tmpSess = *sess stats.ClosedCount, _ = tmpSess.And("is_closed=?", true).Count(new(IssueUser)) } nofilter: - stats.AssignCount, _ = orm.Where("repo_id=?", rid).And("is_closed=?", isShowClosed).And("assignee_id=?", uid).Count(issue) - stats.CreateCount, _ = orm.Where("repo_id=?", rid).And("is_closed=?", isShowClosed).And("poster_id=?", uid).Count(issue) - stats.MentionCount, _ = orm.Where("repo_id=?", rid).And("uid=?", uid).And("is_closed=?", isShowClosed).And("is_mentioned=?", true).Count(new(IssueUser)) + stats.AssignCount, _ = x.Where("repo_id=?", rid).And("is_closed=?", isShowClosed).And("assignee_id=?", uid).Count(issue) + stats.CreateCount, _ = x.Where("repo_id=?", rid).And("is_closed=?", isShowClosed).And("poster_id=?", uid).Count(issue) + stats.MentionCount, _ = x.Where("repo_id=?", rid).And("uid=?", uid).And("is_closed=?", isShowClosed).And("is_mentioned=?", true).Count(new(IssueUser)) return stats } @@ -378,28 +378,28 @@ nofilter: func GetUserIssueStats(uid int64, filterMode int) *IssueStats { stats := &IssueStats{} issue := new(Issue) - stats.AssignCount, _ = orm.Where("assignee_id=?", uid).And("is_closed=?", false).Count(issue) - stats.CreateCount, _ = orm.Where("poster_id=?", uid).And("is_closed=?", false).Count(issue) + stats.AssignCount, _ = x.Where("assignee_id=?", uid).And("is_closed=?", false).Count(issue) + stats.CreateCount, _ = x.Where("poster_id=?", uid).And("is_closed=?", false).Count(issue) return stats } // UpdateIssue updates information of issue. func UpdateIssue(issue *Issue) error { - _, err := orm.Id(issue.Id).AllCols().Update(issue) + _, err := x.Id(issue.Id).AllCols().Update(issue) return err } // UpdateIssueUserByStatus updates issue-user pairs by issue status. func UpdateIssueUserPairsByStatus(iid int64, isClosed bool) error { rawSql := "UPDATE `issue_user` SET is_closed = ? WHERE issue_id = ?" - _, err := orm.Exec(rawSql, isClosed, iid) + _, err := x.Exec(rawSql, isClosed, iid) return err } // UpdateIssueUserPairByAssignee updates issue-user pair for assigning. func UpdateIssueUserPairByAssignee(aid, iid int64) error { rawSql := "UPDATE `issue_user` SET is_assigned = ? WHERE issue_id = ?" - if _, err := orm.Exec(rawSql, false, iid); err != nil { + if _, err := x.Exec(rawSql, false, iid); err != nil { return err } @@ -408,14 +408,14 @@ func UpdateIssueUserPairByAssignee(aid, iid int64) error { return nil } rawSql = "UPDATE `issue_user` SET is_assigned = true WHERE uid = ? AND issue_id = ?" - _, err := orm.Exec(rawSql, aid, iid) + _, err := x.Exec(rawSql, aid, iid) return err } // UpdateIssueUserPairByRead updates issue-user pair for reading. func UpdateIssueUserPairByRead(uid, iid int64) error { rawSql := "UPDATE `issue_user` SET is_read = ? WHERE uid = ? AND issue_id = ?" - _, err := orm.Exec(rawSql, true, uid, iid) + _, err := x.Exec(rawSql, true, uid, iid) return err } @@ -423,16 +423,16 @@ func UpdateIssueUserPairByRead(uid, iid int64) error { func UpdateIssueUserPairsByMentions(uids []int64, iid int64) error { for _, uid := range uids { iu := &IssueUser{Uid: uid, IssueId: iid} - has, err := orm.Get(iu) + has, err := x.Get(iu) if err != nil { return err } iu.IsMentioned = true if has { - _, err = orm.Id(iu.Id).AllCols().Update(iu) + _, err = x.Id(iu.Id).AllCols().Update(iu) } else { - _, err = orm.Insert(iu) + _, err = x.Insert(iu) } if err != nil { return err @@ -467,7 +467,7 @@ func (m *Label) CalOpenIssues() { // NewLabel creates new label of repository. func NewLabel(l *Label) error { - _, err := orm.Insert(l) + _, err := x.Insert(l) return err } @@ -478,7 +478,7 @@ func GetLabelById(id int64) (*Label, error) { } l := &Label{Id: id} - has, err := orm.Get(l) + has, err := x.Get(l) if err != nil { return nil, err } else if !has { @@ -490,13 +490,13 @@ func GetLabelById(id int64) (*Label, error) { // GetLabels returns a list of labels of given repository ID. func GetLabels(repoId int64) ([]*Label, error) { labels := make([]*Label, 0, 10) - err := orm.Where("repo_id=?", repoId).Find(&labels) + err := x.Where("repo_id=?", repoId).Find(&labels) return labels, err } // UpdateLabel updates label information. func UpdateLabel(l *Label) error { - _, err := orm.Id(l.Id).Update(l) + _, err := x.Id(l.Id).Update(l) return err } @@ -516,7 +516,7 @@ func DeleteLabel(repoId int64, strId string) error { return err } - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -569,7 +569,7 @@ func (m *Milestone) CalOpenIssues() { // NewMilestone creates new milestone of repository. func NewMilestone(m *Milestone) (err error) { - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -591,7 +591,7 @@ func NewMilestone(m *Milestone) (err error) { // GetMilestoneById returns the milestone by given ID. func GetMilestoneById(id int64) (*Milestone, error) { m := &Milestone{Id: id} - has, err := orm.Get(m) + has, err := x.Get(m) if err != nil { return nil, err } else if !has { @@ -603,7 +603,7 @@ func GetMilestoneById(id int64) (*Milestone, error) { // GetMilestoneByIndex returns the milestone of given repository and index. func GetMilestoneByIndex(repoId, idx int64) (*Milestone, error) { m := &Milestone{RepoId: repoId, Index: idx} - has, err := orm.Get(m) + has, err := x.Get(m) if err != nil { return nil, err } else if !has { @@ -615,13 +615,13 @@ func GetMilestoneByIndex(repoId, idx int64) (*Milestone, error) { // GetMilestones returns a list of milestones of given repository and status. func GetMilestones(repoId int64, isClosed bool) ([]*Milestone, error) { miles := make([]*Milestone, 0, 10) - err := orm.Where("repo_id=?", repoId).And("is_closed=?", isClosed).Find(&miles) + err := x.Where("repo_id=?", repoId).And("is_closed=?", isClosed).Find(&miles) return miles, err } // UpdateMilestone updates information of given milestone. func UpdateMilestone(m *Milestone) error { - _, err := orm.Id(m.Id).Update(m) + _, err := x.Id(m.Id).Update(m) return err } @@ -632,7 +632,7 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) { return err } - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -658,7 +658,7 @@ func ChangeMilestoneStatus(m *Milestone, isClosed bool) (err error) { // ChangeMilestoneAssign changes assignment of milestone for issue. func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) { - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -717,7 +717,7 @@ func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) { // DeleteMilestone deletes a milestone. func DeleteMilestone(m *Milestone) (err error) { - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -777,7 +777,7 @@ type Comment struct { // CreateComment creates comment of issue or commit. func CreateComment(userId, repoId, issueId, commitId, line int64, cmtType int, content string) error { - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err := sess.Begin(); err != nil { return err @@ -816,6 +816,6 @@ func CreateComment(userId, repoId, issueId, commitId, line int64, cmtType int, c // GetIssueComments returns list of comment by given issue id. func GetIssueComments(issueId int64) ([]Comment, error) { comments := make([]Comment, 0, 10) - err := orm.Asc("created").Find(&comments, &Comment{IssueId: issueId}) + err := x.Asc("created").Find(&comments, &Comment{IssueId: issueId}) return comments, err } diff --git a/models/login.go b/models/login.go index 863ba44e20..98c5c64e40 100644 --- a/models/login.go +++ b/models/login.go @@ -109,19 +109,19 @@ func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) { } func CreateSource(source *LoginSource) error { - _, err := orm.Insert(source) + _, err := x.Insert(source) return err } func GetAuths() ([]*LoginSource, error) { var auths = make([]*LoginSource, 0, 5) - err := orm.Find(&auths) + err := x.Find(&auths) return auths, err } func GetLoginSourceById(id int64) (*LoginSource, error) { source := new(LoginSource) - has, err := orm.Id(id).Get(source) + has, err := x.Id(id).Get(source) if err != nil { return nil, err } else if !has { @@ -131,19 +131,19 @@ func GetLoginSourceById(id int64) (*LoginSource, error) { } func UpdateSource(source *LoginSource) error { - _, err := orm.Id(source.Id).AllCols().Update(source) + _, err := x.Id(source.Id).AllCols().Update(source) return err } func DelLoginSource(source *LoginSource) error { - cnt, err := orm.Count(&User{LoginSource: source.Id}) + cnt, err := x.Count(&User{LoginSource: source.Id}) if err != nil { return err } if cnt > 0 { return ErrAuthenticationUserUsed } - _, err = orm.Id(source.Id).Delete(&LoginSource{}) + _, err = x.Id(source.Id).Delete(&LoginSource{}) return err } @@ -156,7 +156,7 @@ func UserSignIn(uname, passwd string) (*User, error) { u = &User{LowerName: strings.ToLower(uname)} } - has, err := orm.Get(u) + has, err := x.Get(u) if err != nil { return nil, err } @@ -182,7 +182,7 @@ func UserSignIn(uname, passwd string) (*User, error) { } else { if !has { var sources []LoginSource - if err = orm.UseBool().Find(&sources, + if err = x.UseBool().Find(&sources, &LoginSource{IsActived: true, AllowAutoRegister: true}); err != nil { return nil, err } @@ -209,7 +209,7 @@ func UserSignIn(uname, passwd string) (*User, error) { } var source LoginSource - hasSource, err := orm.Id(u.LoginSource).Get(&source) + hasSource, err := x.Id(u.LoginSource).Get(&source) if err != nil { return nil, err } else if !hasSource { diff --git a/models/models.go b/models/models.go index a59c051712..d6273d7f98 100644 --- a/models/models.go +++ b/models/models.go @@ -18,7 +18,7 @@ import ( ) var ( - orm *xorm.Engine + x *xorm.Engine tables []interface{} HasEngine bool @@ -88,7 +88,7 @@ func NewTestEngine(x *xorm.Engine) (err error) { func SetEngine() (err error) { switch DbCfg.Type { case "mysql": - orm, err = xorm.NewEngine("mysql", fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8", + x, err = xorm.NewEngine("mysql", fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8", DbCfg.User, DbCfg.Pwd, DbCfg.Host, DbCfg.Name)) case "postgres": var host, port = "127.0.0.1", "5432" @@ -99,11 +99,11 @@ func SetEngine() (err error) { if len(fields) > 1 && len(strings.TrimSpace(fields[1])) > 0 { port = fields[1] } - orm, err = xorm.NewEngine("postgres", fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s", + x, err = xorm.NewEngine("postgres", fmt.Sprintf("user=%s password=%s host=%s port=%s dbname=%s sslmode=%s", DbCfg.User, DbCfg.Pwd, host, port, DbCfg.Name, DbCfg.SslMode)) case "sqlite3": os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm) - orm, err = xorm.NewEngine("sqlite3", DbCfg.Path) + x, err = xorm.NewEngine("sqlite3", DbCfg.Path) default: return fmt.Errorf("Unknown database type: %s", DbCfg.Type) } @@ -120,11 +120,11 @@ func SetEngine() (err error) { if err != nil { return fmt.Errorf("models.init(fail to create xorm.log): %v", err) } - orm.Logger = xorm.NewSimpleLogger(f) + x.Logger = xorm.NewSimpleLogger(f) - orm.ShowSQL = true - orm.ShowDebug = true - orm.ShowErr = true + x.ShowSQL = true + x.ShowDebug = true + x.ShowErr = true return nil } @@ -132,7 +132,7 @@ func NewEngine() (err error) { if err = SetEngine(); err != nil { return err } - if err = orm.Sync(tables...); err != nil { + if err = x.Sync2(tables...); err != nil { return fmt.Errorf("sync database struct error: %v\n", err) } return nil @@ -147,24 +147,24 @@ type Statistic struct { } func GetStatistic() (stats Statistic) { - stats.Counter.User, _ = orm.Count(new(User)) - stats.Counter.PublicKey, _ = orm.Count(new(PublicKey)) - stats.Counter.Repo, _ = orm.Count(new(Repository)) - stats.Counter.Watch, _ = orm.Count(new(Watch)) - stats.Counter.Action, _ = orm.Count(new(Action)) - stats.Counter.Access, _ = orm.Count(new(Access)) - stats.Counter.Issue, _ = orm.Count(new(Issue)) - stats.Counter.Comment, _ = orm.Count(new(Comment)) - stats.Counter.Mirror, _ = orm.Count(new(Mirror)) - stats.Counter.Oauth, _ = orm.Count(new(Oauth2)) - stats.Counter.Release, _ = orm.Count(new(Release)) - stats.Counter.LoginSource, _ = orm.Count(new(LoginSource)) - stats.Counter.Webhook, _ = orm.Count(new(Webhook)) - stats.Counter.Milestone, _ = orm.Count(new(Milestone)) + stats.Counter.User, _ = x.Count(new(User)) + stats.Counter.PublicKey, _ = x.Count(new(PublicKey)) + stats.Counter.Repo, _ = x.Count(new(Repository)) + stats.Counter.Watch, _ = x.Count(new(Watch)) + stats.Counter.Action, _ = x.Count(new(Action)) + stats.Counter.Access, _ = x.Count(new(Access)) + stats.Counter.Issue, _ = x.Count(new(Issue)) + stats.Counter.Comment, _ = x.Count(new(Comment)) + stats.Counter.Mirror, _ = x.Count(new(Mirror)) + stats.Counter.Oauth, _ = x.Count(new(Oauth2)) + stats.Counter.Release, _ = x.Count(new(Release)) + stats.Counter.LoginSource, _ = x.Count(new(LoginSource)) + stats.Counter.Webhook, _ = x.Count(new(Webhook)) + stats.Counter.Milestone, _ = x.Count(new(Milestone)) return } // DumpDatabase dumps all data from database to file system. func DumpDatabase(filePath string) error { - return orm.DumpAllToFile(filePath) + return x.DumpAllToFile(filePath) } diff --git a/models/oauth2.go b/models/oauth2.go index 61044d6882..4b024a26e4 100644 --- a/models/oauth2.go +++ b/models/oauth2.go @@ -8,16 +8,16 @@ import ( "errors" ) -// OT: Oauth2 Type +type OauthType int + const ( - OT_GITHUB = iota + 1 - OT_GOOGLE - OT_TWITTER - OT_QQ - OT_WEIBO - OT_BITBUCKET - OT_OSCHINA - OT_FACEBOOK + GITHUB OauthType = iota + 1 + GOOGLE + TWITTER + QQ + WEIBO + BITBUCKET + FACEBOOK ) var ( @@ -35,18 +35,18 @@ type Oauth2 struct { } func BindUserOauth2(userId, oauthId int64) error { - _, err := orm.Id(oauthId).Update(&Oauth2{Uid: userId}) + _, err := x.Id(oauthId).Update(&Oauth2{Uid: userId}) return err } func AddOauth2(oa *Oauth2) error { - _, err := orm.Insert(oa) + _, err := x.Insert(oa) return err } func GetOauth2(identity string) (oa *Oauth2, err error) { oa = &Oauth2{Identity: identity} - isExist, err := orm.Get(oa) + isExist, err := x.Get(oa) if err != nil { return } else if !isExist { @@ -60,7 +60,7 @@ func GetOauth2(identity string) (oa *Oauth2, err error) { func GetOauth2ById(id int64) (oa *Oauth2, err error) { oa = new(Oauth2) - has, err := orm.Id(id).Get(oa) + has, err := x.Id(id).Get(oa) if err != nil { return nil, err } else if !has { @@ -71,18 +71,18 @@ func GetOauth2ById(id int64) (oa *Oauth2, err error) { // GetOauthByUserId returns list of oauthes that are releated to given user. func GetOauthByUserId(uid int64) (oas []*Oauth2, err error) { - err = orm.Find(&oas, Oauth2{Uid: uid}) + err = x.Find(&oas, Oauth2{Uid: uid}) return oas, err } // DeleteOauth2ById deletes a oauth2 by ID. func DeleteOauth2ById(id int64) error { - _, err := orm.Delete(&Oauth2{Id: id}) + _, err := x.Delete(&Oauth2{Id: id}) return err } // CleanUnbindOauth deletes all unbind OAuthes. func CleanUnbindOauth() error { - _, err := orm.Delete(&Oauth2{Uid: -1}) + _, err := x.Delete(&Oauth2{Uid: -1}) return err } diff --git a/models/publickey.go b/models/publickey.go index b0021a6880..35768b4893 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -107,7 +107,7 @@ func saveAuthorizedKeyFile(key *PublicKey) error { // AddPublicKey adds new public key to database and authorized_keys file. func AddPublicKey(key *PublicKey) (err error) { - has, err := orm.Get(key) + has, err := x.Get(key) if err != nil { return err } else if has { @@ -130,11 +130,11 @@ func AddPublicKey(key *PublicKey) (err error) { key.Fingerprint = strings.Split(stdout, " ")[1] // Save SSH key. - if _, err = orm.Insert(key); err != nil { + if _, err = x.Insert(key); err != nil { return err } else if err = saveAuthorizedKeyFile(key); err != nil { // Roll back. - if _, err2 := orm.Delete(key); err2 != nil { + if _, err2 := x.Delete(key); err2 != nil { return err2 } return err @@ -146,7 +146,7 @@ func AddPublicKey(key *PublicKey) (err error) { // ListPublicKey returns a list of all public keys that user has. func ListPublicKey(uid int64) ([]PublicKey, error) { keys := make([]PublicKey, 0, 5) - err := orm.Find(&keys, &PublicKey{OwnerId: uid}) + err := x.Find(&keys, &PublicKey{OwnerId: uid}) return keys, err } @@ -205,14 +205,14 @@ func rewriteAuthorizedKeys(key *PublicKey, p, tmpP string) error { // DeletePublicKey deletes SSH key information both in database and authorized_keys file. func DeletePublicKey(key *PublicKey) error { - has, err := orm.Get(key) + has, err := x.Get(key) if err != nil { return err } else if !has { return ErrKeyNotExist } - if _, err = orm.Delete(key); err != nil { + if _, err = x.Delete(key); err != nil { return err } diff --git a/models/release.go b/models/release.go index 32e8c92cc4..3e1a78118c 100644 --- a/models/release.go +++ b/models/release.go @@ -43,7 +43,7 @@ func IsReleaseExist(repoId int64, tagName string) (bool, error) { return false, nil } - return orm.Get(&Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)}) + return x.Get(&Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)}) } func createTag(gitRepo *git.Repository, rel *Release) error { @@ -86,7 +86,7 @@ func CreateRelease(gitRepo *git.Repository, rel *Release) error { return err } rel.LowerTagName = strings.ToLower(rel.TagName) - _, err = orm.InsertOne(rel) + _, err = x.InsertOne(rel) return err } @@ -100,13 +100,13 @@ func GetRelease(repoId int64, tagName string) (*Release, error) { } rel := &Release{RepoId: repoId, LowerTagName: strings.ToLower(tagName)} - _, err = orm.Get(rel) + _, err = x.Get(rel) return rel, err } // GetReleasesByRepoId returns a list of releases of repository. func GetReleasesByRepoId(repoId int64) (rels []*Release, err error) { - err = orm.Desc("created").Find(&rels, Release{RepoId: repoId}) + err = x.Desc("created").Find(&rels, Release{RepoId: repoId}) return rels, err } @@ -141,6 +141,6 @@ func UpdateRelease(gitRepo *git.Repository, rel *Release) (err error) { if err = createTag(gitRepo, rel); err != nil { return err } - _, err = orm.Id(rel.Id).AllCols().Update(rel) + _, err = x.Id(rel.Id).AllCols().Update(rel) return err } diff --git a/models/repo.go b/models/repo.go index 6b98d0e409..4ccaccbf81 100644 --- a/models/repo.go +++ b/models/repo.go @@ -147,7 +147,7 @@ func (repo *Repository) GetOwner() (err error) { // IsRepositoryExist returns true if the repository with given name under user has already existed. func IsRepositoryExist(u *User, repoName string) (bool, error) { repo := Repository{OwnerId: u.Id} - has, err := orm.Where("lower_name = ?", strings.ToLower(repoName)).Get(&repo) + has, err := x.Where("lower_name = ?", strings.ToLower(repoName)).Get(&repo) if err != nil { return has, err } else if !has { @@ -197,7 +197,7 @@ func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) er return errors.New("git clone --mirror: " + stderr) } - if _, err = orm.InsertOne(&Mirror{ + if _, err = x.InsertOne(&Mirror{ RepoId: repoId, RepoName: strings.ToLower(userName + "/" + repoName), Interval: 24, @@ -211,7 +211,7 @@ func MirrorRepository(repoId int64, userName, repoName, repoPath, url string) er func GetMirror(repoId int64) (*Mirror, error) { m := &Mirror{RepoId: repoId} - has, err := orm.Get(m) + has, err := x.Get(m) if err != nil { return nil, err } else if !has { @@ -221,13 +221,13 @@ func GetMirror(repoId int64) (*Mirror, error) { } func UpdateMirror(m *Mirror) error { - _, err := orm.Id(m.Id).Update(m) + _, err := x.Id(m.Id).Update(m) return err } // MirrorUpdate checks and updates mirror repositories. func MirrorUpdate() { - if err := orm.Iterate(new(Mirror), func(idx int, bean interface{}) error { + if err := x.Iterate(new(Mirror), func(idx int, bean interface{}) error { m := bean.(*Mirror) if m.NextUpdate.After(time.Now()) { return nil @@ -481,7 +481,7 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir repoPath := RepoPath(user.Name, repo.Name) - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() sess.Begin() @@ -566,13 +566,13 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir // It also auto-gets corresponding users. func GetRepositoriesWithUsers(num, offset int) ([]*Repository, error) { repos := make([]*Repository, 0, num) - if err := orm.Limit(num, offset).Asc("id").Find(&repos); err != nil { + if err := x.Limit(num, offset).Asc("id").Find(&repos); err != nil { return nil, err } for _, repo := range repos { repo.Owner = &User{Id: repo.OwnerId} - has, err := orm.Get(repo.Owner) + has, err := x.Get(repo.Owner) if err != nil { return nil, err } else if !has { @@ -597,11 +597,11 @@ func TransferOwnership(user *User, newOwner string, repo *Repository) (err error // Update accesses. accesses := make([]Access, 0, 10) - if err = orm.Find(&accesses, &Access{RepoName: user.LowerName + "/" + repo.LowerName}); err != nil { + if err = x.Find(&accesses, &Access{RepoName: user.LowerName + "/" + repo.LowerName}); err != nil { return err } - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -662,11 +662,11 @@ func TransferOwnership(user *User, newOwner string, repo *Repository) (err error func ChangeRepositoryName(userName, oldRepoName, newRepoName string) (err error) { // Update accesses. accesses := make([]Access, 0, 10) - if err = orm.Find(&accesses, &Access{RepoName: strings.ToLower(userName + "/" + oldRepoName)}); err != nil { + if err = x.Find(&accesses, &Access{RepoName: strings.ToLower(userName + "/" + oldRepoName)}); err != nil { return err } - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -697,21 +697,21 @@ func UpdateRepository(repo *Repository) error { if len(repo.Website) > 255 { repo.Website = repo.Website[:255] } - _, err := orm.Id(repo.Id).AllCols().Update(repo) + _, err := x.Id(repo.Id).AllCols().Update(repo) return err } // DeleteRepository deletes a repository for a user or orgnaztion. func DeleteRepository(userId, repoId int64, userName string) (err error) { repo := &Repository{Id: repoId, OwnerId: userId} - has, err := orm.Get(repo) + has, err := x.Get(repo) if err != nil { return err } else if !has { return ErrRepoNotExist } - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -750,7 +750,7 @@ func DeleteRepository(userId, repoId int64, userName string) (err error) { } // Delete comments. - if err = orm.Iterate(&Issue{RepoId: repoId}, func(idx int, bean interface{}) error { + if err = x.Iterate(&Issue{RepoId: repoId}, func(idx int, bean interface{}) error { issue := bean.(*Issue) if _, err = sess.Delete(&Comment{IssueId: issue.Id}); err != nil { sess.Rollback() @@ -785,7 +785,7 @@ func GetRepositoryByName(userId int64, repoName string) (*Repository, error) { OwnerId: userId, LowerName: strings.ToLower(repoName), } - has, err := orm.Get(repo) + has, err := x.Get(repo) if err != nil { return nil, err } else if !has { @@ -797,7 +797,7 @@ func GetRepositoryByName(userId int64, repoName string) (*Repository, error) { // GetRepositoryById returns the repository by given id if exists. func GetRepositoryById(id int64) (*Repository, error) { repo := &Repository{} - has, err := orm.Id(id).Get(repo) + has, err := x.Id(id).Get(repo) if err != nil { return nil, err } else if !has { @@ -809,7 +809,7 @@ func GetRepositoryById(id int64) (*Repository, error) { // GetRepositories returns a list of repositories of given user. func GetRepositories(uid int64, private bool) ([]*Repository, error) { repos := make([]*Repository, 0, 10) - sess := orm.Desc("updated") + sess := x.Desc("updated") if !private { sess.Where("is_private=?", false) } @@ -820,19 +820,19 @@ func GetRepositories(uid int64, private bool) ([]*Repository, error) { // GetRecentUpdatedRepositories returns the list of repositories that are recently updated. func GetRecentUpdatedRepositories() (repos []*Repository, err error) { - err = orm.Where("is_private=?", false).Limit(5).Desc("updated").Find(&repos) + err = x.Where("is_private=?", false).Limit(5).Desc("updated").Find(&repos) return repos, err } // GetRepositoryCount returns the total number of repositories of user. func GetRepositoryCount(user *User) (int64, error) { - return orm.Count(&Repository{OwnerId: user.Id}) + return x.Count(&Repository{OwnerId: user.Id}) } // GetCollaboratorNames returns a list of user name of repository's collaborators. func GetCollaboratorNames(repoName string) ([]string, error) { accesses := make([]*Access, 0, 10) - if err := orm.Find(&accesses, &Access{RepoName: strings.ToLower(repoName)}); err != nil { + if err := x.Find(&accesses, &Access{RepoName: strings.ToLower(repoName)}); err != nil { return nil, err } @@ -847,7 +847,7 @@ func GetCollaboratorNames(repoName string) ([]string, error) { func GetCollaborativeRepos(uname string) ([]*Repository, error) { uname = strings.ToLower(uname) accesses := make([]*Access, 0, 10) - if err := orm.Find(&accesses, &Access{UserName: uname}); err != nil { + if err := x.Find(&accesses, &Access{UserName: uname}); err != nil { return nil, err } @@ -876,7 +876,7 @@ func GetCollaborativeRepos(uname string) ([]*Repository, error) { // GetCollaborators returns a list of users of repository's collaborators. func GetCollaborators(repoName string) (us []*User, err error) { accesses := make([]*Access, 0, 10) - if err = orm.Find(&accesses, &Access{RepoName: strings.ToLower(repoName)}); err != nil { + if err = x.Find(&accesses, &Access{RepoName: strings.ToLower(repoName)}); err != nil { return nil, err } @@ -900,18 +900,18 @@ type Watch struct { // Watch or unwatch repository. func WatchRepo(uid, rid int64, watch bool) (err error) { if watch { - if _, err = orm.Insert(&Watch{RepoId: rid, UserId: uid}); err != nil { + if _, err = x.Insert(&Watch{RepoId: rid, UserId: uid}); err != nil { return err } rawSql := "UPDATE `repository` SET num_watches = num_watches + 1 WHERE id = ?" - _, err = orm.Exec(rawSql, rid) + _, err = x.Exec(rawSql, rid) } else { - if _, err = orm.Delete(&Watch{0, uid, rid}); err != nil { + if _, err = x.Delete(&Watch{0, uid, rid}); err != nil { return err } rawSql := "UPDATE `repository` SET num_watches = num_watches - 1 WHERE id = ?" - _, err = orm.Exec(rawSql, rid) + _, err = x.Exec(rawSql, rid) } return err } @@ -919,7 +919,7 @@ func WatchRepo(uid, rid int64, watch bool) (err error) { // GetWatchers returns all watchers of given repository. func GetWatchers(rid int64) ([]*Watch, error) { watches := make([]*Watch, 0, 10) - err := orm.Find(&watches, &Watch{RepoId: rid}) + err := x.Find(&watches, &Watch{RepoId: rid}) return watches, err } @@ -933,7 +933,7 @@ func NotifyWatchers(act *Action) error { // Add feed for actioner. act.UserId = act.ActUserId - if _, err = orm.InsertOne(act); err != nil { + if _, err = x.InsertOne(act); err != nil { return errors.New("repo.NotifyWatchers(create action): " + err.Error()) } @@ -944,7 +944,7 @@ func NotifyWatchers(act *Action) error { act.Id = 0 act.UserId = watches[i].UserId - if _, err = orm.InsertOne(act); err != nil { + if _, err = x.InsertOne(act); err != nil { return errors.New("repo.NotifyWatchers(create action): " + err.Error()) } } @@ -953,7 +953,7 @@ func NotifyWatchers(act *Action) error { // IsWatching checks if user has watched given repository. func IsWatching(uid, rid int64) bool { - has, _ := orm.Get(&Watch{0, uid, rid}) + has, _ := x.Get(&Watch{0, uid, rid}) return has } diff --git a/models/user.go b/models/user.go index 04ea1fd692..50d81c942d 100644 --- a/models/user.go +++ b/models/user.go @@ -110,7 +110,7 @@ func IsUserExist(name string) (bool, error) { if len(name) == 0 { return false, nil } - return orm.Get(&User{LowerName: strings.ToLower(name)}) + return x.Get(&User{LowerName: strings.ToLower(name)}) } // IsEmailUsed returns true if the e-mail has been used. @@ -118,7 +118,7 @@ func IsEmailUsed(email string) (bool, error) { if len(email) == 0 { return false, nil } - return orm.Get(&User{Email: email}) + return x.Get(&User{Email: email}) } // GetUserSalt returns a user salt token @@ -153,10 +153,10 @@ func RegisterUser(user *User) (*User, error) { user.Rands = GetUserSalt() user.Salt = GetUserSalt() user.EncodePasswd() - if _, err = orm.Insert(user); err != nil { + if _, err = x.Insert(user); err != nil { return nil, err } else if err = os.MkdirAll(UserPath(user.Name), os.ModePerm); err != nil { - if _, err := orm.Id(user.Id).Delete(&User{}); err != nil { + if _, err := x.Id(user.Id).Delete(&User{}); err != nil { return nil, errors.New(fmt.Sprintf( "both create userpath %s and delete table record faild: %v", user.Name, err)) } @@ -166,7 +166,7 @@ func RegisterUser(user *User) (*User, error) { if user.Id == 1 { user.IsAdmin = true user.IsActive = true - _, err = orm.Id(user.Id).UseBool().Update(user) + _, err = x.Id(user.Id).UseBool().Update(user) } return user, err } @@ -174,7 +174,7 @@ func RegisterUser(user *User) (*User, error) { // GetUsers returns given number of user objects with offset. func GetUsers(num, offset int) ([]User, error) { users := make([]User, 0, num) - err := orm.Limit(num, offset).Asc("id").Find(&users) + err := x.Limit(num, offset).Asc("id").Find(&users) return users, err } @@ -218,11 +218,11 @@ func ChangeUserName(user *User, newUserName string) (err error) { // Update accesses of user. accesses := make([]Access, 0, 10) - if err = orm.Find(&accesses, &Access{UserName: user.LowerName}); err != nil { + if err = x.Find(&accesses, &Access{UserName: user.LowerName}); err != nil { return err } - sess := orm.NewSession() + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { return err @@ -245,7 +245,7 @@ func ChangeUserName(user *User, newUserName string) (err error) { for i := range repos { accesses = make([]Access, 0, 10) // Update accesses of user repository. - if err = orm.Find(&accesses, &Access{RepoName: user.LowerName + "/" + repos[i].LowerName}); err != nil { + if err = x.Find(&accesses, &Access{RepoName: user.LowerName + "/" + repos[i].LowerName}); err != nil { return err } @@ -278,7 +278,7 @@ func UpdateUser(u *User) (err error) { u.Website = u.Website[:255] } - _, err = orm.Id(u.Id).AllCols().Update(u) + _, err = x.Id(u.Id).AllCols().Update(u) return err } @@ -295,33 +295,33 @@ func DeleteUser(user *User) error { // TODO: check issues, other repos' commits // Delete all followers. - if _, err = orm.Delete(&Follow{FollowId: user.Id}); err != nil { + if _, err = x.Delete(&Follow{FollowId: user.Id}); err != nil { return err } // Delete oauth2. - if _, err = orm.Delete(&Oauth2{Uid: user.Id}); err != nil { + if _, err = x.Delete(&Oauth2{Uid: user.Id}); err != nil { return err } // Delete all feeds. - if _, err = orm.Delete(&Action{UserId: user.Id}); err != nil { + if _, err = x.Delete(&Action{UserId: user.Id}); err != nil { return err } // Delete all watches. - if _, err = orm.Delete(&Watch{UserId: user.Id}); err != nil { + if _, err = x.Delete(&Watch{UserId: user.Id}); err != nil { return err } // Delete all accesses. - if _, err = orm.Delete(&Access{UserName: user.LowerName}); err != nil { + if _, err = x.Delete(&Access{UserName: user.LowerName}); err != nil { return err } // Delete all SSH keys. keys := make([]*PublicKey, 0, 10) - if err = orm.Find(&keys, &PublicKey{OwnerId: user.Id}); err != nil { + if err = x.Find(&keys, &PublicKey{OwnerId: user.Id}); err != nil { return err } for _, key := range keys { @@ -335,7 +335,13 @@ func DeleteUser(user *User) error { return err } - _, err = orm.Delete(user) + _, err = x.Delete(user) + return err +} + +// DeleteInactivateUsers deletes all inactivate users. +func DeleteInactivateUsers() error { + _, err := x.Where("is_active=?", false).Delete(new(User)) return err } @@ -347,7 +353,7 @@ func UserPath(userName string) string { func GetUserByKeyId(keyId int64) (*User, error) { user := new(User) rawSql := "SELECT a.* FROM `user` AS a, public_key AS b WHERE a.id = b.owner_id AND b.id=?" - has, err := orm.Sql(rawSql, keyId).Get(user) + has, err := x.Sql(rawSql, keyId).Get(user) if err != nil { return nil, err } else if !has { @@ -359,7 +365,7 @@ func GetUserByKeyId(keyId int64) (*User, error) { // GetUserById returns the user object by given ID if exists. func GetUserById(id int64) (*User, error) { u := new(User) - has, err := orm.Id(id).Get(u) + has, err := x.Id(id).Get(u) if err != nil { return nil, err } else if !has { @@ -374,7 +380,7 @@ func GetUserByName(name string) (*User, error) { return nil, ErrUserNotExist } user := &User{LowerName: strings.ToLower(name)} - has, err := orm.Get(user) + has, err := x.Get(user) if err != nil { return nil, err } else if !has { @@ -415,7 +421,7 @@ func GetUserByEmail(email string) (*User, error) { return nil, ErrUserNotExist } user := &User{Email: strings.ToLower(email)} - has, err := orm.Get(user) + has, err := x.Get(user) if err != nil { return nil, err } else if !has { @@ -439,7 +445,7 @@ func SearchUserByName(key string, limit int) (us []*User, err error) { key = strings.ToLower(key) us = make([]*User, 0, limit) - err = orm.Limit(limit).Where("lower_name like '%" + key + "%'").Find(&us) + err = x.Limit(limit).Where("lower_name like '%" + key + "%'").Find(&us) return us, err } @@ -452,7 +458,7 @@ type Follow struct { // FollowUser marks someone be another's follower. func FollowUser(userId int64, followId int64) (err error) { - session := orm.NewSession() + session := x.NewSession() defer session.Close() session.Begin() @@ -477,7 +483,7 @@ func FollowUser(userId int64, followId int64) (err error) { // UnFollowUser unmarks someone be another's follower. func UnFollowUser(userId int64, unFollowId int64) (err error) { - session := orm.NewSession() + session := x.NewSession() defer session.Close() session.Begin() diff --git a/models/webhook.go b/models/webhook.go index ffd47c8f9b..9044befba2 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -68,14 +68,14 @@ func (w *Webhook) HasPushEvent() bool { // CreateWebhook creates a new web hook. func CreateWebhook(w *Webhook) error { - _, err := orm.Insert(w) + _, err := x.Insert(w) return err } // GetWebhookById returns webhook by given ID. func GetWebhookById(hookId int64) (*Webhook, error) { w := &Webhook{Id: hookId} - has, err := orm.Get(w) + has, err := x.Get(w) if err != nil { return nil, err } else if !has { @@ -86,25 +86,25 @@ func GetWebhookById(hookId int64) (*Webhook, error) { // GetActiveWebhooksByRepoId returns all active webhooks of repository. func GetActiveWebhooksByRepoId(repoId int64) (ws []*Webhook, err error) { - err = orm.Find(&ws, &Webhook{RepoId: repoId, IsActive: true}) + err = x.Find(&ws, &Webhook{RepoId: repoId, IsActive: true}) return ws, err } // GetWebhooksByRepoId returns all webhooks of repository. func GetWebhooksByRepoId(repoId int64) (ws []*Webhook, err error) { - err = orm.Find(&ws, &Webhook{RepoId: repoId}) + err = x.Find(&ws, &Webhook{RepoId: repoId}) return ws, err } // UpdateWebhook updates information of webhook. func UpdateWebhook(w *Webhook) error { - _, err := orm.AllCols().Update(w) + _, err := x.AllCols().Update(w) return err } // DeleteWebhook deletes webhook of repository. func DeleteWebhook(hookId int64) error { - _, err := orm.Delete(&Webhook{Id: hookId}) + _, err := x.Delete(&Webhook{Id: hookId}) return err } @@ -174,20 +174,20 @@ func CreateHookTask(t *HookTask) error { return err } t.PayloadContent = string(data) - _, err = orm.Insert(t) + _, err = x.Insert(t) return err } // UpdateHookTask updates information of hook task. func UpdateHookTask(t *HookTask) error { - _, err := orm.AllCols().Update(t) + _, err := x.AllCols().Update(t) return err } // DeliverHooks checks and delivers undelivered hooks. func DeliverHooks() { timeout := time.Duration(setting.WebhookDeliverTimeout) * time.Second - orm.Where("is_deliveried=?", false).Iterate(new(HookTask), + x.Where("is_deliveried=?", false).Iterate(new(HookTask), func(idx int, bean interface{}) error { t := bean.(*HookTask) // Only support JSON now. diff --git a/modules/auth/user.go b/modules/auth/user.go index 3763c0fc64..fdbba31af5 100644 --- a/modules/auth/user.go +++ b/modules/auth/user.go @@ -16,20 +16,32 @@ import ( "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware/binding" + "github.com/gogits/gogs/modules/setting" ) // SignedInId returns the id of signed in user. -func SignedInId(sess session.SessionStore) int64 { +func SignedInId(header http.Header, sess session.SessionStore) int64 { if !models.HasEngine { return 0 } - uid := sess.Get("userId") - if uid == nil { - return 0 + id, _ := base.StrTo(header.Get(setting.ReverseProxyAuthUid)).Int64() + if id <= 0 { + uid := sess.Get("userId") + if uid == nil { + return 0 + } + var ok bool + if id, ok = uid.(int64); !ok { + return 0 + } } - if id, ok := uid.(int64); ok { + + if id > 0 { if _, err := models.GetUserById(id); err != nil { + if err != models.ErrUserNotExist { + log.Error("auth.user.SignedInId(GetUserById): %v", err) + } return 0 } return id @@ -37,21 +49,9 @@ func SignedInId(sess session.SessionStore) int64 { return 0 } -// SignedInName returns the name of signed in user. -func SignedInName(sess session.SessionStore) string { - uname := sess.Get("userName") - if uname == nil { - return "" - } - if s, ok := uname.(string); ok { - return s - } - return "" -} - // SignedInUser returns the user object of signed user. -func SignedInUser(sess session.SessionStore) *models.User { - uid := SignedInId(sess) +func SignedInUser(header http.Header, sess session.SessionStore) *models.User { + uid := SignedInId(header, sess) if uid <= 0 { return nil } @@ -65,8 +65,8 @@ func SignedInUser(sess session.SessionStore) *models.User { } // IsSignedIn check if any user has signed in. -func IsSignedIn(sess session.SessionStore) bool { - return SignedInId(sess) > 0 +func IsSignedIn(header http.Header, sess session.SessionStore) bool { + return SignedInId(header, sess) > 0 } type FeedsForm struct { diff --git a/modules/bin/conf.go b/modules/bin/conf.go index 801395365d..71a9fac815 100644 --- a/modules/bin/conf.go +++ b/modules/bin/conf.go @@ -29,233 +29,241 @@ func conf_app_ini() ([]byte, error) { return bindata_read([]byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb4, 0x59, 0xdd, 0x72, 0xdb, 0xc8, 0xb1, 0xbe, 0xc7, 0x53, 0x8c, 0x79, 0x76, 0xcf, - 0xda, 0xa7, 0x24, 0x92, 0x92, 0x8f, 0x65, 0xad, 0xb4, 0xae, 0x98, 0x22, - 0x41, 0x09, 0xb1, 0x48, 0x6a, 0x01, 0x48, 0x8e, 0xe3, 0x52, 0xa1, 0x20, - 0x60, 0x48, 0x4e, 0x04, 0x60, 0x20, 0xcc, 0x50, 0x14, 0x73, 0x97, 0x57, - 0x48, 0xe5, 0x69, 0xf2, 0x3c, 0xb9, 0xc8, 0x63, 0xe4, 0xeb, 0x01, 0x40, - 0x81, 0x34, 0xd7, 0xeb, 0xfc, 0x55, 0x52, 0x16, 0x31, 0xd3, 0xd3, 0xd3, - 0xfd, 0xf5, 0xff, 0xec, 0x29, 0xeb, 0xe5, 0x39, 0xcb, 0xc2, 0x94, 0x33, - 0x3d, 0x0f, 0x35, 0x53, 0x73, 0xb9, 0x54, 0x4c, 0x66, 0x8c, 0x3f, 0xf2, - 0x62, 0xc5, 0xf2, 0x70, 0x86, 0x0d, 0xa1, 0x13, 0x6e, 0xf5, 0xae, 0xae, - 0x82, 0x71, 0x6f, 0x64, 0xb3, 0x77, 0xec, 0x5c, 0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9, 0x53, - 0x98, 0xe6, 0x09, 0x6f, 0x47, 0x32, 0xb5, 0xfa, 0xb6, 0xeb, 0x07, 0x43, - 0xe7, 0x92, 0x94, 0x69, 0x4a, 0xd1, 0x31, 0x6c, 0x73, 0x9e, 0x5a, 0x1f, - 0xec, 0x4f, 0x3b, 0x09, 0xee, 0xf9, 0xca, 0xec, 0x9f, 0xb2, 0xeb, 0x3c, - 0x87, 0xab, 0x24, 0x80, 0x2b, 0x61, 0x72, 0xca, 0x34, 0x07, 0x77, 0x52, - 0x38, 0xcc, 0x62, 0x28, 0x0d, 0x51, 0x22, 0x36, 0x15, 0xc0, 0x94, 0x54, - 0x06, 0x79, 0xc3, 0x75, 0xe0, 0x63, 0x66, 0x95, 0x2d, 0xe1, 0x6c, 0xdc, - 0x38, 0x35, 0x2d, 0xf3, 0x27, 0x1e, 0x2d, 0x34, 0x8f, 0x2d, 0xcf, 0xef, - 0xf9, 0x4e, 0x3f, 0x30, 0x66, 0xbf, 0xea, 0xf9, 0x17, 0x64, 0x42, 0xeb, - 0x73, 0x1c, 0xea, 0x10, 0xbe, 0xc3, 0x6f, 0x1b, 0x7e, 0x9a, 0xae, 0xd4, - 0x43, 0x62, 0x3c, 0x15, 0x1a, 0xce, 0x0a, 0xae, 0x4a, 0x6f, 0xc5, 0xa2, - 0xd0, 0xfc, 0x35, 0x36, 0x84, 0xfe, 0x41, 0x91, 0xdb, 0x17, 0x2c, 0x9a, - 0x4b, 0x0a, 0x96, 0xc1, 0x59, 0xed, 0x87, 0xe6, 0xac, 0x75, 0x31, 0xf1, - 0xc8, 0x0b, 0x0e, 0x0e, 0xdf, 0xb6, 0xbb, 0xf8, 0xdf, 0xc1, 0xc9, 0xeb, - 0xd7, 0xdd, 0x23, 0xab, 0x0a, 0x37, 0xb2, 0x92, 0x55, 0x05, 0x48, 0x21, - 0xa5, 0xb6, 0xae, 0x7a, 0x9e, 0xf7, 0x71, 0xc0, 0xde, 0x41, 0x84, 0x21, - 0x5d, 0xd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x1f, 0x46, 0x88, 0xb3, 0xf0, 0x11, 0x6e, 0x03, 0x59, 0x14, - 0xcb, 0x45, 0xa4, 0x17, 0x05, 0xb7, 0xec, 0xb1, 0xb9, 0xb7, 0xdf, 0xeb, - 0x5f, 0xd8, 0x41, 0xef, 0x06, 0xc6, 0x77, 0x1b, 0xa7, 0x46, 0x84, 0x01, - 0x94, 0x11, 0x53, 0x11, 0x95, 0xfa, 0x57, 0xf4, 0xe3, 0x89, 0xef, 0x0c, - 0x3f, 0x05, 0x84, 0xc1, 0x9a, 0xdc, 0xfa, 0xbc, 0xe4, 0x77, 0x73, 0x29, - 0xef, 0x29, 0x26, 0xfb, 0x05, 0x8a, 0x97, 0x0e, 0xd5, 0x3d, 0x84, 0x85, - 0xfa, 0x8f, 0x61, 0x42, 0x52, 0x43, 0x7d, 0xc4, 0xb4, 0xb2, 0xfc, 0x9e, - 0xf7, 0x21, 0x70, 0xc6, 0xc0, 0xf1, 0xa6, 0x47, 0x0c, 0x0e, 0x08, 0x38, - 0x9e, 0x08, 0x44, 0x04, 0xca, 0x5c, 0xca, 0xe5, 0x42, 0x13, 0x39, 0x9c, - 0x59, 0x66, 0xb1, 0xb2, 0x06, 0x36, 0x19, 0xce, 0x0d, 0x7c, 0x67, 0x64, - 0x23, 0xbd, 0xe2, 0xc0, 0x1b, 0xdc, 0x46, 0x06, 0xa2, 0x9a, 0x51, 0x8a, - 0x34, 0x68, 0x88, 0x7d, 0xb6, 0x98, 0x4e, 0x4d, 0x36, 0xca, 0x66, 0xc8, - 0x2b, 0x48, 0x47, 0x11, 0xea, 0x5e, 0xc6, 0x93, 0x3d, 0x76, 0xcf, 0x79, - 0x4e, 0xe5, 0x0f, 0x08, 0x08, 0x93, 0x7d, 0xaa, 0x3a, 0x18, 0xcb, 0xec, - 0x07, 0xcd, 0xee, 0x33, 0x58, 0x6c, 0x49, 0xf5, 0xd7, 0x6c, 0xb6, 0x11, - 0x00, 0xe3, 0x41, 0x70, 0x76, 0x3d, 0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c, 0x7a, 0x2a, 0xf1, 0x9a, - 0xd0, 0xad, 0xf3, 0xf2, 0x36, 0x7c, 0xcf, 0x8f, 0xa8, 0x0d, 0x08, 0x37, - 0x5f, 0x53, 0xd9, 0xc6, 0xc3, 0xa6, 0x35, 0x70, 0x89, 0x7b, 0x49, 0x78, - 0x86, 0x93, 0x31, 0xfd, 0x37, 0x8a, 0x27, 0x59, 0xa4, 0xa5, 0x84, 0x27, - 0xe6, 0x61, 0xf4, 0x84, 0xfe, 0x79, 0xbf, 0x7e, 0xb1, 0x37, 0xe9, 0xe7, - 0x37, 0xc8, 0xce, 0x05, 0x3a, 0x89, 0x77, 0x0b, 0x3d, 0x3d, 0xb6, 0xc8, - 0x79, 0x88, 0xc9, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x1e, 0x92, - 0x4d, 0xf7, 0x18, 0x00, 0x00, + 0xda, 0xa7, 0x24, 0x92, 0x92, 0x8f, 0x65, 0xaf, 0xbc, 0xae, 0x63, 0x8a, + 0x04, 0x25, 0x1c, 0xf3, 0x47, 0x0b, 0x40, 0xf2, 0x2a, 0x2e, 0x15, 0x0a, + 0x02, 0x86, 0xe4, 0x44, 0x00, 0x06, 0xc2, 0x0c, 0x45, 0x31, 0x77, 0x79, + 0x85, 0x54, 0x9e, 0x26, 0xcf, 0x93, 0x8b, 0x3c, 0x46, 0xbe, 0x1e, 0x00, + 0x14, 0x28, 0x73, 0xb5, 0xce, 0x5f, 0x25, 0x65, 0x11, 0xf3, 0xd3, 0xd3, + 0xdd, 0xf3, 0xf5, 0xd7, 0xdd, 0xb3, 0xef, 0x59, 0x2f, 0xcf, 0x59, 0x16, + 0xa6, 0x9c, 0xe9, 0x45, 0xa8, 0x99, 0x5a, 0xc8, 0x95, 0x62, 0x32, 0x63, + 0xfc, 0x9e, 0x17, 0x6b, 0x96, 0x87, 0x73, 0x4c, 0x08, 0x9d, 0x70, 0xab, + 0x77, 0x7e, 0x1e, 0x4c, 0x7a, 0x63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+ 0x08, 0x34, 0x31, 0xd3, 0xcf, 0xc9, 0x39, 0x7c, 0x87, 0x74, 0x12, 0x66, + 0x10, 0xc8, 0x7e, 0xfa, 0x09, 0x5f, 0x7b, 0x0c, 0xf1, 0x3c, 0x3e, 0x31, + 0x72, 0x3d, 0xe7, 0x77, 0x60, 0xa8, 0x33, 0x67, 0x68, 0x1e, 0x2b, 0xdf, + 0x99, 0x80, 0x9d, 0xa7, 0x54, 0xef, 0x91, 0xd5, 0x31, 0x2a, 0xeb, 0xf5, + 0xd7, 0x76, 0x0d, 0xd0, 0x3e, 0x5f, 0x7d, 0x65, 0x99, 0xfd, 0x90, 0x0b, + 0x64, 0x14, 0xf3, 0x64, 0x43, 0xea, 0x90, 0x00, 0xd2, 0xe5, 0x65, 0xcc, + 0x13, 0x4e, 0x0f, 0x07, 0x33, 0x7a, 0x4f, 0x48, 0xa1, 0x36, 0xad, 0xd8, + 0x76, 0xd7, 0x5b, 0xa3, 0xcc, 0xe6, 0x61, 0xa7, 0x81, 0x80, 0x6c, 0xd7, + 0xf5, 0x67, 0x8d, 0xfb, 0xa4, 0xe7, 0x9b, 0x2a, 0xeb, 0x97, 0x29, 0x9f, + 0xde, 0x3e, 0xca, 0x57, 0xee, 0xca, 0x21, 0x29, 0x28, 0x28, 0x9c, 0xf3, + 0x1d, 0xe4, 0xee, 0xda, 0x48, 0x2e, 0x13, 0x34, 0xa4, 0x01, 0x28, 0x67, + 0xec, 0x35, 0x5f, 0x58, 0x7d, 0xec, 0x47, 0x1c, 0x16, 0x1b, 0xd9, 0xab, + 0x05, 0xcf, 0x9a, 0xe5, 0x05, 0x84, 0x24, 0x38, 0xee, 0x39, 0xa9, 0xcd, + 0x74, 0x51, 0x85, 0x8c, 0x8e, 0x72, 0x0a, 0x87, 0x65, 0x26, 0x1e, 0x4a, + 0x5e, 0x58, 0xc6, 0xf9, 0x93, 0x98, 0xa0, 0x25, 0xcd, 0x77, 0x6b, 0x7c, + 0x43, 0xc0, 0x59, 0xb3, 0x9a, 0xa9, 0x5f, 0x9e, 0x37, 0x2f, 0x7a, 0x86, + 0x66, 0x9e, 0xf8, 0x89, 0x06, 0xb7, 0xfc, 0xf4, 0x5c, 0x67, 0xbe, 0xad, + 0xc2, 0x40, 0x84, 0xf3, 0x0c, 0x07, 0x8a, 0xa8, 0x76, 0x5e, 0xd9, 0x54, + 0x1b, 0x9a, 0x6c, 0x35, 0xba, 0xf8, 0x67, 0x17, 0x3e, 0x69, 0xeb, 0xb7, + 0xbb, 0xf4, 0x6f, 0xef, 0xc4, 0xcb, 0x1b, 0xe6, 0x54, 0x51, 0x80, 0xff, + 0xa2, 0x30, 0x63, 0x37, 0x64, 0x26, 0x27, 0xf7, 0xa1, 0x48, 0xe2, 0x15, + 0x27, 0x7e, 0x69, 0x1d, 0x7c, 0x6c, 0x3c, 0x42, 0xb7, 0xf6, 0x5a, 0x87, + 0x5b, 0xdf, 0xd7, 0x74, 0x2f, 0x36, 0x3d, 0x95, 0x78, 0x4d, 0xd7, 0x6d, + 0x78, 0xf9, 0xa9, 0xfb, 0x1e, 0x1f, 0x84, 0x1b, 0x2e, 0xdc, 0x7e, 0x19, + 0x66, 0x5b, 0x8f, 0xb4, 0xd6, 0xc0, 0x25, 0xe9, 0xe5, 0xc2, 0x13, 0xec, + 0x8c, 0xe9, 0xbf, 0xb7, 0x3c, 0xc8, 0x22, 0x2d, 0x35, 0x3c, 0x36, 0x8f, + 0xbc, 0xc7, 0xf4, 0xcf, 0xc7, 0xcd, 0x7f, 0x7d, 0x30, 0xf4, 0xf3, 0x7f, + 0x60, 0xe7, 0x02, 0x95, 0xc4, 0x87, 0xa5, 0x9e, 0xbd, 0xb3, 0x08, 0x3c, + 0x24, 0xe4, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, 0xca, 0xc7, 0x79, 0x5b, + 0xc3, 0x19, 0x00, 0x00, }, "conf/app.ini", ) diff --git a/modules/middleware/context.go b/modules/middleware/context.go index 8c837d0852..19556118e3 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -358,7 +358,7 @@ func InitContext() martini.Handler { }) // Get user from session if logined. - user := auth.SignedInUser(ctx.Session) + user := auth.SignedInUser(ctx.req.Header, ctx.Session) ctx.User = user ctx.IsSigned = user != nil diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 93e02210cc..1298996396 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -47,11 +47,12 @@ var ( StaticRootPath string // Security settings. - InstallLock bool - SecretKey string - LogInRememberDays int - CookieUserName string - CookieRememberName string + InstallLock bool + SecretKey string + LogInRememberDays int + CookieUserName string + CookieRememberName string + ReverseProxyAuthUid string // Webhook settings. WebhookTaskInterval int @@ -163,6 +164,7 @@ func NewConfigContext() { LogInRememberDays = Cfg.MustInt("security", "LOGIN_REMEMBER_DAYS") CookieUserName = Cfg.MustValue("security", "COOKIE_USERNAME") CookieRememberName = Cfg.MustValue("security", "COOKIE_REMEMBER_NAME") + ReverseProxyAuthUid = Cfg.MustValue("security", "REVERSE_PROXY_AUTHENTICATION_UID", "X-WEBAUTH-UID") RunUser = Cfg.MustValue("", "RUN_USER") curUser := os.Getenv("USER") @@ -191,14 +193,15 @@ func NewConfigContext() { } var Service struct { - RegisterEmailConfirm bool - DisableRegistration bool - RequireSignInView bool - EnableCacheAvatar bool - NotifyMail bool - LdapAuth bool - ActiveCodeLives int - ResetPwdCodeLives int + RegisterEmailConfirm bool + DisableRegistration bool + RequireSignInView bool + EnableCacheAvatar bool + EnableNotifyMail bool + EnableReverseProxyAuth bool + LdapAuth bool + ActiveCodeLives int + ResetPwdCodeLives int } func newService() { @@ -207,6 +210,7 @@ func newService() { Service.DisableRegistration = Cfg.MustBool("service", "DISABLE_REGISTRATION") Service.RequireSignInView = Cfg.MustBool("service", "REQUIRE_SIGNIN_VIEW") Service.EnableCacheAvatar = Cfg.MustBool("service", "ENABLE_CACHE_AVATAR") + Service.EnableReverseProxyAuth = Cfg.MustBool("service", "ENABLE_REVERSE_PROXY_AUTHENTICATION") } var logLevels = map[string]string{ @@ -395,7 +399,7 @@ func newNotifyMailService() { log.Warn("Notify Mail Service: Mail Service is not enabled") return } - Service.NotifyMail = true + Service.EnableNotifyMail = true log.Info("Notify Mail Service Enabled") } diff --git a/modules/social/social.go b/modules/social/social.go index 62f4d51835..326a463fac 100644 --- a/modules/social/social.go +++ b/modules/social/social.go @@ -120,7 +120,7 @@ type SocialGithub struct { } func (s *SocialGithub) Type() int { - return models.OT_GITHUB + return int(models.GITHUB) } func newGitHubOauth(config *oauth.Config) { @@ -174,7 +174,7 @@ type SocialGoogle struct { } func (s *SocialGoogle) Type() int { - return models.OT_GOOGLE + return int(models.GOOGLE) } func newGoogleOauth(config *oauth.Config) { @@ -229,7 +229,7 @@ type SocialTencent struct { } func (s *SocialTencent) Type() int { - return models.OT_QQ + return int(models.QQ) } func newTencentOauth(config *oauth.Config) { @@ -295,7 +295,7 @@ type SocialTwitter struct { } func (s *SocialTwitter) Type() int { - return models.OT_TWITTER + return int(models.TWITTER) } func newTwitterOauth(config *oauth.Config) { @@ -351,7 +351,7 @@ type SocialWeibo struct { } func (s *SocialWeibo) Type() int { - return models.OT_WEIBO + return int(models.WEIBO) } func newWeiboOauth(config *oauth.Config) { diff --git a/routers/admin/admin.go b/routers/admin/admin.go index a14ffae0e5..1567a3001a 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -102,8 +102,11 @@ func updateSystemStatus() { } // Operation types. +type AdminOperation int + const ( - OT_CLEAN_OAUTH = iota + 1 + CLEAN_UNBIND_OAUTH AdminOperation = iota + 1 + CLEAN_INACTIVATE_USER ) func Dashboard(ctx *middleware.Context) { @@ -116,10 +119,13 @@ func Dashboard(ctx *middleware.Context) { var err error var success string - switch op { - case OT_CLEAN_OAUTH: + switch AdminOperation(op) { + case CLEAN_UNBIND_OAUTH: success = "All unbind OAuthes have been deleted." err = models.CleanUnbindOauth() + case CLEAN_INACTIVATE_USER: + success = "All inactivate accounts have been deleted." + err = models.DeleteInactivateUsers() } if err != nil { @@ -190,6 +196,7 @@ func Config(ctx *middleware.Context) { ctx.Data["StaticRootPath"] = setting.StaticRootPath ctx.Data["LogRootPath"] = setting.LogRootPath ctx.Data["ScriptType"] = setting.ScriptType + ctx.Data["ReverseProxyAuthUid"] = setting.ReverseProxyAuthUid ctx.Data["Service"] = setting.Service diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 808fb52b41..11c573f5cc 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -250,7 +250,7 @@ func CreateIssuePost(ctx *middleware.Context, params martini.Params, form auth.C } // Mail watchers and mentions. - if setting.Service.NotifyMail { + if setting.Service.EnableNotifyMail { tos, err := mailer.SendIssueNotifyMail(ctx.User, ctx.Repo.Owner, ctx.Repo.Repository, issue) if err != nil { ctx.Handle(500, "issue.CreateIssue(SendIssueNotifyMail)", err) @@ -685,7 +685,7 @@ func Comment(ctx *middleware.Context, params martini.Params) { } // Mail watchers and mentions. - if setting.Service.NotifyMail { + if setting.Service.EnableNotifyMail { issue.Content = content tos, err := mailer.SendIssueNotifyMail(ctx.User, ctx.Repo.Owner, ctx.Repo.Repository, issue) if err != nil { diff --git a/routers/repo/setting.go b/routers/repo/setting.go index ac9ce7c77c..6313971c24 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -192,7 +192,7 @@ func CollaborationPost(ctx *middleware.Context) { return } - if setting.Service.NotifyMail { + if setting.Service.EnableNotifyMail { if err = mailer.SendCollaboratorMail(ctx.Render, u, ctx.User, ctx.Repo.Repository); err != nil { ctx.Handle(500, "setting.CollaborationPost(SendCollaboratorMail)", err) return diff --git a/templates/VERSION b/templates/VERSION index 0848cb02d0..7d143dcc1c 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.4.0620 Alpha \ No newline at end of file +0.4.5.0621 Alpha \ No newline at end of file diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 583ee25e35..22be5900e3 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -36,6 +36,8 @@
{{.LogRootPath}}
Script Type
{{.ScriptType}}
+
Reverse Authentication UID
+
{{.ReverseProxyAuthUid}}
@@ -77,7 +79,7 @@
Require Sign In View
Mail Notification
-
+
Enable Cache Avatar

diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index f709cb3f28..aa2080d83e 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -32,6 +32,10 @@ Clean unbind OAuthes Run + + Delete inactivate accounts + Run + From 9d2cef23f2af273933da8f1cef150c1d163be5ee Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 21 Jun 2014 00:53:46 -0400 Subject: [PATCH 26/55] Fix #165 --- modules/auth/user.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/auth/user.go b/modules/auth/user.go index fdbba31af5..284a4644de 100644 --- a/modules/auth/user.go +++ b/modules/auth/user.go @@ -25,7 +25,11 @@ func SignedInId(header http.Header, sess session.SessionStore) int64 { return 0 } - id, _ := base.StrTo(header.Get(setting.ReverseProxyAuthUid)).Int64() + var id int64 + if setting.Service.EnableReverseProxyAuth { + id, _ = base.StrTo(header.Get(setting.ReverseProxyAuthUid)).Int64() + } + if id <= 0 { uid := sess.Get("userId") if uid == nil { From c280415e0b449b420f4540886b8e16ae3c9e6454 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 21 Jun 2014 17:57:59 -0400 Subject: [PATCH 27/55] Clean files --- README.md | 6 +++--- README_ZH.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bd480090a3..847844f38c 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language ![Demo](http://gowalker.org/public/gogs_demo.gif) -##### Current version: 0.4.4 Alpha +##### Current version: 0.4.5 Alpha ### NOTICES -- Due to testing purpose, data of [try.gogits.org](http://try.gogits.org) has been reset in **April 14, 2014** and will reset multiple times after. Please do **NOT** put your important data on the site. +- Due to testing purpose, data of [try.gogits.org](http://try.gogits.org) has been reset in **June 21, 2014** and will reset multiple times after. Please do **NOT** put your important data on the site. - Demo site [try.gogits.org](http://try.gogits.org) is running under `dev` branch. #### Other language version @@ -33,7 +33,7 @@ More importantly, Gogs only needs one binary to setup your own project hosting o - Activity timeline - SSH/HTTP(S) protocol support -- SMTP/LDAP authentication support +- SMTP/LDAP/reverse proxy authentication support - Register/delete/rename account - Create/migrate/mirror/delete/watch/rename/transfer public/private repository - Repository viewer/release/issue tracker/webhooks diff --git a/README_ZH.md b/README_ZH.md index 5f57d8a6df..f67cf037a4 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -5,7 +5,7 @@ Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。 ![Demo](http://gowalker.org/public/gogs_demo.gif) -##### 当前版本:0.4.4 Alpha +##### 当前版本:0.4.5 Alpha ## 开发目的 @@ -24,7 +24,7 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依 - 活动时间线 - 支持 SSH/HTTP(S) 协议 -- 支持 SMTP/LDAP 用户认证 +- 支持 SMTP/LDAP/反向代理 用户认证 - 注册/删除/重命名用户 - 创建/迁移/镜像/删除/关注/重命名/转移 公开/私有 仓库 - 仓库 浏览器/发布/缺陷管理/Web 钩子 From bf703ef61761fc4b09e3cb95672869520eccbc39 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Sun, 22 Jun 2014 14:10:12 +0800 Subject: [PATCH 28/55] add dashboard context switch button --- cmd/web.go | 2 +- public/css/gogs.css | 41 +++++++++++++++++++++++++++++++++++ routers/dashboard.go | 2 +- templates/user/dashboard.tmpl | 14 ++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/cmd/web.go b/cmd/web.go index 2fdfe4332c..f62bc2550a 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -96,7 +96,7 @@ func runWeb(*cli.Context) { r.Get("/stars", user.Stars) }, reqSignIn) - m.Group("/api", func(r martini.Router) { + m.Group("/api", func(_ martini.Router) { m.Group("/v1", func(r martini.Router) { // Miscellaneous. r.Post("/markdown", bindIgnErr(apiv1.MarkdownForm{}), v1.Markdown) diff --git a/public/css/gogs.css b/public/css/gogs.css index 1e29eeba5f..67d1ebe588 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -638,6 +638,47 @@ html, body { margin: 0 .5em; } +#dashboard-switch .btn { + height: 40px; +} + +#dashboard-switch { + margin-top: 14px; + margin-right: 18px; +} + +#dashboard-switch .dropdown-menu { + padding: 0; +} + +#dashboard-switch-menu { + width: 180px; + margin-bottom: 0; + padding-bottom: 0; +} + +#dashboard-switch-menu > li > a { + display: block; + padding: .8em 1.2em; +} + +#dashboard-switch-menu > li { + border-bottom: 1px solid #eaeaea; +} + +#dashboard-switch-menu > li .fa { + opacity: 0; + margin-right: 16px; +} + +#dashboard-switch-menu > li.checked .fa { + opacity: 1; +} + +#dashboard-switch-menu > li:last-child { + border-bottom: none; +} + /* gogits repo single page */ #body-nav.repo-nav { diff --git a/routers/dashboard.go b/routers/dashboard.go index 438d03794b..7daa0e7ba9 100644 --- a/routers/dashboard.go +++ b/routers/dashboard.go @@ -26,7 +26,7 @@ func Home(ctx *middleware.Context) { ctx.Data["PageIsHome"] = true - // Show recent updated repositoires for new visiters. + // Show recent updated repositories for new visitors. repos, err := models.GetRecentUpdatedRepositories() if err != nil { ctx.Handle(500, "dashboard.Home(GetRecentUpdatedRepositories)", err) diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl index 5cda6722f0..c44ba36278 100644 --- a/templates/user/dashboard.tmpl +++ b/templates/user/dashboard.tmpl @@ -2,6 +2,20 @@ {{template "base/navbar" .}}
+
+ + + +
From fb53cc4fa82bbbbba4b8b0281d5f5657b1a6fafc Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Mon, 23 Jun 2014 19:11:20 +0800 Subject: [PATCH 35/55] add organization setting page --- cmd/web.go | 1 + routers/org/org.go | 5 ++ templates/org/setting.tmpl | 151 +++++++++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 templates/org/setting.tmpl diff --git a/cmd/web.go b/cmd/web.go index 65ea606433..d29183a9dc 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -194,6 +194,7 @@ func runWeb(*cli.Context) { r.Get("/:org/dashboard", org.Dashboard) r.Get("/:org/members", org.Members) r.Get("/:org/teams", org.Teams) + r.Get("/:org/setting", org.Setting) }) m.Group("/:username/:reponame", func(r martini.Router) { diff --git a/routers/org/org.go b/routers/org/org.go index 8073d10b8e..ff97402ebc 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -29,3 +29,8 @@ func Dashboard(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = "Dashboard" ctx.HTML(200, "org/dashboard") } + +func Setting(ctx *middleware.Context, param martini.Params) { + ctx.Data["Title"] = "Setting" + ctx.HTML(200, "org/setting") +} diff --git a/templates/org/setting.tmpl b/templates/org/setting.tmpl new file mode 100644 index 0000000000..1be9707a1a --- /dev/null +++ b/templates/org/setting.tmpl @@ -0,0 +1,151 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +
+
+
+ + +
+ +
+
+
+
+ +
+
+ {{template "base/alert" .}} +
+
+ Repository Options +
+ +
+
+ {{.CsrfTokenHtml}} + + +
+ + +
+ +
+
+ +
+ + +
+ +
+
+ +
+ + +
+ +
+
+ +
+ + +
+ +
+
+ +
+ + +
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+
+ Danger Zone +
+
+ +
+
Delete this organization
+
Once you delete this organization and all repositories in, there is no going back. Please be + certain. +
+ + + +
+
+
+
+{{template "base/footer" .}} From 47d29a1ee027734dcbbd1a6ed4d8ff3dde1a789b Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 23 Jun 2014 16:22:34 -0400 Subject: [PATCH 36/55] Mirror fix on #248 --- cmd/update.go | 4 +++- gogs.go | 2 +- models/update.go | 26 +++++++++++++------------- routers/repo/http.go | 5 ++++- templates/VERSION | 2 +- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/cmd/update.go b/cmd/update.go index d0e0acded9..c030b6cfb2 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -42,5 +42,7 @@ func runUpdate(c *cli.Context) { repoUserName := os.Getenv("repoUserName") repoName := os.Getenv("repoName") - models.Update(args[0], args[1], args[2], userName, repoUserName, repoName, userId) + if err := models.Update(args[0], args[1], args[2], userName, repoUserName, repoName, userId); err != nil { + log.GitLogger.Fatal(err.Error()) + } } diff --git a/gogs.go b/gogs.go index 03c2860165..a39d2d4338 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.5.0622 Alpha" +const APP_VER = "0.4.5.0623 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/update.go b/models/update.go index 5675a94cf4..3328f2213f 100644 --- a/models/update.go +++ b/models/update.go @@ -6,6 +6,7 @@ package models import ( "container/list" + "fmt" "os/exec" "strings" @@ -15,11 +16,11 @@ import ( "github.com/gogits/gogs/modules/log" ) -func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName string, userId int64) { +func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName string, userId int64) error { isNew := strings.HasPrefix(oldCommitId, "0000000") if isNew && strings.HasPrefix(newCommitId, "0000000") { - log.GitLogger.Fatal("old rev and new rev both 000000") + return fmt.Errorf("old rev and new rev both 000000") } f := RepoPath(repoUserName, repoName) @@ -31,18 +32,17 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName isDel := strings.HasPrefix(newCommitId, "0000000") if isDel { log.GitLogger.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId) - return + return nil } repo, err := git.OpenRepository(f) if err != nil { - log.GitLogger.Fatal("runUpdate.Open repoId: %v", err) + return fmt.Errorf("runUpdate.Open repoId: %v", err) } newCommit, err := repo.GetCommit(newCommitId) if err != nil { - log.GitLogger.Fatal("runUpdate GetCommit of newCommitId: %v", err) - return + return fmt.Errorf("runUpdate GetCommit of newCommitId: %v", err) } var l *list.List @@ -50,28 +50,27 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName if isNew { l, err = newCommit.CommitsBefore() if err != nil { - log.GitLogger.Fatal("Find CommitsBefore erro: %v", err) + return fmt.Errorf("Find CommitsBefore erro: %v", err) } } else { l, err = newCommit.CommitsBeforeUntil(oldCommitId) if err != nil { - log.GitLogger.Fatal("Find CommitsBeforeUntil erro: %v", err) - return + return fmt.Errorf("Find CommitsBeforeUntil erro: %v", err) } } if err != nil { - log.GitLogger.Fatal("runUpdate.Commit repoId: %v", err) + return fmt.Errorf("runUpdate.Commit repoId: %v", err) } ru, err := GetUserByName(repoUserName) if err != nil { - log.GitLogger.Fatal("runUpdate.GetUserByName: %v", err) + return fmt.Errorf("runUpdate.GetUserByName: %v", err) } repos, err := GetRepositoryByName(ru.Id, repoName) if err != nil { - log.GitLogger.Fatal("runUpdate.GetRepositoryByName userId: %v", err) + return fmt.Errorf("runUpdate.GetRepositoryByName userId: %v", err) } commits := make([]*base.PushCommit, 0) @@ -95,6 +94,7 @@ func Update(refName, oldCommitId, newCommitId, userName, repoUserName, repoName //commits = append(commits, []string{lastCommit.Id().String(), lastCommit.Message()}) if err = CommitRepoAction(userId, ru.Id, userName, actEmail, repos.Id, repoUserName, repoName, refName, &base.PushCommits{l.Len(), commits}); err != nil { - log.GitLogger.Fatal("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err) + return fmt.Errorf("runUpdate.models.CommitRepoAction: %s/%s:%v", repoUserName, repoName, err) } + return nil } diff --git a/routers/repo/http.go b/routers/repo/http.go index 5915e8761e..d2bff29973 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -141,7 +141,10 @@ func Http(ctx *middleware.Context, params martini.Params) { newCommitId := fields[1] refName := fields[2] - models.Update(refName, oldCommitId, newCommitId, authUsername, username, reponame, authUser.Id) + if err = models.Update(refName, oldCommitId, newCommitId, authUsername, username, reponame, authUser.Id); err != nil { + log.GitLogger.Error(err.Error()) + return + } } } } diff --git a/templates/VERSION b/templates/VERSION index 414dc2efe9..ca3b3f1ba5 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.5.0622 Alpha \ No newline at end of file +0.4.5.0623 Alpha \ No newline at end of file From 98f614a58e984b386a464bc687086e096f03026a Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 23 Jun 2014 19:16:09 -0400 Subject: [PATCH 37/55] Work on #249 issue1 --- routers/user/home.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/routers/user/home.go b/routers/user/home.go index 7d0333cb4e..0f2cee2565 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -67,7 +67,7 @@ func Profile(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = "Profile" ctx.Data["PageIsUserProfile"] = true - user, err := models.GetUserByName(params["username"]) + u, err := models.GetUserByName(params["username"]) if err != nil { if err == models.ErrUserNotExist { ctx.Handle(404, "user.Profile(GetUserByName)", err) @@ -76,19 +76,23 @@ func Profile(ctx *middleware.Context, params martini.Params) { } return } - ctx.Data["Owner"] = user + // For security reason, hide e-mail address for anonymous visitors. + if !ctx.IsSigned { + u.Email = "" + } + ctx.Data["Owner"] = u tab := ctx.Query("tab") ctx.Data["TabName"] = tab switch tab { case "activity": - ctx.Data["Feeds"], err = models.GetFeeds(user.Id, 0, true) + ctx.Data["Feeds"], err = models.GetFeeds(u.Id, 0, true) if err != nil { ctx.Handle(500, "user.Profile(GetFeeds)", err) return } default: - ctx.Data["Repos"], err = models.GetRepositories(user.Id, ctx.IsSigned && ctx.User.Id == user.Id) + ctx.Data["Repos"], err = models.GetRepositories(u.Id, ctx.IsSigned && ctx.User.Id == u.Id) if err != nil { ctx.Handle(500, "user.Profile(GetRepositories)", err) return From 29a40c97f367a432e4038f20f09d7bf76ce4ab93 Mon Sep 17 00:00:00 2001 From: niphor Date: Tue, 24 Jun 2014 14:28:47 +0800 Subject: [PATCH 38/55] RepoRootPath must be absolute path --- modules/setting/setting.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 1298996396..cb7734bb32 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -182,6 +182,12 @@ func NewConfigContext() { log.Fatal("Fail to get home directory: %v", err) } RepoRootPath = Cfg.MustValue("repository", "ROOT", filepath.Join(homeDir, "gogs-repositories")) + if !filepath.IsAbs(RepoRootPath) { + RepoRootPath = filepath.Join(workDir, RepoRootPath) + } else { + RepoRootPath = filepath.Clean(RepoRootPath) + } + if err = os.MkdirAll(RepoRootPath, os.ModePerm); err != nil { log.Fatal("Fail to create repository root path(%s): %v", RepoRootPath, err) } From d5d04a66f36f86e2369cb66d54f2095385d7dc70 Mon Sep 17 00:00:00 2001 From: Eryx Date: Tue, 24 Jun 2014 16:53:42 +0800 Subject: [PATCH 39/55] Fix #252 --- models/publickey.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/publickey.go b/models/publickey.go index 35768b4893..603ff36438 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -161,7 +161,7 @@ func rewriteAuthorizedKeys(key *PublicKey, p, tmpP string) error { } defer fr.Close() - fw, err := os.Create(tmpP) + fw, err := os.OpenFile(tmpP, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600) if err != nil { return err } From b2801a2e985f11e940a0cd420cea57242ea26d4c Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 24 Jun 2014 13:55:47 -0400 Subject: [PATCH 40/55] Fix #165 --- README.md | 3 - README_ZH.md | 3 - conf/app.ini | 4 +- gogs.go | 2 +- modules/auth/user.go | 28 ++- modules/bin/conf.go | 471 ++++++++++++++++++------------------ modules/setting/setting.go | 14 +- routers/admin/admin.go | 2 +- templates/VERSION | 2 +- templates/admin/config.tmpl | 4 +- 10 files changed, 264 insertions(+), 269 deletions(-) diff --git a/README.md b/README.md index 847844f38c..af33b0e8eb 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,6 @@ There are 5 ways to install Gogs: The [core team](http://gogs.io/team) of this project. See [contributors page](https://github.com/gogits/gogs/graphs/contributors) for full list of contributors. -[![Clone in Koding](http://learn.koding.com/btn/clone_d.png)][koding] -[koding]: https://koding.com/Teamwork?import=https://github.com/gogits/gogs/archive/master.zip&c=git1 - ## License This project is under the MIT License. See the [LICENSE](https://github.com/gogits/gogs/blob/master/LICENSE) file for the full license text. diff --git a/README_ZH.md b/README_ZH.md index f67cf037a4..26746ccbe8 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -66,9 +66,6 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依 本项目的 [开发团队](http://gogs.io/team)。您可以通过查看 [贡献者页面](https://github.com/gogits/gogs/graphs/contributors) 获取完整的贡献者列表。 -[![Clone in Koding](http://learn.koding.com/btn/clone_d.png)][koding] -[koding]: https://koding.com/Teamwork?import=https://github.com/gogits/gogs/archive/master.zip&c=git1 - ## 授权许可 本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/gogits/gogs/blob/master/LICENSE) 文件中。 \ No newline at end of file diff --git a/conf/app.ini b/conf/app.ini index 111261db98..296509f721 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -51,8 +51,8 @@ SECRET_KEY = !#@FDEWREWR&*( LOGIN_REMEMBER_DAYS = 7 COOKIE_USERNAME = gogs_awesome COOKIE_REMEMBER_NAME = gogs_incredible -; Reverse proxy authentication header name of user ID -REVERSE_PROXY_AUTHENTICATION_UID = X-WEBAUTH-UID +; Reverse proxy authentication header name of user name +REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER [service] ACTIVE_CODE_LIVE_MINUTES = 180 diff --git a/gogs.go b/gogs.go index a39d2d4338..75d3eb4b8d 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.5.0623 Alpha" +const APP_VER = "0.4.5.0624 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/modules/auth/user.go b/modules/auth/user.go index 284a4644de..20f9933626 100644 --- a/modules/auth/user.go +++ b/modules/auth/user.go @@ -25,23 +25,25 @@ func SignedInId(header http.Header, sess session.SessionStore) int64 { return 0 } - var id int64 if setting.Service.EnableReverseProxyAuth { - id, _ = base.StrTo(header.Get(setting.ReverseProxyAuthUid)).Int64() - } - - if id <= 0 { - uid := sess.Get("userId") - if uid == nil { - return 0 - } - var ok bool - if id, ok = uid.(int64); !ok { - return 0 + webAuthUser := header.Get(setting.ReverseProxyAuthUser) + if len(webAuthUser) > 0 { + u, err := models.GetUserByName(webAuthUser) + if err != nil { + if err != models.ErrUserNotExist { + log.Error("auth.user.SignedInId(GetUserByName): %v", err) + } + return 0 + } + return u.Id } } - if id > 0 { + uid := sess.Get("userId") + if uid == nil { + return 0 + } + if id, ok := uid.(int64); ok { if _, err := models.GetUserById(id); err != nil { if err != models.ErrUserNotExist { log.Error("auth.user.SignedInId(GetUserById): %v", err) diff --git a/modules/bin/conf.go b/modules/bin/conf.go index 71a9fac815..fa0822d732 100644 --- a/modules/bin/conf.go +++ b/modules/bin/conf.go @@ -28,242 +28,241 @@ func bindata_read(data []byte, name string) ([]byte, error) { func conf_app_ini() ([]byte, error) { return bindata_read([]byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xb4, 0x59, - 0xdd, 0x72, 0xdb, 0xc8, 0xb1, 0xbe, 0xc7, 0x53, 0x8c, 0x79, 0x76, 0xcf, - 0xda, 0xa7, 0x24, 0x92, 0x92, 0x8f, 0x65, 0xaf, 0xbc, 0xae, 0x63, 0x8a, - 0x04, 0x25, 0x1c, 0xf3, 0x47, 0x0b, 0x40, 0xf2, 0x2a, 0x2e, 0x15, 0x0a, - 0x02, 0x86, 0xe4, 0x44, 0x00, 0x06, 0xc2, 0x0c, 0x45, 0x31, 0x77, 0x79, - 0x85, 0x54, 0x9e, 0x26, 0xcf, 0x93, 0x8b, 0x3c, 0x46, 0xbe, 0x1e, 0x00, - 0x14, 0x28, 0x73, 0xb5, 0xce, 0x5f, 0x25, 0x65, 0x11, 0xf3, 0xd3, 0xd3, - 0xdd, 0xf3, 0xf5, 0xd7, 0xdd, 0xb3, 0xef, 0x59, 0x2f, 0xcf, 0x59, 0x16, - 0xa6, 0x9c, 0xe9, 0x45, 0xa8, 0x99, 0x5a, 0xc8, 0x95, 0x62, 0x32, 0x63, - 0xfc, 0x9e, 0x17, 0x6b, 0x96, 0x87, 0x73, 0x4c, 0x08, 0x9d, 0x70, 0xab, - 0x77, 0x7e, 0x1e, 0x4c, 0x7a, 0x63, 0x9b, 0x7d, 0x60, 0xa7, 0x72, 0xae, - 0x8e, 0xf1, 0x2f, 0x3b, 0x15, 0x9a, 0x79, 0xbc, 0xb8, 0x17, 0x51, 0x39, - 0x3f, 0x9a, 0x9e, 0x4e, 0x31, 0x2f, 0xd2, 0x79, 0x67, 0x16, 0x62, 0x54, - 0x66, 0xed, 0x3c, 0x9b, 0x5b, 0xef, 0x59, 0x7f, 0x11, 0x66, 0x90, 0x84, - 0xe5, 0x62, 0xc6, 0xd6, 0x72, 0xc9, 0x8a, 0x65, 0xc6, 0x12, 0x19, 0x85, - 0x49, 0xb2, 0xb6, 0xdc, 0x8b, 0x49, 0x70, 0xe1, 0xd9, 0x2e, 0x76, 0xce, - 0x85, 0xc6, 0x6a, 0x5b, 0xe8, 0x05, 0x2f, 0x58, 0x2b, 0xe6, 0xf7, 0xad, - 0x3d, 0xd6, 0xca, 0x0b, 0x19, 0xb7, 0x98, 0xc4, 0x80, 0xe6, 0x4a, 0x63, - 0x24, 0xe6, 0xb3, 0x70, 0x99, 0x40, 0x96, 0x2a, 0xd7, 0x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 0xd7, 0xf7, 0x9d, 0x4b, 0x3b, 0xe8, 0xe3, 0x76, 0x82, 0x11, 0xfd, - 0x1a, 0x3b, 0x13, 0x04, 0x39, 0x19, 0x75, 0xf0, 0xae, 0x0b, 0xd1, 0x9e, - 0x4d, 0xd0, 0x24, 0x30, 0xfc, 0xea, 0x22, 0x44, 0x08, 0x69, 0x92, 0x71, - 0x1e, 0x33, 0x2d, 0x19, 0x28, 0x79, 0x26, 0x8a, 0x94, 0xf1, 0xfd, 0x34, - 0x14, 0x09, 0x9b, 0xe1, 0x9e, 0x0b, 0x3e, 0x17, 0x4a, 0x97, 0x51, 0x0b, - 0x99, 0xa7, 0x8e, 0x47, 0x3c, 0x62, 0x83, 0xd0, 0x46, 0x90, 0x3a, 0x19, - 0x3a, 0xee, 0xb8, 0x71, 0x8d, 0x03, 0xc9, 0x15, 0xcb, 0xa4, 0x66, 0xa0, - 0x6e, 0xb9, 0xaa, 0x36, 0xe3, 0x00, 0x8a, 0x37, 0x03, 0x06, 0x06, 0x87, - 0x99, 0x00, 0x8c, 0x22, 0xb9, 0xcc, 0x74, 0x09, 0x9e, 0x0d, 0x49, 0x19, - 0xf1, 0xae, 0xb1, 0xbe, 0x21, 0xd4, 0xa8, 0x98, 0x22, 0xc0, 0x99, 0x12, - 0x73, 0x43, 0x7b, 0x50, 0xf5, 0x5e, 0xf0, 0x15, 0xc4, 0xae, 0xf5, 0x42, - 0x64, 0xf3, 0x36, 0x34, 0xfb, 0xf9, 0xc2, 0x71, 0xed, 0xc0, 0x73, 0x4e, - 0x27, 0xb8, 0xe5, 0x4b, 0xc7, 0xfe, 0xdc, 0x90, 0xd0, 0x0f, 0x23, 0x84, - 0x73, 0x78, 0x0f, 0x74, 0x42, 0x17, 0xc5, 0x72, 0x11, 0xe9, 0x65, 0xc1, - 0x2d, 0x7b, 0x62, 0xce, 0xed, 0xf7, 0xfa, 0x67, 0x76, 0xd0, 0xbb, 0x04, - 0xc6, 0xdc, 0xc6, 0xae, 0x31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, 0x93, 0x6f, 0xdc, 0x14, 0x45, - 0xf0, 0x4d, 0xa0, 0xe5, 0x2d, 0xcf, 0x2c, 0x53, 0x4e, 0x68, 0x16, 0x25, - 0x02, 0xac, 0xc7, 0x44, 0x5c, 0xa6, 0x58, 0x8e, 0x70, 0xd7, 0xc6, 0x95, - 0x98, 0xaf, 0xc5, 0x01, 0x71, 0x4a, 0x22, 0xc9, 0xc7, 0x94, 0x96, 0x25, - 0x12, 0xb4, 0x42, 0x91, 0x20, 0xe7, 0x65, 0xda, 0xef, 0x80, 0x3e, 0x7f, - 0xcf, 0x23, 0xbd, 0x71, 0x8f, 0x99, 0xf9, 0x97, 0xdd, 0xb3, 0x5a, 0xad, - 0x2a, 0x51, 0x70, 0x94, 0x32, 0x07, 0x19, 0x1b, 0xc8, 0x4f, 0x22, 0x9b, - 0xc9, 0x36, 0x37, 0xf8, 0xfa, 0xe6, 0xe5, 0xd0, 0x92, 0x0a, 0x87, 0x5d, - 0x2e, 0xae, 0xa8, 0x6d, 0xcb, 0x28, 0x59, 0xba, 0xec, 0xd0, 0x48, 0xd9, - 0xe9, 0xe3, 0x67, 0x77, 0x55, 0x2e, 0xae, 0x5c, 0x72, 0x77, 0xf7, 0x4f, - 0xbb, 0x03, 0xb4, 0x6c, 0xc0, 0xcf, 0xfe, 0xfa, 0x97, 0x3f, 0xfd, 0xed, - 0x8f, 0x7f, 0xa6, 0x74, 0xb9, 0x03, 0x23, 0x45, 0x98, 0x2f, 0xaa, 0xc0, - 0xa8, 0x34, 0x68, 0x77, 0x1b, 0x10, 0x79, 0xcf, 0x76, 0x82, 0x64, 0xe7, - 0xae, 0x52, 0x73, 0xec, 0xe0, 0x59, 0x44, 0xc0, 0x58, 0x71, 0x71, 0x23, - 0x77, 0x79, 0x0d, 0x38, 0xc8, 0xda, 0xba, 0xde, 0x1f, 0xcd, 0xc5, 0xfe, - 0x4d, 0x0d, 0xb4, 0xc3, 0xdf, 0x80, 0xe7, 0xf3, 0x5b, 0xb7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xa4, 0x37, 0xb6, 0xd9, 0x07, 0x76, 0x2a, 0xe7, 0xea, 0x18, + 0xff, 0xb2, 0x53, 0xa1, 0x99, 0xc7, 0x8b, 0x7b, 0x11, 0x95, 0xfb, 0xa3, + 0xe9, 0xe9, 0x14, 0xfb, 0x22, 0x9d, 0x77, 0x66, 0x21, 0x56, 0x65, 0xd6, + 0xce, 0xb3, 0xb9, 0xf5, 0x9e, 0xf5, 0x17, 0x61, 0x06, 0x4e, 0x38, 0x2e, + 0x66, 0x6c, 0x2d, 0x97, 0xac, 0x58, 0x66, 0x2c, 0x91, 0x51, 0x98, 0x24, + 0x6b, 0xcb, 0xbd, 0x98, 0x04, 0x17, 0x9e, 0xed, 0x82, 0x72, 0x2e, 0x34, + 0x4e, 0xdb, 0x42, 0x2f, 0x78, 0xc1, 0x5a, 0x31, 0xbf, 0x6f, 0xed, 0xb1, + 0x56, 0x5e, 0xc8, 0xb8, 0xc5, 0x24, 0x16, 0x34, 0x57, 0x1a, 0x2b, 0x31, + 0x9f, 0x85, 0xcb, 0x04, 0xbc, 0x54, 0x79, 0xc6, 0x70, 0x18, 0x4f, 0x07, + 0x24, 0x1b, 0xbe, 0x2d, 0xeb, 0x4b, 0xc1, 0x73, 0xa9, 0x84, 0x96, 0xc5, + 0xfa, 0xda, 0x72, 0xa7, 0x53, 0x1f, 0x1b, 0x96, 0xd7, 0x77, 0x9d, 0x73, + 0x3f, 0xf0, 0xaf, 0xce, 0xe9, 0xdc, 0x4d, 0xa8, 0x16, 0x38, 0xa8, 0x20, + 0x3d, 0x2f, 0xae, 0xad, 0x73, 0x77, 0xea, 0x4f, 0xfb, 0xd3, 0x11, 0x76, + 0x16, 0x5a, 0xe7, 0xd6, 0x60, 0x3a, 0xee, 0x39, 0x13, 0x7c, 0x19, 0x21, + 0x17, 0x52, 0x69, 0xc3, 0x27, 0xb8, 0x70, 0xe9, 0xc8, 0xf7, 0x2f, 0xeb, + 0xf3, 0xaf, 0xd4, 0x71, 0xa7, 0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5, 0xa7, 0xd3, 0x4f, 0x8e, 0x6d, 0x72, + 0x4c, 0xc3, 0xa4, 0x41, 0xb8, 0xe2, 0x4a, 0xa6, 0xbc, 0xde, 0xde, 0xd0, + 0x35, 0xcf, 0x88, 0x2c, 0x2a, 0x78, 0x2c, 0x4a, 0xab, 0xb8, 0x94, 0x14, + 0x15, 0x50, 0x53, 0xc8, 0x87, 0x35, 0x0b, 0x97, 0xb0, 0x72, 0x06, 0x80, + 0x19, 0xbc, 0xb3, 0x05, 0x0f, 0x63, 0x08, 0x62, 0x52, 0x29, 0x80, 0xb8, + 0x54, 0xd5, 0x87, 0xe5, 0xda, 0x97, 0xb6, 0xeb, 0xd9, 0x01, 0x52, 0xc6, + 0x2f, 0x57, 0x41, 0xef, 0xc2, 0x3f, 0xb3, 0x27, 0x00, 0x16, 0xc0, 0x35, + 0xdd, 0xe4, 0xbd, 0x5f, 0xf6, 0x3f, 0xdb, 0x27, 0xb4, 0xb5, 0x4f, 0x0b, + 0x55, 0x5e, 0x02, 0x50, 0xae, 0xad, 0x5e, 0xdf, 0x77, 0x2e, 0xed, 0xa0, + 0x0f, 0x0f, 0x05, 0x23, 0xfa, 0x35, 0x76, 0x26, 0x08, 0x74, 0x52, 0xec, + 0xe0, 0x5d, 0x17, 0xcc, 0x3d, 0x9b, 0xe0, 0x49, 0x80, 0xf8, 0xd5, 0x43, + 0x88, 0x12, 0x23, 0x0d, 0xe7, 0x31, 0xd3, 0x92, 0x21, 0x2d, 0xcf, 0x44, + 0x91, 0x32, 0xbe, 0x9f, 0x86, 0x22, 0x61, 0x33, 0xf8, 0xba, 0xe0, 0x73, + 0xa1, 0x74, 0x19, 0xb9, 0xe0, 0x79, 0xea, 0x78, 0x94, 0x4b, 0x6c, 0x24, + 0xb5, 0x11, 0xb8, 0x4e, 0x86, 0x8e, 0x3b, 0x6e, 0xb8, 0x72, 0x20, 0xb9, + 0x62, 0x99, 0xd4, 0x0c, 0xe9, 0x5b, 0xae, 0x2a, 0x62, 0x5c, 0x40, 0x31, + 0x67, 0x00, 0xc1, 0x60, 0x34, 0x13, 0x84, 0x51, 0x24, 0x97, 0x99, 0x2e, + 0x01, 0xb4, 0x49, 0x54, 0x86, 0xbd, 0x6b, 0xf4, 0x6f, 0x30, 0x35, 0x22, + 0xa6, 0x08, 0x72, 0xa6, 0xc4, 0xdc, 0xa4, 0x3e, 0x88, 0x7a, 0x2f, 0xf8, + 0x0a, 0x6c, 0xd7, 0x7a, 0x21, 0xb2, 0x79, 0x1b, 0x92, 0xfd, 0x7c, 0xe1, + 0xb8, 0x76, 0xe0, 0x39, 0xa7, 0x13, 0x78, 0xfa, 0xd2, 0xb1, 0x3f, 0x37, + 0x38, 0xf4, 0xc3, 0x08, 0x21, 0x1d, 0xde, 0x03, 0xa1, 0x90, 0x45, 0xb1, + 0x5c, 0x44, 0x7a, 0x59, 0x70, 0xcb, 0x9e, 0x98, 0x7b, 0xfb, 0xbd, 0xfe, + 0x99, 0x1d, 0xf4, 0x2e, 0x81, 0x33, 0xb7, 0x41, 0x35, 0x26, 0x1b, 0x40, + 0x19, 0x31, 0xab, 0x3c, 0x59, 0x9f, 0x9f, 0x4c, 0x7d, 0x67, 0x78, 0x15, + 0x90, 0x0d, 0x9a, 0xc7, 0x25, 0x72, 0x45, 0xcc, 0x35, 0xa8, 0x8e, 0x4d, + 0xa9, 0xa0, 0x02, 0x80, 0xb2, 0xb5, 0x58, 0xde, 0x50, 0x4e, 0xa3, 0xd0, + 0x10, 0x5a, 0x95, 0x99, 0x55, 0x28, 0xb5, 0xe4, 0xaa, 0x73, 0x70, 0xf4, + 0xa6, 0xe6, 0xf9, 0x1c, 0x16, 0x36, 0x97, 0x58, 0x5f, 0x56, 0xfc, 0x66, + 0x21, 0xe5, 0x2d, 0xe5, 0x98, 0x7e, 0x01, 0x6c, 0xe9, 0x50, 0xdd, 0xc2, + 0x22, 0xb0, 0xf1, 0x7d, 0x98, 0x90, 0x69, 0x60, 0x63, 0xe4, 0x28, 0x65, + 0xf9, 0x3d, 0xef, 0x53, 0xe0, 0x4c, 0xe0, 0xac, 0xcb, 0x1e, 0x49, 0x79, + 0x40, 0xde, 0xe1, 0x89, 0x00, 0x4e, 0x51, 0xb6, 0x53, 0x2e, 0x97, 0x9a, + 0x8e, 0x23, 0x38, 0x65, 0x16, 0x2b, 0x6b, 0x60, 0x13, 0x3a, 0xdc, 0xc0, + 0x77, 0xc6, 0x36, 0xca, 0x05, 0x08, 0xde, 0xe0, 0x36, 0x42, 0x01, 0xd5, + 0xc0, 0x52, 0xc6, 0x41, 0x43, 0xd9, 0x93, 0xe5, 0x6c, 0x66, 0xb2, 0x6b, + 0x36, 0x47, 0x9e, 0x04, 0xaa, 0x23, 0xd4, 0xf1, 0x8c, 0x27, 0x7b, 0xec, + 0x96, 0xf3, 0x9c, 0xca, 0x39, 0xcc, 0x2c, 0x4c, 0x36, 0xad, 0xea, 0x7a, + 0x2c, 0xb3, 0x1f, 0x34, 0xbb, 0xcd, 0x00, 0x8b, 0x15, 0xf5, 0x13, 0x66, + 0xb3, 0x8d, 0x80, 0x9e, 0x0c, 0x82, 0x93, 0x8b, 0xe1, 0x90, 0x2a, 0x94, + 0x4d, 0xaa, 0x1e, 0x10, 0x2c, 0x27, 0x14, 0x2c, 0xc8, 0x3a, 0x48, 0xd9, + 0x6b, 0x60, 0x93, 0x14, 0x23, 0x6f, 0x94, 0x0d, 0x87, 0x77, 0x71, 0xf2, + 0xff, 0x76, 0xdf, 0x37, 0xe5, 0xb6, 0x6e, 0x3e, 0x5e, 0xa9, 0xda, 0x63, + 0x65, 0xe1, 0xa6, 0x12, 0x97, 0x1a, 0x57, 0xa8, 0x54, 0xe7, 0xed, 0x39, + 0xfd, 0x26, 0x37, 0x1c, 0xbf, 0x79, 0xf7, 0x16, 0x7b, 0x3f, 0xff, 0x5c, + 0x6d, 0xdc, 0xdd, 0x99, 0xd5, 0xc3, 0x37, 0x75, 0xa6, 0xad, 0xd9, 0xcc, + 0x0a, 0x99, 0x02,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af, 0xcf, + 0x9b, 0x57, 0x3d, 0x93, 0x66, 0x9e, 0xd8, 0x89, 0x16, 0xb7, 0xec, 0xf4, + 0xdc, 0x64, 0xbe, 0x2d, 0xc2, 0x40, 0x84, 0xf3, 0x0c, 0x17, 0x8a, 0xa8, + 0x36, 0x5e, 0x39, 0x54, 0x9b, 0x34, 0xd9, 0x6a, 0x4c, 0xf1, 0xcf, 0x1e, + 0x7c, 0x32, 0xd6, 0x6f, 0x4f, 0xe9, 0xdf, 0x3e, 0x89, 0x97, 0x1e, 0xe6, + 0xd4, 0x51, 0x20, 0xff, 0x45, 0x61, 0xc6, 0x6e, 0x48, 0x4d, 0x4e, 0xe6, + 0x43, 0x93, 0xc4, 0xab, 0x9c, 0xf8, 0xa5, 0x75, 0xf0, 0xb1, 0xf1, 0x10, + 0xdd, 0xda, 0x6b, 0x1d, 0x6e, 0x7d, 0x5f, 0x93, 0x5f, 0x6c, 0x7a, 0x2a, + 0xf1, 0x9a, 0xa6, 0xdb, 0xe4, 0xe5, 0xa7, 0xe6, 0x7b, 0x7c, 0x14, 0x6e, + 0x98, 0x70, 0xfb, 0x75, 0x98, 0x6d, 0x3d, 0xd4, 0x5a, 0x03, 0x97, 0xb8, + 0x97, 0x07, 0x4f, 0x40, 0x19, 0xd3, 0x7f, 0x73, 0x79, 0x90, 0x45, 0x5a, + 0x4a, 0x78, 0x6c, 0x1e, 0x7a, 0x8f, 0xe9, 0x9f, 0x8f, 0x9b, 0xff, 0x02, + 0x61, 0xd2, 0xcf, 0xff, 0x21, 0x3b, 0x17, 0xe8, 0x24, 0x3e, 0x2c, 0xf5, + 0xec, 0x9d, 0x45, 0xe0, 0x21, 0x26, 0x7f, 0x0f, 0x00, 0x00, 0xff, 0xff, + 0xc9, 0x2e, 0x07, 0x65, 0xc7, 0x19, 0x00, 0x00, }, "conf/app.ini", ) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index cb7734bb32..f03aa8aeae 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -47,12 +47,12 @@ var ( StaticRootPath string // Security settings. - InstallLock bool - SecretKey string - LogInRememberDays int - CookieUserName string - CookieRememberName string - ReverseProxyAuthUid string + InstallLock bool + SecretKey string + LogInRememberDays int + CookieUserName string + CookieRememberName string + ReverseProxyAuthUser string // Webhook settings. WebhookTaskInterval int @@ -164,7 +164,7 @@ func NewConfigContext() { LogInRememberDays = Cfg.MustInt("security", "LOGIN_REMEMBER_DAYS") CookieUserName = Cfg.MustValue("security", "COOKIE_USERNAME") CookieRememberName = Cfg.MustValue("security", "COOKIE_REMEMBER_NAME") - ReverseProxyAuthUid = Cfg.MustValue("security", "REVERSE_PROXY_AUTHENTICATION_UID", "X-WEBAUTH-UID") + ReverseProxyAuthUser = Cfg.MustValue("security", "REVERSE_PROXY_AUTHENTICATION_USER", "X-WEBAUTH-USER") RunUser = Cfg.MustValue("", "RUN_USER") curUser := os.Getenv("USER") diff --git a/routers/admin/admin.go b/routers/admin/admin.go index 140e1e9f63..50a3823a0f 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -206,7 +206,7 @@ func Config(ctx *middleware.Context) { ctx.Data["StaticRootPath"] = setting.StaticRootPath ctx.Data["LogRootPath"] = setting.LogRootPath ctx.Data["ScriptType"] = setting.ScriptType - ctx.Data["ReverseProxyAuthUid"] = setting.ReverseProxyAuthUid + ctx.Data["ReverseProxyAuthUser"] = setting.ReverseProxyAuthUser ctx.Data["Service"] = setting.Service diff --git a/templates/VERSION b/templates/VERSION index ca3b3f1ba5..8c2be60bbf 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.5.0623 Alpha \ No newline at end of file +0.4.5.0624 Alpha \ No newline at end of file diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 22be5900e3..10a53b5397 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -36,8 +36,8 @@
{{.LogRootPath}}
Script Type
{{.ScriptType}}
-
Reverse Authentication UID
-
{{.ReverseProxyAuthUid}}
+
Reverse Authentication User
+
{{.ReverseProxyAuthUser}}
From cc703ee6631e9a559fc3a72bf97d68c8fd5ebd10 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Wed, 25 Jun 2014 12:22:08 +0800 Subject: [PATCH 41/55] select owner when creating repository --- public/css/gogs.css | 7 +++++-- templates/repo/create.tmpl | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/public/css/gogs.css b/public/css/gogs.css index 1f465d845b..960176f582 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -257,6 +257,9 @@ html, body { .card .btn { cursor: pointer; +} + +.card .btn-primary { margin-right: 1.2em; } @@ -638,7 +641,7 @@ html, body { margin: 0 .5em; } -#dashboard-switch .btn { +#dashboard-switch .btn, #repo-owner-switch .btn { height: 40px; } @@ -647,7 +650,7 @@ html, body { margin-right: 18px; } -#dashboard-switch .dropdown-menu { +#dashboard-switch .dropdown-menu,#repo-owner-switch .dropdown-menu { padding: 0; } diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 6da6a93d15..0d1c42deee 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -8,9 +8,28 @@
+
+ + + +
+
+ +
From e0f9c628c5ff7399167944b3d0730698487af498 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 25 Jun 2014 00:44:48 -0400 Subject: [PATCH 42/55] Add create organization --- cmd/serve.go | 20 ++-- cmd/web.go | 5 +- gogs.go | 2 +- models/access.go | 17 +-- models/issue.go | 4 +- models/login.go | 4 +- models/models.go | 2 +- models/org.go | 69 ++++++++++++ models/repo.go | 10 +- models/user.go | 190 +++++++++++++++++++++++++++------- modules/auth/org.go | 33 ++++++ modules/middleware/repo.go | 4 +- routers/admin/user.go | 4 +- routers/install.go | 2 +- routers/org/org.go | 96 +++++++++++++++-- routers/repo/http.go | 8 +- routers/repo/setting.go | 4 +- routers/user/home.go | 13 ++- routers/user/user.go | 7 +- templates/VERSION | 2 +- templates/org/dashboard.tmpl | 73 ------------- templates/org/new.tmpl | 24 +---- templates/user/dashboard.tmpl | 39 +++++-- templates/user/issues.tmpl | 3 +- 24 files changed, 438 insertions(+), 197 deletions(-) create mode 100644 models/org.go create mode 100644 modules/auth/org.go delete mode 100644 templates/org/dashboard.tmpl diff --git a/cmd/serve.go b/cmd/serve.go index 62e290d82a..2a76da7937 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -56,19 +56,19 @@ func parseCmd(cmd string) (string, string) { } var ( - COMMANDS_READONLY = map[string]int{ - "git-upload-pack": models.AU_WRITABLE, - "git upload-pack": models.AU_WRITABLE, - "git-upload-archive": models.AU_WRITABLE, + COMMANDS_READONLY = map[string]models.AccessType{ + "git-upload-pack": models.WRITABLE, + "git upload-pack": models.WRITABLE, + "git-upload-archive": models.WRITABLE, } - COMMANDS_WRITE = map[string]int{ - "git-receive-pack": models.AU_READABLE, - "git receive-pack": models.AU_READABLE, + COMMANDS_WRITE = map[string]models.AccessType{ + "git-receive-pack": models.READABLE, + "git receive-pack": models.READABLE, } ) -func In(b string, sl map[string]int) bool { +func In(b string, sl map[string]models.AccessType) bool { _, e := sl[b] return e } @@ -129,7 +129,7 @@ func runServ(k *cli.Context) { // Access check. switch { case isWrite: - has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.AU_WRITABLE) + has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.WRITABLE) if err != nil { println("Gogs: internal error:", err) log.GitLogger.Fatal("Fail to check write access:", err) @@ -152,7 +152,7 @@ func runServ(k *cli.Context) { break } - has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.AU_READABLE) + has, err := models.HasAccess(user.Name, path.Join(repoUserName, repoName), models.READABLE) if err != nil { println("Gogs: internal error:", err) log.GitLogger.Fatal("Fail to check read access:", err) diff --git a/cmd/web.go b/cmd/web.go index d29183a9dc..878fdeac70 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -188,14 +188,15 @@ func runWeb(*cli.Context) { reqOwner := middleware.RequireOwner() - m.Group("/o", func(r martini.Router) { + m.Group("/org", func(r martini.Router) { r.Get("/create", org.New) + r.Post("/create", bindIgnErr(auth.CreateOrganizationForm{}), org.NewPost) r.Get("/:org", org.Organization) r.Get("/:org/dashboard", org.Dashboard) r.Get("/:org/members", org.Members) r.Get("/:org/teams", org.Teams) r.Get("/:org/setting", org.Setting) - }) + }, reqSignIn) m.Group("/:username/:reponame", func(r martini.Router) { r.Get("/settings", repo.Setting) diff --git a/gogs.go b/gogs.go index 75d3eb4b8d..5c2c6ed943 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.5.0624 Alpha" +const APP_VER = "0.4.5.0625 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/access.go b/models/access.go index cf31fc137b..5238daba32 100644 --- a/models/access.go +++ b/models/access.go @@ -11,19 +11,20 @@ import ( "github.com/go-xorm/xorm" ) -// Access types. +type AccessType int + const ( - AU_READABLE = iota + 1 - AU_WRITABLE + READABLE AccessType = iota + 1 + WRITABLE ) // Access represents the accessibility of user to repository. type Access struct { Id int64 - UserName string `xorm:"unique(s)"` - RepoName string `xorm:"unique(s)"` // / - Mode int `xorm:"unique(s)"` - Created time.Time `xorm:"created"` + UserName string `xorm:"unique(s)"` + RepoName string `xorm:"unique(s)"` // / + Mode AccessType `xorm:"unique(s)"` + Created time.Time `xorm:"created"` } // AddAccess adds new access record. @@ -59,7 +60,7 @@ func UpdateAccessWithSession(sess *xorm.Session, access *Access) error { // HasAccess returns true if someone can read or write to given repository. // The repoName should be in format /. -func HasAccess(uname, repoName string, mode int) (bool, error) { +func HasAccess(uname, repoName string, mode AccessType) (bool, error) { if len(repoName) == 0 { return false, nil } diff --git a/models/issue.go b/models/issue.go index 11f6dd4ef9..6d67a72bc4 100644 --- a/models/issue.go +++ b/models/issue.go @@ -213,9 +213,9 @@ func GetIssueCountByPoster(uid, rid int64, isClosed bool) int64 { // IssueUser represents an issue-user relation. type IssueUser struct { Id int64 - Uid int64 // User ID. + Uid int64 `xorm:"INDEX"` // User ID. IssueId int64 - RepoId int64 + RepoId int64 `xorm:"INDEX"` MilestoneId int64 IsRead bool IsAssigned bool diff --git a/models/login.go b/models/login.go index 98c5c64e40..e99b61e779 100644 --- a/models/login.go +++ b/models/login.go @@ -255,7 +255,7 @@ func LoginUserLdapSource(user *User, name, passwd string, sourceId int64, cfg *L Email: mail, } - return RegisterUser(user) + return CreateUser(user) } type loginAuth struct { @@ -359,5 +359,5 @@ func LoginUserSMTPSource(user *User, name, passwd string, sourceId int64, cfg *S Passwd: passwd, Email: name, } - return RegisterUser(user) + return CreateUser(user) } diff --git a/models/models.go b/models/models.go index d6273d7f98..4e65c00bcb 100644 --- a/models/models.go +++ b/models/models.go @@ -35,7 +35,7 @@ func init() { tables = append(tables, new(User), new(PublicKey), new(Repository), new(Watch), new(Action), new(Access), new(Issue), new(Comment), new(Oauth2), new(Follow), new(Mirror), new(Release), new(LoginSource), new(Webhook), new(IssueUser), - new(Milestone), new(Label), new(HookTask)) + new(Milestone), new(Label), new(HookTask), new(Team), new(OrgUser), new(TeamUser)) } func LoadModelsConfig() { diff --git a/models/org.go b/models/org.go new file mode 100644 index 0000000000..1cfe179846 --- /dev/null +++ b/models/org.go @@ -0,0 +1,69 @@ +// Copyright 2014 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package models + +type AuthorizeType int + +const ( + ORG_READABLE AuthorizeType = iota + 1 + ORG_WRITABLE + ORG_ADMIN +) + +// Team represents a organization team. +type Team struct { + Id int64 + OrgId int64 `xorm:"INDEX"` + Name string + Description string + Authorize AuthorizeType + NumMembers int + NumRepos int +} + +// NewTeam creates a record of new team. +func NewTeam(t *Team) error { + _, err := x.Insert(t) + return err +} + +// ________ ____ ___ +// \_____ \_______ ____ | | \______ ___________ +// / | \_ __ \/ ___\| | / ___// __ \_ __ \ +// / | \ | \/ /_/ > | /\___ \\ ___/| | \/ +// \_______ /__| \___ /|______//____ >\___ >__| +// \/ /_____/ \/ \/ + +// OrgUser represents an organization-user relation. +type OrgUser struct { + Id int64 + Uid int64 `xorm:"INDEX"` + OrgId int64 `xorm:"INDEX"` + IsPublic bool + IsOwner bool + NumTeam int +} + +// GetOrgUsersByUserId returns all organization-user relations by user ID. +func GetOrgUsersByUserId(uid int64) ([]*OrgUser, error) { + ous := make([]*OrgUser, 0, 10) + err := x.Where("uid=?", uid).Find(&ous) + return ous, err +} + +// ___________ ____ ___ +// \__ ___/___ _____ _____ | | \______ ___________ +// | |_/ __ \\__ \ / \| | / ___// __ \_ __ \ +// | |\ ___/ / __ \| Y Y \ | /\___ \\ ___/| | \/ +// |____| \___ >____ /__|_| /______//____ >\___ >__| +// \/ \/ \/ \/ \/ + +// TeamUser represents an team-user relation. +type TeamUser struct { + Id int64 + Uid int64 + OrgId int64 `xorm:"INDEX"` + TeamId int64 +} diff --git a/models/repo.go b/models/repo.go index 4ccaccbf81..f0e46c713e 100644 --- a/models/repo.go +++ b/models/repo.go @@ -158,7 +158,7 @@ func IsRepositoryExist(u *User, repoName string) (bool, error) { } var ( - illegalEquals = []string{"raw", "install", "api", "avatar", "user", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin"} + illegalEquals = []string{"raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin"} illegalSuffixs = []string{".git"} ) @@ -483,7 +483,9 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir sess := x.NewSession() defer sess.Close() - sess.Begin() + if err = sess.Begin(); err != nil { + return nil, err + } if _, err = sess.Insert(repo); err != nil { if err2 := os.RemoveAll(repoPath); err2 != nil { @@ -495,9 +497,9 @@ func CreateRepository(user *User, name, desc, lang, license string, private, mir return nil, err } - mode := AU_WRITABLE + mode := WRITABLE if mirror { - mode = AU_READABLE + mode = READABLE } access := Access{ UserName: user.LowerName, diff --git a/models/user.go b/models/user.go index 50d81c942d..2388be9a9c 100644 --- a/models/user.go +++ b/models/user.go @@ -21,10 +21,11 @@ import ( "github.com/gogits/gogs/modules/setting" ) -// User types. +type UserType int + const ( - UT_INDIVIDUAL = iota + 1 - UT_ORGANIZATION + INDIVIDUAL UserType = iota // Historic reason to make it starts at 0. + ORGANIZATION ) var ( @@ -50,7 +51,8 @@ type User struct { LoginType LoginType LoginSource int64 `xorm:"not null default 0"` LoginName string - Type int + Type UserType + Orgs []*User `xorm:"-"` NumFollowers int NumFollowings int NumStars int @@ -65,36 +67,60 @@ type User struct { Salt string `xorm:"VARCHAR(10)"` Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` + + // For organization. + NumTeams int + NumMembers int } // HomeLink returns the user home page link. -func (user *User) HomeLink() string { - return "/user/" + user.Name +func (u *User) HomeLink() string { + return "/user/" + u.Name } // AvatarLink returns user gravatar link. -func (user *User) AvatarLink() string { +func (u *User) AvatarLink() string { if setting.DisableGravatar { return "/img/avatar_default.jpg" } else if setting.Service.EnableCacheAvatar { - return "/avatar/" + user.Avatar + return "/avatar/" + u.Avatar } - return "//1.gravatar.com/avatar/" + user.Avatar + return "//1.gravatar.com/avatar/" + u.Avatar } // NewGitSig generates and returns the signature of given user. -func (user *User) NewGitSig() *git.Signature { +func (u *User) NewGitSig() *git.Signature { return &git.Signature{ - Name: user.Name, - Email: user.Email, + Name: u.Name, + Email: u.Email, When: time.Now(), } } // EncodePasswd encodes password to safe format. -func (user *User) EncodePasswd() { - newPasswd := base.PBKDF2([]byte(user.Passwd), []byte(user.Salt), 10000, 50, sha256.New) - user.Passwd = fmt.Sprintf("%x", newPasswd) +func (u *User) EncodePasswd() { + newPasswd := base.PBKDF2([]byte(u.Passwd), []byte(u.Salt), 10000, 50, sha256.New) + u.Passwd = fmt.Sprintf("%x", newPasswd) +} + +func (u *User) IsOrganization() bool { + return u.Type == ORGANIZATION +} + +func (u *User) GetOrganizations() error { + ous, err := GetOrgUsersByUserId(u.Id) + if err != nil { + return err + } + + u.Orgs = make([]*User, len(ous)) + for i, ou := range ous { + u.Orgs[i], err = GetUserById(ou.OrgId) + if err != nil { + return err + } + } + return nil } // Member represents user is member of organization. @@ -126,49 +152,135 @@ func GetUserSalt() string { return base.GetRandomString(10) } -// RegisterUser creates record of a new user. -func RegisterUser(user *User) (*User, error) { - - if !IsLegalName(user.Name) { +// CreateUser creates record of a new user. +func CreateUser(u *User) (*User, error) { + if !IsLegalName(u.Name) { return nil, ErrUserNameIllegal } - isExist, err := IsUserExist(user.Name) + isExist, err := IsUserExist(u.Name) if err != nil { return nil, err } else if isExist { return nil, ErrUserAlreadyExist } - isExist, err = IsEmailUsed(user.Email) + isExist, err = IsEmailUsed(u.Email) if err != nil { return nil, err } else if isExist { return nil, ErrEmailAlreadyUsed } - user.LowerName = strings.ToLower(user.Name) - user.Avatar = base.EncodeMd5(user.Email) - user.AvatarEmail = user.Email - user.Rands = GetUserSalt() - user.Salt = GetUserSalt() - user.EncodePasswd() - if _, err = x.Insert(user); err != nil { - return nil, err - } else if err = os.MkdirAll(UserPath(user.Name), os.ModePerm); err != nil { - if _, err := x.Id(user.Id).Delete(&User{}); err != nil { - return nil, errors.New(fmt.Sprintf( - "both create userpath %s and delete table record faild: %v", user.Name, err)) - } + u.LowerName = strings.ToLower(u.Name) + u.Avatar = base.EncodeMd5(u.Email) + u.AvatarEmail = u.Email + u.Rands = GetUserSalt() + u.Salt = GetUserSalt() + u.EncodePasswd() + + sess := x.NewSession() + defer sess.Close() + if err = sess.Begin(); err != nil { return nil, err } - if user.Id == 1 { - user.IsAdmin = true - user.IsActive = true - _, err = x.Id(user.Id).UseBool().Update(user) + if _, err = sess.Insert(u); err != nil { + sess.Rollback() + return nil, err } - return user, err + + if err = os.MkdirAll(UserPath(u.Name), os.ModePerm); err != nil { + sess.Rollback() + return nil, err + } + + if err = sess.Commit(); err != nil { + return nil, err + } + + // Auto-set admin for user whose ID is 1. + if u.Id == 1 { + u.IsAdmin = true + u.IsActive = true + _, err = x.Id(u.Id).UseBool().Update(u) + } + return u, err +} + +// CreateOrganization creates record of a new organization. +func CreateOrganization(org, owner *User) (*User, error) { + if !IsLegalName(org.Name) { + return nil, ErrUserNameIllegal + } + + isExist, err := IsUserExist(org.Name) + if err != nil { + return nil, err + } else if isExist { + return nil, ErrUserAlreadyExist + } + + isExist, err = IsEmailUsed(org.Email) + if err != nil { + return nil, err + } else if isExist { + return nil, ErrEmailAlreadyUsed + } + + org.LowerName = strings.ToLower(org.Name) + org.Avatar = base.EncodeMd5(org.Email) + org.AvatarEmail = org.Email + // No password for organization. + org.NumTeams = 1 + org.NumMembers = 1 + + sess := x.NewSession() + defer sess.Close() + if err = sess.Begin(); err != nil { + return nil, err + } + + if _, err = sess.Insert(org); err != nil { + sess.Rollback() + return nil, err + } + + // Create default owner team. + t := &Team{ + OrgId: org.Id, + Name: "Owner", + Authorize: ORG_ADMIN, + NumMembers: 1, + } + if _, err = sess.Insert(t); err != nil { + sess.Rollback() + return nil, err + } + + // Add initial creator to organization and owner team. + ou := &OrgUser{ + Uid: owner.Id, + OrgId: org.Id, + IsOwner: true, + NumTeam: 1, + } + if _, err = sess.Insert(ou); err != nil { + sess.Rollback() + return nil, err + } + + tu := &TeamUser{ + Uid: owner.Id, + OrgId: org.Id, + TeamId: t.Id, + } + if _, err = sess.Insert(tu); err != nil { + sess.Rollback() + return nil, err + } + + return org, sess.Commit() } // GetUsers returns given number of user objects with offset. diff --git a/modules/auth/org.go b/modules/auth/org.go new file mode 100644 index 0000000000..a60fbb851e --- /dev/null +++ b/modules/auth/org.go @@ -0,0 +1,33 @@ +// Copyright 2014 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package auth + +import ( + "net/http" + "reflect" + + "github.com/go-martini/martini" + + "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/middleware/binding" +) + +type CreateOrganizationForm struct { + OrgName string `form:"orgname" binding:"Required;AlphaDashDot;MaxSize(30)"` + Email string `form:"email" binding:"Required;Email;MaxSize(50)"` +} + +func (f *CreateOrganizationForm) Name(field string) string { + names := map[string]string{ + "OrgName": "Organization name", + "Email": "E-mail address", + } + return names[field] +} + +func (f *CreateOrganizationForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) { + data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) + validate(errs, data, f) +} diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index 6c77ed2a77..43ba1e8c5a 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -46,7 +46,7 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler { // Collaborators who have write access can be seen as owners. if ctx.IsSigned { - ctx.Repo.IsOwner, err = models.HasAccess(ctx.User.Name, userName+"/"+repoName, models.AU_WRITABLE) + ctx.Repo.IsOwner, err = models.HasAccess(ctx.User.Name, userName+"/"+repoName, models.WRITABLE) if err != nil { ctx.Handle(500, "RepoAssignment(HasAccess)", err) return @@ -107,7 +107,7 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler { return } - hasAccess, err := models.HasAccess(ctx.User.Name, ctx.Repo.Owner.Name+"/"+repo.Name, models.AU_READABLE) + hasAccess, err := models.HasAccess(ctx.User.Name, ctx.Repo.Owner.Name+"/"+repo.Name, models.READABLE) if err != nil { ctx.Handle(500, "RepoAssignment(HasAccess)", err) return diff --git a/routers/admin/user.go b/routers/admin/user.go index d1bbb48068..cf99db2bf7 100644 --- a/routers/admin/user.go +++ b/routers/admin/user.go @@ -67,7 +67,7 @@ func NewUserPost(ctx *middleware.Context, form auth.RegisterForm) { } var err error - if u, err = models.RegisterUser(u); err != nil { + if u, err = models.CreateUser(u); err != nil { switch err { case models.ErrUserAlreadyExist: ctx.RenderWithErr("Username has been already taken", USER_NEW, &form) @@ -76,7 +76,7 @@ func NewUserPost(ctx *middleware.Context, form auth.RegisterForm) { case models.ErrUserNameIllegal: ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), USER_NEW, &form) default: - ctx.Handle(500, "admin.user.NewUser(RegisterUser)", err) + ctx.Handle(500, "admin.user.NewUser(CreateUser)", err) } return } diff --git a/routers/install.go b/routers/install.go index 6ce7c98026..bb3c16eae4 100644 --- a/routers/install.go +++ b/routers/install.go @@ -227,7 +227,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) { GlobalInit() // Create admin account. - if _, err := models.RegisterUser(&models.User{Name: form.AdminName, Email: form.AdminEmail, Passwd: form.AdminPasswd, + if _, err := models.CreateUser(&models.User{Name: form.AdminName, Email: form.AdminEmail, Passwd: form.AdminPasswd, IsAdmin: true, IsActive: true}); err != nil { if err != models.ErrUserAlreadyExist { setting.InstallLock = false diff --git a/routers/org/org.go b/routers/org/org.go index ff97402ebc..0595a81b3d 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -1,33 +1,117 @@ +// Copyright 2014 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + package org import ( "github.com/go-martini/martini" + + "github.com/gogits/gogs/models" + "github.com/gogits/gogs/modules/auth" + "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" + "github.com/gogits/gogs/routers/user" +) + +const ( + NEW base.TplName = "org/new" ) func Organization(ctx *middleware.Context, params martini.Params) { - ctx.Data["Title"] = "Organization "+params["org"] + ctx.Data["Title"] = "Organization " + params["org"] ctx.HTML(200, "org/org") } func Members(ctx *middleware.Context, params martini.Params) { - ctx.Data["Title"] = "Organization "+params["org"]+" Members" + ctx.Data["Title"] = "Organization " + params["org"] + " Members" ctx.HTML(200, "org/members") } func Teams(ctx *middleware.Context, params martini.Params) { - ctx.Data["Title"] = "Organization "+params["org"]+" Teams" + ctx.Data["Title"] = "Organization " + params["org"] + " Teams" ctx.HTML(200, "org/teams") } func New(ctx *middleware.Context) { - ctx.Data["Title"] = "Create an Organization" - ctx.HTML(200, "org/new") + ctx.Data["Title"] = "Create An Organization" + ctx.HTML(200, NEW) +} + +func NewPost(ctx *middleware.Context, form auth.CreateOrganizationForm) { + ctx.Data["Title"] = "Create An Organization" + + if ctx.HasError() { + ctx.HTML(200, NEW) + return + } + + org := &models.User{ + Name: form.OrgName, + Email: form.Email, + IsActive: true, // NOTE: may need to set false when require e-mail confirmation. + Type: models.ORGANIZATION, + } + + var err error + if org, err = models.CreateOrganization(org, ctx.User); err != nil { + switch err { + case models.ErrUserAlreadyExist: + ctx.Data["Err_OrgName"] = true + ctx.RenderWithErr("Organization name has been already taken", NEW, &form) + case models.ErrEmailAlreadyUsed: + ctx.Data["Err_Email"] = true + ctx.RenderWithErr("E-mail address has been already used", NEW, &form) + case models.ErrUserNameIllegal: + ctx.Data["Err_OrgName"] = true + ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), NEW, &form) + default: + ctx.Handle(500, "user.NewPost(CreateUser)", err) + } + return + } + log.Trace("%s Organization created: %s", ctx.Req.RequestURI, org.Name) + + ctx.Redirect("/org/" + form.OrgName + "/dashboard") } func Dashboard(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = "Dashboard" - ctx.HTML(200, "org/dashboard") + ctx.Data["PageIsUserDashboard"] = true + ctx.Data["PageIsOrgDashboard"] = true + + org, err := models.GetUserByName(params["org"]) + if err != nil { + if err == models.ErrUserNotExist { + ctx.Handle(404, "org.Dashboard(GetUserByName)", err) + } else { + ctx.Handle(500, "org.Dashboard(GetUserByName)", err) + } + return + } + + if err := ctx.User.GetOrganizations(); err != nil { + ctx.Handle(500, "home.Dashboard(GetOrganizations)", err) + return + } + ctx.Data["Orgs"] = ctx.User.Orgs + ctx.Data["ContextUser"] = org + + ctx.Data["MyRepos"], err = models.GetRepositories(org.Id, true) + if err != nil { + ctx.Handle(500, "org.Dashboard(GetRepositories)", err) + return + } + + actions, err := models.GetFeeds(org.Id, 0, false) + if err != nil { + ctx.Handle(500, "org.Dashboard(GetFeeds)", err) + return + } + ctx.Data["Feeds"] = actions + + ctx.HTML(200, user.DASHBOARD) } func Setting(ctx *middleware.Context, param martini.Params) { diff --git a/routers/repo/http.go b/routers/repo/http.go index d2bff29973..981266d548 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -107,9 +107,9 @@ func Http(ctx *middleware.Context, params martini.Params) { } if !isPublicPull { - var tp = models.AU_WRITABLE + var tp = models.WRITABLE if isPull { - tp = models.AU_READABLE + tp = models.READABLE } has, err := models.HasAccess(authUsername, username+"/"+reponame, tp) @@ -117,8 +117,8 @@ func Http(ctx *middleware.Context, params martini.Params) { ctx.Handle(401, "no basic auth and digit auth", nil) return } else if !has { - if tp == models.AU_READABLE { - has, err = models.HasAccess(authUsername, username+"/"+reponame, models.AU_WRITABLE) + if tp == models.READABLE { + has, err = models.HasAccess(authUsername, username+"/"+reponame, models.WRITABLE) if err != nil || !has { ctx.Handle(401, "no basic auth and digit auth", nil) return diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 6479cb3041..3d48e79c3d 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -175,7 +175,7 @@ func CollaborationPost(ctx *middleware.Context) { ctx.Redirect(ctx.Req.RequestURI) return } - has, err := models.HasAccess(name, repoLink, models.AU_WRITABLE) + has, err := models.HasAccess(name, repoLink, models.WRITABLE) if err != nil { ctx.Handle(500, "setting.CollaborationPost(HasAccess)", err) return @@ -196,7 +196,7 @@ func CollaborationPost(ctx *middleware.Context) { } if err = models.AddAccess(&models.Access{UserName: name, RepoName: repoLink, - Mode: models.AU_WRITABLE}); err != nil { + Mode: models.WRITABLE}); err != nil { ctx.Handle(500, "setting.CollaborationPost(AddAccess)", err) return } diff --git a/routers/user/home.go b/routers/user/home.go index 0f2cee2565..86907b5a90 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -20,7 +20,7 @@ import ( const ( DASHBOARD base.TplName = "user/dashboard" PROFILE base.TplName = "user/profile" - ISSUES base.TplName = "user/issue" + ISSUES base.TplName = "user/issues" PULLS base.TplName = "user/pulls" STARS base.TplName = "user/stars" ) @@ -29,6 +29,13 @@ func Dashboard(ctx *middleware.Context) { ctx.Data["Title"] = "Dashboard" ctx.Data["PageIsUserDashboard"] = true + if err := ctx.User.GetOrganizations(); err != nil { + ctx.Handle(500, "home.Dashboard(GetOrganizations)", err) + return + } + ctx.Data["Orgs"] = ctx.User.Orgs + ctx.Data["ContextUser"] = ctx.User + var err error ctx.Data["MyRepos"], err = models.GetRepositories(ctx.User.Id, true) if err != nil { @@ -53,7 +60,7 @@ func Dashboard(ctx *middleware.Context) { for _, act := range actions { if act.IsPrivate { if has, _ := models.HasAccess(ctx.User.Name, act.RepoUserName+"/"+act.RepoName, - models.AU_READABLE); !has { + models.READABLE); !has { continue } } @@ -131,7 +138,7 @@ func Feeds(ctx *middleware.Context, form auth.FeedsForm) { for _, act := range actions { if act.IsPrivate { if has, _ := models.HasAccess(ctx.User.Name, act.RepoUserName+"/"+act.RepoName, - models.AU_READABLE); !has { + models.READABLE); !has { continue } } diff --git a/routers/user/user.go b/routers/user/user.go index 8144730e09..a50f126c0c 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -226,7 +226,7 @@ func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) { } var err error - if u, err = models.RegisterUser(u); err != nil { + if u, err = models.CreateUser(u); err != nil { switch err { case models.ErrUserAlreadyExist: ctx.Data["Err_UserName"] = true @@ -235,13 +235,14 @@ func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) { ctx.Data["Err_Email"] = true ctx.RenderWithErr("E-mail address has been already used", SIGNUP, &form) case models.ErrUserNameIllegal: + ctx.Data["Err_UserName"] = true ctx.RenderWithErr(models.ErrRepoNameIllegal.Error(), SIGNUP, &form) default: - ctx.Handle(500, "user.SignUpPost(RegisterUser)", err) + ctx.Handle(500, "user.SignUpPost(CreateUser)", err) } return } - log.Trace("%s User created: %s", ctx.Req.RequestURI, form.UserName) + log.Trace("%s User created: %s", ctx.Req.RequestURI, u.Name) // Bind social account. if isOauth { diff --git a/templates/VERSION b/templates/VERSION index 8c2be60bbf..b5cda695b5 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.5.0624 Alpha \ No newline at end of file +0.4.5.0625 Alpha \ No newline at end of file diff --git a/templates/org/dashboard.tmpl b/templates/org/dashboard.tmpl deleted file mode 100644 index f86de1f42b..0000000000 --- a/templates/org/dashboard.tmpl +++ /dev/null @@ -1,73 +0,0 @@ -{{template "base/head" .}} -{{template "base/navbar" .}} -
-
-
- - - -
- -

News Feed

-
-
-
- {{if .HasInfo}}
{{.InfoMsg}}
{{end}} -
-
    - {{range .Feeds}} -
  • - -
    {{TimeSince .Created}}
    {{ActionDesc . | str2html}}
    - -
  • - {{else}} -
  • Oh. Looks like there isn't any activity here yet. Get Busy!
  • - {{end}} -
-
-
-
-
Repositories -
- - -
-
- -
- -
-
-
-
-{{template "base/footer" .}} diff --git a/templates/org/new.tmpl b/templates/org/new.tmpl index baa9c9dfa0..bb46db4ac3 100644 --- a/templates/org/new.tmpl +++ b/templates/org/new.tmpl @@ -1,22 +1,14 @@ {{template "base/head" .}} {{template "base/navbar" .}}
-
+ {{.CsrfTokenHtml}}

Create New Organization

{{template "base/alert" .}} -
- -
-

{{.SignedUserName}}

- -
-
- -
+
- + Great organization names are short and memorable.
@@ -24,18 +16,10 @@
- + Organization's Email receives all notifications and confirmations.
- -
diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl index 12018ad891..e1b43e1597 100644 --- a/templates/user/dashboard.tmpl +++ b/templates/user/dashboard.tmpl @@ -4,29 +4,46 @@
-

News Feed

+
{{if .HasInfo}}
{{.InfoMsg}}
{{end}}
@@ -44,7 +61,7 @@
-
Your Repositories +
{{if not .PageIsOrgDashboard}}Your {{end}}Repositories
- + + {{if not .PageIsOrgDashboard}}
Collaborative Repositories
@@ -78,6 +96,7 @@
+ {{end}}
{{template "base/footer" .}} diff --git a/templates/user/issues.tmpl b/templates/user/issues.tmpl index d1c2bd9941..c4ad64a4cf 100644 --- a/templates/user/issues.tmpl +++ b/templates/user/issues.tmpl @@ -3,7 +3,7 @@
+
{{if .HasInfo}}
{{.InfoMsg}}
{{end}}
From 8e6c254c03dc19cac3ff6dad39f73b1509b46fcf Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 25 Jun 2014 00:53:45 -0400 Subject: [PATCH 43/55] Mirror fix on create repo --- templates/repo/create.tmpl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 0d1c42deee..fc0eb371bb 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -10,21 +10,26 @@
+ +
From 8644c571dbcb964a338565c8042ff71957030e52 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 25 Jun 2014 05:27:17 -0400 Subject: [PATCH 48/55] Mirror bug fix on create repo action --- models/action.go | 3 ++- models/repo.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/models/action.go b/models/action.go index bbbe2134e1..55557da2ff 100644 --- a/models/action.go +++ b/models/action.go @@ -184,7 +184,8 @@ func CommitRepoAction(userId, repoUserId int64, userName, actEmail string, // NewRepoAction adds new action for creating repository. func NewRepoAction(u *User, repo *Repository) (err error) { if err = NotifyWatchers(&Action{ActUserId: u.Id, ActUserName: u.Name, ActEmail: u.Email, - OpType: OP_CREATE_REPO, RepoId: repo.Id, RepoName: repo.Name, IsPrivate: repo.IsPrivate}); err != nil { + OpType: OP_CREATE_REPO, RepoId: repo.Id, RepoUserName: repo.Owner.Name, RepoName: repo.Name, + IsPrivate: repo.IsPrivate}); err != nil { log.Error("action.NewRepoAction(notify watchers): %d/%s", u.Id, repo.Name) return err } diff --git a/models/repo.go b/models/repo.go index 9cf90a9439..728f14a7d6 100644 --- a/models/repo.go +++ b/models/repo.go @@ -475,6 +475,7 @@ func CreateRepository(u *User, name, desc, lang, license string, private, mirror repo := &Repository{ OwnerId: u.Id, + Owner: u, Name: name, LowerName: strings.ToLower(name), Description: desc, From 32b09681b2da96afe9a44790e7944c4ac51e696c Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 25 Jun 2014 05:35:23 -0400 Subject: [PATCH 49/55] Migrate repository by organization --- models/repo.go | 8 +++---- modules/auth/repo.go | 1 + routers/repo/repo.go | 46 +++++++++++++++++++++++++++++-------- templates/repo/migrate.tmpl | 32 ++++++++++++++++++++++++-- 4 files changed, 72 insertions(+), 15 deletions(-) diff --git a/models/repo.go b/models/repo.go index 728f14a7d6..840529b959 100644 --- a/models/repo.go +++ b/models/repo.go @@ -251,8 +251,8 @@ func MirrorUpdate() { } // MigrateRepository migrates a existing repository from other project hosting. -func MigrateRepository(user *User, name, desc string, private, mirror bool, url string) (*Repository, error) { - repo, err := CreateRepository(user, name, desc, "", "", private, mirror, false) +func MigrateRepository(u *User, name, desc string, private, mirror bool, url string) (*Repository, error) { + repo, err := CreateRepository(u, name, desc, "", "", private, mirror, false) if err != nil { return nil, err } @@ -261,11 +261,11 @@ func MigrateRepository(user *User, name, desc string, private, mirror bool, url tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("%d", time.Now().Nanosecond())) os.MkdirAll(tmpDir, os.ModePerm) - repoPath := RepoPath(user.Name, name) + repoPath := RepoPath(u.Name, name) repo.IsBare = false if mirror { - if err = MirrorRepository(repo.Id, user.Name, repo.Name, repoPath, url); err != nil { + if err = MirrorRepository(repo.Id, u.Name, repo.Name, repoPath, url); err != nil { return repo, err } repo.IsMirror = true diff --git a/modules/auth/repo.go b/modules/auth/repo.go index 999f33fe81..db13743de8 100644 --- a/modules/auth/repo.go +++ b/modules/auth/repo.go @@ -48,6 +48,7 @@ type MigrateRepoForm struct { Url string `form:"url" binding:"Url"` AuthUserName string `form:"auth_username"` AuthPasswd string `form:"auth_password"` + Uid int64 `form:"uid" binding:"Required"` RepoName string `form:"repo" binding:"Required;AlphaDash;MaxSize(100)"` Mirror bool `form:"mirror"` Private bool `form:"private"` diff --git a/routers/repo/repo.go b/routers/repo/repo.go index d96456422b..6cb6c0660e 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -53,7 +53,7 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) { ctx.Data["Licenses"] = models.Licenses if err := ctx.User.GetOrganizations(); err != nil { - ctx.Handle(500, "home.Dashboard(GetOrganizations)", err) + ctx.Handle(500, "home.CreatePost(GetOrganizations)", err) return } ctx.Data["Orgs"] = ctx.User.Orgs @@ -70,9 +70,9 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) { u, err = models.GetUserById(form.Uid) if err != nil { if err == models.ErrUserNotExist { - ctx.Handle(404, "home.Dashboard(GetUserById)", err) + ctx.Handle(404, "home.CreatePost(GetUserById)", err) } else { - ctx.Handle(500, "home.Dashboard(GetUserById)", err) + ctx.Handle(500, "home.CreatePost(GetUserById)", err) } return } @@ -97,12 +97,19 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) { log.Error("repo.CreatePost(DeleteRepository): %v", errDelete) } } - ctx.Handle(500, "repo.CreatePost", err) + ctx.Handle(500, "repo.CreatePost(CreateRepository)", err) } func Migrate(ctx *middleware.Context) { ctx.Data["Title"] = "Migrate repository" ctx.Data["PageIsNewRepo"] = true + + if err := ctx.User.GetOrganizations(); err != nil { + ctx.Handle(500, "home.Migrate(GetOrganizations)", err) + return + } + ctx.Data["Orgs"] = ctx.User.Orgs + ctx.HTML(200, MIGRATE) } @@ -110,19 +117,40 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { ctx.Data["Title"] = "Migrate repository" ctx.Data["PageIsNewRepo"] = true + if err := ctx.User.GetOrganizations(); err != nil { + ctx.Handle(500, "home.MigratePost(GetOrganizations)", err) + return + } + ctx.Data["Orgs"] = ctx.User.Orgs + if ctx.HasError() { ctx.HTML(200, MIGRATE) return } + u := ctx.User + // Not equal means current user is an organization. + if u.Id != form.Uid { + var err error + u, err = models.GetUserById(form.Uid) + if err != nil { + if err == models.ErrUserNotExist { + ctx.Handle(404, "home.MigratePost(GetUserById)", err) + } else { + ctx.Handle(500, "home.MigratePost(GetUserById)", err) + } + return + } + } + authStr := strings.Replace(fmt.Sprintf("://%s:%s", form.AuthUserName, form.AuthPasswd), "@", "%40", -1) url := strings.Replace(form.Url, "://", authStr+"@", 1) - repo, err := models.MigrateRepository(ctx.User, form.RepoName, form.Description, form.Private, + repo, err := models.MigrateRepository(u, form.RepoName, form.Description, form.Private, form.Mirror, url) if err == nil { - log.Trace("%s Repository migrated: %s/%s", ctx.Req.RequestURI, ctx.User.LowerName, form.RepoName) - ctx.Redirect("/" + ctx.User.Name + "/" + form.RepoName) + log.Trace("%s Repository migrated: %s/%s", ctx.Req.RequestURI, u.LowerName, form.RepoName) + ctx.Redirect("/" + u.Name + "/" + form.RepoName) return } else if err == models.ErrRepoAlreadyExist { ctx.RenderWithErr("Repository name has already been used", MIGRATE, &form) @@ -133,7 +161,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { } if repo != nil { - if errDelete := models.DeleteRepository(ctx.User.Id, repo.Id, ctx.User.Name); errDelete != nil { + if errDelete := models.DeleteRepository(u.Id, repo.Id, u.Name); errDelete != nil { log.Error("repo.MigratePost(DeleteRepository): %v", errDelete) } } @@ -142,7 +170,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { ctx.RenderWithErr(err.Error(), MIGRATE, &form) return } - ctx.Handle(500, "repo.Migrate", err) + ctx.Handle(500, "repo.Migrate(MigrateRepository)", err) } func Single(ctx *middleware.Context, params martini.Params) { diff --git a/templates/repo/migrate.tmpl b/templates/repo/migrate.tmpl index 34a4077eec..fff25e6de5 100644 --- a/templates/repo/migrate.tmpl +++ b/templates/repo/migrate.tmpl @@ -44,9 +44,37 @@
-

{{.SignedUserName}}

- +
+ + + +
+
From 19e910428951135b9a341554dad54a6546d2ad50 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 27 Jun 2014 03:37:01 -0400 Subject: [PATCH 50/55] Organization settings page --- cmd/web.go | 5 +- gogs.go | 2 +- models/org.go | 86 +++++++++++++ models/repo.go | 2 +- models/user.go | 114 ++++-------------- modules/auth/org.go | 30 ++++- modules/auth/repo.go | 2 +- modules/auth/user.go | 2 +- routers/org/org.go | 56 ++++++++- templates/VERSION | 2 +- templates/org/{setting.tmpl => settings.tmpl} | 56 +++------ 11 files changed, 217 insertions(+), 140 deletions(-) rename templates/org/{setting.tmpl => settings.tmpl} (72%) diff --git a/cmd/web.go b/cmd/web.go index 878fdeac70..729a1ba28f 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -190,12 +190,13 @@ func runWeb(*cli.Context) { m.Group("/org", func(r martini.Router) { r.Get("/create", org.New) - r.Post("/create", bindIgnErr(auth.CreateOrganizationForm{}), org.NewPost) + r.Post("/create", bindIgnErr(auth.CreateOrgForm{}), org.NewPost) r.Get("/:org", org.Organization) r.Get("/:org/dashboard", org.Dashboard) r.Get("/:org/members", org.Members) r.Get("/:org/teams", org.Teams) - r.Get("/:org/setting", org.Setting) + r.Get("/:org/settings", org.Settings) + r.Post("/:org/settings", bindIgnErr(auth.OrgSettingForm{}), org.SettingsPost) }, reqSignIn) m.Group("/:username/:reponame", func(r martini.Router) { diff --git a/gogs.go b/gogs.go index 5c2c6ed943..d56760ab24 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.5.0625 Alpha" +const APP_VER = "0.4.5.0627 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/org.go b/models/org.go index 227151ab02..553a46aa0b 100644 --- a/models/org.go +++ b/models/org.go @@ -4,6 +4,88 @@ package models +import ( + "strings" + + "github.com/gogits/gogs/modules/base" +) + +// CreateOrganization creates record of a new organization. +func CreateOrganization(org, owner *User) (*User, error) { + if !IsLegalName(org.Name) { + return nil, ErrUserNameIllegal + } + + isExist, err := IsUserExist(org.Name) + if err != nil { + return nil, err + } else if isExist { + return nil, ErrUserAlreadyExist + } + + isExist, err = IsEmailUsed(org.Email) + if err != nil { + return nil, err + } else if isExist { + return nil, ErrEmailAlreadyUsed + } + + org.LowerName = strings.ToLower(org.Name) + org.FullName = org.Name + org.Avatar = base.EncodeMd5(org.Email) + org.AvatarEmail = org.Email + // No password for organization. + org.NumTeams = 1 + org.NumMembers = 1 + + sess := x.NewSession() + defer sess.Close() + if err = sess.Begin(); err != nil { + return nil, err + } + + if _, err = sess.Insert(org); err != nil { + sess.Rollback() + return nil, err + } + + // Create default owner team. + t := &Team{ + OrgId: org.Id, + Name: OWNER_TEAM, + Authorize: ORG_ADMIN, + NumMembers: 1, + } + if _, err = sess.Insert(t); err != nil { + sess.Rollback() + return nil, err + } + + // Add initial creator to organization and owner team. + ou := &OrgUser{ + Uid: owner.Id, + OrgId: org.Id, + IsOwner: true, + NumTeam: 1, + } + if _, err = sess.Insert(ou); err != nil { + sess.Rollback() + return nil, err + } + + tu := &TeamUser{ + Uid: owner.Id, + OrgId: org.Id, + TeamId: t.Id, + } + if _, err = sess.Insert(tu); err != nil { + sess.Rollback() + return nil, err + } + + return org, sess.Commit() +} + type AuthorizeType int const ( @@ -72,6 +154,10 @@ func GetOrgUsersByOrgId(orgId int64) ([]*OrgUser, error) { return ous, err } +func GetOrganizationCount(u *User) (int64, error) { + return x.Where("uid=?", u.Id).Count(new(OrgUser)) +} + // ___________ ____ ___ // \__ ___/___ _____ _____ | | \______ ___________ // | |_/ __ \\__ \ / \| | / ___// __ \_ __ \ diff --git a/models/repo.go b/models/repo.go index 840529b959..85f2a913d3 100644 --- a/models/repo.go +++ b/models/repo.go @@ -240,7 +240,7 @@ func MirrorUpdate() { "git", "remote", "update"); err != nil { return errors.New("git remote update: " + stderr) } else if err = git.UnpackRefs(repoPath); err != nil { - return err + return errors.New("UnpackRefs: " + err.Error()) } m.NextUpdate = time.Now().Add(time.Duration(m.Interval) * time.Hour) diff --git a/models/user.go b/models/user.go index f67911ca6c..8ffad26632 100644 --- a/models/user.go +++ b/models/user.go @@ -30,6 +30,7 @@ const ( var ( ErrUserOwnRepos = errors.New("User still have ownership of repositories") + ErrUserHasOrgs = errors.New("User still have membership of organization") ErrUserAlreadyExist = errors.New("User already exist") ErrUserNotExist = errors.New("User does not exist") ErrUserNotKeyOwner = errors.New("User does not the owner of public key") @@ -69,8 +70,9 @@ type User struct { Updated time.Time `xorm:"updated"` // For organization. - NumTeams int - NumMembers int + Description string + NumTeams int + NumMembers int } // HomeLink returns the user home page link. @@ -211,81 +213,6 @@ func CreateUser(u *User) (*User, error) { return u, err } -// CreateOrganization creates record of a new organization. -func CreateOrganization(org, owner *User) (*User, error) { - if !IsLegalName(org.Name) { - return nil, ErrUserNameIllegal - } - - isExist, err := IsUserExist(org.Name) - if err != nil { - return nil, err - } else if isExist { - return nil, ErrUserAlreadyExist - } - - isExist, err = IsEmailUsed(org.Email) - if err != nil { - return nil, err - } else if isExist { - return nil, ErrEmailAlreadyUsed - } - - org.LowerName = strings.ToLower(org.Name) - org.Avatar = base.EncodeMd5(org.Email) - org.AvatarEmail = org.Email - // No password for organization. - org.NumTeams = 1 - org.NumMembers = 1 - - sess := x.NewSession() - defer sess.Close() - if err = sess.Begin(); err != nil { - return nil, err - } - - if _, err = sess.Insert(org); err != nil { - sess.Rollback() - return nil, err - } - - // Create default owner team. - t := &Team{ - OrgId: org.Id, - Name: OWNER_TEAM, - Authorize: ORG_ADMIN, - NumMembers: 1, - } - if _, err = sess.Insert(t); err != nil { - sess.Rollback() - return nil, err - } - - // Add initial creator to organization and owner team. - ou := &OrgUser{ - Uid: owner.Id, - OrgId: org.Id, - IsOwner: true, - NumTeam: 1, - } - if _, err = sess.Insert(ou); err != nil { - sess.Rollback() - return nil, err - } - - tu := &TeamUser{ - Uid: owner.Id, - OrgId: org.Id, - TeamId: t.Id, - } - if _, err = sess.Insert(tu); err != nil { - sess.Rollback() - return nil, err - } - - return org, sess.Commit() -} - // GetUsers returns given number of user objects with offset. func GetUsers(num, offset int) ([]User, error) { users := make([]User, 0, num) @@ -392,51 +319,62 @@ func UpdateUser(u *User) (err error) { if len(u.Website) > 255 { u.Website = u.Website[:255] } + if len(u.Description) > 255 { + u.Description = u.Description[:255] + } _, err = x.Id(u.Id).AllCols().Update(u) return err } // DeleteUser completely deletes everything of the user. -func DeleteUser(user *User) error { +func DeleteUser(u *User) error { // Check ownership of repository. - count, err := GetRepositoryCount(user) + count, err := GetRepositoryCount(u) if err != nil { - return errors.New("modesl.GetRepositories: " + err.Error()) + return errors.New("modesl.GetRepositories(GetRepositoryCount): " + err.Error()) } else if count > 0 { return ErrUserOwnRepos } + // Check membership of organization. + count, err = GetOrganizationCount(u) + if err != nil { + return errors.New("modesl.GetRepositories(GetOrganizationCount): " + err.Error()) + } else if count > 0 { + return ErrUserHasOrgs + } + // TODO: check issues, other repos' commits // Delete all followers. - if _, err = x.Delete(&Follow{FollowId: user.Id}); err != nil { + if _, err = x.Delete(&Follow{FollowId: u.Id}); err != nil { return err } // Delete oauth2. - if _, err = x.Delete(&Oauth2{Uid: user.Id}); err != nil { + if _, err = x.Delete(&Oauth2{Uid: u.Id}); err != nil { return err } // Delete all feeds. - if _, err = x.Delete(&Action{UserId: user.Id}); err != nil { + if _, err = x.Delete(&Action{UserId: u.Id}); err != nil { return err } // Delete all watches. - if _, err = x.Delete(&Watch{UserId: user.Id}); err != nil { + if _, err = x.Delete(&Watch{UserId: u.Id}); err != nil { return err } // Delete all accesses. - if _, err = x.Delete(&Access{UserName: user.LowerName}); err != nil { + if _, err = x.Delete(&Access{UserName: u.LowerName}); err != nil { return err } // Delete all SSH keys. keys := make([]*PublicKey, 0, 10) - if err = x.Find(&keys, &PublicKey{OwnerId: user.Id}); err != nil { + if err = x.Find(&keys, &PublicKey{OwnerId: u.Id}); err != nil { return err } for _, key := range keys { @@ -446,11 +384,11 @@ func DeleteUser(user *User) error { } // Delete user directory. - if err = os.RemoveAll(UserPath(user.Name)); err != nil { + if err = os.RemoveAll(UserPath(u.Name)); err != nil { return err } - _, err = x.Delete(user) + _, err = x.Delete(u) return err } diff --git a/modules/auth/org.go b/modules/auth/org.go index a60fbb851e..f87d10a707 100644 --- a/modules/auth/org.go +++ b/modules/auth/org.go @@ -14,12 +14,12 @@ import ( "github.com/gogits/gogs/modules/middleware/binding" ) -type CreateOrganizationForm struct { +type CreateOrgForm struct { OrgName string `form:"orgname" binding:"Required;AlphaDashDot;MaxSize(30)"` Email string `form:"email" binding:"Required;Email;MaxSize(50)"` } -func (f *CreateOrganizationForm) Name(field string) string { +func (f *CreateOrgForm) Name(field string) string { names := map[string]string{ "OrgName": "Organization name", "Email": "E-mail address", @@ -27,7 +27,31 @@ func (f *CreateOrganizationForm) Name(field string) string { return names[field] } -func (f *CreateOrganizationForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) { +func (f *CreateOrgForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) { data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) validate(errs, data, f) } + +type OrgSettingForm struct { + DisplayName string `form:"display_name" binding:"Required;MaxSize(100)"` + Email string `form:"email" binding:"Required;Email;MaxSize(50)"` + Description string `form:"desc" binding:"MaxSize(255)"` + Website string `form:"site" binding:"Url;MaxSize(100)"` + Location string `form:"location" binding:"MaxSize(50)"` +} + +func (f *OrgSettingForm) Name(field string) string { + names := map[string]string{ + "DisplayName": "Display name", + "Email": "E-mail address", + "Description": "Description", + "Website": "Website address", + "Location": "Location", + } + return names[field] +} + +func (f *OrgSettingForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) { + data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) + validate(errors, data, f) +} diff --git a/modules/auth/repo.go b/modules/auth/repo.go index db13743de8..d3d215322a 100644 --- a/modules/auth/repo.go +++ b/modules/auth/repo.go @@ -71,7 +71,7 @@ func (f *MigrateRepoForm) Validate(errors *binding.Errors, req *http.Request, co type RepoSettingForm struct { RepoName string `form:"name" binding:"Required;AlphaDash;MaxSize(100)"` - Description string `form:"desc" binding:"MaxSize(100)"` + Description string `form:"desc" binding:"MaxSize(255)"` Website string `form:"site" binding:"Url;MaxSize(100)"` Branch string `form:"branch"` Interval int `form:"interval"` diff --git a/modules/auth/user.go b/modules/auth/user.go index 20f9933626..4a781acfa5 100644 --- a/modules/auth/user.go +++ b/modules/auth/user.go @@ -93,7 +93,7 @@ func (f *UpdateProfileForm) Name(field string) string { names := map[string]string{ "UserName": "Username", "Email": "E-mail address", - "Website": "Website", + "Website": "Website address", "Location": "Location", "Avatar": "Gravatar Email", } diff --git a/routers/org/org.go b/routers/org/org.go index 0595a81b3d..4f57b9a963 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -16,7 +16,8 @@ import ( ) const ( - NEW base.TplName = "org/new" + NEW base.TplName = "org/new" + SETTINGS base.TplName = "org/settings" ) func Organization(ctx *middleware.Context, params martini.Params) { @@ -39,7 +40,7 @@ func New(ctx *middleware.Context) { ctx.HTML(200, NEW) } -func NewPost(ctx *middleware.Context, form auth.CreateOrganizationForm) { +func NewPost(ctx *middleware.Context, form auth.CreateOrgForm) { ctx.Data["Title"] = "Create An Organization" if ctx.HasError() { @@ -114,7 +115,52 @@ func Dashboard(ctx *middleware.Context, params martini.Params) { ctx.HTML(200, user.DASHBOARD) } -func Setting(ctx *middleware.Context, param martini.Params) { - ctx.Data["Title"] = "Setting" - ctx.HTML(200, "org/setting") +func Settings(ctx *middleware.Context, params martini.Params) { + ctx.Data["Title"] = "Settings" + + org, err := models.GetUserByName(params["org"]) + if err != nil { + if err == models.ErrUserNotExist { + ctx.Handle(404, "org.Settings(GetUserByName)", err) + } else { + ctx.Handle(500, "org.Settings(GetUserByName)", err) + } + return + } + ctx.Data["Org"] = org + + ctx.HTML(200, SETTINGS) +} + +func SettingsPost(ctx *middleware.Context, params martini.Params, form auth.OrgSettingForm) { + ctx.Data["Title"] = "Settings" + + org, err := models.GetUserByName(params["org"]) + if err != nil { + if err == models.ErrUserNotExist { + ctx.Handle(404, "org.SettingsPost(GetUserByName)", err) + } else { + ctx.Handle(500, "org.SettingsPost(GetUserByName)", err) + } + return + } + ctx.Data["Org"] = org + + if ctx.HasError() { + ctx.HTML(200, SETTINGS) + return + } + + org.FullName = form.DisplayName + org.Email = form.Email + org.Description = form.Description + org.Website = form.Website + org.Location = form.Location + if err = models.UpdateUser(org); err != nil { + ctx.Handle(500, "org.SettingsPost(UpdateUser)", err) + return + } + log.Trace("%s Organization setting updated: %s", ctx.Req.RequestURI, org.LowerName) + ctx.Flash.Success("Organization profile has been successfully updated.") + ctx.Redirect("/org/" + org.Name + "/settings") } diff --git a/templates/VERSION b/templates/VERSION index b5cda695b5..be0ebee0f5 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.5.0625 Alpha \ No newline at end of file +0.4.5.0627 Alpha \ No newline at end of file diff --git a/templates/org/setting.tmpl b/templates/org/settings.tmpl similarity index 72% rename from templates/org/setting.tmpl rename to templates/org/settings.tmpl index 1be9707a1a..e19c027d44 100644 --- a/templates/org/setting.tmpl +++ b/templates/org/settings.tmpl @@ -4,32 +4,20 @@
-
+
    @@ -40,52 +28,46 @@ {{template "base/alert" .}}
    - Repository Options + Organization Options
    - + {{.CsrfTokenHtml}} -
    - - +
    +
    - +
    -
    +
    -
    - +
    -
    +
    -
    - +
    -
    +
    -
    - +
    -
    +
    -
    - +
    From b5ba2bd268b144ae0c878fe17257d8685d92f9cc Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Fri, 27 Jun 2014 21:33:49 +0800 Subject: [PATCH 51/55] add organization team-create page --- cmd/web.go | 3 ++ public/css/gogs.css | 2 +- routers/org/org.go | 4 -- routers/org/teams.go | 16 ++++++++ templates/org/new_team.tmpl | 74 +++++++++++++++++++++++++++++++++++++ templates/org/teams.tmpl | 6 +++ 6 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 routers/org/teams.go create mode 100644 templates/org/new_team.tmpl diff --git a/cmd/web.go b/cmd/web.go index 729a1ba28f..bf84d5872b 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -194,7 +194,10 @@ func runWeb(*cli.Context) { r.Get("/:org", org.Organization) r.Get("/:org/dashboard", org.Dashboard) r.Get("/:org/members", org.Members) + // organization teams + r.Get("/:org/teams/new",org.NewTeam) r.Get("/:org/teams", org.Teams) + r.Get("/:org/settings", org.Settings) r.Post("/:org/settings", bindIgnErr(auth.OrgSettingForm{}), org.SettingsPost) }, reqSignIn) diff --git a/public/css/gogs.css b/public/css/gogs.css index 960176f582..eb95a1d088 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -375,7 +375,7 @@ html, body { /* gogits repo create */ -#repo-create, #org-create { +#repo-create, #org-create, #org-teams-create { width: 800px; } diff --git a/routers/org/org.go b/routers/org/org.go index 4f57b9a963..c036a8e5dc 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -30,10 +30,6 @@ func Members(ctx *middleware.Context, params martini.Params) { ctx.HTML(200, "org/members") } -func Teams(ctx *middleware.Context, params martini.Params) { - ctx.Data["Title"] = "Organization " + params["org"] + " Teams" - ctx.HTML(200, "org/teams") -} func New(ctx *middleware.Context) { ctx.Data["Title"] = "Create An Organization" diff --git a/routers/org/teams.go b/routers/org/teams.go new file mode 100644 index 0000000000..9585cb272e --- /dev/null +++ b/routers/org/teams.go @@ -0,0 +1,16 @@ +package org + +import ( + "github.com/go-martini/martini" + "github.com/gogits/gogs/modules/middleware" +) + +func Teams(ctx *middleware.Context, params martini.Params) { + ctx.Data["Title"] = "Organization "+params["org"]+" Teams" + ctx.HTML(200, "org/teams") +} + +func NewTeam(ctx *middleware.Context, params martini.Params) { + ctx.Data["Title"] = "Organization "+params["org"]+" New Team" + ctx.HTML(200, "org/new_team") +} diff --git a/templates/org/new_team.tmpl b/templates/org/new_team.tmpl new file mode 100644 index 0000000000..752f37d2e0 --- /dev/null +++ b/templates/org/new_team.tmpl @@ -0,0 +1,74 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +
    +
    +
    + + +
    +

    Organization Name

    +
    +
    +
    +
    +
    +
    + +

    Create new team

    +
    + +
    + + You'll use this name to mention this team in conversations. +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +

    This team will be able to view and clone its repositories.

    +
    +
    + +

    This team will be able to read its repositories, as well as push to them.

    +
    +
    + +

    This team will be able to push/pull to its repositories, as well as add other collaborators to them.

    +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    +
    +{{template "base/footer" .}} diff --git a/templates/org/teams.tmpl b/templates/org/teams.tmpl index a8218812c9..90aab94401 100644 --- a/templates/org/teams.tmpl +++ b/templates/org/teams.tmpl @@ -21,6 +21,12 @@
    +
    +
    + +
    +
    +

    Team Name

    From 1d55ecd29ce261cd3adf78649a44aaa30e4fd468 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Fri, 27 Jun 2014 22:04:04 +0800 Subject: [PATCH 52/55] add organization team-create page --- cmd/web.go | 3 +- public/css/gogs.css | 2 +- routers/org/teams.go | 5 +++ templates/org/edit_team.tmpl | 75 ++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 templates/org/edit_team.tmpl diff --git a/cmd/web.go b/cmd/web.go index bf84d5872b..1668fae240 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -195,7 +195,8 @@ func runWeb(*cli.Context) { r.Get("/:org/dashboard", org.Dashboard) r.Get("/:org/members", org.Members) // organization teams - r.Get("/:org/teams/new",org.NewTeam) + r.Get("/:org/teams/:team/edit", org.EditTeam) + r.Get("/:org/teams/new", org.NewTeam) r.Get("/:org/teams", org.Teams) r.Get("/:org/settings", org.Settings) diff --git a/public/css/gogs.css b/public/css/gogs.css index eb95a1d088..98cb5ee188 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -375,7 +375,7 @@ html, body { /* gogits repo create */ -#repo-create, #org-create, #org-teams-create { +#repo-create, #org-create, #org-teams-create, #org-teams-edit { width: 800px; } diff --git a/routers/org/teams.go b/routers/org/teams.go index 9585cb272e..9ca5185a94 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -14,3 +14,8 @@ func NewTeam(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = "Organization "+params["org"]+" New Team" ctx.HTML(200, "org/new_team") } + +func EditTeam(ctx *middleware.Context, params martini.Params){ + ctx.Data["Title"] = "Organization "+params["org"]+" Edit Team" + ctx.HTML(200,"org/edit_team") +} diff --git a/templates/org/edit_team.tmpl b/templates/org/edit_team.tmpl new file mode 100644 index 0000000000..4292575c87 --- /dev/null +++ b/templates/org/edit_team.tmpl @@ -0,0 +1,75 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +
    +
    +
    + + +
    +

    Organization Name

    +
    +
    +
    +
    +
    +
    +
    +

    Edit team

    +
    + +
    + + You'll use this name to mention this team in conversations. +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +

    This team will be able to view and clone its repositories.

    +
    +
    + +

    This team will be able to read its repositories, as well as push to them.

    +
    +
    + +

    This team will be able to push/pull to its repositories, as well as add other collaborators to them.

    +
    +
    +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    +{{template "base/footer" .}} From 7dbeee94e3ebec0a91efa6cba613e30fd387ffb4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 28 Jun 2014 11:06:07 +0800 Subject: [PATCH 53/55] bug fixed #236 --- routers/repo/http.go | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/routers/repo/http.go b/routers/repo/http.go index 5915e8761e..08bbfc99a5 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -7,7 +7,6 @@ package repo import ( "bytes" "fmt" - "io" "io/ioutil" "net/http" "os" @@ -190,7 +189,6 @@ var routes = []route{ // Request handling function func HttpBackend(config *Config) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - //log.GitLogger.Printf("%s %s %s %s", r.RemoteAddr, r.Method, r.URL.Path, r.Proto) for _, route := range routes { if m := route.cr.FindStringSubmatch(r.URL.Path); m != nil { if route.method != r.Method { @@ -212,13 +210,13 @@ func HttpBackend(config *Config) http.HandlerFunc { return } } + renderNotFound(w) return } } // Actual command handling functions - func serviceUploadPack(hr handler) { serviceRpc("upload-pack", hr) } @@ -236,36 +234,24 @@ func serviceRpc(rpc string, hr handler) { return } - input, _ := ioutil.ReadAll(r.Body) - w.Header().Set("Content-Type", fmt.Sprintf("application/x-git-%s-result", rpc)) w.WriteHeader(http.StatusOK) + input, _ := ioutil.ReadAll(r.Body) + br := bytes.NewReader(input) + args := []string{rpc, "--stateless-rpc", dir} cmd := exec.Command(hr.Config.GitBinPath, args...) cmd.Dir = dir - in, err := cmd.StdinPipe() + cmd.Stdout = w + cmd.Stdin = br + + err := cmd.Run() if err != nil { log.GitLogger.Error(err.Error()) return } - stdout, err := cmd.StdoutPipe() - if err != nil { - log.GitLogger.Error(err.Error()) - return - } - - err = cmd.Start() - if err != nil { - log.GitLogger.Error(err.Error()) - return - } - - in.Write(input) - io.Copy(w, stdout) - cmd.Wait() - if hr.Config.OnSucceed != nil { hr.Config.OnSucceed(rpc, input) } From ee9b7f322ff4c4c14952c2f83fb03e90fa583cad Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 27 Jun 2014 23:14:33 -0400 Subject: [PATCH 54/55] Clean code --- routers/user/setting.go | 2 +- routers/user/user.go | 2 +- templates/org/settings.tmpl | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/routers/user/setting.go b/routers/user/setting.go index 9075ee0b43..8e4b0840c7 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -68,7 +68,7 @@ func SettingPost(ctx *middleware.Context, form auth.UpdateProfileForm) { ctx.User.Avatar = base.EncodeMd5(form.Avatar) ctx.User.AvatarEmail = form.Avatar if err := models.UpdateUser(ctx.User); err != nil { - ctx.Handle(500, "setting.Setting", err) + ctx.Handle(500, "setting.Setting(UpdateUser)", err) return } log.Trace("%s User setting updated: %s", ctx.Req.RequestURI, ctx.User.LowerName) diff --git a/routers/user/user.go b/routers/user/user.go index a50f126c0c..a402744b86 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -296,7 +296,7 @@ func DeletePost(ctx *middleware.Context) { case models.ErrUserOwnRepos: ctx.Flash.Error("Your account still have ownership of repository, you have to delete or transfer them first.") default: - ctx.Handle(500, "user.Delete", err) + ctx.Handle(500, "user.Delete(DeleteUser)", err) return } } else { diff --git a/templates/org/settings.tmpl b/templates/org/settings.tmpl index e19c027d44..fd0d6a1c14 100644 --- a/templates/org/settings.tmpl +++ b/templates/org/settings.tmpl @@ -98,11 +98,9 @@