Skip to content

Commit f459901

Browse files
authored
Merge branch 'main' into also_auto-merge_on_review_updates
2 parents 7009459 + 62aa5e2 commit f459901

File tree

340 files changed

+7229
-2206
lines changed

Some content is hidden

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

340 files changed

+7229
-2206
lines changed

.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

.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

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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1480,8 +1480,9 @@ LEVEL = Info
14801480
;;
14811481
;; Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
14821482
;DEFAULT_EMAIL_NOTIFICATIONS = enabled
1483-
;; Disabled features for users, could be "deletion","manage_gpg_keys" 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
14841484
;; - deletion: a user cannot delete their own account
1485+
;; - manage_ssh_keys: a user cannot configure ssh keys
14851486
;; - manage_gpg_keys: a user cannot configure gpg keys
14861487
;USER_DISABLED_FEATURES =
14871488

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +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`, `manage_gpg_keys` 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_gpg_keys`: User cannot configure gpg keys
523+
- `manage_ssh_keys`: User cannot configure ssh keys.
524+
- `manage_gpg_keys`: User cannot configure gpg keys.
524525

525526
## Security (`security`)
526527

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

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

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

504505
## 安全性 (`security`)
505506

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

Lines changed: 9 additions & 9 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 | SanitizeHTML}}
227+
{{.Body}}
228228
{{end}}
229229
</p>
230230
<hr>
@@ -259,14 +259,14 @@ 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-
| `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 `.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

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

