Skip to content

Commit 7c721f9

Browse files
Merge branch 'master' into api-repo-topics
2 parents 244cbd3 + e3115cc commit 7c721f9

File tree

447 files changed

+15351
-13582
lines changed

Some content is hidden

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

447 files changed

+15351
-13582
lines changed

.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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ 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.2](https://github.com/go-gitea/gitea/releases/tag/v1.9.2) - 2019-08-22
8+
* BUGFIXES
9+
* Fix wrong sender when send slack webhook (#7918) (#7924)
10+
* Upload support text/plain; charset=utf8 (#7899)
11+
* Lfs/lock: round locked_at timestamp to second (#7872) (#7875)
12+
* Fix non existent milestone with 500 error (#7867) (#7873)
13+
* SECURITY
14+
* Fix No PGP signature on 1.9.1 tag (#7874)
15+
* 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
16+
* ENHANCEMENT
17+
* Fix pull creation with empty changes (#7920) (#7926)
18+
* BUILD
19+
* Drone/docker: prepare multi-arch release + provide arm64 image (#7571) (#7884)
20+
721
## [1.9.1](https://github.com/go-gitea/gitea/releases/tag/v1.9.1) - 2019-08-14
822
* BREAKING
923
* Add pagination for admin api get orgs and fix only list public orgs bug (#7742) (#7752)

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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ LOG_SQL = true
275275
DB_RETRIES = 10
276276
; Backoff time per DB retry (time.Duration)
277277
DB_RETRY_BACKOFF = 3s
278+
; Max idle database connections on connnection pool, default is 0
279+
MAX_IDLE_CONNS = 0
280+
; Database connection max life time, default is 3s
281+
CONN_MAX_LIFETIME = 3s
278282

279283
[indexer]
280284
; Issue indexer type, currently support: bleve or db, default is bleve
@@ -401,6 +405,9 @@ DEFAULT_ALLOW_CREATE_ORGANIZATION = true
401405
; Private is only for member of the organization
402406
; Public is for everyone
403407
DEFAULT_ORG_VISIBILITY = public
408+
; Default value for DefaultOrgMemberVisible
409+
; True will make the membership of the users visible when added to the organisation
410+
DEFAULT_ORG_MEMBER_VISIBLE = false
404411
; Default value for EnableDependencies
405412
; Repositories will use dependencies by default depending on this setting
406413
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

docs/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21+
version: 1.9.2
2122

2223
menu:
2324
page:

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
166166
- `LOG_SQL`: **true**: Log the executed SQL.
167167
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.
168168
- `DB_RETRY_BACKOFF`: **3s**: time.Duration to wait before trying another ORM init / DB connect attempt, if failure occured.
169+
- `MAX_IDLE_CONNS` **0**: Max idle database connections on connnection pool, default is 0
170+
- `CONN_MAX_LIFETIME` **3s**: Database connection max lifetime
169171

170172
## Indexer (`indexer`)
171173

@@ -244,6 +246,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
244246
- `SHOW_REGISTRATION_BUTTON`: **! DISABLE\_REGISTRATION**: Show Registration Button
245247
- `AUTO_WATCH_NEW_REPOS`: **true**: Enable this to let all organisation users watch new repos when they are created
246248
- `DEFAULT_ORG_VISIBILITY`: **public**: Set default visibility mode for organisations, either "public", "limited" or "private".
249+
- `DEFAULT_ORG_MEMBER_VISIBLE`: **false** True will make the membership of the users visible when added to the organisation.
247250

248251
## Webhook (`webhook`)
249252

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ menu:
8282
- `CHARSET`: **utf8**: 仅当数据库为 MySQL 时有效, 可以为 "utf8" 或 "utf8mb4"。注意:如果使用 "utf8mb4",你的 MySQL InnoDB 版本必须在 5.6 以上。
8383
- `PATH`: Tidb 或者 SQLite3 数据文件存放路径。
8484
- `LOG_SQL`: **true**: 显示生成的SQL,默认为真。
85+
- `MAX_IDLE_CONNS` **0**: 最大空闲数据库连接
86+
- `CONN_MAX_LIFETIME` **3s**: 数据库连接最大存活时间
8587

8688
## Indexer (`indexer`)
8789

docs/content/doc/installation/from-binary.en-us.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ the destination platform from the [downloads page](https://dl.gitea.io/gitea/),
2121
the URL and replace the URL within the commands below:
2222

2323
```sh
24-
wget -O gitea https://dl.gitea.io/gitea/1.8.3/gitea-1.8.3-linux-amd64
24+
wget -O gitea https://dl.gitea.io/gitea/{{< version >}}/gitea-{{< version >}}-linux-amd64
2525
chmod +x gitea
2626
```
2727

@@ -30,7 +30,7 @@ Gitea signs all binaries with a [GPG key](https://pgp.mit.edu/pks/lookup?op=vind
3030

3131
```sh
3232
gpg --keyserver pgp.mit.edu --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
33-
gpg --verify gitea-1.8.3-linux-amd64.asc gitea-1.8.3-linux-amd64
33+
gpg --verify gitea-{{< version >}}-linux-amd64.asc gitea-{{< version >}}-linux-amd64
3434
```
3535

3636
## Test

docs/content/doc/installation/from-binary.fr-fr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ menu:
1818
Tous les binaires sont livrés avec le support de SQLite, MySQL et PostgreSQL, et sont construits avec les ressources incorporées. Gardez à l'esprit que cela peut être différent pour les versions antérieures. L'installation basée sur nos binaires est assez simple, il suffit de choisir le fichier correspondant à votre plateforme à partir de la [page de téléchargement](https://dl.gitea.io/gitea). Copiez l'URL et remplacer l'URL dans les commandes suivantes par la nouvelle:
1919

2020
```
21-
wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64
21+
wget -O gitea https://dl.gitea.io/gitea/{{< version >}}/gitea-{{< version >}}-linux-amd64
2222
chmod +x gitea
2323
```
2424

docs/content/doc/installation/from-binary.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ menu:
1818
所有下载均包括 SQLite, MySQL 和 PostgreSQL 的支持,同时所有资源均已嵌入到可执行程序中,这一点和老版本有所不同。 基于二进制的安装非常简单,只要从 [下载页面](https://dl.gitea.io/gitea) 选择对应平台,拷贝下载URL,执行以下命令即可(以Linux为例):
1919

2020
```
21-
wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64
21+
wget -O gitea https://dl.gitea.io/gitea/{{< version >}}/gitea-{{< version >}}-linux-amd64
2222
chmod +x gitea
2323
```
2424

docs/content/doc/installation/from-binary.zh-tw.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ menu:
1818
所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.io/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了:
1919

2020
```
21-
wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64
21+
wget -O gitea https://dl.gitea.io/gitea/{{< version >}}/gitea-{{< version >}}-linux-amd64
2222
chmod +x gitea
2323
```
2424

docs/content/doc/installation/from-source.en-us.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ To work with tagged releases, the following commands can be used:
5353

5454
```bash
5555
git branch -a
56-
git checkout v1.0
56+
git checkout v{{< version >}}
5757
```
5858

5959
To validate a Pull Request, first enable the new branch (`xyz` is the PR id;
@@ -63,14 +63,14 @@ for example `2663` for [#2663](https://github.com/go-gitea/gitea/pull/2663)):
6363
git fetch origin pull/xyz/head:pr-xyz
6464
```
6565

66-
To build Gitea from source at a specific tagged release (like v1.0.0), list the
66+
To build Gitea from source at a specific tagged release (like v{{< version >}}), list the
6767
available tags and check out the specific tag.
6868

6969
List available tags with the following.
7070

7171
```bash
7272
git tag -l
73-
git checkout v1.0.0 # or git checkout pr-xyz
73+
git checkout v{{< version >}} # or git checkout pr-xyz
7474
```
7575

7676
## Build

docs/content/doc/installation/from-source.fr-fr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Si vous souhaitez compiler la dernière version stable, utilisez les étiquettes
3535

3636
```
3737
git branch -a
38-
git checkout v1.0
38+
git checkout v{{< version >}}
3939
```
4040

4141
Si vous souhaitez valider une demande d'ajout (_Pull request_), vous devez activer cette branche en premier :
@@ -44,11 +44,11 @@ Si vous souhaitez valider une demande d'ajout (_Pull request_), vous devez activ
4444
git fetch origin pull/xyz/head:pr-xyz # xyz is PR value
4545
```
4646

47-
Enfin, vous pouvez directement utiliser les versions étiquettées (ex : `v1.0.0`). Pour utiliser les étiquettes, vous devez lister les étiquettes disponibles et choisir une étiquette spécifique avec les commandes suivantes :
47+
Enfin, vous pouvez directement utiliser les versions étiquettées (ex : `v{{< version >}}`). Pour utiliser les étiquettes, vous devez lister les étiquettes disponibles et choisir une étiquette spécifique avec les commandes suivantes :
4848

4949
```
5050
git tag -l
51-
git checkout v1.0.0
51+
git checkout v{{< version >}}
5252
git checkout pr-xyz
5353
```
5454

docs/content/doc/installation/from-source.zh-cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ cd $GOPATH/src/code.gitea.io/gitea
3232

3333
```
3434
git branch -a
35-
git checkout v1.0
35+
git checkout v{{< version >}}
3636
```
3737

38-
最后,你也可以直接使用标签版本如 `v1.0.0`。你可以执行以下命令列出可用的版本并选择某个版本签出:
38+
最后,你也可以直接使用标签版本如 `v{{< version >}}`。你可以执行以下命令列出可用的版本并选择某个版本签出:
3939

4040
```
4141
git tag -l
42-
git checkout v1.0.0
42+
git checkout v{{< version >}}
4343
```
4444

4545
## 编译

docs/content/doc/installation/from-source.zh-tw.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ cd $GOPATH/src/code.gitea.io/gitea
3232

3333
```
3434
git branch -a
35-
git checkout v1.0
35+
git checkout v{{< version >}}
3636
```
3737

38-
最後您也可以直接編譯最新的標籤版本像是 `v1.0.0`,假如您想要從原始碼編譯,這方法是最合適的,在編譯標籤版本前,您需要列出當下所有標籤,並且直接切換到標籤版本,請使用底下指令::
38+
最後您也可以直接編譯最新的標籤版本像是 `v{{< version >}}`,假如您想要從原始碼編譯,這方法是最合適的,在編譯標籤版本前,您需要列出當下所有標籤,並且直接切換到標籤版本,請使用底下指令::
3939

4040
```
4141
git tag -l
42-
git checkout v1.0.0
42+
git checkout v{{< version >}}
4343
```
4444

4545
## 編譯

docs/content/doc/installation/with-docker.en-us.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Create a directory like `gitea` and paste the following content into a file name
3131
Note that the volume should be owned by the user/group with the UID/GID specified in the config file.
3232
If you don't give the volume correct permissions, the container may not start.
3333
Also be aware that the tag `:latest` will install the current development version.
34-
For a stable release you can use `:1` or specify a certain release like `:1.5.1`.
34+
For a stable release you can use `:1` or specify a certain release like `:{{< version >}}`.
3535

3636
```yaml
3737
version: "2"
@@ -245,6 +245,7 @@ You can configure some of Gitea's settings via environment variables:
245245
* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
246246
* `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed clone URL in Gitea's UI.
247247
* `SSH_PORT`: **22**: SSH port displayed in clone URL.
248+
* `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
248249
* `DISABLE_SSH`: **false**: Disable SSH feature when it's not available.
249250
* `HTTP_PORT`: **3000**: HTTP listen port.
250251
* `ROOT_URL`: **""**: Overwrite the automatically generated public URL. This is useful if the internal and the external URL don't match (e.g. in Docker).

docs/layouts/shortcodes/version.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ .Site.Params.version }}

0 commit comments

Comments
 (0)