Skip to content

Commit 589d5fc

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: (21 commits) Support public code/issue access for private repositories (go-gitea#33127) Validate that the tag doesn't exist when creating a tag via the web (go-gitea#33241) [skip ci] Updated translations via Crowdin Switch back to `vue-tsc` (go-gitea#33248) Let API create and edit system webhooks, attempt 2 (go-gitea#33180) Fix incorrect ref "blob" (go-gitea#33240) Refactor RefName (go-gitea#33234) Refactor context RefName and RepoAssignment (go-gitea#33226) [skip ci] Updated translations via Crowdin Fix upload file form (go-gitea#33230) Fix mirror bug (go-gitea#33224) Remove unused CSS styles and move some styles to proper files (go-gitea#33217) Refactor context repository (go-gitea#33202) [skip ci] Updated translations via Crowdin Fix unpin hint on the pinned pull requests (go-gitea#33207) fix(cache): cache test triggered by non memory cache (go-gitea#33220) Update README.md (go-gitea#33149) Fix editor markdown not incrementing in a numbered list (go-gitea#33187) Some small refactors (go-gitea#33144) Fix sync fork for consistency (go-gitea#33147) ...
2 parents 9e7866c + a98a836 commit 589d5fc

File tree

116 files changed

+1919
-1270
lines changed

Some content is hidden

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

116 files changed

+1919
-1270
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ contact_links:
1313
url: https://docs.gitea.com/help/faq
1414
about: Please check if your question isn't mentioned here.
1515
- name: Crowdin Translations
16-
url: https://crowdin.com/project/gitea
16+
url: https://translate.gitea.com
1717
about: Translations are managed here.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Here's how to run the test suite:
182182

183183
## Translation
184184

185-
All translation work happens on [Crowdin](https://crowdin.com/project/gitea).
185+
All translation work happens on [Crowdin](https://translate.gitea.com).
186186
The only translation that is maintained in this repository is [the English translation](https://github.com/go-gitea/gitea/blob/main/options/locale/locale_en-US.ini).
187187
It is synced regularly with Crowdin. \
188188
Other locales on main branch **should not** be updated manually as they will be overwritten with each sync. \

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![](https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen)](https://opencollective.com/gitea "Become a backer/sponsor of gitea")
1010
[![](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT "License: MIT")
1111
[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod&color=green)](https://gitpod.io/#https://github.com/go-gitea/gitea)
12-
[![](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea "Crowdin")
12+
[![](https://badges.crowdin.net/gitea/localized.svg)](https://translate.gitea.com "Crowdin")
1313

1414
[View this document in Chinese](./README_ZH.md)
1515

@@ -31,6 +31,14 @@ For accessing free Gitea service (with a limited number of repositories), you ca
3131

3232
To quickly deploy your own dedicated Gitea instance on Gitea Cloud, you can start a free trial at [cloud.gitea.com](https://cloud.gitea.com).
3333

34+
## Documentation
35+
36+
You can find comprehensive documentation on our official [documentation website](https://docs.gitea.com/).
37+
38+
It includes installation, administration, usage, development, contributing guides, and more to help you get started and explore all features effectively.
39+
40+
If you have any suggestions or would like to contribute to it, you can visit the [documentation repository](https://gitea.com/gitea/docs)
41+
3442
## Building
3543

3644
From the root of the source tree, run:
@@ -52,6 +60,8 @@ More info: https://docs.gitea.com/installation/install-from-source
5260

5361
## Using
5462

63+
After building, a binary file named `gitea` will be generated in the root of the source tree by default. To run it, use:
64+
5565
./gitea web
5666

5767
> [!NOTE]
@@ -68,22 +78,25 @@ Expected workflow is: Fork -> Patch -> Push -> Pull Request
6878
6979
## Translating
7080

71-
Translations are done through Crowdin. If you want to translate to a new language ask one of the managers in the Crowdin project to add a new language there.
81+
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://translate.gitea.com)
82+
83+
Translations are done through [Crowdin](https://translate.gitea.com). If you want to translate to a new language ask one of the managers in the Crowdin project to add a new language there.
7284

7385
You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope to fill it as questions pop up.
7486

75-
https://docs.gitea.com/contributing/localization
87+
Get more information from [documentation](https://docs.gitea.com/contributing/localization).
7688

77-
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
89+
## Official and Third-Party Projects
7890

79-
## Further information
91+
We provide an official [go-sdk](https://gitea.com/gitea/go-sdk), a CLI tool called [tea](https://gitea.com/gitea/tea) and an [action runner](https://gitea.com/gitea/act_runner) for Gitea Action.
8092

81-
For more information and instructions about how to install Gitea, please look at our [documentation](https://docs.gitea.com/).
82-
If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://forum.gitea.com/).
93+
We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea), where you can discover more third-party projects, including SDKs, plugins, themes, and more.
8394

84-
We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea).
95+
## Communication
8596

86-
The official Gitea CLI is developed at [gitea/tea](https://gitea.com/gitea/tea).
97+
[![](https://img.shields.io/discord/322538954119184384.svg?logo=discord&logoColor=white&label=Discord&color=5865F2)](https://discord.gg/Gitea "Join the Discord chat at https://discord.gg/Gitea")
98+
99+
If you have questions that are not covered by the [documentation](https://docs.gitea.com/), you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://forum.gitea.com/).
87100

88101
## Authors
89102

@@ -122,18 +135,25 @@ Gitea is pronounced [/ɡɪ’ti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea"
122135

123136
We're [working on it](https://github.com/go-gitea/gitea/issues/1029).
124137

138+
**Where can I find the security patches?**
139+
140+
In the [release log](https://github.com/go-gitea/gitea/releases) or the [change log](https://github.com/go-gitea/gitea/blob/main/CHANGELOG.md), search for the keyword `SECURITY` to find the security patches.
141+
125142
## License
126143

127144
This project is licensed under the MIT License.
128145
See the [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) file
129146
for the full license text.
130147

131-
## Screenshots
148+
## Further information
132149

133-
Looking for an overview of the interface? Check it out!
150+
<details>
151+
<summary>Looking for an overview of the interface? Check it out!</summary>
134152

135153
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
136154
|:---:|:---:|:---:|
137155
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
138156
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
139157
|![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|
158+
159+
</details>

README_ZH.md

Lines changed: 57 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,94 @@
99
[![](https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen)](https://opencollective.com/gitea "Become a backer/sponsor of gitea")
1010
[![](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT "License: MIT")
1111
[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod&color=green)](https://gitpod.io/#https://github.com/go-gitea/gitea)
12-
[![](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea "Crowdin")
12+
[![](https://badges.crowdin.net/gitea/localized.svg)](https://translate.gitea.com "Crowdin")
1313

1414
[View this document in English](./README.md)
1515

1616
## 目标
1717

18-
Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了 x86amd64,还包括 ARM 和 PowerPC。
18+
Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 LinuxmacOS 和 Windows 以及各种架构,除了 x86amd64,还包括 ARM 和 PowerPC。
1919

2020
如果你想试用在线演示和报告问题,请访问 [demo.gitea.com](https://demo.gitea.com/)
2121

2222
如果你想使用免费的 Gitea 服务(有仓库数量限制),请访问 [gitea.com](https://gitea.com/user/login)
2323

2424
如果你想在 Gitea Cloud 上快速部署你自己独享的 Gitea 实例,请访问 [cloud.gitea.com](https://cloud.gitea.com) 开始免费试用。
2525

26-
## 提示
27-
28-
1. **开始贡献代码之前请确保你已经看过了 [贡献者向导(英文)](CONTRIBUTING.md)**.
29-
2. 所有的安全问题,请私下发送邮件给 **[email protected]**。谢谢!
30-
3. 如果你要使用API,请参见 [API 文档](https://godoc.org/code.gitea.io/sdk/gitea).
31-
3226
## 文档
3327

3428
关于如何安装请访问我们的 [文档站](https://docs.gitea.com/zh-cn/category/installation),如果没有找到对应的文档,你也可以通过 [Discord - 英文](https://discord.gg/gitea) 和 QQ群 328432459 来和我们交流。
3529

36-
## 贡献流程
30+
## 编译
31+
32+
在源代码的根目录下执行:
33+
34+
TAGS="bindata" make build
35+
36+
或者如果需要SQLite支持:
37+
38+
TAGS="bindata sqlite sqlite_unlock_notify" make build
39+
40+
编译过程会分成2个子任务:
41+
42+
- `make backend`,需要 [Go Stable](https://go.dev/dl/),最低版本需求可查看 [go.mod](/go.mod)
43+
- `make frontend`,需要 [Node.js LTS](https://nodejs.org/en/download/) 或更高版本。
44+
45+
你需要连接网络来下载 go 和 npm modules。当从 tar 格式的源文件编译时,其中包含了预编译的前端文件,因此 `make frontend` 将不会被执行。这允许编译时不需要 Node.js。
46+
47+
更多信息: https://docs.gitea.com/installation/install-from-source
48+
49+
## 使用
50+
51+
编译之后,默认会在根目录下生成一个名为 `gitea` 的文件。你可以这样执行它:
3752

38-
Fork -> Patch -> Push -> Pull Request
53+
./gitea web
54+
55+
> [!注意]
56+
> 如果你要使用API,请参见 [API 文档](https://godoc.org/code.gitea.io/sdk/gitea)
57+
58+
## 贡献
59+
60+
贡献流程:Fork -> Patch -> Push -> Pull Request
61+
62+
> [!注意]
63+
>
64+
> 1. **开始贡献代码之前请确保你已经看过了 [贡献者向导(英文)](CONTRIBUTING.md)**
65+
> 2. 所有的安全问题,请私下发送邮件给 **[email protected]**。 谢谢!
3966
4067
## 翻译
4168

42-
多语言翻译是基于Crowdin进行的.
43-
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
69+
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://translate.gitea.com)
70+
71+
多语言翻译是基于Crowdin进行的。
72+
73+
[文档](https://docs.gitea.com/contributing/localization) 中获取更多信息。
74+
75+
## 官方和第三方项目
76+
77+
Gitea 提供官方的 [go-sdk](https://gitea.com/gitea/go-sdk),以及名为 [tea](https://gitea.com/gitea/tea) 的 CLI 工具 和 用于 Gitea Action 的 [action runner](https://gitea.com/gitea/act_runner)
78+
79+
[gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea) 是一个 Gitea 相关项目的列表,你可以在这里找到更多的第三方项目,包括 SDK、插件、主题等等。
4480

4581
## 作者
4682

47-
* [Maintainers](https://github.com/orgs/go-gitea/people)
48-
* [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
49-
* [Translators](options/locale/TRANSLATORS)
83+
- [Maintainers](https://github.com/orgs/go-gitea/people)
84+
- [Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
85+
- [Translators](options/locale/TRANSLATORS)
5086

5187
## 授权许可
5288

5389
本项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/go-gitea/gitea/blob/main/LICENSE) 文件中。
5490

55-
## 截图
91+
## 更多信息
92+
93+
<details>
94+
<summary>截图</summary>
5695

5796
|![Dashboard](https://dl.gitea.com/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.com/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.com/screenshots/global_issues.png)|
5897
|:---:|:---:|:---:|
5998
|![Branches](https://dl.gitea.com/screenshots/branches.png)|![Web Editor](https://dl.gitea.com/screenshots/web_editor.png)|![Activity](https://dl.gitea.com/screenshots/activity.png)|
6099
|![New Migration](https://dl.gitea.com/screenshots/migration.png)|![Migrating](https://dl.gitea.com/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
61100
|![Pull Request Dark](https://dl.gitea.com/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.com/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.com/screenshots/diff_dark.png)|
101+
102+
</details>

docker/root/usr/bin/entrypoint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ done
3737
if [ $# -gt 0 ]; then
3838
exec "$@"
3939
else
40-
exec /bin/s6-svscan /etc/s6
40+
exec /usr/bin/s6-svscan /etc/s6
4141
fi

models/actions/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (run *ActionRun) RefLink() string {
8888
if refName.IsPull() {
8989
return run.Repo.Link() + "/pulls/" + refName.ShortName()
9090
}
91-
return git.RefURL(run.Repo.Link(), run.Ref)
91+
return run.Repo.Link() + "/src/" + refName.RefWebLinkPath()
9292
}
9393

9494
// PrettyRef return #id for pull ref or ShortName for others

models/activities/action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func (a *Action) GetBranch() string {
355355

356356
// GetRefLink returns the action's ref link.
357357
func (a *Action) GetRefLink(ctx context.Context) string {
358-
return git.RefURL(a.GetRepoLink(ctx), a.RefName)
358+
return a.GetRepoLink(ctx) + "/src/" + git.RefName(a.RefName).RefWebLinkPath()
359359
}
360360

361361
// GetTag returns the action's repository tag.

models/fixtures/webhook.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,31 @@
2222
content_type: 1 # json
2323
events: '{"push_only":false,"send_everything":false,"choose_events":false,"events":{"create":false,"push":true,"pull_request":true}}'
2424
is_active: true
25+
2526
-
2627
id: 4
2728
repo_id: 2
2829
url: www.example.com/url4
2930
content_type: 1 # json
3031
events: '{"push_only":true,"branch_filter":"{master,feature*}"}'
3132
is_active: true
33+
34+
-
35+
id: 5
36+
repo_id: 0
37+
owner_id: 0
38+
url: www.example.com/url5
39+
content_type: 1 # json
40+
events: '{"push_only":true,"branch_filter":"{master,feature*}"}'
41+
is_active: true
42+
is_system_webhook: true
43+
44+
-
45+
id: 6
46+
repo_id: 0
47+
owner_id: 0
48+
url: www.example.com/url6
49+
content_type: 1 # json
50+
events: '{"push_only":true,"branch_filter":"{master,feature*}"}'
51+
is_active: true
52+
is_system_webhook: false

models/issues/comment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ const (
112112
CommentTypePRScheduledToAutoMerge // 34 pr was scheduled to auto merge when checks succeed
113113
CommentTypePRUnScheduledToAutoMerge // 35 pr was un scheduled to auto merge when checks succeed
114114

115-
CommentTypePin // 36 pin Issue
116-
CommentTypeUnpin // 37 unpin Issue
115+
CommentTypePin // 36 pin Issue/PullRequest
116+
CommentTypeUnpin // 37 unpin Issue/PullRequest
117117

118118
CommentTypeChangeTimeEstimate // 38 Change time estimate
119119
)

models/issues/comment_list.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ func (comments CommentList) LoadPosters(ctx context.Context) error {
2626
return c.PosterID, c.Poster == nil && c.PosterID > 0
2727
})
2828

29-
posterMaps, err := getPostersByIDs(ctx, posterIDs)
29+
posterMaps, err := user_model.GetUsersMapByIDs(ctx, posterIDs)
3030
if err != nil {
3131
return err
3232
}
3333

3434
for _, comment := range comments {
3535
if comment.Poster == nil {
36-
comment.Poster = getPoster(comment.PosterID, posterMaps)
36+
comment.Poster = user_model.GetPossibleUserFromMap(comment.PosterID, posterMaps)
3737
}
3838
}
3939
return nil
4040
}
4141

4242
func (comments CommentList) getLabelIDs() []int64 {
4343
return container.FilterSlice(comments, func(comment *Comment) (int64, bool) {
44-
return comment.LabelID, comment.LabelID > 0
44+
return comment.LabelID, comment.LabelID > 0 && comment.Label == nil
4545
})
4646
}
4747

@@ -51,6 +51,9 @@ func (comments CommentList) loadLabels(ctx context.Context) error {
5151
}
5252

5353
labelIDs := comments.getLabelIDs()
54+
if len(labelIDs) == 0 {
55+
return nil
56+
}
5457
commentLabels := make(map[int64]*Label, len(labelIDs))
5558
left := len(labelIDs)
5659
for left > 0 {
@@ -118,8 +121,8 @@ func (comments CommentList) loadMilestones(ctx context.Context) error {
118121
milestoneIDs = milestoneIDs[limit:]
119122
}
120123

121-
for _, issue := range comments {
122-
issue.Milestone = milestoneMaps[issue.MilestoneID]
124+
for _, comment := range comments {
125+
comment.Milestone = milestoneMaps[comment.MilestoneID]
123126
}
124127
return nil
125128
}
@@ -175,6 +178,9 @@ func (comments CommentList) loadAssignees(ctx context.Context) error {
175178
}
176179

177180
assigneeIDs := comments.getAssigneeIDs()
181+
if len(assigneeIDs) == 0 {
182+
return nil
183+
}
178184
assignees := make(map[int64]*user_model.User, len(assigneeIDs))
179185
left := len(assigneeIDs)
180186
for left > 0 {
@@ -301,6 +307,9 @@ func (comments CommentList) loadDependentIssues(ctx context.Context) error {
301307

302308
e := db.GetEngine(ctx)
303309
issueIDs := comments.getDependentIssueIDs()
310+
if len(issueIDs) == 0 {
311+
return nil
312+
}
304313
issues := make(map[int64]*Issue, len(issueIDs))
305314
left := len(issueIDs)
306315
for left > 0 {
@@ -427,6 +436,9 @@ func (comments CommentList) loadReviews(ctx context.Context) error {
427436
}
428437

429438
reviewIDs := comments.getReviewIDs()
439+
if len(reviewIDs) == 0 {
440+
return nil
441+
}
430442
reviews := make(map[int64]*Review, len(reviewIDs))
431443
if err := db.GetEngine(ctx).In("id", reviewIDs).Find(&reviews); err != nil {
432444
return err

models/issues/issue.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ func (issue *Issue) loadCommentsByType(ctx context.Context, tp CommentType) (err
238238
IssueID: issue.ID,
239239
Type: tp,
240240
})
241+
for _, comment := range issue.Comments {
242+
comment.Issue = issue
243+
}
241244
return err
242245
}
243246

0 commit comments

Comments
 (0)