Lines changed: 9 additions & 9 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 | SanitizeHTML}}
210+
{{.Body}}
211211
{{end}}
212212
</p>
213213
<hr>
@@ -242,14 +242,14 @@ _主题_ 和 _邮件正文_ 由 [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-
| `SanitizeHTML` | 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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
date: "2024-01-31T00:00:00+00:00"
3+
title: "Blocking a user"
4+
slug: "blocking-user"
5+
sidebar_position: 25
6+
toc: false
7+
draft: false
8+
aliases:
9+
- /en-us/webhooks
10+
menu:
11+
sidebar:
12+
parent: "usage"
13+
name: "Blocking a user"
14+
sidebar_position: 30
15+
identifier: "blocking-user"
16+
---
17+
18+
# Blocking a user
19+
20+
Gitea supports blocking of users to restrict how they can interact with you and your content.
21+
22+
You can block a user in your account settings, from the user's profile or from comments created by the user.
23+
The user is not directly notified about the block, but they can notice they are blocked when they attempt to interact with you.
24+
Organization owners can block anyone who is not a member of the organization too.
25+
If a blocked user has admin permissions, they can still perform all actions even if blocked.
26+
27+
### When you block a user
28+
29+
- the user stops following you
30+
- you stop following the user
31+
- the user's stars are removed from your repositories
32+
- your stars are removed from their repositories
33+
- the user stops watching your repositories
34+
- you stop watching their repositories
35+
- the user's issue assignments are removed from your repositories
36+
- your issue assignments are removed from their repositories
37+
- the user is removed as a collaborator on your repositories
38+
- you are removed as a collaborator on their repositories
39+
- any pending repository transfers to or from the blocked user are canceled
40+
41+
### When you block a user, the user cannot
42+
43+
- follow you
44+
- watch your repositories
45+
- star your repositories
46+
- fork your repositories
47+
- transfer repositories to you
48+
- open issues or pull requests on your repositories
49+
- comment on issues or pull requests you've created
50+
- comment on issues or pull requests on your repositories
51+
- react to your comments on issues or pull requests
52+
- react to comments on issues or pull requests on your repositories
53+
- assign you to issues or pull requests
54+
- add you as a collaborator on their repositories
55+
- send you notifications by @mentioning your username
56+
- be added as team member (if blocked by an organization)

docs/content/usage/issue-pull-request-templates.en-us.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ body:
136136
attributes:
137137
value: |
138138
Thanks for taking the time to fill out this bug report!
139+
# some markdown that will only be visible once the issue has been created
140+
- type: markdown
141+
attributes:
142+
value: |
143+
This issue was created by an issue **template** :)
144+
visible: [content]
139145
- type: input
140146
id: contact
141147
attributes:
@@ -187,18 +193,25 @@ body:
187193
options:
188194
- label: I agree to follow this project's Code of Conduct
189195
required: true
196+
- label: I have also read the CONTRIBUTION.MD
197+
required: true
198+
visible: [form]
199+
- label: This is a TODO only visible after issue creation
200+
visible: [content]
190201
```
191202
192203
### Markdown
193204
194-
You can use a `markdown` element to display Markdown in your form that provides extra context to the user, but is not submitted.
205+
You can use a `markdown` element to display Markdown in your form that provides extra context to the user, but is not submitted by default.
195206

196207
Attributes:
197208

198209
| Key | Description | Required | Type | Default | Valid values |
199210
|-------|--------------------------------------------------------------|----------|--------|---------|--------------|
200211
| value | The text that is rendered. Markdown formatting is supported. | Required | String | - | - |
201212

213+
visible: Default is **[form]**
214+
202215
### Textarea
203216

204217
You can use a `textarea` element to add a multi-line text field to your form. Contributors can also attach files in `textarea` fields.
@@ -219,6 +232,8 @@ Validations:
219232
|----------|------------------------------------------------------|----------|---------|---------|--------------|
220233
| required | Prevents form submission until element is completed. | Optional | Boolean | false | - |
221234

235+
visible: Default is **[form, content]**
236+
222237
### Input
223238

224239
You can use an `input` element to add a single-line text field to your form.
@@ -240,6 +255,8 @@ Validations:
240255
| is_number | Prevents form submission until element is filled with a number. | Optional | Boolean | false | - |
241256
| regex | Prevents form submission until element is filled with a value that match the regular expression. | Optional | String | - | a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) |
242257

258+
visible: Default is **[form, content]**
259+
243260
### Dropdown
244261

245262
You can use a `dropdown` element to add a dropdown menu in your form.
@@ -259,24 +276,29 @@ Validations:
259276
|----------|------------------------------------------------------|----------|---------|---------|--------------|
260277
| required | Prevents form submission until element is completed. | Optional | Boolean | false | - |
261278

279+
visible: Default is **[form, content]**
280+
262281
### Checkboxes
263282

264283
You can use the `checkboxes` element to add a set of checkboxes to your form.
265284

266285
Attributes:
267286

268287
| Key | Description | Required | Type | Default | Valid values |
269-
|-------------|-------------------------------------------------------------------------------------------------------|----------|--------|--------------|--------------|
288+
| ----------- | ----------------------------------------------------------------------------------------------------- | -------- | ------ | ------------ | ------------ |
270289
| label | A brief description of the expected user input, which is displayed in the form. | Required | String | - | - |
271290
| description | A description of the set of checkboxes, which is displayed in the form. Supports Markdown formatting. | Optional | String | Empty String | - |
272291
| options | An array of checkboxes that the user can select. For syntax, see below. | Required | Array | - | - |
273292

274293
For each value in the options array, you can set the following keys.
275294

276-
| Key | Description | Required | Type | Default | Options |
277-
|----------|------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|---------|---------|
278-
| label | The identifier for the option, which is displayed in the form. Markdown is supported for bold or italic text formatting, and hyperlinks. | Required | String | - | - |
279-
| required | Prevents form submission until element is completed. | Optional | Boolean | false | - |
295+
| Key | Description | Required | Type | Default | Options |
296+
|--------------|------------------------------------------------------------------------------------------------------------------------------------------|----------|--------------|---------|---------|
297+
| label | The identifier for the option, which is displayed in the form. Markdown is supported for bold or italic text formatting, and hyperlinks. | Required | String | - | - |
298+
| required | Prevents form submission until element is completed. | Optional | Boolean | false | - |
299+
| visible | Whether a specific checkbox appears in the form only, in the created issue only, or both. Valid options are "form" and "content". | Optional | String array | false | - |
300+
301+
visible: Default is **[form, content]**
280302

281303
## Syntax for issue config
282304

@@ -292,15 +314,15 @@ contact_links:
292314

293315
### Possible Options
294316

295-
| Key | Description | Type | Default |
296-
|----------------------|-------------------------------------------------------------------------------------------------------|--------------------|----------------|
297-
| blank_issues_enabled | If set to false, the User is forced to use a Template | Boolean | true |
298-
| contact_links | Custom Links to show in the Choose Box | Contact Link Array | Empty Array |
317+
| Key | Description | Type | Default |
318+
|----------------------|-------------------------------------------------------|--------------------|-------------|
319+
| blank_issues_enabled | If set to false, the User is forced to use a Template | Boolean | true |
320+
| contact_links | Custom Links to show in the Choose Box | Contact Link Array | Empty Array |
299321

300322
### Contact Link
301323

302-
| Key | Description | Type | Required |
303-
|----------------------|-------------------------------------------------------------------------------------------------------|---------|----------|
304-
| name | the name of your link | String | true |
305-
| url | The URL of your Link | String | true |
306-
| about | A short description of your Link | String | true |
324+
| Key | Description | Type | Required |
325+
|-------|----------------------------------|--------|----------|
326+
| name | the name of your link | String | true |
327+
| url | The URL of your Link | String | true |
328+
| about | A short description of your Link | String | true |

0 commit comments

Comments
 (0)