Primitive spam filter
This commit is contained in:
parent
9f36bd59a9
commit
7ab0f052f3
2 changed files with 34 additions and 1 deletions
|
@ -2,3 +2,14 @@ Dependencies.mechanism = :require
|
|||
ActionController::Base.consider_all_requests_local = false
|
||||
ActionController::Base.perform_caching = false
|
||||
|
||||
|
||||
spam_patterns_filename = RAILS_ROOT + '/config/spam_patterns.txt'
|
||||
if File.exists? spam_patterns_filename
|
||||
SPAM_PATTERNS = File.readlines(spam_patterns_filename).select { |line| line != '' }.map {
|
||||
|line| Regexp.new(line) }
|
||||
end
|
||||
|
||||
blocked_ips_filename = RAILS_ROOT + '/config/blocked_ips.txt'
|
||||
if File.exists? blocked_ips_filename
|
||||
BLOCKED_IPS = File.readlines(blocked_ips_filename).select { |line| line != '' }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue