fix: increase media size limit
This commit is contained in:
parent
e0302b3864
commit
1e64472343
7 changed files with 9 additions and 9 deletions
|
@ -233,7 +233,7 @@ class Request
|
||||||
contents
|
contents
|
||||||
end
|
end
|
||||||
|
|
||||||
def body_with_limit(limit = 1.megabyte)
|
def body_with_limit(limit = 30.megabyte)
|
||||||
require_limit_not_exceeded!(limit)
|
require_limit_not_exceeded!(limit)
|
||||||
|
|
||||||
contents = truncated_body(limit)
|
contents = truncated_body(limit)
|
||||||
|
|
|
@ -72,9 +72,9 @@ class Account < ApplicationRecord
|
||||||
MENTION_RE = %r{(?<![=/[:word:]])@((#{USERNAME_RE})(?:@[[:word:].-]+[[:word:]]+)?)}
|
MENTION_RE = %r{(?<![=/[:word:]])@((#{USERNAME_RE})(?:@[[:word:].-]+[[:word:]]+)?)}
|
||||||
URL_PREFIX_RE = %r{\Ahttp(s?)://[^/]+}
|
URL_PREFIX_RE = %r{\Ahttp(s?)://[^/]+}
|
||||||
USERNAME_ONLY_RE = /\A#{USERNAME_RE}\z/i
|
USERNAME_ONLY_RE = /\A#{USERNAME_RE}\z/i
|
||||||
USERNAME_LENGTH_LIMIT = 30
|
USERNAME_LENGTH_LIMIT = 72
|
||||||
DISPLAY_NAME_LENGTH_LIMIT = 30
|
DISPLAY_NAME_LENGTH_LIMIT = 30
|
||||||
NOTE_LENGTH_LIMIT = 500
|
NOTE_LENGTH_LIMIT = 4_096
|
||||||
|
|
||||||
AUTOMATED_ACTOR_TYPES = %w(Application Service).freeze
|
AUTOMATED_ACTOR_TYPES = %w(Application Service).freeze
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Account::Avatar
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
|
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
|
||||||
LIMIT = 2.megabytes
|
LIMIT = 200.megabytes
|
||||||
|
|
||||||
class_methods do
|
class_methods do
|
||||||
def avatar_styles(file)
|
def avatar_styles(file)
|
||||||
|
|
|
@ -4,7 +4,7 @@ module Account::Header
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
|
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze
|
||||||
LIMIT = 2.megabytes
|
LIMIT = 200.megabytes
|
||||||
MAX_PIXELS = 750_000 # 1500x500px
|
MAX_PIXELS = 750_000 # 1500x500px
|
||||||
|
|
||||||
class_methods do
|
class_methods do
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
class CustomEmoji < ApplicationRecord
|
class CustomEmoji < ApplicationRecord
|
||||||
include Attachmentable
|
include Attachmentable
|
||||||
|
|
||||||
LIMIT = 256.kilobytes
|
LIMIT = 30.megabytes
|
||||||
MINIMUM_SHORTCODE_SIZE = 2
|
MINIMUM_SHORTCODE_SIZE = 2
|
||||||
|
|
||||||
SHORTCODE_RE_FRAGMENT = '[a-zA-Z0-9_]{2,}'
|
SHORTCODE_RE_FRAGMENT = '[a-zA-Z0-9_]{2,}'
|
||||||
|
|
|
@ -39,8 +39,8 @@ class MediaAttachment < ApplicationRecord
|
||||||
|
|
||||||
MAX_DESCRIPTION_LENGTH = 1_500
|
MAX_DESCRIPTION_LENGTH = 1_500
|
||||||
|
|
||||||
IMAGE_LIMIT = 16.megabytes
|
IMAGE_LIMIT = 500.megabytes
|
||||||
VIDEO_LIMIT = 99.megabytes
|
VIDEO_LIMIT = 500.megabytes
|
||||||
|
|
||||||
MAX_VIDEO_MATRIX_LIMIT = 8_294_400 # 3840x2160px
|
MAX_VIDEO_MATRIX_LIMIT = 8_294_400 # 3840x2160px
|
||||||
MAX_VIDEO_FRAME_RATE = 120
|
MAX_VIDEO_FRAME_RATE = 120
|
||||||
|
|
|
@ -24,7 +24,7 @@ class PreviewCardProvider < ApplicationRecord
|
||||||
include Reviewable
|
include Reviewable
|
||||||
|
|
||||||
ICON_MIME_TYPES = %w(image/x-icon image/vnd.microsoft.icon image/png).freeze
|
ICON_MIME_TYPES = %w(image/x-icon image/vnd.microsoft.icon image/png).freeze
|
||||||
LIMIT = 1.megabyte
|
LIMIT = 50.megabyte
|
||||||
|
|
||||||
validates :domain, presence: true, uniqueness: true, domain: true
|
validates :domain, presence: true, uniqueness: true, domain: true
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue