Skip to content

Commit 4564fbd

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: Fix action runner offline label padding (go-gitea#29691) Update allowed attachment types (go-gitea#29688) Completely style the webkit autofill (go-gitea#29683) Include go files in tailwind processing (go-gitea#29686) Fix WebHookEditor regression from jQuery removal (go-gitea#29692)
2 parents c0d2a38 + a192a5e commit 4564fbd

File tree

7 files changed

+30
-16
lines changed

7 files changed

+30
-16
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ Default templates for project boards:
832832
## Issue and pull request attachments (`attachment`)
833833

834834
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
835-
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
835+
- `ALLOWED_TYPES`: **.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
836836
- `MAX_SIZE`: **2048**: Maximum size (MB).
837837
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
838838
- `STORAGE_TYPE`: **local**: Storage type for attachments, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ Gitea 创建以下非唯一队列:
782782
## 工单和合并请求的附件 (`attachment`)
783783

784784
- `ENABLED`: **true**: 是否允许用户上传附件。
785-
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: 允许的文件扩展名(`.zip`)、mime 类型(`text/plain`)或通配符类型(`image/*``audio/*``video/*`)的逗号分隔列表。空值或 `*/*` 允许所有类型。
785+
- `ALLOWED_TYPES`: **.cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip**: 允许的文件扩展名(`.zip`)、mime 类型(`text/plain`)或通配符类型(`image/*``audio/*``video/*`)的逗号分隔列表。空值或 `*/*` 允许所有类型。
786786
- `MAX_SIZE`: **2048**: 附件的最大限制(MB)。
787787
- `MAX_FILES`: **5**: 一次最多上传的附件数量。
788788
- `STORAGE_TYPE`: **local**: 附件的存储类型,`local` 表示本地磁盘,`minio` 表示兼容 S3 的对象存储服务,如果未设置将使用默认值 `local` 或其他在 `[storage.xxx]` 中定义的名称。

modules/setting/attachment.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var Attachment = struct {
1212
Enabled bool
1313
}{
1414
Storage: &Storage{},
15-
AllowedTypes: ".csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip",
15+
AllowedTypes: ".cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip",
1616
MaxSize: 2048,
1717
MaxFiles: 5,
1818
Enabled: true,
@@ -25,7 +25,7 @@ func loadAttachmentFrom(rootCfg ConfigProvider) (err error) {
2525
return err
2626
}
2727

28-
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip")
28+
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".cpuprofile,.csv,.dmp,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.json,.jsonc,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip")
2929
Attachment.MaxSize = sec.Key("MAX_SIZE").MustInt64(2048)
3030
Attachment.MaxFiles = sec.Key("MAX_FILES").MustInt(5)
3131
Attachment.Enabled = sec.Key("ENABLED").MustBool(true)

tailwind.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export default {
3131
isProduction && '!./web_src/js/standalone/devtest.js',
3232
'!./templates/swagger/v1_json.tmpl',
3333
'!./templates/user/auth/oidc_wellknown.tmpl',
34+
'!**/*_test.go',
35+
'!./modules/{public,options,templates}/bindata.go',
36+
'./{build,models,modules,routers,services}/**/*.go',
3437
'./templates/**/*.tmpl',
3538
'./web_src/js/**/*.{js,vue}',
3639
].filter(Boolean),

templates/shared/actions/runner_list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
{{range .Runners}}
6969
<tr>
7070
<td>
71-
<span class="ui {{if .IsOnline}}green{{else}}basic{{end}} label">{{.StatusLocaleName ctx.Locale}}</span>
71+
<span class="ui {{if .IsOnline}}green{{end}} label">{{.StatusLocaleName ctx.Locale}}</span>
7272
</td>
7373
<td>{{.ID}}</td>
7474
<td><p data-tooltip-content="{{.Description}}">{{.Name}}</p></td>

web_src/css/base.css

+12-4
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,18 @@ img.ui.avatar,
872872
border-color: var(--color-error-border) !important;
873873
}
874874

875-
/* A fix for text visibility issue in Chrome autofill in dark mode. */
876-
/* It's a problem from Formatic UI, and this rule overrides it. */
877-
.ui.form .field.field input:-webkit-autofill {
878-
-webkit-text-fill-color: var(--color-black) !important;
875+
input:-webkit-autofill,
876+
input:-webkit-autofill:focus,
877+
input:-webkit-autofill:hover,
878+
input:-webkit-autofill:active,
879+
.ui.form .field.field input:-webkit-autofill,
880+
.ui.form .field.field input:-webkit-autofill:focus,
881+
.ui.form .field.field input:-webkit-autofill:hover,
882+
.ui.form .field.field input:-webkit-autofill:active {
883+
-webkit-background-clip: text;
884+
-webkit-text-fill-color: var(--color-text);
885+
box-shadow: 0 0 0 100px var(--color-primary-light-6) inset !important;
886+
border-color: var(--color-primary-light-4) !important;
879887
}
880888

881889
.ui.form .field.muted {

web_src/js/features/comp/WebHookEditor.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ export function initCompWebHookEditor() {
2222
});
2323
}
2424

25-
const updateContentType = function () {
26-
const visible = document.getElementById('http_method').value === 'POST';
27-
toggleElem(document.getElementById('content_type').parentNode.parentNode, visible);
28-
};
29-
updateContentType();
30-
31-
document.getElementById('http_method').addEventListener('change', updateContentType);
25+
// some webhooks (like Gitea) allow to set the request method (GET/POST), and it would toggle the "Content Type" field
26+
const httpMethodInput = document.getElementById('http_method');
27+
if (httpMethodInput) {
28+
const updateContentType = function () {
29+
const visible = httpMethodInput.value === 'POST';
30+
toggleElem(document.getElementById('content_type').closest('.field'), visible);
31+
};
32+
updateContentType();
33+
httpMethodInput.addEventListener('change', updateContentType);
34+
}
3235

3336
// Test delivery
3437
document.getElementById('test-delivery')?.addEventListener('click', async function () {

0 commit comments

Comments
 (0)