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'

View file

@ -190,9 +190,11 @@
<% if !current_site.plan_feature(:no_file_restrictions) %>
<a href="/site_files/allowed_types">Allowed file types</a> |
<% end %>
<a href="/site_files/<%= current_site.username %>.zip">Download entire site</a>
<% unless current_site.too_big_to_download? %>
<a href="/site_files/<%= current_site.username %>.zip">Download entire site</a> |
<% end %>
<% unless is_education? %>
| <a href="/site_files/mount_info">Mount your site as a drive on your computer!</a>
<a href="/site_files/mount_info">Mount your site as a drive on your computer</a>
<% end %>
</div>

View file

@ -1,7 +1,7 @@
<div class="header-Outro">
<div class="row content single-Col">
<h1>Mount your site</h1>
<h3 class="subtitle">Now you can access your Neocities site as a drive on your computer!</h3>
<h3 class="subtitle">Access your Neocities site as a drive on your computer</h3>
</div>
</div>
@ -10,7 +10,7 @@
<h1>About</h1>
<p>
Neocities now supports <strong>WebDAV</strong>, which allows you to mount your Neocities share on your computer. Now you can access and change your files on your own computer's file manager!
Neocities supports <strong>WebDAV</strong>, which allows you to mount your Neocities share on your computer.
</p>
<% if current_site.nil? %>
@ -22,13 +22,13 @@
This feature requires a supporter account. <a href="/supporter">Click here</a> to become a supporter.
</p>
<% else %>
<h2>Instructions for Windows 7</h2>
<h2>Instructions for Windows</h2>
<p>
<a href="http://www.onemetric.com.au/Documentation/Mounting-A-WebDAV-Share-Windows-7">Use these instructions</a>, except use this URL to connect: <strong>https://neocities.org/webdav</strong>
<br>
Enter your login info when requested.
</p>
Unfortunately, the WebDAV that comes with Windows file manager has issues with SSL,
and the problem has not yet been fixed. We recommend using a client like <a href="https://cyberduck.io">Cyberduck</a> with Windows, which is free and has
WebDAV support. You can also try <a href="https://mountainduck.io/">Mountain Duck</a>
which will allow you to mount your Neocities site as a hard drive on your computer.
<h2>Instructions for OSX</h2>
@ -38,6 +38,10 @@
Enter login info when requested.
</p>
<p>
You can also try out <a href="https://cyberduck.io">Cyberduck</a> or <a href="https://mountainduck.io/">Mountain Duck</a> if you run into any issues.
</p>
<h2>Instructions for Linux (Ubuntu)</h2>
<p>