mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 13:15:40 +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
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
require 'countries'
|
||||
require 'action_view'
|
||||
|
||||
class SortedCountry
|
||||
class << self
|
||||
include ActionView::Helpers
|
|
@ -40,8 +40,8 @@ module DomainNameRegistry
|
|||
|
||||
# Autoload all model subdirs
|
||||
config.autoload_paths += Dir[Rails.root.join('app', 'models', '**/')]
|
||||
config.autoload_paths << Rails.root.join('lib')
|
||||
config.eager_load_paths << config.root.join('lib', 'validators')
|
||||
config.watchable_dirs['lib'] = %i[rb]
|
||||
|
||||
# Add the fonts path
|
||||
config.assets.paths << Rails.root.join('vendor', 'assets', 'fonts')
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'devise_custom_failure'
|
||||
|
||||
# Use this hook to configure devise mailer, warden hooks and so forth.
|
||||
# Many of these configuration options can be set straight in your model.
|
||||
Devise.setup do |config|
|
||||
|
|
4
config/initializers/ext.rb
Normal file
4
config/initializers/ext.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
require 'core_ext/array'
|
||||
require 'gem_ext/builder'
|
||||
require 'gem_ext/i18n'
|
||||
require 'gem_ext/paper_trail'
|
|
@ -1 +0,0 @@
|
|||
Dir[File.join(Rails.root, 'lib', 'ext', '*.rb')].each { |x| require x }
|
|
@ -1,4 +1,4 @@
|
|||
require 'epp_constraint'
|
||||
require_dependency 'epp_constraint'
|
||||
|
||||
Rails.application.routes.draw do
|
||||
namespace(:epp, defaults: { format: :xml }) do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Don't raise error when nil
|
||||
# http://stackoverflow.com/questions/9467034/rails-i18n-how-to-handle-case-of-a-nil-date-being-passed-ie-lnil
|
||||
# http://stackoverflow.com/questions/9467034/rails-i18n-how-to-handle-case-of-a-nil-date-being-passed-ie-lnil
|
||||
module I18n
|
||||
class << self
|
||||
alias_method :original_localize, :localize
|
|
@ -1,17 +0,0 @@
|
|||
module Iptable
|
||||
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