mirror of
https://github.com/neocities/neocities.git
synced 2025-08-03 16:21:52 +02:00
add WebDAV windows alt; restrict zipball downloads44444444 for large sites
This commit is contained in:
parent
cfef4bc9c9
commit
7d17202f39
3 changed files with 23 additions and 12 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue