Skip to content

Commit

Permalink
Merge branch 'master' into api-repo-topics
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsvantesson authored Aug 24, 2019
2 parents 244cbd3 + e3115cc commit 7c721f9
Show file tree
Hide file tree
Showing 447 changed files with 15,351 additions and 13,582 deletions.
9 changes: 0 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ issues:
- path: models/issue_comment_list.go
linters:
- dupl
# "Destroy" is misspelled in github.com/go-macaron/session/session.go:213 so it's not our responsability to fix it
- path: modules/session/virtual.go
linters:
- misspell
text: '`Destory` is a misspelling of `Destroy`'
- path: modules/session/memory.go
linters:
- misspell
text: '`Destory` is a misspelling of `Destroy`'
- linters:
- misspell
text: '`Unknwon` is a misspelling of `Unknown`'
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io).

## [1.9.2](https://github.com/go-gitea/gitea/releases/tag/v1.9.2) - 2019-08-22
* BUGFIXES
* Fix wrong sender when send slack webhook (#7918) (#7924)
* Upload support text/plain; charset=utf8 (#7899)
* Lfs/lock: round locked_at timestamp to second (#7872) (#7875)
* Fix non existent milestone with 500 error (#7867) (#7873)
* SECURITY
* Fix No PGP signature on 1.9.1 tag (#7874)
* 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
* ENHANCEMENT
* Fix pull creation with empty changes (#7920) (#7926)
* BUILD
* Drone/docker: prepare multi-arch release + provide arm64 image (#7571) (#7884)

## [1.9.1](https://github.com/go-gitea/gitea/releases/tag/v1.9.1) - 2019-08-14
* BREAKING
* Add pagination for admin api get orgs and fix only list public orgs bug (#7742) (#7752)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func initDB() error {

func initDBDisableConsole(disableConsole bool) error {
setting.NewContext()
models.LoadConfigs()
setting.InitDBConfig()

setting.NewXORMLogService(disableConsole)
if err := models.SetEngine(); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func runConvert(ctx *cli.Context) error {
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
log.Trace("Custom path: %s", setting.CustomPath)
log.Trace("Log path: %s", setting.LogRootPath)
models.LoadConfigs()
setting.InitDBConfig()

if models.DbCfg.Type != "mysql" {
if !setting.Database.UseMySQL {
fmt.Println("This command can only be used with a MySQL database")
return nil
}
Expand Down
9 changes: 4 additions & 5 deletions cmd/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"

"github.com/Unknwon/cae/zip"
"github.com/Unknwon/com"
"github.com/unknwon/cae/zip"
"github.com/unknwon/com"
"github.com/urfave/cli"
)

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

err := models.SetEngine()
if err != nil {
Expand Down Expand Up @@ -104,8 +103,8 @@ func runDump(ctx *cli.Context) error {
}

targetDBType := ctx.String("database")
if len(targetDBType) > 0 && targetDBType != models.DbCfg.Type {
log.Printf("Dumping database %s => %s...", models.DbCfg.Type, targetDBType)
if len(targetDBType) > 0 && targetDBType != setting.Database.Type {
log.Printf("Dumping database %s => %s...", setting.Database.Type, targetDBType)
} else {
log.Printf("Dumping database...")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func runMigrate(ctx *cli.Context) error {
log.Trace("AppWorkPath: %s", setting.AppWorkPath)
log.Trace("Custom path: %s", setting.CustomPath)
log.Trace("Log path: %s", setting.LogRootPath)
models.LoadConfigs()
setting.InitDBConfig()

if err := models.NewEngine(migrations.Migrate); err != nil {
log.Fatal("Failed to initialize ORM engine: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/serv.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"

"github.com/Unknwon/com"
"github.com/dgrijalva/jwt-go"
"github.com/unknwon/com"
"github.com/urfave/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"code.gitea.io/gitea/routers"
"code.gitea.io/gitea/routers/routes"

"github.com/Unknwon/com"
context2 "github.com/gorilla/context"
"github.com/unknwon/com"
"github.com/urfave/cli"
"golang.org/x/crypto/acme/autocert"
ini "gopkg.in/ini.v1"
Expand Down
12 changes: 6 additions & 6 deletions contrib/pr/checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
"code.gitea.io/gitea/routers"
"code.gitea.io/gitea/routers/routes"

"github.com/Unknwon/com"
"github.com/go-xorm/xorm"
context2 "github.com/gorilla/context"
"github.com/unknwon/com"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/plumbing"
Expand Down Expand Up @@ -79,16 +79,16 @@ func runPR() {
setting.CheckLFSVersion()
//models.LoadConfigs()
/*
models.DbCfg.Type = "sqlite3"
models.DbCfg.Path = ":memory:"
models.DbCfg.Timeout = 500
setting.Database.Type = "sqlite3"
setting.Database.Path = ":memory:"
setting.Database.Timeout = 500
*/
db := setting.Cfg.Section("database")
db.NewKey("DB_TYPE", "sqlite3")
db.NewKey("PATH", ":memory:")
setting.LogSQL = true
models.LoadConfigs()

routers.NewServices()
setting.Database.LogSQL = true
//x, err = xorm.NewEngine("sqlite3", "file::memory:?cache=shared")

var helper testfixtures.Helper = &testfixtures.SQLite{}
Expand Down
7 changes: 7 additions & 0 deletions custom/conf/app.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ LOG_SQL = true
DB_RETRIES = 10
; Backoff time per DB retry (time.Duration)
DB_RETRY_BACKOFF = 3s
; Max idle database connections on connnection pool, default is 0
MAX_IDLE_CONNS = 0
; Database connection max life time, default is 3s
CONN_MAX_LIFETIME = 3s

[indexer]
; Issue indexer type, currently support: bleve or db, default is bleve
Expand Down Expand Up @@ -401,6 +405,9 @@ DEFAULT_ALLOW_CREATE_ORGANIZATION = true
; Private is only for member of the organization
; Public is for everyone
DEFAULT_ORG_VISIBILITY = public
; Default value for DefaultOrgMemberVisible
; True will make the membership of the users visible when added to the organisation
DEFAULT_ORG_MEMBER_VISIBLE = false
; Default value for EnableDependencies
; Repositories will use dependencies by default depending on this setting
DEFAULT_ENABLE_DEPENDENCIES = true
Expand Down
1 change: 1 addition & 0 deletions docker/root/etc/s6/gitea/setup
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
ROOT_URL=${ROOT_URL:-""} \
DISABLE_SSH=${DISABLE_SSH:-"false"} \
SSH_PORT=${SSH_PORT:-"22"} \
SSH_LISTEN_PORT=${SSH_LISTEN_PORT:-"${SSH_PORT}"} \
LFS_START_SERVER=${LFS_START_SERVER:-"false"} \
DB_TYPE=${DB_TYPE:-"sqlite3"} \
DB_HOST=${DB_HOST:-"localhost:3306"} \
Expand Down
1 change: 1 addition & 0 deletions docker/root/etc/templates/app.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ HTTP_PORT = $HTTP_PORT
ROOT_URL = $ROOT_URL
DISABLE_SSH = $DISABLE_SSH
SSH_PORT = $SSH_PORT
SSH_LISTEN_PORT = $SSH_LISTEN_PORT
LFS_START_SERVER = $LFS_START_SERVER
LFS_CONTENT_PATH = /data/git/lfs

Expand Down
1 change: 1 addition & 0 deletions docs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ params:
description: Git with a cup of tea
author: The Gitea Authors
website: https://docs.gitea.io
version: 1.9.2

menu:
page:
Expand Down
3 changes: 3 additions & 0 deletions docs/content/doc/advanced/config-cheat-sheet.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `LOG_SQL`: **true**: Log the executed SQL.
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.
- `DB_RETRY_BACKOFF`: **3s**: time.Duration to wait before trying another ORM init / DB connect attempt, if failure occured.
- `MAX_IDLE_CONNS` **0**: Max idle database connections on connnection pool, default is 0
- `CONN_MAX_LIFETIME` **3s**: Database connection max lifetime

## Indexer (`indexer`)

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

## Webhook (`webhook`)

Expand Down
2 changes: 2 additions & 0 deletions docs/content/doc/advanced/config-cheat-sheet.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ menu:
- `CHARSET`: **utf8**: 仅当数据库为 MySQL 时有效, 可以为 "utf8" 或 "utf8mb4"。注意:如果使用 "utf8mb4",你的 MySQL InnoDB 版本必须在 5.6 以上。
- `PATH`: Tidb 或者 SQLite3 数据文件存放路径。
- `LOG_SQL`: **true**: 显示生成的SQL,默认为真。
- `MAX_IDLE_CONNS` **0**: 最大空闲数据库连接
- `CONN_MAX_LIFETIME` **3s**: 数据库连接最大存活时间

## Indexer (`indexer`)

Expand Down
4 changes: 2 additions & 2 deletions docs/content/doc/installation/from-binary.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ the destination platform from the [downloads page](https://dl.gitea.io/gitea/),
the URL and replace the URL within the commands below:

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

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

```sh
gpg --keyserver pgp.mit.edu --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea-1.8.3-linux-amd64.asc gitea-1.8.3-linux-amd64
gpg --verify gitea-{{< version >}}-linux-amd64.asc gitea-{{< version >}}-linux-amd64
```

## Test
Expand Down
2 changes: 1 addition & 1 deletion docs/content/doc/installation/from-binary.fr-fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ menu:
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:

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

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

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

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

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

Expand Down
6 changes: 3 additions & 3 deletions docs/content/doc/installation/from-source.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To work with tagged releases, the following commands can be used:

```bash
git branch -a
git checkout v1.0
git checkout v{{< version >}}
```

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

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

List available tags with the following.

```bash
git tag -l
git checkout v1.0.0 # or git checkout pr-xyz
git checkout v{{< version >}} # or git checkout pr-xyz
```

## Build
Expand Down
6 changes: 3 additions & 3 deletions docs/content/doc/installation/from-source.fr-fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Si vous souhaitez compiler la dernière version stable, utilisez les étiquettes

```
git branch -a
git checkout v1.0
git checkout v{{< version >}}
```

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

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 :
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 :

```
git tag -l
git checkout v1.0.0
git checkout v{{< version >}}
git checkout pr-xyz
```

Expand Down
6 changes: 3 additions & 3 deletions docs/content/doc/installation/from-source.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ cd $GOPATH/src/code.gitea.io/gitea

```
git branch -a
git checkout v1.0
git checkout v{{< version >}}
```

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

```
git tag -l
git checkout v1.0.0
git checkout v{{< version >}}
```

## 编译
Expand Down
6 changes: 3 additions & 3 deletions docs/content/doc/installation/from-source.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ cd $GOPATH/src/code.gitea.io/gitea

```
git branch -a
git checkout v1.0
git checkout v{{< version >}}
```

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

```
git tag -l
git checkout v1.0.0
git checkout v{{< version >}}
```

## 編譯
Expand Down
3 changes: 2 additions & 1 deletion docs/content/doc/installation/with-docker.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Create a directory like `gitea` and paste the following content into a file name
Note that the volume should be owned by the user/group with the UID/GID specified in the config file.
If you don't give the volume correct permissions, the container may not start.
Also be aware that the tag `:latest` will install the current development version.
For a stable release you can use `:1` or specify a certain release like `:1.5.1`.
For a stable release you can use `:1` or specify a certain release like `:{{< version >}}`.

```yaml
version: "2"
Expand Down Expand Up @@ -245,6 +245,7 @@ You can configure some of Gitea's settings via environment variables:
* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
* `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed clone URL in Gitea's UI.
* `SSH_PORT`: **22**: SSH port displayed in clone URL.
* `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
* `DISABLE_SSH`: **false**: Disable SSH feature when it's not available.
* `HTTP_PORT`: **3000**: HTTP listen port.
* `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).
Expand Down
1 change: 1 addition & 0 deletions docs/layouts/shortcodes/version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ .Site.Params.version }}
Loading

0 comments on commit 7c721f9

Please sign in to comment.