Skip to content

Commit 5780b7b

Browse files
Merge branch 'master' into api-repository-advanced-settings
2 parents 791117b + 7a8e299 commit 5780b7b

File tree

2,012 files changed

+296706
-83059
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,012 files changed

+296706
-83059
lines changed

.drone.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ steps:
7272

7373
- name: build-linux-386
7474
pull: always
75-
image: golang:1.12
75+
image: golang:1.13
7676
environment:
7777
GO111MODULE: on
7878
GOPROXY: off
@@ -83,7 +83,7 @@ steps:
8383

8484
- name: build
8585
pull: always
86-
image: golang:1.12
86+
image: golang:1.13
8787
commands:
8888
- make clean
8989
- make generate
@@ -100,7 +100,7 @@ steps:
100100

101101
- name: unit-test
102102
pull: always
103-
image: golang:1.12
103+
image: golang:1.13
104104
commands:
105105
- make unit-test-coverage
106106
environment:
@@ -117,7 +117,7 @@ steps:
117117

118118
- name: release-test
119119
pull: always
120-
image: golang:1.12
120+
image: golang:1.13
121121
commands:
122122
- make test
123123
environment:
@@ -145,7 +145,7 @@ steps:
145145

146146
- name: tag-test
147147
pull: always
148-
image: golang:1.12
148+
image: golang:1.13
149149
commands:
150150
- make test
151151
environment:
@@ -159,7 +159,7 @@ steps:
159159

160160
- name: test-sqlite
161161
pull: always
162-
image: golang:1.12
162+
image: golang:1.13
163163
commands:
164164
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
165165
- apt-get install -y git-lfs
@@ -173,7 +173,7 @@ steps:
173173

174174
- name: test-mysql
175175
pull: always
176-
image: golang:1.12
176+
image: golang:1.13
177177
commands:
178178
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
179179
- apt-get install -y git-lfs
@@ -194,7 +194,7 @@ steps:
194194

195195
- name: tag-test-mysql
196196
pull: always
197-
image: golang:1.12
197+
image: golang:1.13
198198
commands:
199199
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
200200
- apt-get install -y git-lfs
@@ -212,7 +212,7 @@ steps:
212212

213213
- name: test-mysql8
214214
pull: always
215-
image: golang:1.12
215+
image: golang:1.13
216216
commands:
217217
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
218218
- apt-get install -y git-lfs
@@ -227,7 +227,7 @@ steps:
227227

228228
- name: test-pgsql
229229
pull: always
230-
image: golang:1.12
230+
image: golang:1.13
231231
commands:
232232
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
233233
- apt-get install -y git-lfs
@@ -242,7 +242,7 @@ steps:
242242

243243
- name: test-mssql
244244
pull: always
245-
image: golang:1.12
245+
image: golang:1.13
246246
commands:
247247
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
248248
- apt-get install -y git-lfs
@@ -257,7 +257,7 @@ steps:
257257

258258
- name: generate-coverage
259259
pull: always
260-
image: golang:1.12
260+
image: golang:1.13
261261
commands:
262262
- make coverage
263263
environment:

.golangci.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ issues:
8686
- path: models/issue_comment_list.go
8787
linters:
8888
- dupl
89-
# "Destroy" is misspelled in github.com/go-macaron/session/session.go:213 so it's not our responsability to fix it
90-
- path: modules/session/virtual.go
91-
linters:
92-
- misspell
93-
text: '`Destory` is a misspelling of `Destroy`'
94-
- path: modules/session/memory.go
95-
linters:
89+
- linters:
9690
- misspell
97-
text: '`Destory` is a misspelling of `Destroy`'
91+
text: '`Unknwon` is a misspelling of `Unknown`'

CHANGELOG.md

