Remove lib folder from autoload path

- Load extensions explicitly
This commit is contained in:
Artur Beljajev 2018-06-05 17:26:14 +03:00
parent 9ea5b54f5c
commit 30ac973f96
12 changed files with 25 additions and 25 deletions

View file

@ -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