Skip to content

Commit 54e7483

Browse files
authored
Update default allowed attachment types (#20192)
Synced the list to what is allowed on GitHub currently.
1 parent 7c1f18a commit 54e7483

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
@@ -1676,7 +1676,7 @@ PATH =
16761676
;ENABLED = true
16771677
;;
16781678
;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
1679-
;ALLOWED_TYPES = .docx,.gif,.gz,.jpeg,.jpg,.mp4,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip
1679+
;ALLOWED_TYPES = .csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip
16801680
;;
16811681
;; Max size of each file. Defaults to 4MB
16821682
;MAX_SIZE = 4

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

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

744744
- `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
745-
- `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.
745+
- `ALLOWED_TYPES`: **.csv,.docx,.fodg,.fodp,.fods,.fodt,.gif,.gz,.jpeg,.jpg,.log,.md,.mov,.mp4,.odf,.odg,.odp,.ods,.odt,.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.
746746
- `MAX_SIZE`: **4**: Maximum size (MB).
747747
- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
748748
- `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
@@ -27,7 +27,7 @@ func newAttachmentService() {
2727

2828
Attachment.Storage = getStorage("attachments", storageType, sec)
2929

30-
Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".docx,.gif,.gz,.jpeg,.jpg,.mp4,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip")
30+
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,.pdf,.png,.pptx,.svg,.tgz,.txt,.webm,.xls,.xlsx,.zip")
3131
Attachment.MaxSize = sec.Key("MAX_SIZE").MustInt64(4)
3232
Attachment.MaxFiles = sec.Key("MAX_FILES").MustInt(5)
3333
Attachment.Enabled = sec.Key("ENABLED").MustBool(true)

0 commit comments

Comments
 (0)