mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Merge branch 'master' of https://github.com/kyledrake/neocities-web
This commit is contained in:
commit
2feecd69fe
4 changed files with 11 additions and 5 deletions
2
app.rb
2
app.rb
|
@ -119,7 +119,7 @@ post '/site_files/upload' do
|
|||
|
||||
mime_type = Magic.guess_file_mime_type params[:newfile][:tempfile].path
|
||||
|
||||
unless Site::VALID_MIME_TYPES.include?(mime_type) && Site::VALID_EXTENSIONS.include?(File.extname(params[:newfile][:filename]).sub(/^./, ''))
|
||||
unless (Site::VALID_MIME_TYPES.include?(mime_type) || mime_type =~ /text/) && Site::VALID_EXTENSIONS.include?(File.extname(params[:newfile][:filename]).sub(/^./, ''))
|
||||
@errors << 'File must me one of the following: HTML, Text, Image (JPG PNG GIF JPEG SVG), JS, CSS, Markdown.'
|
||||
halt slim(:'site_files/new')
|
||||
end
|
||||
|
|
|
@ -45,3 +45,9 @@ DB.loggers << Logger.new(STDOUT) if ENV['RACK_ENV'] == 'development'
|
|||
if ENV['RACK_ENV'] == 'development' && Server.count == 0
|
||||
Server.create ip: '127.0.0.1', slots_available: 999999
|
||||
end
|
||||
|
||||
Backburner.configure do |config|
|
||||
config.max_job_retries = 3
|
||||
config.retry_delay = 200
|
||||
config.respond_timeout = 20
|
||||
end
|
||||
|
|
|
@ -10,9 +10,9 @@ class ScreenshotJob
|
|||
screenshot = Tempfile.new 'neocities_screenshot'
|
||||
screenshot.close
|
||||
|
||||
caps = Selenium::WebDriver::Remote::Capabilities.htmlunit javascript_enabled: false, takesScreenshot: true
|
||||
caps = Selenium::WebDriver::Remote::Capabilities.htmlunit javascript_enabled: true, takesScreenshot: true
|
||||
|
||||
driver = Selenium::WebDriver.for :remote, url: $config['phantomjs_url'], desired_capabilities: caps
|
||||
driver = Selenium::WebDriver.for :remote, url: $config['phantomjs_url'][rand($config['phantomjs_url'].length)], desired_capabilities: caps
|
||||
driver.manage.window.resize_to 1280, 720
|
||||
|
||||
wait = Selenium::WebDriver::Wait.new(:timeout => 5) # seconds
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
div
|
||||
h1 Web Sites on NeoCities
|
||||
p If you like a site, don't forget to bookmark it!<br>Visitor counts are updated hourly.
|
||||
div style="margin-bottom: 40px": .btn.btn-success Create your NeoCities site now
|
||||
div style="margin-bottom: 40px": a.btn.btn-success href="/new" Create your NeoCities site now
|
||||
- count = 0
|
||||
- @sites.each_with_index do |site,i|
|
||||
- if count == 0
|
||||
|
@ -16,7 +16,7 @@
|
|||
.span1
|
||||
h5: b style="margin-left: 20px": a href="http://#{site.username}.neocities.org" target="_blank" #{site.username}
|
||||
.span3.text-right
|
||||
p style="margin-right: 20px; margin-top: 10px; font-size: 10pt" #{site.hits} visits, updated #{site.updated_at.ago}
|
||||
p style="margin-right: 20px; margin-top: 10px; font-size: 10pt" <strong>#{site.hits} visits</strong>, updated #{site.updated_at.ago}
|
||||
a href="http://#{site.username}.neocities.org" target="_blank": img src="/site_screenshots/#{ENV['RACK_ENV'] == 'development' ? 'victoria' : site.username}.jpg"
|
||||
|
||||
- if @page_count > 1
|
||||
|
|
Loading…
Add table
Reference in a new issue