+56
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,62 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.9.3](https://github.com/go-gitea/gitea/releases/tag/v1.9.3) - 2019-09-06
8+
* BUGFIXES
9+
* Fix go get from a private repository with Go 1.13 (#8100)
10+
* Strict name matching for Repository.GetTagID() (#8082)
11+
* Avoid ambiguity of branch/directory names for the git-diff-tree command (#8070)
12+
* Add change title notification for issues (#8064)
13+
* Run CORS handler first for /api routes (#7967) (#8053)
14+
* Evaluate emojis in commit messages in list view (#8044)
15+
* Fix failed to synchronize tags to releases for repository (#7990) (#7994)
16+
* Fix adding default Telegram webhook (#7972) (#7992)
17+
* Abort synchronization from LDAP source if there is some error (#7965)
18+
* Fix deformed emoji in commit message (#8071)
19+
* ENHANCEMENT
20+
* Keep blame view buttons sequence consistent with normal view when viewing a file (#8007) (#8009)
21+
22+
## [1.9.2](https://github.com/go-gitea/gitea/releases/tag/v1.9.2) - 2019-08-22
23+
* BUGFIXES
24+
* Fix wrong sender when send slack webhook (#7918) (#7924)
25+
* Upload support text/plain; charset=utf8 (#7899)
26+
* Lfs/lock: round locked_at timestamp to second (#7872) (#7875)
27+
* Fix non existent milestone with 500 error (#7867) (#7873)
28+
* SECURITY
29+
* Fix No PGP signature on 1.9.1 tag (#7874)
30+
* Release built with go 1.12.9 to fix security fixes in golang std lib, ref: https://groups.google.com/forum/#!msg/golang-announce/oeMaeUnkvVE/a49yvTLqAAAJ
31+
* ENHANCEMENT
32+
* Fix pull creation with empty changes (#7920) (#7926)
33+
* BUILD
34+
* Drone/docker: prepare multi-arch release + provide arm64 image (#7571) (#7884)
35+
36+
## [1.9.1](https://github.com/go-gitea/gitea/releases/tag/v1.9.1) - 2019-08-14
37+
* BREAKING
38+
* Add pagination for admin api get orgs and fix only list public orgs bug (#7742) (#7752)
39+
* SECURITY
40+
* Be more strict with git arguments (#7715) (#7762)
41+
* Release built with go 1.12.8 to fix security fixes in golang std lib, ref: https://groups.google.com/forum/#!topic/golang-nuts/fCQWxqxP8aA
42+
* BUGFIXES
43+
* Fix local runs of ssh-requiring integration tests (#7855) (#7857)
44+
* Fix hook problem (#7856) (#7754)
45+
* Use .ExpiredUnix.IsZero to display green color of forever valid gpg key (#7850) (#7846)
46+
* Do not fetch all refs (#7797) (#7837)
47+
* Fix duplicate call of webhook (#7824) (#7821)
48+
* Enable switching to a different source branch when PR already exists (#7823)
49+
* Rewrite existing repo units if setting is not included in api body (#7811)
50+
* Prevent Commit Status and Message From Overflowing On Branch Page (#7800) (#7808)
51+
* API: fix multiple bugs with statuses endpoints (Backport #7785) (#7807)
52+
* Fix Slack webhook fork message (1.9 release backport) (#7783)
53+
* Fix approvals counting (#7757) (#7777)
54+
* Fix rename failed when rewrite public keys (#7761) (#7769)
55+
* Fix dropTableColumns sqlite implementation (#7710) (#7765)
56+
* Fix repo_index_status lingering when deleting a repository (#7738)
57+
* Fix milestone completness calculation when migrating (#7725) (#7732)
58+
* Fixes indexed repos keeping outdated indexes when files grow too large (#7731)
59+
* Skip non-regular files (e.g. submodules) on repo indexing (#7717)
60+
* Improve branches list performance and fix protected branch icon when no-login (#7695) (#7704)
61+
* Correct wrong datetime format for git (#7689) (#7690)
62+
763
## [1.9.0](https://github.com/go-gitea/gitea/releases/tag/v1.9.0) - 2019-07-30
864
* BREAKING
965
* Better logging (#6038) (#6095)

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
###################################
33
#Build stage
4-
FROM golang:1.12-alpine3.10 AS build-env
4+
FROM golang:1.13-alpine3.10 AS build-env
55

66
ARG GOPROXY
77
ENV GOPROXY ${GOPROXY:-direct}

MAINTAINERS

+2
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ Richard Mahn <[email protected]> (@richmahn)
3131
Mrsdizzie <[email protected]> (@mrsdizzie)
3232
silverwind <[email protected]> (@silverwind)
3333
Gary Kim <[email protected]> (@gary-kim)
34+
Guillermo Prandi <[email protected]> (@guillep2k)
35+
Mura Li <[email protected]> (@typeless)

Makefile

+7-11
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ endif
4141

4242
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
4343

44-
PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/)))
44+
PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell GO111MODULE=on $(GO) list -mod=vendor ./... | grep -v /vendor/)))
4545
SOURCES ?= $(shell find . -name "*.go" -type f)
4646

4747
TAGS ?=
4848

4949
TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'gitea-temp')
5050

51+
#To update swagger use: GO111MODULE=on go get -u github.com/go-swagger/go-swagger/cmd/[email protected]
52+
SWAGGER := GO111MODULE=on $(GO) run -mod=vendor github.com/go-swagger/go-swagger/cmd/swagger
5153
SWAGGER_SPEC := templates/swagger/v1_json.tmpl
5254
SWAGGER_SPEC_S_TMPL := s|"basePath": *"/api/v1"|"basePath": "{{AppSubUrl}}/api/v1"|g
5355
SWAGGER_SPEC_S_JSON := s|"basePath": *"{{AppSubUrl}}/api/v1"|"basePath": "/api/v1"|g
@@ -101,10 +103,7 @@ generate:
101103

102104
.PHONY: generate-swagger
103105
generate-swagger:
104-
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
105-
GO111MODULE="on" $(GO) get -u github.com/go-swagger/go-swagger/cmd/[email protected]; \
106-
fi
107-
swagger generate spec -o './$(SWAGGER_SPEC)'
106+
$(SWAGGER) generate spec -o './$(SWAGGER_SPEC)'
108107
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
109108
$(SED_INPLACE) $(SWAGGER_NEWLINE_COMMAND) './$(SWAGGER_SPEC)'
110109

@@ -119,11 +118,8 @@ swagger-check: generate-swagger
119118

120119
.PHONY: swagger-validate
121120
swagger-validate:
122-
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
123-
$(GO) get -u github.com/go-swagger/go-swagger/cmd/swagger; \
124-
fi
125121
$(SED_INPLACE) '$(SWAGGER_SPEC_S_JSON)' './$(SWAGGER_SPEC)'
126-
swagger validate './$(SWAGGER_SPEC)'
122+
$(SWAGGER) validate './$(SWAGGER_SPEC)'
127123
$(SED_INPLACE) '$(SWAGGER_SPEC_S_TMPL)' './$(SWAGGER_SPEC)'
128124

129125
.PHONY: errcheck
@@ -473,6 +469,6 @@ pr:
473469
golangci-lint:
474470
@hash golangci-lint > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
475471
export BINARY="golangci-lint"; \
476-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.16.0; \
472+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.18.0; \
477473
fi
478-
golangci-lint run
474+
golangci-lint run --deadline=3m

cmd/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func initDB() error {
3838

3939
func initDBDisableConsole(disableConsole bool) error {
4040
setting.NewContext()
41-
models.LoadConfigs()
41+
setting.InitDBConfig()
4242

4343
setting.NewXORMLogService(disableConsole)
4444
if err := models.SetEngine(); err != nil {

cmd/convert.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ func runConvert(ctx *cli.Context) error {
3131
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
3232
log.Trace("Custom path: %s", setting.CustomPath)
3333
log.Trace("Log path: %s", setting.LogRootPath)
34-
models.LoadConfigs()
34+
setting.InitDBConfig()
3535

36-
if models.DbCfg.Type != "mysql" {
36+
if !setting.Database.UseMySQL {
3737
fmt.Println("This command can only be used with a MySQL database")
3838
return nil
3939
}

cmd/dump.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717
"code.gitea.io/gitea/models"
1818
"code.gitea.io/gitea/modules/setting"
1919

20-
"github.com/Unknwon/cae/zip"
21-
"github.com/Unknwon/com"
20+
"github.com/unknwon/cae/zip"
21+
"github.com/unknwon/com"
2222
"github.com/urfave/cli"
2323
)
2424

@@ -58,7 +58,6 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
5858
func runDump(ctx *cli.Context) error {
5959
setting.NewContext()
6060
setting.NewServices() // cannot access session settings otherwise
61-
models.LoadConfigs()
6261

6362
err := models.SetEngine()
6463
if err != nil {
@@ -104,8 +103,8 @@ func runDump(ctx *cli.Context) error {
104103
}
105104

106105
targetDBType := ctx.String("database")
107-
if len(targetDBType) > 0 && targetDBType != models.DbCfg.Type {
108-
log.Printf("Dumping database %s => %s...", models.DbCfg.Type, targetDBType)
106+
if len(targetDBType) > 0 && targetDBType != setting.Database.Type {
107+
log.Printf("Dumping database %s => %s...", setting.Database.Type, targetDBType)
109108
} else {
110109
log.Printf("Dumping database...")
111110
}

cmd/hook.go

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func runHookPreReceive(c *cli.Context) error {
9696
UserID: userID,
9797
GitAlternativeObjectDirectories: os.Getenv(private.GitAlternativeObjectDirectories),
9898
GitObjectDirectory: os.Getenv(private.GitObjectDirectory),
99+
GitQuarantinePath: os.Getenv(private.GitQuarantinePath),
99100
ProtectedBranchID: prID,
100101
})
101102
switch statusCode {

cmd/migrate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func runMigrate(ctx *cli.Context) error {
3030
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
3131
log.Trace("Custom path: %s", setting.CustomPath)
3232
log.Trace("Log path: %s", setting.LogRootPath)
33-
models.LoadConfigs()
33+
setting.InitDBConfig()
3434

3535
if err := models.NewEngine(migrations.Migrate); err != nil {
3636
log.Fatal("Failed to initialize ORM engine: %v", err)

cmd/serv.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222
"code.gitea.io/gitea/modules/private"
2323
"code.gitea.io/gitea/modules/setting"
2424

25-
"github.com/Unknwon/com"
2625
"github.com/dgrijalva/jwt-go"
26+
"github.com/unknwon/com"
2727
"github.com/urfave/cli"
2828
)
2929

@@ -109,7 +109,7 @@ func runServ(c *cli.Context) error {
109109
if key.Type == models.KeyTypeDeploy {
110110
println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Gitea does not provide shell access.")
111111
} else {
112-
println("Hi there: " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Gitea does not provide shell access.")
112+
println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Gitea does not provide shell access.")
113113
}
114114
println("If this is unexpected, please log in with password and setup Gitea under another user.")
115115
return nil

cmd/web.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
"code.gitea.io/gitea/routers"
1919
"code.gitea.io/gitea/routers/routes"
2020

21-
"github.com/Unknwon/com"
2221
context2 "github.com/gorilla/context"
22+
"github.com/unknwon/com"
2323
"github.com/urfave/cli"
2424
"golang.org/x/crypto/acme/autocert"
2525
ini "gopkg.in/ini.v1"

contrib/pr/checkout.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727
"code.gitea.io/gitea/routers"
2828
"code.gitea.io/gitea/routers/routes"
2929

30-
"github.com/Unknwon/com"
3130
"github.com/go-xorm/xorm"
3231
context2 "github.com/gorilla/context"
32+
"github.com/unknwon/com"
3333
"gopkg.in/src-d/go-git.v4"
3434
"gopkg.in/src-d/go-git.v4/config"
3535
"gopkg.in/src-d/go-git.v4/plumbing"
@@ -79,16 +79,16 @@ func runPR() {
7979
setting.CheckLFSVersion()
8080
//models.LoadConfigs()
8181
/*
82-
models.DbCfg.Type = "sqlite3"
83-
models.DbCfg.Path = ":memory:"
84-
models.DbCfg.Timeout = 500
82+
setting.Database.Type = "sqlite3"
83+
setting.Database.Path = ":memory:"
84+
setting.Database.Timeout = 500
8585
*/
8686
db := setting.Cfg.Section("database")
8787
db.NewKey("DB_TYPE", "sqlite3")
8888
db.NewKey("PATH", ":memory:")
89-
setting.LogSQL = true
90-
models.LoadConfigs()
89+
9190
routers.NewServices()
91+
setting.Database.LogSQL = true
9292
//x, err = xorm.NewEngine("sqlite3", "file::memory:?cache=shared")
9393

9494
var helper testfixtures.Helper = &testfixtures.SQLite{}

0 commit comments

Comments
 (0)