add WebDAV windows alt; restrict zipball downloads44444444 for large sites

This commit is contained in:
Kyle Drake 2017-05-21 15:37:50 -05:00
parent cfef4bc9c9
commit 7d17202f39
3 changed files with 23 additions and 12 deletions

View file

@ -70,6 +70,7 @@ class Site < Sequel::Model
THUMBNAIL_RESOLUTIONS = ['210x158']
MAX_FILE_SIZE = 10**8 # 100 MB
MAX_SITE_DOWNLOAD_SIZE = 2_000_000_000 # 2GB
CLAMAV_THREAT_MATCHES = [
/^VBS/,
@ -1135,6 +1136,10 @@ class Site < Sequel::Model
((total_space_used.to_f / maximum_space) * 100).round(1)
end
def too_big_to_download?
space_used > MAX_SITE_DOWNLOAD_SIZE
end
# Note: Change Stat#prune! and the nginx map compiler if you change this business logic.
def supporter?
owner.plan_type != 'free'