mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +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']
|
THUMBNAIL_RESOLUTIONS = ['210x158']
|
||||||
|
|
||||||
MAX_FILE_SIZE = 10**8 # 100 MB
|
MAX_FILE_SIZE = 10**8 # 100 MB
|
||||||
|
MAX_SITE_DOWNLOAD_SIZE = 2_000_000_000 # 2GB
|
||||||
|
|
||||||
CLAMAV_THREAT_MATCHES = [
|
CLAMAV_THREAT_MATCHES = [
|
||||||
/^VBS/,
|
/^VBS/,
|
||||||
|
@ -1135,6 +1136,10 @@ class Site < Sequel::Model
|
||||||
((total_space_used.to_f / maximum_space) * 100).round(1)
|
((total_space_used.to_f / maximum_space) * 100).round(1)
|
||||||
end
|
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.
|
# Note: Change Stat#prune! and the nginx map compiler if you change this business logic.
|
||||||
def supporter?
|
def supporter?
|
||||||
owner.plan_type != 'free'
|
owner.plan_type != 'free'
|
||||||
|
|
|
@ -190,9 +190,11 @@
|
||||||
<% if !current_site.plan_feature(:no_file_restrictions) %>
|
<% if !current_site.plan_feature(:no_file_restrictions) %>
|
||||||
<a href="/site_files/allowed_types">Allowed file types</a> |
|
<a href="/site_files/allowed_types">Allowed file types</a> |
|
||||||
<% end %>
|
<% 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? %>
|
<% 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 %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="header-Outro">
|
<div class="header-Outro">
|
||||||
<div class="row content single-Col">
|
<div class="row content single-Col">
|
||||||
<h1>Mount your site</h1>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
<h1>About</h1>
|
<h1>About</h1>
|
||||||
|
|
||||||
<p>
|
<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>
|
</p>
|
||||||
|
|
||||||
<% if current_site.nil? %>
|
<% if current_site.nil? %>
|
||||||
|
@ -22,20 +22,24 @@
|
||||||
This feature requires a supporter account. <a href="/supporter">Click here</a> to become a supporter.
|
This feature requires a supporter account. <a href="/supporter">Click here</a> to become a supporter.
|
||||||
</p>
|
</p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<h2>Instructions for Windows 7</h2>
|
<h2>Instructions for Windows</h2>
|
||||||
|
|
||||||
<p>
|
<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>
|
Unfortunately, the WebDAV that comes with Windows file manager has issues with SSL,
|
||||||
<br>
|
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
|
||||||
Enter your login info when requested.
|
WebDAV support. You can also try <a href="https://mountainduck.io/">Mountain Duck</a>
|
||||||
</p>
|
which will allow you to mount your Neocities site as a hard drive on your computer.
|
||||||
|
|
||||||
<h2>Instructions for OSX</h2>
|
<h2>Instructions for OSX</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://support.apple.com/kb/ph3857">Use these instructions</a>, and use this URL to connect: <strong>https://neocities.org/webdav</strong>
|
<a href="http://support.apple.com/kb/ph3857">Use these instructions</a>, and use this URL to connect: <strong>https://neocities.org/webdav</strong>
|
||||||
<br>
|
<br>
|
||||||
Enter login info when requested.
|
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>
|
</p>
|
||||||
|
|
||||||
<h2>Instructions for Linux (Ubuntu)</h2>
|
<h2>Instructions for Linux (Ubuntu)</h2>
|
||||||
|
|
Loading…
Add table
Reference in a new issue