Skip to content

Fix #3743: Fix SHA and compare regex on route file [Critical] #3848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Depends on the situation, you will:

### Bug Report

If you find something you consider a bug, please create a issue on [GitHub](https://github.com/gogits/gogs/issues). To avoid wasting time and reduce back-and-forth communication with team members, please include at least the following information in a form comfortable for you:
If you find something you consider a bug, please create a issue on [GitHub](https://github.com/go-gitea/gitea/issues). To avoid wasting time and reduce back-and-forth communication with team members, please include at least the following information in a form comfortable for you:

- Bug Description
- Gogs Version
Expand All @@ -24,7 +24,7 @@ If you find something you consider a bug, please create a issue on [GitHub](http
- Error Log
- Other information

Please take a moment to check that an issue on [GitHub](https://github.com/gogits/gogs/issues) doesn't already exist documenting your bug report or improvement proposal. If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests.
Please take a moment to check that an issue on [GitHub](https://github.com/go-gitea/gitea/issues) doesn't already exist documenting your bug report or improvement proposal. If it does, it never hurts to add a quick "+1" or "I have this problem too". This will help prioritize the most common problems and requests.

#### Bug Report Example

Expand All @@ -42,7 +42,7 @@ There is no standard form of making a feature request. Just try to describe the

### Pull Request

Please read detailed information on [Wiki](https://github.com/gogits/gogs/wiki/Contributing-Code).
Please read detailed information on [Wiki](https://github.com/go-gitea/gitea/wiki/Contributing-Code).

### Ask For Help

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ The pull request will be closed without any reasons if it does not satisfy any o

1. Please make sure you are targeting the `develop` branch.
2. Please read contributing guidelines:
https://github.com/gogits/gogs/wiki/Contributing-Code
https://github.com/go-gitea/gitea/wiki/Contributing-Code
3. Please describe what your pull request does and which issue you're targeting
4. ... if it is not related to any particular issues, explain why we should not reject your pull request.

Expand Down
4 changes: 2 additions & 2 deletions .gopmfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[target]
path = github.com/gogits/gogs
path = github.com/go-gitea/gitea

[deps]
github.com/bradfitz/gomemcache = commit:fb1f79c
Expand Down Expand Up @@ -35,7 +35,7 @@ github.com/nfnt/resize = commit:891127d
github.com/russross/blackfriday = commit:93622da
github.com/satori/go.uuid = commit:0aa62d5
github.com/sergi/go-diff = commit:ec7fdbb
github.com/strk/go-libravatar = commit:5eed7bf
strk.kbt.io/projects/go/libravatar = commit:5eed7bf
github.com/shurcooL/sanitized_anchor_name = commit:10ef21a
github.com/Unknwon/cae = commit:7f5e046
github.com/Unknwon/com = commit:28b053d
Expand Down
1 change: 1 addition & 0 deletions .lgtm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
self_approval_off = false
30 changes: 17 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
language: go

go:
- 1.4
- 1.5
- 1.6
- 1.7

before_install:
- sudo apt-get update -qq
- sudo apt-get install -y libpam-dev
- go get github.com/msteinert/pam
- go get github.com/msteinert/pam

install:
- go get -t -v ./...

script:
- go build -v -tags "pam"
- go test -v -cover -race ./...
script: |
go build -v -tags "pam"

for pkg in $(go list ./... | grep -v /vendor/)
do
go test -v -race -cover -coverprofile $GOPATH/src/$pkg/coverage.out $pkg || exit 1
done

after_success:
- bash <(curl -s https://codecov.io/bash)

notifications:
email:
- [email protected]
slack: gophercn:o5pSanyTeNhnfYc3QnG0X7Wx
webhooks:
on_success: change
on_failure: always
on_start: never
urls:
- https://webhooks.gitter.im/e/b590f8e03882f7aedc3e
on_success: change
on_failure: always
on_start: never
- https://webhooks.gitter.im/e/ee6b822f3cf54c98e70c
- https://webhooks.gitter.im/e/87428658ef177ce8a7e4
- https://webhooks.gitter.im/e/a1d2b69804dfda72187e
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
LDFLAGS += -X "github.com/gogits/gogs/modules/setting.BuildTime=$(shell date -u '+%Y-%m-%d %I:%M:%S %Z')"
LDFLAGS += -X "github.com/gogits/gogs/modules/setting.BuildGitHash=$(shell git rev-parse HEAD)"
LDFLAGS += -X "github.com/go-gitea/gitea/modules/setting.BuildTime=$(shell date -u '+%Y-%m-%d %I:%M:%S %Z')"
LDFLAGS += -X "github.com/go-gitea/gitea/modules/setting.BuildGitHash=$(shell git rev-parse HEAD)"

DATA_FILES := $(shell find conf | sed 's/ /\\ /g')
LESS_FILES := $(wildcard public/less/gogs.less public/less/_*.less)
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?branch=master)](https://travis-ci.org/gogits/gogs) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/gogs/localized.svg)](https://crowdin.com/project/gogs) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gogits/gogs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
=====================
# Gitea - Git with a cup of tea

![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
[![Build Status](https://travis-ci.org/go-gitea/gitea.svg?branch=master)](https://travis-ci.org/go-gitea/gitea)
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-gitea/gitea)](https://goreportcard.com/report/github.com/go-gitea/gitea)
[![GoDoc](https://godoc.org/github.com/go-gitea/gitea?status.svg)](https://godoc.org/github.com/go-gitea/gitea)
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](http://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
[![Join the chat at https://gitter.im/go-gitea/gitea](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-gitea/gitea?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

##### Current tip version: 0.9.99 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions or submit a task on [alpha stage automated binary building system](https://build.gogs.io/))
![](https://github.com/go-gitea/gitea/blob/master/public/img/gogs-large-resize.png?raw=true)

##### Current tip version: 0.9.99 (see [Releases](https://github.com/go-gitea/gitea/releases) for binary versions or submit a task on [alpha stage automated binary building system](https://build.gogs.io/))

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

### Important Notes

1. **YOU MUST READ [Contributing Code](https://github.com/gogits/gogs/wiki/Contributing-Code) BEFORE STARTING TO WORK ON A PULL REQUEST**.
1. **YOU MUST READ [Contributing Code](https://github.com/go-gitea/gitea/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 **[email protected]**. Thanks!
Expand Down Expand Up @@ -72,7 +78,7 @@ There are 5 ways to install Gogs:
- [Install from binary](https://gogs.io/docs/installation/install_from_binary.html)
- [Install from source](https://gogs.io/docs/installation/install_from_source.html)
- [Install from packages](https://gogs.io/docs/installation/install_from_packages.html)
- [Ship with Docker](https://github.com/gogits/gogs/tree/master/docker)
- [Ship with Docker](https://github.com/go-gitea/gitea/tree/master/docker)
- [Install with Vagrant](https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs)

### Tutorials
Expand Down Expand Up @@ -130,9 +136,9 @@ There are 5 ways to install Gogs:
## Contributors

- Ex-team members [@lunny](https://github.com/lunny), [@fuxiaohei](https://github.com/fuxiaohei) and [@slene](https://github.com/slene).
- See [contributors page](https://github.com/gogits/gogs/graphs/contributors) for full list of contributors.
- See [contributors page](https://github.com/go-gitea/gitea/graphs/contributors) for full list of contributors.
- See [TRANSLATORS](conf/locale/TRANSLATORS) for public list of translators.

## 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.
This project is under the MIT License. See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file for the full license text.
16 changes: 11 additions & 5 deletions README_ZH.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?branch=master)](https://travis-ci.org/gogits/gogs)
=====================
# Gitea - Git with a cup of tea

[![Build Status](https://travis-ci.org/go-gitea/gitea.svg?branch=master)](https://travis-ci.org/go-gitea/gitea)
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-gitea/gitea)](https://goreportcard.com/report/github.com/go-gitea/gitea)
[![GoDoc](https://godoc.org/github.com/go-gitea/gitea?status.svg)](https://godoc.org/github.com/go-gitea/gitea)
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](http://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
[![Join the chat at https://gitter.im/go-gitea/gitea](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-gitea/gitea?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Gogs (Go Git Service) 是一款极易搭建的自助 Git 服务。

Expand Down Expand Up @@ -53,7 +59,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
- [二进制安装](https://gogs.io/docs/installation/install_from_binary.html)
- [源码安装](https://gogs.io/docs/installation/install_from_source.html)
- [包管理安装](https://gogs.io/docs/installation/install_from_packages.html)
- [采用 Docker 部署](https://github.com/gogits/gogs/tree/master/docker)
- [采用 Docker 部署](https://github.com/go-gitea/gitea/tree/master/docker)
- [通过 Vagrant 安装](https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs)

### 使用教程
Expand Down Expand Up @@ -99,9 +105,9 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
## 贡献成员

- 前团队成员 [@lunny](https://github.com/lunny)、[@fuxiaohei](https://github.com/fuxiaohei) 和 [@slene](https://github.com/slene)。
- 您可以通过查看 [贡献者页面](https://github.com/gogits/gogs/graphs/contributors) 获取完整的贡献者列表。
- 您可以通过查看 [贡献者页面](https://github.com/go-gitea/gitea/graphs/contributors) 获取完整的贡献者列表。
- 您可以通过查看 [TRANSLATORS](conf/locale/TRANSLATORS) 文件获取公开的翻译人员列表。

## 授权许可

本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/gogits/gogs/blob/master/LICENSE) 文件中。
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) 文件中。
4 changes: 2 additions & 2 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/urfave/cli"

"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/setting"
"github.com/go-gitea/gitea/models"
"github.com/go-gitea/gitea/modules/setting"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions cmd/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/Unknwon/cae/zip"
"github.com/urfave/cli"

"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/setting"
"github.com/go-gitea/gitea/models"
"github.com/go-gitea/gitea/modules/setting"
)

var CmdDump = cli.Command{
Expand Down
10 changes: 5 additions & 5 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
gouuid "github.com/satori/go.uuid"
"github.com/urfave/cli"

"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/httplib"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
"github.com/go-gitea/gitea/models"
"github.com/go-gitea/gitea/modules/base"
"github.com/go-gitea/gitea/modules/httplib"
"github.com/go-gitea/gitea/modules/log"
"github.com/go-gitea/gitea/modules/setting"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

"github.com/urfave/cli"

"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
"github.com/go-gitea/gitea/models"
"github.com/go-gitea/gitea/modules/log"
"github.com/go-gitea/gitea/modules/setting"
)

var CmdUpdate = cli.Command{
Expand Down
34 changes: 17 additions & 17 deletions cmd/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ import (
"github.com/gogits/git-module"
"github.com/gogits/go-gogs-client"

"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/auth"
"github.com/gogits/gogs/modules/bindata"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
"github.com/gogits/gogs/modules/template"
"github.com/gogits/gogs/routers"
"github.com/gogits/gogs/routers/admin"
apiv1 "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"
"github.com/go-gitea/gitea/models"
"github.com/go-gitea/gitea/modules/auth"
"github.com/go-gitea/gitea/modules/bindata"
"github.com/go-gitea/gitea/modules/context"
"github.com/go-gitea/gitea/modules/log"
"github.com/go-gitea/gitea/modules/setting"
"github.com/go-gitea/gitea/modules/template"
"github.com/go-gitea/gitea/routers"
"github.com/go-gitea/gitea/routers/admin"
apiv1 "github.com/go-gitea/gitea/routers/api/v1"
"github.com/go-gitea/gitea/routers/dev"
"github.com/go-gitea/gitea/routers/org"
"github.com/go-gitea/gitea/routers/repo"
"github.com/go-gitea/gitea/routers/user"
)

var CmdWeb = cli.Command{
Expand Down Expand Up @@ -585,12 +585,12 @@ func runWeb(ctx *cli.Context) error {
m.Get("/src/*", repo.Home)
m.Get("/raw/*", repo.SingleDownload)
m.Get("/commits/*", repo.RefCommits)
m.Get("/commit/:sha([a-z0-9]{7,40})$", repo.Diff)
m.Get("/commit/:sha([a-f0-9]{7,40})$", repo.Diff)
m.Get("/forks", repo.Forks)
}, context.RepoRef())
m.Get("/commit/:sha([a-z0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff)
m.Get("/commit/:sha([a-f0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff)

m.Get("/compare/:before([a-z0-9]{7,40})\\.\\.\\.:after([a-z0-9]{7,40})", repo.CompareDiff)
m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.CompareDiff)
}, ignSignIn, context.RepoAssignment(), repo.MustBeNotBare)
m.Group("/:username/:reponame", func() {
m.Get("/stars", repo.Stars)
Expand Down
2 changes: 1 addition & 1 deletion conf/app.ini
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ DISABLE_REGISTRATION = false
REQUIRE_SIGNIN_VIEW = false
; Mail notification
ENABLE_NOTIFY_MAIL = false
; More detail: https://github.com/gogits/gogs/issues/165
; More detail: https://github.com/go-gitea/gitea/issues/165
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
; Enable captcha validation for registration
Expand Down
4 changes: 2 additions & 2 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ go install

# Build Gogs
mkdir -p ${GOPATH}/src/github.com/gogits/
ln -s /app/gogs/ ${GOPATH}/src/github.com/gogits/gogs
cd ${GOPATH}/src/github.com/gogits/gogs
ln -s /app/gogs/ ${GOPATH}/src/github.com/go-gitea/gitea
cd ${GOPATH}/src/github.com/go-gitea/gitea
glide install
make build TAGS="sqlite cert pam"

Expand Down
2 changes: 1 addition & 1 deletion glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package: github.com/gogits/gogs
package: github.com/go-gitea/gitea
import:
- package: github.com/Unknwon/cae
subpackages:
Expand Down Expand Up @@ -40,7 +40,7 @@ import:
- package: github.com/sergi/go-diff
subpackages:
- diffmatchpatch
- package: github.com/strk/go-libravatar
- package: strk.kbt.io/projects/go/libravatar
- package: golang.org/x/crypto
subpackages:
- ssh
Expand Down
4 changes: 2 additions & 2 deletions gogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

"github.com/urfave/cli"

"github.com/gogits/gogs/cmd"
"github.com/gogits/gogs/modules/setting"
"github.com/go-gitea/gitea/cmd"
"github.com/go-gitea/gitea/modules/setting"
)

const APP_VER = "0.9.99.0915"
Expand Down
2 changes: 1 addition & 1 deletion models/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package models
import (
"fmt"

"github.com/gogits/gogs/modules/log"
"github.com/go-gitea/gitea/modules/log"
)

type AccessMode int
Expand Down
6 changes: 3 additions & 3 deletions models/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"github.com/gogits/git-module"
api "github.com/gogits/go-gogs-client"

"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
"github.com/go-gitea/gitea/modules/base"
"github.com/go-gitea/gitea/modules/log"
"github.com/go-gitea/gitea/modules/setting"
)

type ActionType int
Expand Down
6 changes: 3 additions & 3 deletions models/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/Unknwon/com"
"github.com/go-xorm/xorm"

"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/setting"
"github.com/go-gitea/gitea/modules/base"
"github.com/go-gitea/gitea/modules/log"
"github.com/go-gitea/gitea/modules/setting"
)

type NoticeType int
Expand Down
Loading