1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00
This commit is contained in:
FuXiaoHei 2014-03-24 21:27:28 +08:00
commit 98ec6a4eaa
10 changed files with 23 additions and 13 deletions

View file

@ -2,6 +2,8 @@
> Thanks [drone](https://github.com/drone/drone) because this guidelines sheet is forked from its [CONTRIBUTING.md](https://github.com/drone/drone/blob/master/CONTRIBUTING.md). > Thanks [drone](https://github.com/drone/drone) because this guidelines sheet is forked from its [CONTRIBUTING.md](https://github.com/drone/drone/blob/master/CONTRIBUTING.md).
**This document is pre^3 release, we're not ready for receiving contribution until v0.5.0 release.**
Want to hack on Gogs? Awesome! Here are instructions to get you started. They are probably not perfect, please let us know if anything feels wrong or incomplete. Want to hack on Gogs? Awesome! Here are instructions to get you started. They are probably not perfect, please let us know if anything feels wrong or incomplete.
## Contribution guidelines ## Contribution guidelines

View file

@ -1,4 +1,4 @@
Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/gogits/gogs/trend.png)](https://bitdeli.com/free "Bitdeli Badge") Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest)
===================== =====================
Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language. Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language.
@ -48,9 +48,11 @@ There are two ways to install Gogs:
## Acknowledgments ## Acknowledgments
- Logo is inspired by [martini](https://github.com/martini-contrib). - Logo is inspired by [martini-contrib](https://github.com/martini-contrib).
- Router and middleware mechanism of [martini](http://martini.codegangsta.io/).
- Mail Service, modules design is inspired by [WeTalk](https://github.com/beego/wetalk). - Mail Service, modules design is inspired by [WeTalk](https://github.com/beego/wetalk).
- System Monitor Status is inspired by [GoBlog](https://github.com/fuxiaohei/goblog). - System Monitor Status is inspired by [GoBlog](https://github.com/fuxiaohei/goblog).
- Usage and modification from [beego](http://beego.me) modules.
## Contributors ## Contributors

View file

@ -1,4 +1,4 @@
Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/gogits/gogs/trend.png)](https://bitdeli.com/free "Bitdeli Badge") Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest)
===================== =====================
Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。 Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。
@ -44,9 +44,11 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依
## 特别鸣谢 ## 特别鸣谢
- Logo 基于 [martini](https://github.com/martini-contrib) 修改而来。 - Logo 基于 [martini-contrib](https://github.com/martini-contrib) 修改而来。
- 邮件服务、模块设计基于 [WeTalk](https://github.com/beego/wetalk) 修改而来。 - 基于 [WeTalk](https://github.com/beego/wetalk) 修改的邮件服务和模块设计。
- 系统监视状态基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改而来。 - 基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改的系统监视状态。
- [beego](http://beego.me) 模块的使用与修改。
- [martini](http://martini.codegangsta.io/) 的路由与中间件机制。
## 贡献成员 ## 贡献成员

View file

@ -20,7 +20,7 @@ import (
// Test that go1.2 tag above is included in builds. main.go refers to this definition. // Test that go1.2 tag above is included in builds. main.go refers to this definition.
const go12tag = true const go12tag = true
const APP_VER = "0.1.7.0323.1" const APP_VER = "0.1.7.0324"
func init() { func init() {
base.AppVer = APP_VER base.AppVer = APP_VER

View file

@ -92,10 +92,12 @@ func CommitRepoAction(userId int64, userName string,
// Update repository last update time. // Update repository last update time.
repo, err := GetRepositoryByName(userId, repoName) repo, err := GetRepositoryByName(userId, repoName)
if err != nil { if err != nil {
log.Error("action.CommitRepoAction(GetRepositoryByName): %d/%s", userId, repo.LowerName)
return err return err
} }
repo.IsBare = false repo.IsBare = false
if err = UpdateRepository(repo); err != nil { if err = UpdateRepository(repo); err != nil {
log.Error("action.CommitRepoAction(UpdateRepository): %d/%s", userId, repo.LowerName)
return err return err
} }

View file

@ -387,7 +387,7 @@ func UpdateRepository(repo *Repository) error {
repo.Website = repo.Website[:255] repo.Website = repo.Website[:255]
} }
_, err := orm.Id(repo.Id).UseBool().Cols("description", "website").Update(repo) _, err := orm.Id(repo.Id).AllCols().Update(repo)
return err return err
} }

View file

@ -211,7 +211,7 @@ func UpdateUser(user *User) (err error) {
user.Website = user.Website[:255] user.Website = user.Website[:255]
} }
_, err = orm.Id(user.Id).UseBool().Cols("website", "location", "is_active", "is_admin").Update(user) _, err = orm.Id(user.Id).AllCols().Update(user)
return err return err
} }

View file

@ -21,7 +21,7 @@ type ToggleOptions struct {
func Toggle(options *ToggleOptions) martini.Handler { func Toggle(options *ToggleOptions) martini.Handler {
return func(ctx *Context) { return func(ctx *Context) {
if options.SignOutRequire && ctx.IsSigned { if options.SignOutRequire && ctx.IsSigned && ctx.Req.RequestURI != "/" {
ctx.Redirect("/") ctx.Redirect("/")
return return
} }

View file

@ -6,6 +6,7 @@ package repo
import ( import (
"github.com/codegangsta/martini" "github.com/codegangsta/martini"
"github.com/gogits/gogs/modules/middleware" "github.com/gogits/gogs/modules/middleware"
) )

7
web.go
View file

@ -31,9 +31,10 @@ import (
var CmdWeb = cli.Command{ var CmdWeb = cli.Command{
Name: "web", Name: "web",
Usage: "just run", Usage: "Gogs web server",
Description: ` Description: `
gogs web`, gogs web server is the only thing you need to run,
and it takes care of all the other things for you`,
Action: runWeb, Action: runWeb,
Flags: []cli.Flag{}, Flags: []cli.Flag{},
} }
@ -88,7 +89,7 @@ func runWeb(*cli.Context) {
reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true}) reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true})
// Routers. // Routers.
m.Get("/", ignSignIn, routers.Home) m.Get("/", reqSignIn, routers.Home)
m.Get("/issues", reqSignIn, user.Issues) m.Get("/issues", reqSignIn, user.Issues)
m.Get("/pulls", reqSignIn, user.Pulls) m.Get("/pulls", reqSignIn, user.Pulls)
m.Get("/stars", reqSignIn, user.Stars) m.Get("/stars", reqSignIn, user.Stars)