Skip to content

Commit 941a921

Browse files
authored
Merge branch 'main' into feature/filter-branches
2 parents 5fe3a3f + 1f0625a commit 941a921

File tree

725 files changed

+11483
-4380
lines changed

Some content is hidden

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

725 files changed

+11483
-4380
lines changed

.github/workflows/cron-lock.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ jobs:
1919
steps:
2020
- uses: dessant/lock-threads@v5
2121
with:
22-
issue-inactive-days: 45
22+
issue-inactive-days: 10
23+
pr-inactive-days: 7

.github/workflows/pull-compliance.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- uses: actions/checkout@v4
35-
- uses: actions/setup-python@v4
35+
- uses: actions/setup-python@v5
3636
with:
37-
python-version: "3.11"
37+
python-version: "3.12"
3838
- run: pip install poetry
3939
- run: make deps-py
4040
- run: make lint-templates
@@ -45,9 +45,9 @@ jobs:
4545
runs-on: ubuntu-latest
4646
steps:
4747
- uses: actions/checkout@v4
48-
- uses: actions/setup-python@v4
48+
- uses: actions/setup-python@v5
4949
with:
50-
python-version: "3.11"
50+
python-version: "3.12"
5151
- run: pip install poetry
5252
- run: make deps-py
5353
- run: make lint-yaml

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ _test
1515

1616
# MS VSCode
1717
.vscode
18-
__debug_bin
18+
__debug_bin*
1919

2020
*.cgo1.go
2121
*.cgo2.c

.stylelintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ rules:
6464
"@stylistic/media-query-list-comma-newline-before": null
6565
"@stylistic/media-query-list-comma-space-after": null
6666
"@stylistic/media-query-list-comma-space-before": null
67+
"@stylistic/named-grid-areas-alignment": null
6768
"@stylistic/no-empty-first-line": null
6869
"@stylistic/no-eol-whitespace": true
6970
"@stylistic/no-extra-semicolons": true

