]> source.dussan.org Git - gitea.git/commitdiff
Update default allowed attachment types (#20192)
authorsilverwind <me@silverwind.io>
Fri, 1 Jul 2022 13:42:20 +0000 (15:42 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Jul 2022 13:42:20 +0000 (15:42 +0200)
Synced the list to what is allowed on GitHub currently.

custom/conf/app.example.ini
docs/content/doc/advanced/config-cheat-sheet.en-us.md
modules/setting/attachment.go

index 3646dfc71e844196620d51a0e2d5cfbc201c7e11..01f5cb6a47926429b28c64f1d890687d33a16594 100644 (file)
@@ -1676,7 +1676,7 @@ PATH =
 ;ENABLED = true
 ;;
 ;; Comma-separated list of allowed file extensions (`.zip`), mime types (`text/plain`) or wildcard type (`image/*`, `audio/*`, `video/*`). Empty value or `*/*` allows all types.
-;ALLOWED_TYPES = .docx,.gif,.gz,.jpeg,.jpg,.mp4,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip
+;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
 ;;
 ;; Max size of each file. Defaults to 4MB
 ;MAX_SIZE = 4
index b1557f93fc21ec8dfd49f70202f2cfce92b33d49..1d067d1f1ca9dc3c103af0238eaa616c217ea5a7 100644 (file)
@@ -742,7 +742,7 @@ Default templates for project boards:
 ## Issue and pull request attachments (`attachment`)
 
 - `ENABLED`: **true**: Whether issue and pull request attachments are enabled.
-- `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.
+- `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.
 - `MAX_SIZE`: **4**: Maximum size (MB).
 - `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once.
 - `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]`
index c3c2c3fafdb7e52b3e7c4b65be2fc7b84d8164f6..474b73293cceb46ee7516a5193a4db109fcdd860 100644 (file)
@@ -27,7 +27,7 @@ func newAttachmentService() {
 
        Attachment.Storage = getStorage("attachments", storageType, sec)
 
-       Attachment.AllowedTypes = sec.Key("ALLOWED_TYPES").MustString(".docx,.gif,.gz,.jpeg,.jpg,.mp4,.log,.pdf,.png,.pptx,.txt,.xlsx,.zip")
+       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")
        Attachment.MaxSize = sec.Key("MAX_SIZE").MustInt64(4)
        Attachment.MaxFiles = sec.Key("MAX_FILES").MustInt(5)
        Attachment.Enabled = sec.Key("ENABLED").MustBool(true)