Skip to content

Commit b220125

Browse files
Merge branch 'master' into add-team-as-collaborator
2 parents 7e45038 + 3c0e6d1 commit b220125

File tree

1,637 files changed

+183683
-29950
lines changed

Some content is hidden

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

1,637 files changed

+183683
-29950
lines changed

.drone.yml

Lines changed: 12 additions & 12 deletions
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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +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:
96-
- misspell
97-
text: '`Destory` is a misspelling of `Destroy`'
9889
- linters:
9990
- misspell
10091
text: '`Unknwon` is a misspelling of `Unknown`'

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,35 @@ 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+
736
## [1.9.1](https://github.com/go-gitea/gitea/releases/tag/v1.9.1) - 2019-08-14
837
* BREAKING
938
* Add pagination for admin api get orgs and fix only list public orgs bug (#7742) (#7752)

Dockerfile

Lines changed: 1 addition & 1 deletion
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}

Makefile

Lines changed: 6 additions & 10 deletions
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.17.1; \
472+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.18.0; \
477473
fi
478474
golangci-lint run --deadline=3m

cmd/cmd.go

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 5 deletions
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/migrate.go

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

cmd/web.go

Lines changed: 1 addition & 1 deletion
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

Lines changed: 6 additions & 6 deletions
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{}

custom/conf/app.ini.sample

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ DEFAULT_THEME = gitea
116116
THEMES = gitea,arc-green
117117
; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
118118
DEFAULT_SHOW_FULL_NAME = false
119+
; Whether to search within description at repository search on explore page.
120+
SEARCH_REPO_DESCRIPTION = true
119121

120122
[ui.admin]
121123
; Number of users that are displayed on one page
@@ -275,6 +277,10 @@ LOG_SQL = true
275277
DB_RETRIES = 10
276278
; Backoff time per DB retry (time.Duration)
277279
DB_RETRY_BACKOFF = 3s
280+
; Max idle database connections on connnection pool, default is 0
281+
MAX_IDLE_CONNS = 0
282+
; Database connection max life time, default is 3s
283+
CONN_MAX_LIFETIME = 3s
278284

279285
[indexer]
280286
; Issue indexer type, currently support: bleve or db, default is bleve
@@ -296,10 +302,17 @@ REPO_INDEXER_ENABLED = false
296302
REPO_INDEXER_PATH = indexers/repos.bleve
297303
UPDATE_BUFFER_LEN = 20
298304
MAX_FILE_SIZE = 1048576
305+
; A comma separated list of glob patterns (see https://github.com/gobwas/glob) to include
306+
; in the index; default is empty
307+
REPO_INDEXER_INCLUDE =
308+
; A comma separated list of glob patterns to exclude from the index; ; default is empty
309+
REPO_INDEXER_EXCLUDE =
299310

300311
[admin]
301312
; Disallow regular (non-admin) users from creating organizations.
302313
DISABLE_REGULAR_ORG_CREATION = false
314+
; Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
315+
DEFAULT_EMAIL_NOTIFICATIONS = enabled
303316

304317
[security]
305318
; Whether the installer is disabled
@@ -401,6 +414,9 @@ DEFAULT_ALLOW_CREATE_ORGANIZATION = true
401414
; Private is only for member of the organization
402415
; Public is for everyone
403416
DEFAULT_ORG_VISIBILITY = public
417+
; Default value for DefaultOrgMemberVisible
418+
; True will make the membership of the users visible when added to the organisation
419+
DEFAULT_ORG_MEMBER_VISIBLE = false
404420
; Default value for EnableDependencies
405421
; Repositories will use dependencies by default depending on this setting
406422
DEFAULT_ENABLE_DEPENDENCIES = true

docker/root/etc/s6/gitea/setup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
3131
ROOT_URL=${ROOT_URL:-""} \
3232
DISABLE_SSH=${DISABLE_SSH:-"false"} \
3333
SSH_PORT=${SSH_PORT:-"22"} \
34+
SSH_LISTEN_PORT=${SSH_LISTEN_PORT:-"${SSH_PORT}"} \
3435
LFS_START_SERVER=${LFS_START_SERVER:-"false"} \
3536
DB_TYPE=${DB_TYPE:-"sqlite3"} \
3637
DB_HOST=${DB_HOST:-"localhost:3306"} \

docker/root/etc/templates/app.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ HTTP_PORT = $HTTP_PORT
1717
ROOT_URL = $ROOT_URL
1818
DISABLE_SSH = $DISABLE_SSH
1919
SSH_PORT = $SSH_PORT
20+
SSH_LISTEN_PORT = $SSH_LISTEN_PORT
2021
LFS_START_SERVER = $LFS_START_SERVER
2122
LFS_CONTENT_PATH = /data/git/lfs
2223

0 commit comments

Comments
 (0)