CONTRIBUTING.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [How to report issues](#how-to-report-issues)
99
- [Types of issues](#types-of-issues)
1010
- [Discuss your design before the implementation](#discuss-your-design-before-the-implementation)
11+
- [Issue locking](#issue-locking)
1112
- [Building Gitea](#building-gitea)
1213
- [Dependencies](#dependencies)
1314
- [Backend](#backend)
@@ -103,6 +104,13 @@ the goals for the project and tools.
103104

104105
Pull requests should not be the place for architecture discussions.
105106

107+
### Issue locking
108+
109+
Commenting on closed or merged issues/PRs is strongly discouraged.
110+
Such comments will likely be overlooked as some maintainers may not view notifications on closed issues, thinking that the item is resolved.
111+
As such, commenting on closed/merged issues/PRs may be disabled prior to the scheduled auto-locking if a discussion starts or if unrelated comments are posted.
112+
If further discussion is needed, we encourage you to open a new issue instead and we recommend linking to the issue/PR in question for context.
113+
106114
## Building Gitea
107115

108116
See the [development setup instructions](https://docs.gitea.com/development/hacking-on-gitea).
@@ -456,7 +464,7 @@ We assume in good faith that the information you provide is legally binding.
456464
We adopted a release schedule to streamline the process of working on, finishing, and issuing releases. \
457465
The overall goal is to make a major release every three or four months, which breaks down into two or three months of general development followed by one month of testing and polishing known as the release freeze. \
458466
All the feature pull requests should be
459-
merged before feature freeze. And, during the frozen period, a corresponding
467+
merged before feature freeze. All feature pull requests haven't been merged before this feature freeze will be moved to next milestone, please notice our feature freeze announcement on discord. And, during the frozen period, a corresponding
460468
release branch is open for fixes backported from main branch. Release candidates
461469
are made during this period for user testing to
462470
obtain a final version that is maintained in this branch.

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ fomantic:
908908
cd $(FOMANTIC_WORK_DIR) && npm install --no-save
909909
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
910910
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
911+
$(SED_INPLACE) -e 's/ overrideBrowserslist\r/ overrideBrowserslist: ["defaults"]\r/g' $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/tasks/config/tasks.js
911912
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
912913
# fomantic uses "touchstart" as click event for some browsers, it's not ideal, so we force fomantic to always use "click" as click event
913914
$(SED_INPLACE) -e 's/clickEvent[ \t]*=/clickEvent = "click", unstableClickEvent =/g' $(FOMANTIC_WORK_DIR)/build/semantic.js

cmd/admin_regenerate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
package cmd
55

66
import (
7-
asymkey_model "code.gitea.io/gitea/models/asymkey"
87
"code.gitea.io/gitea/modules/graceful"
8+
asymkey_service "code.gitea.io/gitea/services/asymkey"
99
repo_service "code.gitea.io/gitea/services/repository"
1010

1111
"github.com/urfave/cli/v2"
@@ -42,5 +42,5 @@ func runRegenerateKeys(_ *cli.Context) error {
4242
if err := initDB(ctx); err != nil {
4343
return err
4444
}
45-
return asymkey_model.RewriteAllPublicKeys(ctx)
45+
return asymkey_service.RewriteAllPublicKeys(ctx)
4646
}

contrib/systemd/gitea.service

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[Unit]
22
Description=Gitea (Git with a cup of tea)
3-
After=syslog.target
43
After=network.target
54
###
65
# Don't forget to add the database service dependencies

custom/conf/app.example.ini

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,12 @@ LEVEL = Info
956956
;GO_GET_CLONE_URL_PROTOCOL = https
957957
;;
958958
;; Close issues as long as a commit on any branch marks it as fixed
959+
;DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = false
960+
;;
961+
;; Allow users to push local repositories to Gitea and have them automatically created for a user or an org
962+
;ENABLE_PUSH_CREATE_USER = false
963+
;ENABLE_PUSH_CREATE_ORG = false
964+
;;
959965
;; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions.
960966
;DISABLED_REPO_UNITS =
961967
;;
@@ -1474,8 +1480,10 @@ LEVEL = Info
14741480
;;
14751481
;; Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
14761482
;DEFAULT_EMAIL_NOTIFICATIONS = enabled
1477-
;; Disabled features for users, could be "deletion", more features can be disabled in future
1483+
;; Disabled features for users, could be "deletion", "manage_ssh_keys","manage_gpg_keys" more features can be disabled in future
14781484
;; - deletion: a user cannot delete their own account
1485+
;; - manage_ssh_keys: a user cannot configure ssh keys
1486+
;; - manage_gpg_keys: a user cannot configure gpg keys
14791487
;USER_DISABLED_FEATURES =
14801488

14811489
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/administration/backup-and-restore.en-us.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ cd gitea-dump-1610949662
9292
mv app.ini /etc/gitea/conf/app.ini
9393
mv data/* /var/lib/gitea/data/
9494
mv log/* /var/lib/gitea/log/
95-
mv repos/* /var/lib/gitea/gitea-repositories/
95+
mv repos/* /var/lib/gitea/data/gitea-repositories/
9696
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea
9797

9898
# mysql
@@ -111,6 +111,8 @@ With Gitea running, and from the directory Gitea's binary is located, execute: `
111111

112112
This ensures that application and configuration file paths in repository Git Hooks are consistent and applicable to the current installation. If these paths are not updated, repository `push` actions will fail.
113113

114+
If you still have issues, consider running `./gitea doctor check` to inspect possible errors (or run with `--fix`).
115+
114116
### Using Docker (`restore`)
115117

116118
There is also no support for a recovery command in a Docker-based gitea instance. The restore process contains the same steps as described in the previous section but with different paths.

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,10 @@ And the following unique queues:
518518

519519
- `DEFAULT_EMAIL_NOTIFICATIONS`: **enabled**: Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
520520
- `DISABLE_REGULAR_ORG_CREATION`: **false**: Disallow regular (non-admin) users from creating organizations.
521-
- `USER_DISABLED_FEATURES`: **_empty_** Disabled features for users, could be `deletion` and more features can be added in future.
521+
- `USER_DISABLED_FEATURES`: **_empty_** Disabled features for users, could be `deletion`, `manage_ssh_keys`, `manage_gpg_keys` and more features can be added in future.
522522
- `deletion`: User cannot delete their own account.
523+
- `manage_ssh_keys`: User cannot configure ssh keys.
524+
- `manage_gpg_keys`: User cannot configure gpg keys.
523525

524526
## Security (`security`)
525527

docs/content/administration/config-cheat-sheet.zh-cn.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,10 @@ Gitea 创建以下非唯一队列:
497497

498498
- `DEFAULT_EMAIL_NOTIFICATIONS`: **enabled**:用户电子邮件通知的默认配置(用户可配置)。选项:enabled、onmention、disabled
499499
- `DISABLE_REGULAR_ORG_CREATION`: **false**:禁止普通(非管理员)用户创建组织。
500-
- `USER_DISABLED_FEATURES`:**_empty_** 禁用的用户特性,当前允许为空或者 `deletion`, 未来可以增加更多设置。
500+
- `USER_DISABLED_FEATURES`:**_empty_** 禁用的用户特性,当前允许为空或者 `deletion``manage_ssh_keys``manage_gpg_keys` 未来可以增加更多设置。
501501
- `deletion`: 用户不能通过界面或者API删除他自己。
502+
- `manage_ssh_keys`: 用户不能通过界面或者API配置SSH Keys。
503+
- `manage_gpg_keys`: 用户不能配置 GPG 密钥。
502504

503505
## 安全性 (`security`)
504506

docs/content/administration/mail-templates.en-us.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Please check [Gitea's logs](administration/logging-config.md) for error messages
224224
{{if not (eq .Body "")}}
225225
<h3>Message content</h3>
226226
<hr>
227-
{{.Body | Str2html}}
227+
{{.Body}}
228228
{{end}}
229229
</p>
230230
<hr>
@@ -259,20 +259,20 @@ This template produces something along these lines:
259259
The template system contains several functions that can be used to further process and format
260260
the messages. Here's a list of some of them:
261261

262-
| Name | Parameters | Available | Usage |
263-
| ---------------- | ----------- | --------- | --------------------------------------------------------------------------- |
264-
| `AppUrl` | - | Any | Gitea's URL |
265-
| `AppName` | - | Any | Set from `app.ini`, usually "Gitea" |
266-
| `AppDomain` | - | Any | Gitea's host name |
267-
| `EllipsisString` | string, int | Any | Truncates a string to the specified length; adds ellipsis as needed |
268-
| `Str2html` | string | Body only | Sanitizes text by removing any HTML tags from it. |
269-
| `SafeHTML` | string | Body only | Takes the input as HTML; can be used for `.ReviewComments.RenderedContent`. |
262+
| Name | Parameters | Available | Usage |
263+
| ---------------- | ----------- | --------- | ------------------------------------------------------------------- |
264+
| `AppUrl` | - | Any | Gitea's URL |
265+
| `AppName` | - | Any | Set from `app.ini`, usually "Gitea" |
266+
| `AppDomain` | - | Any | Gitea's host name |
267+
| `EllipsisString` | string, int | Any | Truncates a string to the specified length; adds ellipsis as needed |
268+
| `SanitizeHTML` | string | Body only | Sanitizes text by removing any dangerous HTML tags from it |
269+
| `SafeHTML` | string | Body only | Takes the input as HTML, can be used for outputing raw HTML content |
270270

271271
These are _functions_, not metadata, so they have to be used:
272272

273273
```html
274-
Like this: {{Str2html "Escape<my>text"}}
275-
Or this: {{"Escape<my>text" | Str2html}}
274+
Like this: {{SanitizeHTML "Escape<my>text"}}
275+
Or this: {{"Escape<my>text" | SanitizeHTML}}
276276
Or this: {{AppUrl}}
277277
But not like this: {{.AppUrl}}
278278
```

docs/content/administration/mail-templates.zh-cn.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ _主题_ 和 _邮件正文_ 由 [Golang的模板引擎](https://go.dev/pkg/text/
207207
{{if not (eq .Body "")}}
208208
<h3>消息内容:</h3>
209209
<hr>
210-
{{.Body | Str2html}}
210+
{{.Body}}
211211
{{end}}
212212
</p>
213213
<hr>
@@ -242,20 +242,20 @@ _主题_ 和 _邮件正文_ 由 [Golang的模板引擎](https://go.dev/pkg/text/
242242

243243
模板系统包含一些函数,可用于进一步处理和格式化消息。以下是其中一些函数的列表:
244244

245-
| 函数名 | 参数 | 可用于 | 用法 |
246-
|------------------| ----------- | ------------ | --------------------------------------------------------------------------------- |
247-
| `AppUrl` | - | 任何地方 | Gitea 的 URL |
248-
| `AppName` | - | 任何地方 |`app.ini` 中设置,通常为 "Gitea" |
249-
| `AppDomain` | - | 任何地方 | Gitea 的主机名 |
250-
| `EllipsisString` | string, int | 任何地方 | 将字符串截断为指定长度;根据需要添加省略号 |
251-
| `Str2html` | string | 仅正文部分 | 通过删除其中的 HTML 标签对文本进行清理 |
252-
| `SafeHTML` | string | 仅正文部分 | 将输入作为 HTML 处理;可用于 `.ReviewComments.RenderedContent` 等字段 |
245+
| 函数名 | 参数 | 可用于 | 用法 |
246+
|------------------| ----------- | ------------ | ------------------------------ |
247+
| `AppUrl` | - | 任何地方 | Gitea 的 URL |
248+
| `AppName` | - | 任何地方 |`app.ini` 中设置,通常为 "Gitea" |
249+
| `AppDomain` | - | 任何地方 | Gitea 的主机名 |
250+
| `EllipsisString` | string, int | 任何地方 | 将字符串截断为指定长度;根据需要添加省略号 |
251+
| `SanitizeHTML` | string | 仅正文部分 | 通过删除其中的危险 HTML 标签对文本进行清理 |
252+
| `SafeHTML` | string | 仅正文部分 | 将输入作为 HTML 处理;可用于输出原始的 HTML 内容 |
253253

254254
这些都是 _函数_,而不是元数据,因此必须按以下方式使用:
255255

256256
```html
257-
像这样使用: {{Str2html "Escape<my>text"}}
258-
或者这样使用: {{"Escape<my>text" | Str2html}}
257+
像这样使用: {{SanitizeHTML "Escape<my>text"}}
258+
或者这样使用: {{"Escape<my>text" | SanitizeHTML}}
259259
或者这样使用: {{AppUrl}}
260260
但不要像这样使用: {{.AppUrl}}
261261
```

docs/content/help/faq.en-us.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@ Our translations are currently crowd-sourced on our [Crowdin project](https://cr
221221

222222
Whether you want to change a translation or add a new one, it will need to be there as all translations are overwritten in our CI via the Crowdin integration.
223223

224-
## Push Hook / Webhook aren't running
224+
## Push Hook / Webhook / Actions aren't running
225225

226-
If you can push but can't see push activities on the home dashboard, or the push doesn't trigger webhook, there are a few possibilities:
226+
If you can push but can't see push activities on the home dashboard, or the push doesn't trigger webhook and Actions workflows, it's likely that the git hooks are not working.
227+
228+
There are a few possibilities:
227229

228230
1. The git hooks are out of sync: run "Resynchronize pre-receive, update and post-receive hooks of all repositories" on the site admin panel
229231
2. The git repositories (and hooks) are stored on some filesystems (ex: mounted by NAS) which don't support script execution, make sure the filesystem supports `chmod a+x any-script`

docs/content/help/faq.zh-cn.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,11 @@ Gitea还提供了自己的SSH服务器,用于在SSHD不可用时使用。
225225

226226
无论您想要更改翻译还是添加新的翻译,都需要在Crowdin集成中进行,因为所有翻译都会被CI覆盖。
227227

228-
## 推送钩子/ Webhook未运行
228+
## 推送钩子/ Webhook / Actions 未运行
229229

230-
如果您可以推送但无法在主页仪表板上看到推送活动,或者推送不触发Webhook,有几种可能性:
230+
如果您可以推送但无法在主页仪表板上看到推送活动,或者推送不触发 Webhook 和 Actions,可能是 git 钩子不工作而导致的。
231+
232+
这可能是由于以下原因:
231233

232234
1. Git钩子不同步:在站点管理面板上运行“重新同步所有仓库的pre-receive、update和post-receive钩子”
233235
2. Git仓库(和钩子)存储在一些不支持脚本执行的文件系统上(例如由NAS挂载),请确保文件系统支持`chmod a+x any-script`

docs/content/usage/actions/faq.en-us.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,24 @@ It is technically possible to implement, but we need to discuss whether it is ne
4545

4646
## Where will the runner download scripts when using actions such as `actions/checkout@v4`?
4747

48-
You may be aware that there are tens of thousands of [marketplace actions](https://github.com/marketplace?type=actions) in GitHub.
49-
However, when you write `uses: actions/checkout@v4`, it actually downloads the scripts from [gitea.com/actions/checkout](http://gitea.com/actions/checkout) by default (not GitHub).
50-
This is a mirror of [github.com/actions/checkout](http://github.com/actions/checkout), but it's impossible to mirror all of them.
51-
That's why you may encounter failures when trying to use some actions that haven't been mirrored.
48+
There are tens of thousands of [actions scripts](https://github.com/marketplace?type=actions) in GitHub, and when you write `uses: actions/checkout@v4`, it downloads the scripts from [github.com/actions/checkout](http://github.com/actions/checkout) by default.
49+
But what if you want to use actions from other places such as gitea.com instead of GitHub?
5250

5351
The good news is that you can specify the URL prefix to use actions from anywhere.
5452
This is an extra syntax in Gitea Actions.
5553
For example:
5654

57-
- `uses: https://github.com/xxx/xxx@xxx`
5855
- `uses: https://gitea.com/xxx/xxx@xxx`
56+
- `uses: https://github.com/xxx/xxx@xxx`
5957
- `uses: http://your_gitea_instance.com/xxx@xxx`
6058

6159
Be careful, the `https://` or `http://` prefix is necessary!
6260

63-
Alternatively, if you want your runners to download actions from GitHub or your own Gitea instance by default, you can configure it by setting `[actions].DEFAULT_ACTIONS_URL`.
64-
See [Configuration Cheat Sheet](administration/config-cheat-sheet.md#actions-actions).
61+
This is one of the differences from GitHub Actions which supports actions scripts only from GitHub.
62+
But it should allow users much more flexibility in how they run Actions.
6563

66-
This is one of the differences from GitHub Actions, but it should allow users much more flexibility in how they run Actions.
64+
Alternatively, if you want your runners to download actions from your own Gitea instance by default, you can configure it by setting `[actions].DEFAULT_ACTIONS_URL`.
65+
See [Configuration Cheat Sheet](administration/config-cheat-sheet.md#actions-actions).
6766

6867
## How to limit the permission of the runners?
6968

0 commit comments

Comments
 (0)