Skip to content

Commit 165346c

Browse files
author
Gusted
authored
Add MP4 as default allowed attachment type (#18170)
1 parent 0848c71 commit 165346c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

custom/conf/app.example.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ PATH =
16171617
;ENABLED = true
16181618
;;
16191619
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
1620-
;ALLOWED_TYPES = .docx,.gif,.gz,.jpeg,.jpg,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip
1620+
;ALLOWED_TYPES = .docx,.gif,.gz,.jpeg,.jpg,.mp4,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip
16211621
;;
16221622
;; Max size of each file. Defaults to 4MB
16231623
;MAX_SIZE = 4

docs/content/doc/advanced/config-cheat-sheet.en-us.md

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

733733
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
734-
- `ALLOWED_TYPES`: **.docx,.gif,.gz,.jpeg,.jpg,.log,.pdf,.png,.pptx,.txt,.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.
734+
- `ALLOWED_TYPES`: **.docx,.gif,.gz,.jpeg,.jpg,mp4,.log,.pdf,.png,.pptx,.txt,.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.
735735
- `MAX_SIZE`: **4**: Maximum size (MB).
736736
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
737737
- `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]`

modules/setting/attachment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func newAttachmentService() {
2929

3030
Attachment.Storage = getStorage("attachments", storageType, sec)
3131

32-
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".docx,.gif,.gz,.jpeg,.jpg,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip")
32+
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".docx,.gif,.gz,.jpeg,.jpg,.mp4,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip")
3333
Attachment.MaxSize = sec.Key("MAX_SIZE").MustInt64(4)
3434
Attachment.MaxFiles = sec.Key("MAX_FILES").MustInt(5)
3535
Attachment.Enabled = sec.Key("ENABLED").MustBool(true)

0 commit comments

Comments
 (0)