Skip to content

Commit 16ff24f

Browse files
committed
Merge branch 'master' into empty_pr
* master: Changelog v1.13.2 (go-gitea#14535) (go-gitea#14543) [skip ci] Updated translations via Crowdin [API] List, Check, Add & delete endpoints for repository teams (go-gitea#13630) [skip ci] Updated translations via Crowdin rm redirect (go-gitea#14534) Upgrade 'css-minimizer-webpack-plugin' to the latest version (go-gitea#14527) Set the name Mapper in migrations (go-gitea#14526)
2 parents bfcfb44 + 3f332a9 commit 16ff24f

File tree

13 files changed

+549
-9
lines changed

13 files changed

+549
-9
lines changed

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,38 @@ 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.13.2](https://github.com/go-gitea/gitea/releases/tag/v1.13.2) - 2021-01-31
8+
9+
* SECURITY
10+
* Prevent panic on fuzzer provided string (#14405) (#14409)
11+
* Add secure/httpOnly attributes to the lang cookie (#14279) (#14280)
12+
* API
13+
* If release publisher is deleted use ghost user (#14375)
14+
* BUGFIXES
15+
* Internal ssh server respect Ciphers, MACs and KeyExchanges settings (#14523) (#14530)
16+
* Set the name Mapper in migrations (#14526) (#14529)
17+
* Fix wiki preview (#14515)
18+
* Update code.gitea.io/sdk/gitea v0.13.1 -> v0.13.2 (#14497)
19+
* ChangeUserName: rename user files back on DB issue (#14447)
20+
* Fix lfs preview bug (#14428) (#14433)
21+
* Ensure timeout error is shown on u2f timeout (#14417) (#14431)
22+
* Fix Deadlock & Delete affected reactions on comment deletion (#14392) (#14425)
23+
* Use path not filepath in routers/editor (#14390) (#14396)
24+
* Check if label template exist first (#14384) (#14389)
25+
* Fix migration v141 (#14387) (#14388)
26+
* Use Request.URL.RequestURI() for fcgi (#14347)
27+
* Use ServerError provided by Context (#14333) (#14345)
28+
* Fix edit-label form init (#14337)
29+
* Fix mailIssueCommentBatch for pull request (#14252) (#14296)
30+
* Render links for commit hashes followed by comma (#14224) (#14227)
31+
* Send notifications for mentions in pulls, issues, (code-)comments (#14218) (#14221)
32+
* Fix avatar bugs (#14217) (#14220)
33+
* Ensure that schema search path is set with every connection on postgres (#14131) (#14216)
34+
* Fix dashboard issues labels filter bug (#14210) (#14214)
35+
* When visit /favicon.ico but the static file is not exist return 404 but not continue to handle the route (#14211) (#14213)
36+
* Fix branch selector on new issue page (#14194) (#14207)
37+
* Check for notExist on profile repository page (#14197) (#14203)
38+
739
## [1.13.1](https://github.com/go-gitea/gitea/releases/tag/v1.13.1) - 2020-12-29
840

941
* SECURITY

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require (
4242
github.com/gobwas/glob v0.2.3
4343
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
4444
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
45-
github.com/gogs/go-gogs-client v0.0.0-20200905025246-8bb8a50cb355
45+
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
4646
github.com/google/go-github/v32 v32.1.0
4747
github.com/google/uuid v1.2.0
4848
github.com/gorilla/context v1.1.1
@@ -125,5 +125,3 @@ require (
125125
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.2.4
126126

127127
replace github.com/microcosm-cc/bluemonday => github.com/lunny/bluemonday v1.0.5-0.20201227154428-ca34796141e8
128-
129-
replace github.com/gogs/go-gogs-client => github.com/6543-forks/go-gogs-client v0.0.0-20210116182316-f2f8bc0ea9cc

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ gitea.com/lunny/levelqueue v0.3.0 h1:MHn1GuSZkxvVEDMyAPqlc7A3cOW+q8RcGhRgH/xtm6I
5252
gitea.com/lunny/levelqueue v0.3.0/go.mod h1:HBqmLbz56JWpfEGG0prskAV97ATNRoj5LDmPicD22hU=
5353
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s=
5454
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU=
55-
github.com/6543-forks/go-gogs-client v0.0.0-20210116182316-f2f8bc0ea9cc h1:FLylYVXDwK+YtrmXYnv2Q1Y5lQ9TU1Xp5F2vndIOTb4=
56-
github.com/6543-forks/go-gogs-client v0.0.0-20210116182316-f2f8bc0ea9cc/go.mod h1:1Jj2LLcHcL+RHIT1IOaEsnoawRw+sjZYoiAjFWKJN/o=
5755
github.com/6543/go-version v1.2.4 h1:MPsSnqNrM0HwA9tnmWNnsMdQMg4/u4fflARjwomoof4=
5856
github.com/6543/go-version v1.2.4/go.mod h1:oqFAHCwtLVUTLdhQmVZWYvaHXTdsbB4SY85at64SQEo=
5957
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28=
@@ -485,6 +483,8 @@ github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28 h1:gBeyun7mySAKWg7Fb0
485483
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
486484
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 h1:yXtpJr/LV6PFu4nTLgfjQdcMdzjbqqXMEnHfq0Or6p8=
487485
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk=
486+
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85 h1:UjoPNDAQ5JPCjlxoJd6K8ALZqSDDhk2ymieAZOVaDg0=
487+
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU=
488488
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
489489
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
490490
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=

integrations/api_repo_teams_test.go

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright 2021 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package integrations
6+
7+
import (
8+
"fmt"
9+
"net/http"
10+
"testing"
11+
12+
"code.gitea.io/gitea/models"
13+
api "code.gitea.io/gitea/modules/structs"
14+
15+
"github.com/stretchr/testify/assert"
16+
)
17+
18+
func TestAPIRepoTeams(t *testing.T) {
19+
defer prepareTestEnv(t)()
20+
21+
// publicOrgRepo = user3/repo21
22+
publicOrgRepo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 32}).(*models.Repository)
23+
// user4
24+
user := models.AssertExistsAndLoadBean(t, &models.User{ID: 4}).(*models.User)
25+
session := loginUser(t, user.Name)
26+
token := getTokenForLoggedInUser(t, session)
27+
28+
// ListTeams
29+
url := fmt.Sprintf("/api/v1/repos/%s/teams?token=%s", publicOrgRepo.FullName(), token)
30+
req := NewRequest(t, "GET", url)
31+
res := session.MakeRequest(t, req, http.StatusOK)
32+
var teams []*api.Team
33+
DecodeJSON(t, res, &teams)
34+
if assert.Len(t, teams, 2) {
35+
assert.EqualValues(t, "Owners", teams[0].Name)
36+
assert.EqualValues(t, false, teams[0].CanCreateOrgRepo)
37+
assert.EqualValues(t, []string{"repo.code", "repo.issues", "repo.pulls", "repo.releases", "repo.wiki", "repo.ext_wiki", "repo.ext_issues"}, teams[0].Units)
38+
assert.EqualValues(t, "owner", teams[0].Permission)
39+
40+
assert.EqualValues(t, "test_team", teams[1].Name)
41+
assert.EqualValues(t, false, teams[1].CanCreateOrgRepo)
42+
assert.EqualValues(t, []string{"repo.issues"}, teams[1].Units)
43+
assert.EqualValues(t, "write", teams[1].Permission)
44+
}
45+
46+
// IsTeam
47+
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "Test_Team", token)
48+
req = NewRequest(t, "GET", url)
49+
res = session.MakeRequest(t, req, http.StatusOK)
50+
var team *api.Team
51+
DecodeJSON(t, res, &team)
52+
assert.EqualValues(t, teams[1], team)
53+
54+
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "NonExistingTeam", token)
55+
req = NewRequest(t, "GET", url)
56+
res = session.MakeRequest(t, req, http.StatusNotFound)
57+
58+
// AddTeam with user4
59+
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
60+
req = NewRequest(t, "PUT", url)
61+
res = session.MakeRequest(t, req, http.StatusForbidden)
62+
63+
// AddTeam with user2
64+
user = models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
65+
session = loginUser(t, user.Name)
66+
token = getTokenForLoggedInUser(t, session)
67+
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
68+
req = NewRequest(t, "PUT", url)
69+
res = session.MakeRequest(t, req, http.StatusNoContent)
70+
res = session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
71+
72+
// DeleteTeam
73+
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
74+
req = NewRequest(t, "DELETE", url)
75+
res = session.MakeRequest(t, req, http.StatusNoContent)
76+
res = session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
77+
}

models/migrations/migrations.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"code.gitea.io/gitea/modules/setting"
1818

1919
"xorm.io/xorm"
20+
"xorm.io/xorm/names"
2021
"xorm.io/xorm/schemas"
2122
)
2223

@@ -333,6 +334,8 @@ func EnsureUpToDate(x *xorm.Engine) error {
333334

334335
// Migrate database to current version
335336
func Migrate(x *xorm.Engine) error {
337+
// Set a new clean the default mapper to GonicMapper as that is the default for Gitea.
338+
x.SetMapper(names.GonicMapper{})
336339
if err := x.Sync(new(Version)); err != nil {
337340
return fmt.Errorf("sync: %v", err)
338341
}
@@ -371,6 +374,8 @@ Please try upgrading to a lower version first (suggested v1.6.4), then upgrade t
371374
// Migrate
372375
for i, m := range migrations[v-minDBVersion:] {
373376
log.Info("Migration[%d]: %s", v+int64(i), m.Description())
377+
// Reset the mapper between each migration - migrations are not supposed to depend on each other
378+
x.SetMapper(names.GonicMapper{})
374379
if err = m.Migrate(x); err != nil {
375380
return fmt.Errorf("do migrate: %v", err)
376381
}

options/locale/locale_cs-CZ.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ users=Uživatelé
237237
organizations=Organizace
238238
search=Vyhledat
239239
code=Zdrojový kód
240+
search.fuzzy=Fuzzy
241+
search.match=Shoda
240242
repo_no_results=Nebyly nalezeny žádné odpovídající repozitáře.
241243
user_no_results=Nebyly nalezeni žádní odpovídající uživatelé.
242244
org_no_results=Nebyly nalezeny žádné odpovídající organizace.
@@ -871,6 +873,7 @@ editor.add=Přidat „%s“
871873
editor.update=Aktualizovat „%s“
872874
editor.delete=Smazat „%s“
873875
editor.commit_message_desc=Přidat volitelný rozšířený popis…
876+
editor.signoff_desc=Přidat Signed-off-by podpis tvůrce revize na konec zprávy o revizi.
874877
editor.commit_directly_to_this_branch=Uložte změny revize přímo do větve <strong class="branch-name">%s</strong>.
875878
editor.create_new_branch=Vytvořit <strong>novou větev</strong> pro tuto revizi a spustit požadavek na natažení.
876879
editor.create_new_branch_np=Vytvořte <strong>novou větev</strong> z této revize.
@@ -926,6 +929,7 @@ ext_issues=Ext. úkoly
926929
ext_issues.desc=Odkaz na externí systém úkolů.
927930
928931
projects=Projekty
932+
projects.desc=Spravovat úkoly a požadavky na natažení na projektových nástěnkách.
929933
projects.description=Popis (volitelné)
930934
projects.description_placeholder=Popis
931935
projects.create=Vytvořit projekt
@@ -1461,6 +1465,8 @@ activity.git_stats_deletion_n=%d odebrání
14611465

14621466
search=Vyhledat
14631467
search.search_repo=Hledat repozitář
1468+
search.fuzzy=Fuzzy
1469+
search.match=Shoda
14641470
search.results=Výsledky hledání „%s“ v <a href="%s">%s</a>
14651471

14661472
settings=Nastavení
@@ -2064,6 +2070,7 @@ dashboard.resync_all_sshprincipals.desc=(Není potřeba pro vestavěný SSH serv
20642070
dashboard.resync_all_hooks=Znovu synchronizovat háčky před přijetím, aktualizace a po přijetí všech repozitářů.
20652071
dashboard.reinit_missing_repos=Znovu inicializovat všechny chybějící repozitáře, pro které existují záznamy
20662072
dashboard.sync_external_users=Synchronizovat externí uživatelská data
2073+
dashboard.cleanup_hook_task_table=Vyčistit tabulku hook_task
20672074
dashboard.server_uptime=Doba provozu serveru
20682075
dashboard.current_goroutine=Aktuální Goroutines
20692076
dashboard.current_memory_usage=Aktuální využití paměti

options/locale/locale_ja-JP.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ users=ユーザー
237237
organizations=組織
238238
search=検索
239239
code=コード
240+
search.fuzzy=あいまい
241+
search.match=一致
240242
repo_no_results=一致するリポジトリが見つかりません。
241243
user_no_results=一致するユーザーが見つかりません。
242244
org_no_results=一致する組織が見つかりません。
@@ -871,6 +873,7 @@ editor.add='%s' を追加
871873
editor.update='%s' を更新
872874
editor.delete='%s' を削除
873875
editor.commit_message_desc=詳細な説明を追加…
876+
editor.signoff_desc=コミットログメッセージの最後にコミッターの Signed-off-by 行を追加
874877
editor.commit_directly_to_this_branch=ブランチ<strong class="branch-name">%s</strong>へ直接コミットする。
875878
editor.create_new_branch=<strong>新しいブランチ</strong>にコミットしてプルリクエストを作成する。
876879
editor.create_new_branch_np=<strong>新しいブランチ</strong>にコミットする。
@@ -926,6 +929,7 @@ ext_issues=外部課題
926929
ext_issues.desc=外部の課題管理システムへのリンク。
927930

928931
projects=プロジェクト
932+
projects.desc=プロジェクトボードで課題とプルを管理します。
929933
projects.description=説明 (オプション)
930934
projects.description_placeholder=説明
931935
projects.create=プロジェクトを作成
@@ -1461,6 +1465,8 @@ activity.git_stats_deletion_n=%d行削除
14611465

14621466
search=検索
14631467
search.search_repo=リポジトリを検索
1468+
search.fuzzy=あいまい
1469+
search.match=一致
14641470
search.results=<a href="%[2]s">%[3]s</a> 内での "%[1]s" の検索結果
14651471

14661472
settings=設定
@@ -2064,6 +2070,7 @@ dashboard.resync_all_sshprincipals.desc=(ビルトインSSHサーバーでは不
20642070
dashboard.resync_all_hooks=すべてのリポジトリの pre-receive, update, post-receive フックを更新する。
20652071
dashboard.reinit_missing_repos=レコードが存在するが見当たらないすべてのGitリポジトリを再初期化する
20662072
dashboard.sync_external_users=外部ユーザーデータの同期
2073+
dashboard.cleanup_hook_task_table=hook_taskテーブルのクリーンアップ
20672074
dashboard.server_uptime=サーバーの稼働時間
20682075
dashboard.current_goroutine=現在のGoroutine数
20692076
dashboard.current_memory_usage=現在のメモリ使用量

options/locale/locale_zh-TW.ini

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ users=使用者
236236
organizations=組織
237237
search=搜尋
238238
code=程式碼
239+
search.fuzzy=模糊
240+
search.match=符合
239241
repo_no_results=沒有找到符合的儲存庫。
240242
user_no_results=沒有找到符合的使用者。
241243
org_no_results=沒有找到符合的組織。
@@ -447,7 +449,8 @@ update_profile=更新個人資料
447449
update_language_not_found=無法使用語言「%s」。
448450
update_profile_success=已更新您的個人資料。
449451
change_username=您的帳號已更改。
450-
change_username_prompt=注意:帳號更改也會更改您的帳戶的 URL。
452+
change_username_prompt=注意:修改帳號也會更改您的帳戶的 URL。
453+
change_username_redirect_prompt=舊的帳號被領用前,會重新導向您的新帳號。
451454
continue=繼續操作
452455
cancel=取消操作
453456
language=語言
@@ -869,6 +872,7 @@ editor.add=新增 '%s'
869872
editor.update=更新 '%s'
870873
editor.delete=刪除 '%s'
871874
editor.commit_message_desc=(選填)加入詳細說明...
875+
editor.signoff_desc=在提交訊息底部加入提交者的「Signed-off-by」資訊。
872876
editor.commit_directly_to_this_branch=直接提交到 <strong class="branch-name">%s</strong> 分支。
873877
editor.create_new_branch=為此提交建立<strong>新分支</strong>並提出合併請求。
874878
editor.create_new_branch_np=為本次提交建立一個 <strong>新分支</strong>。
@@ -924,6 +928,7 @@ ext_issues=外部問題
924928
ext_issues.desc=連結到外部問題追蹤器。
925929

926930
projects=專案
931+
projects.desc=在專案看板中管理問題與合併請求。
927932
projects.description=描述(非必要)
928933
projects.description_placeholder=描述
929934
projects.create=建立專案
@@ -1459,6 +1464,8 @@ activity.git_stats_deletion_n=刪除 %d 行
14591464

14601465
search=搜尋
14611466
search.search_repo=搜尋儲存庫
1467+
search.fuzzy=模糊
1468+
search.match=符合
14621469
search.results=在 <a href="%s"> %s </a> 中搜尋 "%s" 的结果
14631470

14641471
settings=設定
@@ -1939,6 +1946,7 @@ settings.visibility.private_shortname=私有
19391946
settings.update_settings=更新設定
19401947
settings.update_setting_success=組織設定已更新。
19411948
settings.change_orgname_prompt=注意:修改組織名稱將會同時修改對應的 URL。
1949+
settings.change_orgname_redirect_prompt=舊的名稱被領用前,會重新導向新名稱。
19421950
settings.update_avatar_success=已更新組織的大頭貼。
19431951
settings.delete=刪除組織
19441952
settings.delete_account=刪除這個組織
@@ -2061,6 +2069,7 @@ dashboard.resync_all_sshprincipals.desc=(內建 SSH 伺服器無需使用。)
20612069
dashboard.resync_all_hooks=重新同步所有儲存庫的 pre-receive、update 和 post-receive Hook。
20622070
dashboard.reinit_missing_repos=重新初始化所有記錄存在但遺失的 Git 儲存庫
20632071
dashboard.sync_external_users=同步外部使用者資料
2072+
dashboard.cleanup_hook_task_table=清理 hook_task 資料表
20642073
dashboard.server_uptime=服務執行時間
20652074
dashboard.current_goroutine=目前的 Goroutines 數量
20662075
dashboard.current_memory_usage=目前記憶體使用量

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"codemirror": "5.59.0",
1818
"core-js": "3.8.1",
1919
"css-loader": "5.0.1",
20-
"css-minimizer-webpack-plugin": "1.1.5",
20+
"css-minimizer-webpack-plugin": "1.2.0",
2121
"dropzone": "5.7.2",
2222
"easymde": "2.13.0",
2323
"escape-goat": "3.0.0",

routers/api/v1/api.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,12 @@ func Routes() *web.Route {
727727
Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
728728
Delete(reqAdmin(), repo.DeleteCollaborator)
729729
}, reqToken())
730+
m.Group("/teams", func() {
731+
m.Get("", reqAnyRepoReader(), repo.ListTeams)
732+
m.Combo("/{team}").Get(reqAnyRepoReader(), repo.IsTeam).
733+
Put(reqAdmin(), repo.AddTeam).
734+
Delete(reqAdmin(), repo.DeleteTeam)
735+
}, reqToken())
730736
m.Get("/raw/*", context.RepoRefForAPI, reqRepoReader(models.UnitTypeCode), repo.GetRawFile)
731737
m.Get("/archive/*", reqRepoReader(models.UnitTypeCode), repo.GetArchive)
732738
m.Combo("/forks").Get(repo.ListForks).

0 commit comments

Comments
 (0)