mirror of
https://gitea.com/gitea/gitea-mirror.git
synced 2026-03-20 03:40:27 +00:00
various fixes (#36697)
fixes bad address concat causing malformed address Introduces new config options to for release attachments and number of files to avoid sharing limits for PR/issue attachments and release ones Fixes: https://github.com/go-gitea/gitea/issues/31638 Fixes: https://github.com/go-gitea/gitea/issues/35812 Doc update: https://gitea.com/gitea/docs/pulls/348 Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -16,13 +16,9 @@ var Attachment AttachmentSettingType
|
||||
func loadAttachmentFrom(rootCfg ConfigProvider) (err error) {
|
||||
Attachment = AttachmentSettingType{
|
||||
AllowedTypes: ".avif,.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,.webp,.xls,.xlsx,.zip",
|
||||
|
||||
// FIXME: this size is used for both "issue attachment" and "release attachment"
|
||||
// The design is not right, these two should be different settings
|
||||
MaxSize: 2048,
|
||||
|
||||
MaxFiles: 5,
|
||||
Enabled: true,
|
||||
MaxSize: 100,
|
||||
MaxFiles: 5,
|
||||
Enabled: true,
|
||||
}
|
||||
sec, _ := rootCfg.GetSection("attachment")
|
||||
if sec == nil {
|
||||
|
||||
@@ -100,6 +100,8 @@ var (
|
||||
Release struct {
|
||||
AllowedTypes string
|
||||
DefaultPagingNum int
|
||||
FileMaxSize int64
|
||||
MaxFiles int64
|
||||
} `ini:"repository.release"`
|
||||
|
||||
Signing struct {
|
||||
@@ -241,9 +243,13 @@ var (
|
||||
Release: struct {
|
||||
AllowedTypes string
|
||||
DefaultPagingNum int
|
||||
FileMaxSize int64
|
||||
MaxFiles int64
|
||||
}{
|
||||
AllowedTypes: "",
|
||||
DefaultPagingNum: 10,
|
||||
FileMaxSize: 2048,
|
||||
MaxFiles: 5,
|
||||
},
|
||||
|
||||
// Signing settings
|
||||
|
||||
Reference in New Issue
Block a user