mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
parent
3b28d91381
commit
e70c84b280
4 changed files with 9 additions and 18 deletions
|
@ -10,7 +10,6 @@ require 'sprockets/railtie'
|
||||||
require 'csv'
|
require 'csv'
|
||||||
require 'rails/all'
|
require 'rails/all'
|
||||||
# require "rails/test_unit/railtie"
|
# require "rails/test_unit/railtie"
|
||||||
require_relative '../lib/registry_log_formatter'
|
|
||||||
|
|
||||||
# Require the gems listed in Gemfile, including any gems
|
# Require the gems listed in Gemfile, including any gems
|
||||||
# you've limited to :test, :development, or :production.
|
# you've limited to :test, :development, or :production.
|
||||||
|
@ -79,8 +78,6 @@ module Registry
|
||||||
domain: ENV['smtp_domain'],
|
domain: ENV['smtp_domain'],
|
||||||
openssl_verify_mode: ENV['smtp_openssl_verify_mode']
|
openssl_verify_mode: ENV['smtp_openssl_verify_mode']
|
||||||
}
|
}
|
||||||
|
|
||||||
config.log_formatter = RegistryLogFormatter.new # Only works if placed in application.rb
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,9 @@ Rails.application.configure do
|
||||||
# Disable automatic flushing of the log to improve performance.
|
# Disable automatic flushing of the log to improve performance.
|
||||||
# config.autoflush_log = false
|
# config.autoflush_log = false
|
||||||
|
|
||||||
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||||
|
config.log_formatter = ::Logger::Formatter.new
|
||||||
|
|
||||||
# Do not dump schema after migrations.
|
# Do not dump schema after migrations.
|
||||||
config.active_record.dump_schema_after_migration = false
|
config.active_record.dump_schema_after_migration = false
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
config.filter_parameters += [:password, :nokogiri_frame, :parsed_frame]
|
config.filter_parameters += [:password, /^frame$/, /^nokogiri_frame$/, /^parsed_frame$/]
|
||||||
config.filter_parameters << lambda do |key, value|
|
config.filter_parameters << lambda do |key, value|
|
||||||
value.to_s.gsub!(/pw>.+<\//, 'pw>[FILTERED]</') if key =~ /^(frame|raw_frame)$/i
|
if key == 'raw_frame'
|
||||||
|
value.to_s.gsub!(/pw>.+<\//, 'pw>[FILTERED]</')
|
||||||
|
value.to_s.gsub!(/<eis:legalDocument([^>]+)>([^<])+<\/eis:legalDocument>/,
|
||||||
|
"<eis:legalDocument>[FILTERED]</eis:legalDocument>")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
class RegistryLogFormatter < ::Logger::Formatter
|
|
||||||
def call(severity, timestamp, progname, msg)
|
|
||||||
msg = filter_epp_legal_document(msg)
|
|
||||||
"#{msg}\n"
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def filter_epp_legal_document(msg)
|
|
||||||
msg.gsub(/<eis:legalDocument([^>]+)>([^<])+<\/eis:legalDocument>/,
|
|
||||||
"<eis:legalDocument>[FILTERED]</eis:legalDocument>")
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Add table
Add a link
Reference in a new issue