Skip to content

v1.3.3-beta(20260224) ​

1. oss.yml 配置参数安全增强说明 ​

本次升级对 OSS 配置文件 oss.yml 进行了补充和优化,全面提升了文件上传的安全性和合规性。新增了 allowedExts 和 allowedMimeTypes 配置项,用于精确控制允许上传的文件扩展名和 MIME 类型,有效防止非法或高风险类型文件被上传。请根据实际业务需求进行相应的配置和同步。

yml
oss:
  # 支持S3协议的厂商
  provider: MINIO
  endpoint: 192.168.56.101:9000
  accessKey: a4jtJvgEmk4ead5dzac6
  secretKey: UW6kxTGRetIAahV759rFkgoQ8ilXLRUMW0ULdIoo
  bucketName: test
  richtextBucketName: static
  domain: http://192.168.56.101:9000
  # 命名方式: UUID、ORIGINAL原文件名偏好,冲突会补充时间
  naming: original
  scheme: http
  allowedExts:
    # 图片
    - jpg
    - jpeg
    - png
    - gif
    - bmp
    - webp
    - svg
    - ico
    # 文档
    - pdf
    - doc
    - docx
    - xls
    - xlsx
    - ppt
    - pptx
    - rtf
    - txt
    - csv
    - odt
    - ods
    - odp
    - pages
    - numbers
    - keynote
    # 压缩包
    - zip
    - rar
    - 7z
    - tar
    - gz
    # 音频格式
    - mp3
    - wav
    - ogg
    # 视频格式
    - mp4
    - mov
    - avi
    - wmv
  allowedMimeTypes:
    # 图片
    - image/jpeg
    - image/pjpeg
    - image/png
    - image/gif
    - image/bmp
    - image/webp
    - image/svg+xml
    - image/vnd.microsoft.icon
    # 文档
    - application/pdf
    - application/msword
    - application/vnd.openxmlformats-officedocument.wordprocessingml.document
    - application/vnd.ms-excel
    - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    - application/vnd.ms-powerpoint
    - application/vnd.openxmlformats-officedocument.presentationml.presentation
    - application/rtf
    - text/plain
    - text/csv
    - application/vnd.oasis.opendocument.text
    - application/vnd.oasis.opendocument.spreadsheet
    - application/vnd.oasis.opendocument.presentation
    - application/vnd.apple.pages
    - application/vnd.apple.numbers
    - application/vnd.apple.keynote
    # 压缩包
    - application/zip
    - application/x-zip-compressed
    - application/x-rar-compressed
    - application/x-7z-compressed
    - application/x-tar
    - application/gzip
    - application/x-gzip
    # 音频
    - audio/mpeg
    - audio/wav
    - audio/ogg
    # 视频
    - video/mp4
    - video/quicktime
    - video/x-msvideo
    - video/x-ms-wmv
    # 二进制
    - application/octet-stream
  • 新增配置项说明:
    • allowedExts:用于指定允许上传的文件扩展名,建议根据实际需要精确定义,提升上传安全性。
    • allowedMimeTypes:用于指定允许上传的 MIME 类型,有助于规避高风险或不被支持的文件类型。
    • 其余参数保持兼容原有配置,继续支持原有存储和业务逻辑。

请及时同步本次 oss.yml 配置更新,以确保服务安全稳定运行。