Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gogits/gogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Mahn committed Mar 8, 2016
2 parents 429ec9b + 0c9a616 commit bf21322
Show file tree
Hide file tree
Showing 92 changed files with 3,566 additions and 1,741 deletions.
1 change: 0 additions & 1 deletion .bra.toml
@@ -1,6 +1,5 @@
[run]
init_cmds = [
#["grep", "-rn", "FIXME", "."],
["make", "build-dev", "TAGS=sqlite"],
["./gogs", "web"]
]
Expand Down
21 changes: 1 addition & 20 deletions .gitignore
Expand Up @@ -8,31 +8,12 @@ data/
.idea/
*.iml
public/img/avatar/
files/
*.o
*.a
*.so
_obj
_test
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.exe~
/gogs
profile/
__pycache__
*.pem
output*
.brackets.json
docker/fig.yml
docker/docker/Dockerfile
docker/docker/init_gogs.sh
gogs.sublime-project
gogs.sublime-workspace
.tags*
release
/release
28 changes: 14 additions & 14 deletions .gopmfile
Expand Up @@ -3,30 +3,30 @@ path = github.com/gogits/gogs

[deps]
github.com/bradfitz/gomemcache = commit:fb1f79c
github.com/codegangsta/cli = commit:5db7419
github.com/codegangsta/cli = commit:a294348
github.com/go-macaron/binding = commit:a68f342
github.com/go-macaron/cache = commit:5617353
github.com/go-macaron/captcha = commit:8aa5919
github.com/go-macaron/csrf = commit:715bca0
github.com/go-macaron/csrf = commit:546646c
github.com/go-macaron/gzip = commit:cad1c65
github.com/go-macaron/i18n = commit:d2d3329
github.com/go-macaron/inject = commit:c5ab7bf
github.com/go-macaron/session = commit:66031fc
github.com/go-macaron/toolbox = commit:82b5115
github.com/go-sql-driver/mysql = commit:1309049
github.com/go-xorm/core = commit:9ddf4ee
github.com/go-xorm/xorm = commit:e72082c
github.com/go-sql-driver/mysql = commit:0f2db9e
github.com/go-xorm/core = commit:5021584
github.com/go-xorm/xorm = commit:1045aa0
github.com/gogits/chardet = commit:2404f77725
github.com/gogits/cron = commit:3abc0f8
github.com/gogits/git-module = commit:a1c5096
github.com/gogits/git-module = commit:76e8cce
github.com/gogits/go-gogs-client = commit:d584b1e
github.com/issue9/identicon = commit:f8c0d2c
github.com/kardianos/minwinsvc = commit:cad6b2b
github.com/klauspost/compress = commit:f962535
github.com/klauspost/cpuid = commit:2c698c6
github.com/klauspost/compress = commit:2d3d403
github.com/klauspost/cpuid = commit:09cded8
github.com/klauspost/crc32 = commit:19b0b33
github.com/lib/pq = commit:69552e5
github.com/mattn/go-sqlite3 = commit:09d5c45
github.com/lib/pq = commit:165a352
github.com/mattn/go-sqlite3 = commit:45f056c
github.com/mcuadros/go-version = commit:d52711f
github.com/microcosm-cc/bluemonday = commit:4ac6f27
github.com/msteinert/pam = commit:02ccfbf
Expand All @@ -39,11 +39,11 @@ github.com/Unknwon/cae = commit:7f5e046
github.com/Unknwon/com = commit:28b053d
github.com/Unknwon/i18n = commit:3b48b66
github.com/Unknwon/paginater = commit:7748a72
golang.org/x/net = commit:4599ae7
golang.org/x/text = commit:07b9a78
golang.org/x/crypto = commit:1f22c01
golang.org/x/net = commit:a4bbce9
golang.org/x/text = commit:a71fd10
golang.org/x/crypto = commit:5dc8cb4
gopkg.in/asn1-ber.v1 = commit:4e86f43
gopkg.in/gomail.v2 = commit:fbb71dd
gopkg.in/gomail.v2 = commit:5ceb8e6
gopkg.in/ini.v1 = commit:776aa73
gopkg.in/ldap.v2 = commit:07a7330
gopkg.in/macaron.v1 = commit:b9eee38
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -53,3 +53,9 @@ clean-mac: clean

