Merge branch 'master' of github.com:gogits/gogs
This commit is contained in:
commit
6302f54628
|
@ -53,6 +53,7 @@ There are two ways to install Gogs:
|
||||||
- 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.
|
- Usage and modification from [beego](http://beego.me) modules.
|
||||||
|
- Thanks [gobuild.io](http://gobuild.io) for providing binary compile and download service.
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依
|
||||||
- 基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改的系统监视状态。
|
- 基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改的系统监视状态。
|
||||||
- [beego](http://beego.me) 模块的使用与修改。
|
- [beego](http://beego.me) 模块的使用与修改。
|
||||||
- [martini](http://martini.codegangsta.io/) 的路由与中间件机制。
|
- [martini](http://martini.codegangsta.io/) 的路由与中间件机制。
|
||||||
|
- 感谢 [gobuild.io](http://gobuild.io) 提供二进制编译与下载服务。
|
||||||
|
|
||||||
## 贡献成员
|
## 贡献成员
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ func IsRepositoryExist(user *User, repoName string) (bool, error) {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// Define as all lower case!!
|
// Define as all lower case!!
|
||||||
illegalPatterns = []string{"[.][Gg][Ii][Tt]", "user", "help", "stars", "issues", "pulls", "commits", "admin", "repo", "template", "admin"}
|
illegalPatterns = []string{"[.][Gg][Ii][Tt]", "raw", "user", "help", "stars", "issues", "pulls", "commits", "admin", "repo", "template", "admin"}
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsLegalName returns false if name contains illegal characters.
|
// IsLegalName returns false if name contains illegal characters.
|
||||||
|
|
|
@ -100,7 +100,7 @@ func newService() {
|
||||||
Service.EnableCacheAvatar = Cfg.MustBool("service", "ENABLE_CACHE_AVATAR", false)
|
Service.EnableCacheAvatar = Cfg.MustBool("service", "ENABLE_CACHE_AVATAR", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLogService() {
|
func newLogService() {
|
||||||
// Get and check log mode.
|
// Get and check log mode.
|
||||||
LogMode = Cfg.MustValue("log", "MODE", "console")
|
LogMode = Cfg.MustValue("log", "MODE", "console")
|
||||||
modeSec := "log." + LogMode
|
modeSec := "log." + LogMode
|
||||||
|
@ -296,7 +296,7 @@ func NewConfigContext() {
|
||||||
|
|
||||||
func NewServices() {
|
func NewServices() {
|
||||||
newService()
|
newService()
|
||||||
NewLogService()
|
newLogService()
|
||||||
newCacheService()
|
newCacheService()
|
||||||
newSessionService()
|
newSessionService()
|
||||||
newMailService()
|
newMailService()
|
||||||
|
|
2
serve.go
2
serve.go
|
@ -45,6 +45,7 @@ gogs serv provide access auth for repositories`,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
os.MkdirAll("log", os.ModePerm)
|
||||||
log.NewLogger(10000, "file", fmt.Sprintf(`{"filename":"%s"}`, "log/serv.log"))
|
log.NewLogger(10000, "file", fmt.Sprintf(`{"filename":"%s"}`, "log/serv.log"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +73,6 @@ func runServ(k *cli.Context) {
|
||||||
base.NewConfigContext()
|
base.NewConfigContext()
|
||||||
models.LoadModelsConfig()
|
models.LoadModelsConfig()
|
||||||
models.NewEngine()
|
models.NewEngine()
|
||||||
base.NewLogService()
|
|
||||||
|
|
||||||
keys := strings.Split(os.Args[2], "-")
|
keys := strings.Split(os.Args[2], "-")
|
||||||
if len(keys) != 2 {
|
if len(keys) != 2 {
|
||||||
|
|
2
web.go
2
web.go
|
@ -89,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("/", reqSignIn, routers.Home)
|
m.Get("/", ignSignIn, 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)
|
||||||
|
|
Loading…
Reference in New Issue