mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
fixes tests, quiet sidekiq client logger
This commit is contained in:
parent
74f5ef31d9
commit
4b94fc65bf
2 changed files with 21 additions and 16 deletions
|
@ -44,6 +44,7 @@ Sidekiq.configure_server do |config|
|
||||||
end
|
end
|
||||||
|
|
||||||
Sidekiq.configure_client do |config|
|
Sidekiq.configure_client do |config|
|
||||||
|
config.logger = nil
|
||||||
config.redis = sidekiq_redis_config
|
config.redis = sidekiq_redis_config
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ class Site < Sequel::Model
|
||||||
/PHP\.Hide/
|
/PHP\.Hide/
|
||||||
]
|
]
|
||||||
|
|
||||||
SPAM_MATCH_REGEX = /#{$config['spam_smart_filter'].join('|')}/i
|
SPAM_MATCH_REGEX = ENV['RACK_ENV'] == 'test' ? /pillz/ : /#{$config['spam_smart_filter'].join('|')}/i
|
||||||
|
|
||||||
EMAIL_SANITY_REGEX = /.+@.+\..+/i
|
EMAIL_SANITY_REGEX = /.+@.+\..+/i
|
||||||
|
|
||||||
|
@ -344,22 +344,26 @@ class Site < Sequel::Model
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
open(uploaded.path) { |f| matches = f.grep SPAM_MATCH_REGEX }
|
if File.extname(relative_path).match /\.#{EDITABLE_FILE_EXT}/
|
||||||
|
open(uploaded.path) {|f|
|
||||||
|
matches = f.grep SPAM_MATCH_REGEX
|
||||||
|
|
||||||
if !matches.empty?
|
if !matches.empty?
|
||||||
EmailWorker.perform_async({
|
EmailWorker.perform_async({
|
||||||
from: 'web@neocities.org',
|
from: 'web@neocities.org',
|
||||||
reply_to: email,
|
reply_to: email,
|
||||||
to: 'spam@neocities.org',
|
to: 'spam@neocities.org',
|
||||||
subject: "[Neocities SPAM]: #{username}",
|
subject: "[Neocities SPAM]: #{username}",
|
||||||
body: %{
|
body: %{
|
||||||
#{username}
|
#{username}
|
||||||
<br>
|
<br>
|
||||||
https://#{self.host}#{relative_path}
|
https://#{self.host}#{relative_path}
|
||||||
<br>
|
<br>
|
||||||
<a href="https://#{self.host}/#{relative_path}">link</a>
|
<a href="https://#{self.host}/#{relative_path}">link</a>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
pathname = Pathname(path)
|
pathname = Pathname(path)
|
||||||
|
|
Loading…
Add table
Reference in a new issue