test:
go test -cover -race ./...

fixme:
grep -rnw "FIXME" routers models modules

todo:
grep -rnw "TODO" routers models modules
15 changes: 8 additions & 7 deletions README.md
Expand Up @@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra

![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)

##### Current version: 0.8.55
##### Current version: 0.9.1

| Web | UI | Preview |
|:-------------:|:-------:|:-------:|
Expand All @@ -13,11 +13,12 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra

### Important Notes

1. Due to testing purpose, data of [try.gogs.io](https://try.gogs.io) was reset in **Jan 28, 2015** and will reset multiple times after. Please do **NOT** put your important data on the site.
2. The demo site [try.gogs.io](https://try.gogs.io) is running under `develop` branch.
3. If you think there are vulnerabilities in the project, please talk privately to **u@gogs.io**. Thanks!
4. If you're interested in using APIs, we have experimental support with [documentation](https://github.com/gogits/go-gogs-client/wiki).
5. If your team/company is using Gogs and would like to put your logo on [our website](http://gogs.io), contact us by any means.
1. **YOU MUST READ [Contributing Code](https://github.com/gogits/gogs/wiki/Contributing-Code) BEFORE STARTING TO WORK ON A PULL REQUEST**.
2. Due to testing purpose, data of [try.gogs.io](https://try.gogs.io) was reset in **Jan 28, 2015** and will reset multiple times after. Please do **NOT** put your important data on the site.
3. The demo site [try.gogs.io](https://try.gogs.io) is running under `develop` branch.
4. If you think there are vulnerabilities in the project, please talk privately to **u@gogs.io**. Thanks!
5. If you're interested in using APIs, we have experimental support with [documentation](https://github.com/gogits/go-gogs-client/wiki).
6. If your team/company is using Gogs and would like to put your logo on [our website](http://gogs.io), contact us by any means.

[简体中文](README_ZH.md)

Expand Down Expand Up @@ -48,7 +49,7 @@ The goal of this project is to make the easiest, fastest, and most painless way
- Mail service
- Administration panel
- Supports MySQL, PostgreSQL, SQLite3 and [TiDB](https://github.com/pingcap/tidb) (experimental)
- Multi-language support ([14 languages](https://crowdin.com/project/gogs))
- Multi-language support ([15 languages](https://crowdin.com/project/gogs))

## System Requirements

Expand Down
2 changes: 1 addition & 1 deletion README_ZH.md
Expand Up @@ -30,7 +30,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
- 支持邮件服务
- 支持后台管理面板
- 支持 MySQL、PostgreSQL、SQLite3 和 [TiDB](https://github.com/pingcap/tidb)(实验性支持) 数据库
- 支持多语言本地化([14 种语言]([more](https://crowdin.com/project/gogs))
- 支持多语言本地化([15 种语言]([more](https://crowdin.com/project/gogs))

## 系统要求

Expand Down
34 changes: 21 additions & 13 deletions cmd/web.go
Expand Up @@ -7,7 +7,6 @@ package cmd
import (
"crypto/tls"
"fmt"
gotmpl "html/template"
"io/ioutil"
"net/http"
"net/http/fcgi"
Expand Down Expand Up @@ -79,16 +78,16 @@ func checkVersion() {

// Check dependency version.
checkers := []VerChecker{
{"github.com/go-xorm/xorm", func() string { return xorm.Version }, "0.4.4.1029"},
{"github.com/go-xorm/xorm", func() string { return xorm.Version }, "0.5.2.0304"},
{"github.com/go-macaron/binding", binding.Version, "0.2.1"},
{"github.com/go-macaron/cache", cache.Version, "0.1.2"},
{"github.com/go-macaron/csrf", csrf.Version, "0.0.3"},
{"github.com/go-macaron/csrf", csrf.Version, "0.0.5"},
{"github.com/go-macaron/i18n", i18n.Version, "0.2.0"},
{"github.com/go-macaron/session", session.Version, "0.1.6"},
{"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"},
{"gopkg.in/ini.v1", ini.Version, "1.8.4"},
{"gopkg.in/macaron.v1", macaron.Version, "0.8.0"},
{"github.com/gogits/git-module", git.Version, "0.2.8"},
{"github.com/gogits/git-module", git.Version, "0.2.9"},
{"github.com/gogits/go-gogs-client", gogs.Version, "0.7.3"},
}
for _, c := range checkers {
Expand Down Expand Up @@ -126,7 +125,7 @@ func newMacaron() *macaron.Macaron {
))
m.Use(macaron.Renderer(macaron.RenderOptions{
Directory: path.Join(setting.StaticRootPath, "templates"),
Funcs: []gotmpl.FuncMap{template.Funcs},
Funcs: template.NewFuncMap(),
IndentJSON: macaron.Env != macaron.PROD,
}))

Expand Down Expand Up @@ -190,6 +189,8 @@ func runWeb(ctx *cli.Context) {

bindIgnErr := binding.BindIgnErr

// FIXME: not all routes need go through same middlewares.
// Especially some AJAX requests, we can reduce middleware number to improve performance.
// Routers.
m.Get("/", ignSignIn, routers.Home)
m.Get("/explore", ignSignIn, routers.Explore)
Expand Down Expand Up @@ -217,6 +218,7 @@ func runWeb(ctx *cli.Context) {
m.Get("", user.Settings)
m.Post("", bindIgnErr(auth.UpdateProfileForm{}), user.SettingsPost)
m.Post("/avatar", binding.MultipartForm(auth.UploadAvatarForm{}), user.SettingsAvatar)
m.Post("/avatar/delete", user.SettingsDeleteAvatar)
m.Combo("/email").Get(user.SettingsEmails).
Post(bindIgnErr(auth.AddEmailForm{}), user.SettingsEmailPost)
m.Post("/email/delete", user.DeleteEmail)
Expand Down Expand Up @@ -331,7 +333,7 @@ func runWeb(ctx *cli.Context) {
}

reqRepoAdmin := middleware.RequireRepoAdmin()
reqRepoPusher := middleware.RequireRepoPusher()
reqRepoWriter := middleware.RequireRepoWriter()

// ***** START: Organization *****
m.Group("/org", func() {
Expand Down Expand Up @@ -365,6 +367,7 @@ func runWeb(ctx *cli.Context) {
m.Combo("").Get(org.Settings).
Post(bindIgnErr(auth.UpdateOrgSettingForm{}), org.SettingsPost)
m.Post("/avatar", binding.MultipartForm(auth.UploadAvatarForm{}), org.SettingsAvatar)
m.Post("/avatar/delete", org.SettingsDeleteAvatar)

m.Group("/hooks", func() {
m.Get("", org.Webhooks)
Expand Down Expand Up @@ -399,7 +402,11 @@ func runWeb(ctx *cli.Context) {
m.Group("/settings", func() {
m.Combo("").Get(repo.Settings).
Post(bindIgnErr(auth.RepoSettingForm{}), repo.SettingsPost)
m.Combo("/collaboration").Get(repo.Collaboration).Post(repo.CollaborationPost)
m.Group("/collaboration", func() {
m.Combo("").Get(repo.Collaboration).Post(repo.CollaborationPost)
m.Post("/access_mode", repo.ChangeCollaborationAccessMode)
m.Post("/delete", repo.DeleteCollaboration)
})

m.Group("/hooks", func() {
m.Get("", repo.Webhooks)
Expand Down Expand Up @@ -441,7 +448,7 @@ func runWeb(ctx *cli.Context) {
m.Post("/label", repo.UpdateIssueLabel)
m.Post("/milestone", repo.UpdateIssueMilestone)
m.Post("/assignee", repo.UpdateIssueAssignee)
}, reqRepoAdmin)
}, reqRepoWriter)

m.Group("/:index", func() {
m.Post("/title", repo.UpdateIssueTitle)
Expand All @@ -453,23 +460,23 @@ func runWeb(ctx *cli.Context) {
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel)
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel)
m.Post("/delete", repo.DeleteLabel)
}, reqRepoAdmin, middleware.RepoRef())
}, reqRepoWriter, middleware.RepoRef())
m.Group("/milestones", func() {
m.Combo("/new").Get(repo.NewMilestone).
Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost)
m.Get("/:id/edit", repo.EditMilestone)
m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost)
m.Get("/:id/:action", repo.ChangeMilestonStatus)
m.Post("/delete", repo.DeleteMilestone)
}, reqRepoAdmin, middleware.RepoRef())
}, reqRepoWriter, middleware.RepoRef())

m.Group("/releases", func() {
m.Get("/new", repo.NewRelease)
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)
m.Get("/edit/:tagname", repo.EditRelease)
m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost)
m.Post("/delete", repo.DeleteRelease)
}, reqRepoAdmin, middleware.RepoRef())
}, reqRepoWriter, middleware.RepoRef())

m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest).
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost)
Expand All @@ -495,15 +502,16 @@ func runWeb(ctx *cli.Context) {
Post(bindIgnErr(auth.NewWikiForm{}), repo.NewWikiPost)
m.Combo("/:page/_edit").Get(repo.EditWiki).
Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost)
}, reqSignIn, reqRepoPusher)
m.Post("/:page/delete", repo.DeleteWikiPagePost)
}, reqSignIn, reqRepoWriter)
}, repo.MustEnableWiki, middleware.RepoRef())

m.Get("/archive/*", repo.Download)

m.Group("/pulls/:index", func() {
m.Get("/commits", middleware.RepoRef(), repo.ViewPullCommits)
m.Get("/files", middleware.RepoRef(), repo.ViewPullFiles)
m.Post("/merge", reqRepoAdmin, repo.MergePullRequest)
m.Post("/merge", reqRepoWriter, repo.MergePullRequest)
}, repo.MustAllowPulls)

m.Group("", func() {
Expand Down
6 changes: 1 addition & 5 deletions conf/README.md
@@ -1,7 +1,3 @@
Execute following command in ROOT directory when anything is changed:

$ go-bindata -o=modules/bindata/bindata.go -ignore="\\.DS_Store|README.md" -pkg=bindata conf/...

Add -debug flag to make life easier in development(somehow isn't working):

$ go-bindata -debug -o=modules/bindata/bindata.go -ignore="\\.DS_Store|README.md" -pkg=bindata conf/...
$ make bindata
5 changes: 3 additions & 2 deletions conf/app.ini
Expand Up @@ -337,8 +337,8 @@ CLONE = 300
PULL = 300

[i18n]
LANGS = en-US,zh-CN,zh-HK,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT
NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu,Русский,日本語,Español,Português do Brasil,Polski,български,Italiano
LANGS = en-US,zh-CN,zh-HK,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT,fi-FI
NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu,Русский,日本語,Español,Português do Brasil,Polski,български,Italiano,Suomalainen

; Used for datetimepicker
[i18n.datelang]
Expand All @@ -356,6 +356,7 @@ pt-BR = pt-BR
pl-PL = pl
bg-BG = bg
it-IT = it
fi-FI = fi

; Extension mapping to highlight class
; e.g. .toml=ini
Expand Down
2 changes: 1 addition & 1 deletion conf/locale/TRANSLATORS
@@ -1,4 +1,4 @@
# This file lists all PUBLIC individuals having contributed content to the translation.
# This file lists all PUBLIC individuals having contributed content to the translation.
# Entries are in alphabetical order.

Adam Strzelecki <ono AT java DOT pl>
Expand Down

0 comments on commit bf21322

Please sign in to comment.