mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Remove lib
folder from autoload path
- Load extensions explicitly
This commit is contained in:
parent
9ea5b54f5c
commit
30ac973f96
12 changed files with 25 additions and 25 deletions
|
@ -1,5 +1,4 @@
|
|||
class EppController < ApplicationController
|
||||
include Iptable
|
||||
layout false
|
||||
protect_from_forgery with: :null_session
|
||||
skip_before_action :verify_authenticity_token
|
||||
|
@ -407,4 +406,20 @@ class EppController < ApplicationController
|
|||
timeout = 5.minutes
|
||||
epp_session.updated_at < (Time.zone.now - timeout)
|
||||
end
|
||||
|
||||
def counter_update(registrar_code, ip)
|
||||
counter_proc = "/proc/net/xt_recent/#{registrar_code}"
|
||||
|
||||
begin
|
||||
File.open(counter_proc, 'a') do |f|
|
||||
f.puts "+#{ip}"
|
||||
end
|
||||
rescue Errno::ENOENT => e
|
||||
logger.error "IPTABLES COUNTER UPDATE: cannot open #{counter_proc}: #{e}"
|
||||
rescue Errno::EACCES => e
|
||||
logger.error "IPTABLES COUNTER UPDATE: no permission #{counter_proc}: #{e}"
|
||||
rescue IOError => e
|
||||
logger.error "IPTABLES COUNTER UPDATE: cannot write #{ip} to #{counter_proc}: #{e}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue