mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Merge branch 'master' of github.com:neocities/neocities
This commit is contained in:
commit
9d718f09b7
3 changed files with 10 additions and 7 deletions
|
@ -251,7 +251,7 @@ post '/admin/banhammer' do
|
|||
username: site.username,
|
||||
email: site.email,
|
||||
ip: site.ip,
|
||||
evidence: "#{params[:classifier]}\n#{site.screenshot_url(Site::SCREENSHOT_RESOLUTIONS.first)}"
|
||||
evidence: "#{params[:classifier]}\nhttps://neocities.org#{site.screenshot_url('index.html', Site::SCREENSHOT_RESOLUTIONS.first)}"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ require 'open-uri'
|
|||
# It's some nginx bug. I'm not going to deal with it.
|
||||
|
||||
class DeleteCacheWorker
|
||||
HTTP_TIMEOUT = 5
|
||||
HTTP_TIMEOUT = 10
|
||||
include Sidekiq::Worker
|
||||
sidekiq_options queue: :deletecache, retry: 3, backtrace: false, average_scheduled_poll_interval: 1
|
||||
|
||||
|
@ -16,15 +16,17 @@ class DeleteCacheWorker
|
|||
end
|
||||
|
||||
def perform(proxy_ip, username, path)
|
||||
# DOES NOTHING RIGHT NOW SO WE JUST RETURN
|
||||
return
|
||||
# Must always have a forward slash
|
||||
path = '/' + path if path[0] != '/'
|
||||
|
||||
url = Addressable::URI.encode_component(
|
||||
"https://#{proxy_ip}/:cache/purge#{path}",
|
||||
"http://#{proxy_ip}/:cache/purge#{path}",
|
||||
Addressable::URI::CharacterClasses::QUERY
|
||||
)
|
||||
|
||||
HTTP.timeout(read: 10, write: 10, connect: 2).
|
||||
HTTP.follow.timeout(read: 10, write: 10, connect: 2).
|
||||
headers(host: URI::encode("#{username}.neocities.org")).
|
||||
get(url)
|
||||
end
|
||||
|
|
|
@ -62,8 +62,9 @@ class LetsEncryptWorker
|
|||
puts "testing #{challenge_url}"
|
||||
|
||||
begin
|
||||
res = HTTP.timeout(:global, write: 5, connect: 10, read: 10).follow.get(challenge_url)
|
||||
rescue
|
||||
res = HTTP.timeout(:global, write: 5, connect: 10, read: 10).get(challenge_url)
|
||||
rescue => e
|
||||
puts e.inspect
|
||||
puts "error with #{challenge_url}"
|
||||
next
|
||||
end
|
||||
|
@ -130,7 +131,7 @@ class LetsEncryptWorker
|
|||
end
|
||||
end
|
||||
|
||||
if verified_domains.empty? || (site.created_at >= 2017 && !verified_domains.include?(domain_raw))
|
||||
if verified_domains.empty? || (site.created_at.year >= 2017 && !verified_domains.include?(domain_raw))
|
||||
if @international_domain
|
||||
puts "still waiting on IDN support, ignoring failure for now"
|
||||
clean_wellknown_turds site
|
||||
|
|
Loading…
Add table
Reference in a new issue