Skip to content

Commit fc79e5e

Browse files
authored
Merge branch 'main' into refactor-easymde
2 parents 9a1bec6 + c99b8ef commit fc79e5e

35 files changed

+173
-129
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ 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.15.9](https://github.com/go-gitea/gitea/releases/tag/v1.15.9) - 2021-12-30
8+
9+
* BUGFIXES
10+
* Fix wrong redirect on org labels (#18128) (#18134)
11+
* Fix: unstable sort skips/duplicates issues across pages (#18094) (#18095)
12+
* Revert "Fix delete u2f keys bug (#18042)" (#18107)
13+
* Migrating wiki don't require token, so we should move it out of the require form (#17645) (#18104)
14+
* Prevent NPE if gitea uploader fails to open url (#18080) (#18101)
15+
* Reset locale on login (#17734) (#18100)
16+
* Correctly handle failed migrations (#17575) (#18099)
17+
* Instead of using routerCtx just escape the url before routing (#18086) (#18098)
18+
* Quote references to the user table in consistency checks (#18072) (#18073)
19+
* Add NotFound handler (#18062) (#18067)
20+
* Ensure that git repository is closed before transfer (#18049) (#18057)
21+
* Use common sessioner for API and web routes (#18114)
22+
* TRANSLATION
23+
* Fix code search result hint on zh-CN (#18053)
24+
725
## [1.15.8](https://github.com/go-gitea/gitea/releases/tag/v1.15.8) - 2021-12-20
826

927
* BUGFIXES

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +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.15.8
21+
version: 1.15.9
2222
minGoVersion: 1.16
2323
goVersion: 1.17
2424
minNodeVersion: 12.17

docs/content/doc/developers/hacking-on-gitea.en-us.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ One of these three distributions of Make will run on Windows:
7373
- MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software, it includes MinGW-w64.
7474
- In MingGW-w64, the binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to `PATH`.
7575
- In MSYS2, you can use `make` directly. See [MSYS2 Porting](https://www.msys2.org/wiki/Porting/).
76+
- To compile Gitea with CGO_ENABLED (eg: SQLite3), you might need to use [tdm-gcc](https://jmeubank.github.io/tdm-gcc/) instead of MSYS2 gcc, because MSYS2 gcc headers lack some Windows-only CRT functions like `_beginthread`.
7677
- [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make`
7778

7879
**Note**: If you are attempting to build using make with Windows Command Prompt, you may run into issues. The above prompts (Git bash, or MinGW) are recommended, however if you only have command prompt (or potentially PowerShell) you can set environment variables using the [set](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1) command, e.g. `set TAGS=bindata`.
@@ -273,10 +274,17 @@ make test-sqlite-migration # with SQLite switched for the appropriate database
273274

274275
There are two types of test run by Gitea: Unit tests and Integration Tests.
275276

277+
### Unit Tests
278+
279+
Unit tests are covered by `*_test.go` in `go test` system.
280+
You can set environment variable `GITEA_UNIT_TESTS_VERBOSE=1` to see detail logs during the test.
281+
276282
```bash
277283
TAGS="bindata sqlite sqlite_unlock_notify" make test # Runs the unit tests
278284
```
279285

286+
### Integration Tests
287+
280288
Unit tests will not and cannot completely test Gitea alone. Therefore, we
281289
have written integration tests; however, these are database dependent.
282290

@@ -288,10 +296,12 @@ will run the integration tests in an SQLite environment. Integration tests
288296
require `git lfs` to be installed. Other database tests are available but
289297
may need adjustment to the local environment.
290298

291-
Look at
292-
[`integrations/README.md`](https://github.com/go-gitea/gitea/blob/main/integrations/README.md)
299+
Take a look at [`integrations/README.md`](https://github.com/go-gitea/gitea/blob/main/integrations/README.md)
293300
for more information and how to run a single test.
294301

302+
303+
### Testing for a PR
304+
295305
Our continuous integration will test the code passes its unit tests and that
296306
all supported databases will pass integration test in a Docker environment.
297307
Migration from several recent versions of Gitea will also be tested.
Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,108 @@
11
---
22
date: "2016-12-01T16:00:00+02:00"
3-
title: "选择包安装"
3+
title: "使用包管理器安装"
44
slug: "install-from-package"
55
weight: 10
66
toc: false
77
draft: false
88
menu:
99
sidebar:
1010
parent: "installation"
11-
name: "选择包安装"
11+
name: "使用包管理器安装"
1212
weight: 20
1313
identifier: "install-from-package"
1414
---
1515

16-
# 使用包安装
16+
# 使用包管理器安装
1717

18-
## Linux
18+
**目录**
1919

20-
目前还没有对应的Linux安装包发布,如果我们发布了,我们将更新本页面。当前你可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。
20+
{{< toc >}}
21+
22+
## Alpine Linux
23+
24+
Gitea 已经包含在 Alpine Linux 的[社区存储库](https://pkgs.alpinelinux.org/packages?name=gitea&branch=edge)中,版本与 Gitea 官方保持同步。
25+
26+
```sh
27+
apk add gitea
28+
```
29+
30+
## Arch Linux
31+
32+
Gitea 已经在滚动发布发行版的官方[社区存储库](https://www.archlinux.org/packages/community/x86_64/gitea/)中,版本与 Gitea 官方保持同步。
33+
34+
```sh
35+
pacman -S gitea
36+
```
37+
38+
## Arch Linux ARM
39+
40+
官方支持 [aarch64](https://archlinuxarm.org/packages/aarch64/gitea)[armv7h](https://archlinuxarm.org/packages/armv7h/gitea)[armv6h](https://archlinuxarm.org/packages/armv6h/gitea) 架构。
41+
42+
```sh
43+
pacman -S gitea
44+
```
45+
46+
## Canonical Snap
47+
48+
目前 Gitea 已在 Snap Store 中发布,名称为 [gitea](https://snapcraft.io/gitea)
49+
50+
```sh
51+
snap install gitea
52+
```
53+
54+
## SUSE/openSUSE
55+
56+
OpenSUSE 构建服务为 [openSUSE 和 SLE](https://software.opensuse.org/download/package?package=gitea&project=devel%3Atools%3Ascm)
57+
提供包,你可以在开发软件配置管理存储库中找到它们。
2158

2259
## Windows
2360

24-
目前还没有对应的Windows安装包发布,如果我们发布了,我们将更新本页面。我们计划使用 `MSI` 安装器或者 [Chocolatey](https://chocolatey.org/)来制作安装包。当前你可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。
61+
目前你可以通过 [Chocolatey](https://chocolatey.org/) 来安装 [Gitea](https://chocolatey.org/packages/gitea)
62+
63+
```sh
64+
choco install gitea
65+
```
66+
67+
你也可以 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}}) 。
2568

2669
## macOS
2770

28-
macOS 平台下当前我们仅支持通过 `brew` 来安装。如果您没有安装 [Homebrew](http://brew.sh/),你也可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令:
71+
macOS 平台下当前我们仅支持通过 `brew` 来安装。如果你没有安装 [Homebrew](http://brew.sh/),你也可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令:
2972

3073
```
3174
brew tap go-gitea/gitea
3275
brew install gitea
3376
```
3477

78+
## FreeBSD
79+
80+
可以使用 Gitea 的 FreeBSD port `www/gitea`。 请安装预构建的二进制包:
81+
82+
```
83+
pkg install gitea
84+
```
85+
86+
对于最新版本,或使用自定义选项构建 port,请
87+
[从 port 安装](https://www.freebsd.org/doc/handbook/ports-using.html)
88+
89+
```
90+
su -
91+
cd /usr/ports/www/gitea
92+
make install clean
93+
```
94+
95+
该 port 使用标准的 FreeBSD 文件系统布局:配置文件在 `/usr/local/etc/gitea` 目录中,
96+
模板、选项、插件和主题在 `/usr/local/share/gitea` 目录中,启动脚本在 `/usr/local/etc/rc.d/gitea` 目录中。
97+
98+
要使 Gitea 作为服务运行,请运行 `sysrc gitea_enable=YES` 并使用 `service gitea start` 命令启动它。
99+
100+
## 第三方
101+
102+
如果这里没有找到你喜欢的包管理器,可以使用 Gitea 第三方软件包。这里有一个完整的列表: [awesome-gitea](https://gitea.com/gitea/awesome-gitea/src/branch/master/README.md#user-content-packages)
103+
104+
如果你知道其他 Gitea 第三方软件包,请发送 PR 来添加它。
105+
35106
## 需要帮助?
36107

37108
如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}})

models/repo.go

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -294,33 +294,39 @@ func CanUserForkRepo(user *user_model.User, repo *repo_model.Repository) (bool,
294294
return false, nil
295295
}
296296

297+
// FindUserOrgForks returns the forked repositories for one user from a repository
298+
func FindUserOrgForks(repoID, userID int64) ([]*repo_model.Repository, error) {
299+
var cond builder.Cond = builder.And(
300+
builder.Eq{"fork_id": repoID},
301+
builder.In("owner_id",
302+
builder.Select("org_id").
303+
From("org_user").
304+
Where(builder.Eq{"uid": userID}),
305+
),
306+
)
307+
308+
var repos []*repo_model.Repository
309+
return repos, db.GetEngine(db.DefaultContext).Table("repository").Where(cond).Find(&repos)
310+
}
311+
297312
// GetForksByUserAndOrgs return forked repos of the user and owned orgs
298313
func GetForksByUserAndOrgs(user *user_model.User, repo *repo_model.Repository) ([]*repo_model.Repository, error) {
299314
var repoList []*repo_model.Repository
300315
if user == nil {
301316
return repoList, nil
302317
}
303-
var forkedRepo *repo_model.Repository
304318
forkedRepo, err := repo_model.GetUserFork(repo.ID, user.ID)
305319
if err != nil {
306320
return repoList, err
307321
}
308322
if forkedRepo != nil {
309323
repoList = append(repoList, forkedRepo)
310324
}
311-
canCreateRepos, err := GetOrgsCanCreateRepoByUserID(user.ID)
325+
orgForks, err := FindUserOrgForks(repo.ID, user.ID)
312326
if err != nil {
313-
return repoList, err
314-
}
315-
for _, org := range canCreateRepos {
316-
forkedRepo, err := repo_model.GetUserFork(repo.ID, org.ID)
317-
if err != nil {
318-
return repoList, err
319-
}
320-
if forkedRepo != nil {
321-
repoList = append(repoList, forkedRepo)
322-
}
327+
return nil, err
323328
}
329+
repoList = append(repoList, orgForks...)
324330
return repoList, nil
325331
}
326332

options/locale/locale_cs-CZ.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ error404=Stránka, kterou se snažíte zobrazit, buď <strong>neexistuje</strong
9999
never=Nikdy
100100

101101
[error]
102-
occurred=Nastala chyba
103-
report_message=Pokud jste si jisti, že se jedná o chybu Gitea, prosím vyhledejte problém na <a href="https://github.com/go-gitea/gitea/issues">GitHub</a> a v případě potřeby otevřete nový problém.
104102
missing_csrf=Špatný požadavek: Neexistuje CSRF token
105-
invalid_csrf=Špatný požadavek: Neplatný CSRF token
106103

107104
[startpage]
108105
app_desc=Snadno přístupný vlastní Git

options/locale/locale_de-DE.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ error404=Die Seite, die du gerade versuchst aufzurufen, <strong>existiert entwed
104104
never=Niemals
105105

106106
[error]
107-
occurred=Ein Fehler ist aufgetreten
108-
report_message=Wenn du dir sicher bist, dass dies ein Gitea-Fehler ist, suche bitte auf <a href="https://github.com/go-gitea/gitea/issues">GitHub</a> nach diesem Fehler und erstelle gegebenenfalls einen neuen Bugreport.
109107
missing_csrf=Fehlerhafte Anfrage: Kein CSRF Token verfügbar
110-
invalid_csrf=Fehlerhafte Anfrage: Ungültiger CSRF Token
111108

112109
[startpage]
113110
app_desc=Ein einfacher, selbst gehosteter Git-Service

options/locale/locale_el-GR.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ error404=Η σελίδα που προσπαθείτε να φτάσετε εί
104104
never=Ποτέ
105105

106106
[error]
107-
occurred=Παρουσιάστηκε ένα σφάλμα
108-
report_message=Αν είστε σίγουροι ότι πρόκειται για σφάλμα Gitea, παρακαλούμε αναζητήστε το ζήτημα στο <a href="https://github.com/go-gitea/gitea/issues">GitHub</a> και ανοίξτε νέο ζήτημα εάν είναι απαραίτητο.
109107
missing_csrf=Bad Request: δεν υπάρχει διακριτικό CSRF
110-
invalid_csrf=Bad Request: Άκυρο διακριτικό CSRF
111108

112109
[startpage]
113110
app_desc=Μια ανώδυνη, αυτο-φιλοξενούμενη υπηρεσία Git

options/locale/locale_es-ES.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,7 @@ error404=La página a la que está intentando acceder o <strong>no existe</stron
104104
never=Nunca
105105

106106
[error]
107-
occurred=Se ha producido un error
108-
report_message=Si estás seguro de que este es un error de Gitea, por favor busca un problema en <a href="https://github.com/go-gitea/gitea/issues">GitHub</a> y abre un nuevo problema si es necesario.
109107
missing_csrf=Solicitud incorrecta: sin token CSRF
110-
invalid_csrf=Solicitud incorrecta: el token CSRF no es válido
111108

112109
[startpage]
113110
app_desc=Un servicio de Git autoalojado y sin complicaciones

options/locale/locale_fa-IR.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ error404=صفحه موردنظر شما یا <strong>وجود ندارد</strong
9090

9191

9292
[error]
93-
occurred=خطایی رخ داده است
94-
report_message=اگر شما مطمئن هستیند این مشکل مربوط به یک باگ در Gitea است، لطفا در <a href="https://github.com/go-gitea/gitea/issues">GitHub</a> مشکل را جستجو کنید و در صورت نیاز، یک موضوع جدید باز کنید.
9593

9694
[startpage]
9795
app_desc=یک سرویس گیت بی‌درد سر و راحت

options/locale/locale_fi-FI.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ error404=Sivu, jota yrität nähdä, joko <strong>ei löydy</strong> tai <strong
8686

8787

8888
[error]
89-
occurred=Tapahtui virhe
9089

9190
[startpage]
9291
app_desc=Kivuton, itsehostattu Git-palvelu

options/locale/locale_fr-FR.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ error404=La page que vous essayez d'atteindre <strong>n'existe pas</strong> ou <
9999
never=Jamais
100100

101101
[error]
102-
occurred=Une erreur est survenue
103-
report_message=Si vous êtes sûr qu'il s'agit d'un bug de Gitea, cherchez s’il existe un ticket sur <a href="https://github.com/go-gitea/gitea/issues">GitHub</a> et ouvrez-en un nouveau si nécessaire.
104102
missing_csrf=Requête incorrecte: aucun jeton CSRF présent
105-
invalid_csrf=Requête incorrecte: jeton CSRF invalide
106103

107104
[startpage]
108105
app_desc=Un service Git auto-hébergé sans prise de tête

options/locale/locale_hu-HU.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ error404=Az elérni kívánt oldal vagy <strong>nem létezik</strong>, vagy <str
9393

9494

9595
[error]
96-
occurred=Probléma lépett fel
97-
report_message=Ha biztos benne, hogy ez egy Gitea hiba, keressen a problémára a <a href="https://github.com/go-gitea/gitea/issues">GitHub-on</a> és hozzon létre új hibajelentést, ha szükséges.
9896

9997
[startpage]
10098
app_desc=Fájdalommentes, saját gépre telepíthető Git szolgáltatás

options/locale/locale_it-IT.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ error404=La pagina che stai cercando di raggiungere <strong>non esiste</strong>
9696
9797
9898
[error]
99-
occurred=Si è verificato un errore
100-
report_message=Se sei sicuro che sia un bug di Gitea, cerca il problema su <a href="https://github.com/go-gitea/gitea/issues">GitHub</a> e apri una nuova segnalazione se necessario.
10199
102100
[startpage]
103101
app_desc=Un servizio auto-ospitato per Git pronto all'uso

0 commit comments

Comments
 (0)