Merge branch 'master' into 108869472-objects_archive

This commit is contained in:
Stas Paaslane 2016-08-04 19:22:08 +03:00
commit 305333d6c9
29 changed files with 202 additions and 142 deletions

View file

@ -1,5 +1,33 @@
20.05.2016 14.07.2016
* Registry:
* whois records generation fix in contact.rb model (#117612931)
* english translation fix for pending_update_notification_for_new_registrant automated registrant message
16.06.2016
* EPP
* BUG: XML syntax error for poll and logout if optional clTRID is missing (#121580929)
* support for glue records with ipv6 addresses only (#120095555)
15.06.2016
* Portal for registrants
* Notice on login screen on limited access to Estonian electronic IDs (#120182999)
* Admin interface:
* epp log view has now reference to the object name for better usability (#118912395)
* BUG: dnssec data missing from domain history view (#115762063)
* BUG: internal error in doamin history view in case some contact has been deleted (#118300251)
* Registry:
* all values sent over epp are now trimmed of beginning and trailing spaces (#117690107)
* typo and form fixes for automated e-mail messages sent to domain contacts
* EPP:
* BUG: error 2005 on adding IDN nameservers (#114677695)
* BUG: nameserver lable maximum 63 char length validation handled inproperly (#114677695) - support currently limited to Estonian IDN characters.
* BUG: validation passes out of range ident_type values - now limited to org, priv and birthday (#111601356)
* BUG: internal error on hello (#120828283)
* BUG: internal error broken incoming frame (#121580929)
* Deploy:
* BUG: incorrect version in commit message on deploy - config/deploy-example.rb (#120259603)
20.05.2016
* Portal for registrars * Portal for registrars
* domain details view new displays contact name in addition to ID (#117226457) * domain details view new displays contact name in addition to ID (#117226457)
* added an option to set veryfied = "yes" parameter to GUI for registrant change and domain delete opertions (#116209751) * added an option to set veryfied = "yes" parameter to GUI for registrant change and domain delete opertions (#116209751)

View file

@ -31,7 +31,7 @@ gem 'rails-settings-cached', '0.4.1' # for settings
# html-xml # html-xml
gem 'haml-rails', '0.9.0' # haml for views gem 'haml-rails', '0.9.0' # haml for views
gem 'nokogiri', '1.6.7.2' # For XML parsing gem 'nokogiri', '1.6.8' # For XML parsing
# style # style
gem 'sass-rails', '5.0.3' # sass style gem 'sass-rails', '5.0.3' # sass style

View file

@ -316,7 +316,7 @@ GEM
mina (0.3.1) mina (0.3.1)
open4 (~> 1.3.4) open4 (~> 1.3.4)
rake rake
mini_portile2 (2.0.0) mini_portile2 (2.1.0)
minitest (5.8.4) minitest (5.8.4)
monetize (1.1.0) monetize (1.1.0)
money (~> 6.5.0) money (~> 6.5.0)
@ -332,8 +332,9 @@ GEM
nenv (0.2.0) nenv (0.2.0)
netrc (0.11.0) netrc (0.11.0)
newrelic_rpm (3.12.0.288) newrelic_rpm (3.12.0.288)
nokogiri (1.6.7.2) nokogiri (1.6.8)
mini_portile2 (~> 2.0.0.rc2) mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
nori (2.6.0) nori (2.6.0)
notiffany (0.0.7) notiffany (0.0.7)
nenv (~> 0.1) nenv (~> 0.1)
@ -348,6 +349,7 @@ GEM
phantomjs (1.9.8.0) phantomjs (1.9.8.0)
phantomjs-binaries (1.9.2.4) phantomjs-binaries (1.9.2.4)
sys-uname (= 0.9.0) sys-uname (= 0.9.0)
pkg-config (1.1.7)
poltergeist (1.6.0) poltergeist (1.6.0)
capybara (~> 2.1) capybara (~> 2.1)
cliver (~> 0.3.1) cliver (~> 0.3.1)
@ -619,7 +621,7 @@ DEPENDENCIES
mina (= 0.3.1) mina (= 0.3.1)
money-rails (= 1.4.1) money-rails (= 1.4.1)
newrelic_rpm (= 3.12.0.288) newrelic_rpm (= 3.12.0.288)
nokogiri (= 1.6.7.2) nokogiri (= 1.6.8)
nprogress-rails (= 0.1.6.7) nprogress-rails (= 0.1.6.7)
paper_trail! paper_trail!
pdfkit (= 0.6.2) pdfkit (= 0.6.2)

View file

@ -35,7 +35,7 @@ module Repp
error! I18n.t('errors.messages.epp_authorization_error'), 401 unless domain.auth_info.eql? request.headers['Auth-Code'] error! I18n.t('errors.messages.epp_authorization_error'), 401 unless domain.auth_info.eql? request.headers['Auth-Code']
contact_repp_json = proc{|contact| contact_repp_json = proc{|contact|
contact.attributes.slice("code", "name", "ident", "ident_type", "ident_country_code", "phone", "email", "street", "city", "zip","country_code", "statuses") contact.as_json.slice("code", "name", "ident", "ident_type", "ident_country_code", "phone", "email", "street", "city", "zip","country_code", "statuses")
} }
@response = { @response = {

View file

@ -2,6 +2,9 @@ $(document).on 'page:change', ->
$('.selectize').selectize({ $('.selectize').selectize({
allowEmptyOption: true allowEmptyOption: true
}) })
$('.selectize_create').selectize({
allowEmptyOption: true, create: true
})
$('.js-datepicker').datepicker({ $('.js-datepicker').datepicker({
showAnim: "", showAnim: "",

View file

@ -10,21 +10,13 @@ class Admin::ContactsController < AdminController
search_params[:registrant_domains_id_not_null] = 1 search_params[:registrant_domains_id_not_null] = 1
end end
@q = Contact.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name').search(search_params)
@contacts = @q.result(distinct: :true).page(params[:page])
if params[:statuses_contains]
contacts = Contact.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name').where(
"contacts.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}"
)
else
contacts = Contact.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name') contacts = Contact.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name')
end contacts = contacts.filter_by_states(params[:statuses_contains].join(',')) if params[:statuses_contains]
contacts = contacts.where("ident_country_code is null or ident_country_code=''") if params[:only_no_country_code].eql?('1') contacts = contacts.where("ident_country_code is null or ident_country_code=''") if params[:only_no_country_code].eql?('1')
normalize_search_parameters do normalize_search_parameters do
@q = contacts.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name').search(search_params) @q = contacts.search(search_params)
@contacts = @q.result.uniq.page(params[:page]) @contacts = @q.result.uniq.page(params[:page])
end end

View file

@ -51,6 +51,7 @@ class Admin::SettingsController < AdminController
:admin_contacts_max_count, :admin_contacts_max_count,
:tech_contacts_min_count, :tech_contacts_min_count,
:tech_contacts_max_count, :tech_contacts_max_count,
:orphans_contacts_in_months,
:ds_digest_type, :ds_digest_type,
:dnskeys_min_count, :dnskeys_min_count,
:dnskeys_max_count, :dnskeys_max_count,

View file

@ -56,4 +56,8 @@ class Epp::KeyrelaysController < EppController
# domain # domain
end end
def resource
@domain
end
end end

View file

@ -54,4 +54,8 @@ class Epp::PollsController < EppController
def validate_poll def validate_poll
requires_attribute 'poll', 'op', values: %(ack req), allow_blank: true requires_attribute 'poll', 'op', values: %(ack req), allow_blank: true
end end
def resource
@message
end
end end

View file

@ -137,4 +137,9 @@ class Epp::SessionsController < EppController
pw = params[:parsed_frame].css('pw').first.text pw = params[:parsed_frame].css('pw').first.text
{ username: user, password: pw } { username: user, password: pw }
end end
private
def resource
@api_user
end
end end

View file

@ -6,8 +6,15 @@ class EppController < ApplicationController
before_action :generate_svtrid before_action :generate_svtrid
before_action :latin_only before_action :latin_only
before_action :validate_against_schema before_action :validate_against_schema
before_action :validate_request
before_action :update_epp_session
around_action :catch_epp_errors
helper_method :current_user
helper_method :resource
def validate_against_schema def validate_against_schema
return if ['hello', 'error', 'keyrelay'].include?(params[:action]) return if ['hello', 'error', 'keyrelay'].include?(params[:action])
schema.validate(params[:nokogiri_frame]).each do |error| schema.validate(params[:nokogiri_frame]).each do |error|
@ -20,10 +27,7 @@ class EppController < ApplicationController
handle_errors and return if epp_errors.any? handle_errors and return if epp_errors.any?
end end
before_action :validate_request
before_action :update_epp_session
around_action :catch_epp_errors
def catch_epp_errors def catch_epp_errors
err = catch(:epp_error) do err = catch(:epp_error) do
yield yield
@ -34,7 +38,6 @@ class EppController < ApplicationController
handle_errors handle_errors
end end
helper_method :current_user
rescue_from StandardError do |e| rescue_from StandardError do |e|
@errors ||= [] @errors ||= []
@ -367,7 +370,7 @@ class EppController < ApplicationController
request: trimmed_request, request: trimmed_request,
request_command: request_command, request_command: request_command,
request_successful: epp_errors.empty?, request_successful: epp_errors.empty?,
request_object: params[:epp_object_type], request_object: resource ? "#{params[:epp_object_type]}: #{resource.class} - #{resource.id} - #{resource.name}" : params[:epp_object_type],
response: @response, response: @response,
api_user_name: @api_user.try(:username) || current_user.try(:username) || 'api-public', api_user_name: @api_user.try(:username) || current_user.try(:username) || 'api-public',
api_user_registrar: @api_user.try(:registrar).try(:to_s) || current_user.try(:registrar).try(:to_s), api_user_registrar: @api_user.try(:registrar).try(:to_s) || current_user.try(:registrar).try(:to_s),
@ -383,4 +386,9 @@ class EppController < ApplicationController
return if current_user.blank? return if current_user.blank?
counter_update(current_user.registrar_code, ENV['iptables_server_ip']) counter_update(current_user.registrar_code, ENV['iptables_server_ip'])
end end
def resource
name = self.class.to_s.sub("Epp::","").sub("Controller","").underscore.singularize
instance_variable_get("@#{name}")
end
end end

View file

@ -42,13 +42,8 @@ class Registrar::ContactsController < Registrar::DeppController # EPP controller
@contacts = Contact.find_by(name: params[:q][:name_matches]) @contacts = Contact.find_by(name: params[:q][:name_matches])
end end
if params[:statuses_contains]
contacts = current_user.registrar.contacts.includes(:registrar).where(
"contacts.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}"
)
else
contacts = current_user.registrar.contacts.includes(:registrar) contacts = current_user.registrar.contacts.includes(:registrar)
end contacts = contacts.filter_by_states(params[:statuses_contains]) if params[:statuses_contains]
normalize_search_parameters do normalize_search_parameters do
@q = contacts.search(params[:q]) @q = contacts.search(params[:q])

View file

@ -62,6 +62,10 @@ class ApiUser < User
username username
end end
def name
username
end
def queued_messages def queued_messages
registrar.messages.queued registrar.messages.queued
end end

View file

@ -36,12 +36,10 @@ class Contact < ActiveRecord::Base
validate :val_ident_type validate :val_ident_type
validate :val_ident_valid_format? validate :val_ident_valid_format?
validate :uniq_statuses?
validate :validate_html validate :validate_html
validate :val_country_code validate :val_country_code
after_initialize do after_initialize do
self.statuses = [] if statuses.nil?
self.status_notes = {} if status_notes.nil? self.status_notes = {} if status_notes.nil?
self.ident_updated_at = Time.zone.now if new_record? && ident_updated_at.blank? self.ident_updated_at = Time.zone.now if new_record? && ident_updated_at.blank?
end end
@ -64,16 +62,6 @@ class Contact < ActiveRecord::Base
end end
end end
before_save :manage_statuses
def manage_statuses
if domain_transfer # very ugly but need better workflow
self.statuses = statuses | [OK, LINKED]
return
end
manage_linked
manage_ok
end
after_save :update_related_whois_records after_save :update_related_whois_records
@ -176,7 +164,7 @@ class Contact < ActiveRecord::Base
end end
def find_orphans def find_orphans
Contact.where(' where('
NOT EXISTS( NOT EXISTS(
select 1 from domains d where d.registrant_id = contacts.id select 1 from domains d where d.registrant_id = contacts.id
) AND NOT EXISTS( ) AND NOT EXISTS(
@ -185,20 +173,49 @@ class Contact < ActiveRecord::Base
') ')
end end
def find_linked
where('
EXISTS(
select 1 from domains d where d.registrant_id = contacts.id
) OR EXISTS(
select 1 from domain_contacts dc where dc.contact_id = contacts.id
)
')
end
def filter_by_states in_states
states = Array(in_states).dup
scope = all
# all contacts has state ok, so no need to filter by it
scope = scope.where("NOT contacts.statuses && ?::varchar[]", "{#{(STATUSES - [OK, LINKED]).join(',')}}") if states.delete(OK)
scope = scope.find_linked if states.delete(LINKED)
scope = scope.where("contacts.statuses @> ?::varchar[]", "{#{states.join(',')}}") if states.any?
scope
end
# To leave only new ones we need to check
# if contact was at any time used in domain.
# This can be checked by domain history.
# This can be checked by saved relations in children attribute
def destroy_orphans def destroy_orphans
STDOUT << "#{Time.zone.now.utc} - Destroying orphaned contacts\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} - Destroying orphaned contacts\n" unless Rails.env.test?
orphans = find_orphans counter = Counter.new
find_orphans.find_each do |contact|
unless Rails.env.test? ver_scope = []
orphans.each do |m| %w(admin_contacts tech_contacts registrant).each do |type|
STDOUT << "#{Time.zone.now.utc} Contact.destroy_orphans: ##{m.id} (#{m.name})\n" ver_scope << "(children->'#{type}')::jsonb <@ json_build_array(#{contact.id})::jsonb"
end end
next if DomainVersion.where("created_at > ?", Time.now - Setting.orphans_contacts_in_months.to_i.months).where(ver_scope.join(" OR ")).any?
next if contact.domains_present?
contact.destroy
counter.next
STDOUT << "#{Time.zone.now.utc} Contact.destroy_orphans: ##{contact.id} (#{contact.name})\n"
end end
count = orphans.destroy_all.count STDOUT << "#{Time.zone.now.utc} - Successfully destroyed #{counter} orphaned contacts\n" unless Rails.env.test?
STDOUT << "#{Time.zone.now.utc} - Successfully destroyed #{count} orphaned contacts\n" unless Rails.env.test?
end end
def privs def privs
@ -239,6 +256,23 @@ class Contact < ActiveRecord::Base
"EIS-#{id}" "EIS-#{id}"
end end
# kind of decorator in order to always return statuses
# if we use separate decorator, then we should add it
# to too many places
def statuses
calculated = Array(read_attribute(:statuses))
calculated.delete(Contact::OK)
calculated.delete(Contact::LINKED)
calculated << Contact::OK if calculated.empty?# && valid?
calculated << Contact::LINKED if domains_present?
calculated.uniq
end
def statuses= arr
write_attribute(:statuses, Array(arr).uniq)
end
def to_s def to_s
name || '[no name]' name || '[no name]'
end end
@ -278,11 +312,6 @@ class Contact < ActiveRecord::Base
end end
end end
def uniq_statuses?
return true unless statuses.detect { |s| statuses.count(s) > 1 }
errors.add(:statuses, :not_uniq)
false
end
def org? def org?
ident_type == ORG ident_type == ORG
@ -412,13 +441,6 @@ class Contact < ActiveRecord::Base
domain_contacts.present? || registrant_domains.present? domain_contacts.present? || registrant_domains.present?
end end
def manage_linked
if domains_present?
set_linked
else
unset_linked
end
end
def search_name def search_name
"#{code} #{name}" "#{code} #{name}"
@ -497,43 +519,6 @@ class Contact < ActiveRecord::Base
end end
end end
def set_linked
statuses << LINKED if statuses.detect { |s| s == LINKED }.blank?
end
def unset_linked
statuses.delete_if { |s| s == LINKED }
end
# rubocop:disable Metrics/CyclomaticComplexity
def manage_ok
return unset_ok unless valid?
case statuses.size
when 0
set_ok
when 1
set_ok if statuses == [LINKED]
when 2
return if statuses.sort == [LINKED, OK]
unset_ok
else
unset_ok
end
end
# rubocop:enable Metrics/CyclomaticComplexity
def unset_ok
statuses.delete_if { |s| s == OK }
end
def set_ok
statuses << OK if statuses.detect { |s| s == OK }.blank?
end
def linked?
statuses.include?(LINKED)
end
def update_prohibited? def update_prohibited?
(statuses & [ (statuses & [
@ -562,6 +547,9 @@ class Contact < ActiveRecord::Base
end end
def update_related_whois_records def update_related_whois_records
# not doing anything if no real changes
return if changes.slice(*(self.class.column_names - ["updated_at", "created_at", "statuses", "status_notes"])).empty?
names = related_domain_descriptions.keys names = related_domain_descriptions.keys
UpdateWhoisRecordJob.enqueue(names, :domain) if names.present? UpdateWhoisRecordJob.enqueue(names, :domain) if names.present?
end end

View file

@ -478,7 +478,8 @@ class Domain < ActiveRecord::Base
def validate_nameserver_ips def validate_nameserver_ips
nameservers.to_a.reject(&:marked_for_destruction?).each do |ns| nameservers.to_a.reject(&:marked_for_destruction?).each do |ns|
next unless ns.hostname.end_with?(".#{name}") next unless ns.hostname.end_with?(".#{name}")
next if ns.ipv4.present? next if ns.ipv4.present? || ns.ipv6.present?
errors.add(:nameservers, :invalid) if errors[:nameservers].blank? errors.add(:nameservers, :invalid) if errors[:nameservers].blank?
ns.errors.add(:ipv4, :blank) ns.errors.add(:ipv4, :blank)
end end

View file

@ -39,29 +39,12 @@ class Epp::Domain < Domain
before_save :link_contacts before_save :link_contacts
def link_contacts def link_contacts
# Based on bullet report #TODO: cleanup cache if we think to cache dynamic statuses
if new_record?
# new record does not have correct instance contacts entries thanks to epp
unlinked_contacts = [registrant]
unlinked_contacts << admin_domain_contacts.map(&:contact)
unlinked_contacts << tech_domain_contacts.map(&:contact)
unlinked_contacts.flatten!
else
unlinked_contacts = contacts.select { |c| !c.linked? } # speed up a bit
end
unlinked_contacts.each do |uc|
uc.domains_present = true # no need to fetch domains again
uc.save(validate: false)
end
end end
after_destroy :unlink_contacts after_destroy :unlink_contacts
def unlink_contacts def unlink_contacts
contacts.each do |c| #TODO: cleanup cache if we think to cache dynamic statuses
c.domains_present = false
c.save(validate: false)
end
end end
class << self class << self

View file

@ -12,4 +12,8 @@ class Message < ActiveRecord::Base
self.queued = false self.queued = false
save save
end end
def name
"-"
end
end end

View file

@ -32,7 +32,7 @@ class Nameserver < ActiveRecord::Base
[:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }], [:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }],
[:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }] [:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }]
], ],
'2306' => [ '2003' => [
[:ipv4, :blank] [:ipv4, :blank]
] ]
} }

View file

@ -5,6 +5,7 @@
- if domain.present? - if domain.present?
- if version # normal history - if version # normal history
- epp_req = ApiLog::EppLog.find_by(uuid: version.uuid).try(:request) if version.uuid
- children = HashWithIndifferentAccess.new(version.children) - children = HashWithIndifferentAccess.new(version.children)
- nameservers = Nameserver.all_versions_for(children[:nameservers], version.created_at) - nameservers = Nameserver.all_versions_for(children[:nameservers], version.created_at)
- dnskeys = Dnskey.all_versions_for(children[:dnskeys], version.created_at) - dnskeys = Dnskey.all_versions_for(children[:dnskeys], version.created_at)
@ -13,7 +14,9 @@
- registrant = Contact.all_versions_for(children[:registrant], version.created_at) - registrant = Contact.all_versions_for(children[:registrant], version.created_at)
- event = version.event - event = version.event
- creator = plain_username(version.terminator) - creator = plain_username(version.terminator)
- whodunnit = version.try(:whodunnit)
- else # pending history - else # pending history
- epp_req = false
- nameservers = domain.nameservers - nameservers = domain.nameservers
- dnskeys = domain.dnskeys - dnskeys = domain.dnskeys
- tech_contacts = domain.tech_contacts - tech_contacts = domain.tech_contacts
@ -26,6 +29,7 @@
- registrant = [registrant] - registrant = [registrant]
- creator = pending_user.try(:username) - creator = pending_user.try(:username)
- event = 'pending' - event = 'pending'
- whodunnit = false
%td %td
%p.nowrap %p.nowrap
@ -34,8 +38,14 @@
%br= link_to t(:edit_statuses), edit_admin_domain_path(params[:domain_id]) %br= link_to t(:edit_statuses), edit_admin_domain_path(params[:domain_id])
%p.text-right %p.text-right
- if (event == 'update' || event == 'create') && epp_req
= link_to event, '#', class: 'js-event'
- else
= event = event
%br %br
- if whodunnit
= whodunnit
- else
= creator = creator
- if version - if version
%p.text-right %p.text-right
@ -54,7 +64,7 @@
%br %br
- if domain.pending_json.present? - if domain.pending_json.present?
%p %p
= link_to t(:pending_epp), '#', class: 'js-pending-toggle' = link_to t(:pending_epp), '#', class: 'js-pending'
%td{class: changing_css_class(version, "period", "period_unit", "valid_from", "valid_to")} %td{class: changing_css_class(version, "period", "period_unit", "valid_from", "valid_to")}
%p %p
@ -120,9 +130,15 @@
= link_to admin_registrar_path(domain.registrar), target: "registrar_#{domain.registrar.id}" do = link_to admin_registrar_path(domain.registrar), target: "registrar_#{domain.registrar.id}" do
= domain.registrar.name = domain.registrar.name
- if (event == 'create' || event == 'update') && epp_req
%tr.js-event{ style: 'display: none;' }
%td{colspan: 9}
%pre
= Nokogiri::XML(epp_req)
- if domain.pending_json.present? - if domain.pending_json.present?
%tr.js-pending{ style: 'display: none;' } %tr.js-pending{ style: 'display: none;' }
%td{colspan: 8} %td{colspan: 9}
= preserve do = preserve do
%pre %pre
- formatted_req = Nokogiri::XML(domain.pending_json['frame']) - formatted_req = Nokogiri::XML(domain.pending_json['frame'])

View file

@ -37,9 +37,9 @@
domain: version.reify, version: version.previous domain: version.reify, version: version.previous
:coffee :coffee
$(document).on 'click', '.js-pending-toggle', (e) -> $(document).on 'click', '.js-pending, .js-event', (e) ->
e.preventDefault() e.preventDefault()
$(document).on 'mousedown', '.js-pending-toggle', (e) -> $(document).on 'mousedown', '.js-pending, .js-event', (e) ->
target = $(e.target) target = $(e.target)
target.parents('tr').next('tr.js-pending').toggle() target.parents('tr').nextUntil('tr.small' ,'tr.' + this.className).toggle()

View file

@ -11,8 +11,10 @@
= f.select :request_command_eq, [[t(:choose),''], 'hello', 'login', 'logout', 'info', 'create', 'update', 'delete', 'check', 'renew', 'transfer', 'poll', 'keyrelay'], {}, class: 'form-control selectize', placeholder: t(:choose) = f.select :request_command_eq, [[t(:choose),''], 'hello', 'login', 'logout', 'info', 'create', 'update', 'delete', 'check', 'renew', 'transfer', 'poll', 'keyrelay'], {}, class: 'form-control selectize', placeholder: t(:choose)
.col-md-3 .col-md-3
.form-group .form-group
- opts = [[t(:choose),''], 'contact', 'domain', 'poll', 'keyrelay']
- opts += [params[:q][:request_object_cont]] if params[:q].present? && params[:q][:request_object_cont].present?
= f.label :request_object = f.label :request_object
= f.select :request_object_eq, [[t(:choose),''], 'contact', 'domain', 'poll', 'keyrelay'], {}, class: 'form-control selectize', placeholder: t(:choose) = f.select :request_object_cont, opts, {}, class: 'form-control selectize_create', placeholder: t(:choose)
.col-md-3 .col-md-3
.form-group .form-group
= f.label :request_successful = f.label :request_successful

View file

@ -15,6 +15,7 @@
= render 'setting_row', var: :admin_contacts_max_count = render 'setting_row', var: :admin_contacts_max_count
= render 'setting_row', var: :tech_contacts_min_count = render 'setting_row', var: :tech_contacts_min_count
= render 'setting_row', var: :tech_contacts_max_count = render 'setting_row', var: :tech_contacts_max_count
= render 'setting_row', var: :orphans_contacts_in_months
= render 'setting_row', var: :ds_data_allowed = render 'setting_row', var: :ds_data_allowed
= render 'setting_row', var: :key_data_allowed = render 'setting_row', var: :key_data_allowed
= render 'setting_row', var: :dnskeys_min_count = render 'setting_row', var: :dnskeys_min_count

View file

@ -30,6 +30,8 @@ Hi,
<br><br> <br><br>
Registrant change process for the domain <%= @params[:name] %> has been started. Registrant change process for the domain <%= @params[:name] %> has been started.
<br><br> <br><br>
Please verify the details of the following change request. In case of problems contact your registrar <%= @params[:registrar_name] %>
<br><br>
New registrant:<br> New registrant:<br>
Name: <%= @params[:registrant_name] %><br> Name: <%= @params[:registrant_name] %><br>
<% if @params[:registrant_priv] %> <% if @params[:registrant_priv] %>
@ -41,7 +43,11 @@ Street: <%= @params[:registrant_street] %><br>
City: <%= @params[:registrant_city] %><br> City: <%= @params[:registrant_city] %><br>
Country: <%= @params[:registrant_country] %> Country: <%= @params[:registrant_country] %>
<br><br> <br><br>
Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions. The registrant change procedure will be completed only after the current registrant <%= @params[:old_registrant_name] %> has approved it.
<br><br>
Change request will be cancelled in case <%= @params[:old_registrant_name] %> rejects or does not approve it in <%= Setting.expire_pending_confirmation %> hours.
<br><br>
Please contact registrar <%= @params[:registrar_name] %> in case of questions. You can find the registrar's contacts at http://internet.ee/registrars.
<br><br> <br><br>
Best Regards,<br> Best Regards,<br>
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -30,6 +30,8 @@ Hi,
Registrant change process for the domain <%= @params[:name] %> has been started. Registrant change process for the domain <%= @params[:name] %> has been started.
Please verify the details of the following change request. In case of problems contact your registrar <%= @params[:registrar_name] %>
New registrant: New registrant:
Name: <%= @params[:registrant_name] %> Name: <%= @params[:registrant_name] %>
<% if @params[:registrant_priv] %> <% if @params[:registrant_priv] %>
@ -41,7 +43,11 @@ Street: <%= @params[:registrant_street] %>
City: <%= @params[:registrant_city] %> City: <%= @params[:registrant_city] %>
Country: <%= @params[:registrant_country] %> Country: <%= @params[:registrant_country] %>
Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions. The registrant change procedure will be completed only after the current registrant <%= @params[:old_registrant_name] %> has approved it.
Change request will be cancelled in case <%= @params[:old_registrant_name] %> rejects or does not approve it in <%= Setting.expire_pending_confirmation %> hours.
Please contact registrar <%= @params[:registrar_name] %> in case of questions. You can find the registrar's contacts at http://internet.ee/registrars.
Best Regards, Best Regards,
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -10,6 +10,7 @@ if con.present? && con.table_exists?('settings')
Setting.save_default(:admin_contacts_max_count, 10) Setting.save_default(:admin_contacts_max_count, 10)
Setting.save_default(:tech_contacts_min_count, 1) Setting.save_default(:tech_contacts_min_count, 1)
Setting.save_default(:tech_contacts_max_count, 10) Setting.save_default(:tech_contacts_max_count, 10)
Setting.save_default(:orphans_contacts_in_months, 6)
Setting.save_default(:expire_pending_confirmation, 48) Setting.save_default(:expire_pending_confirmation, 48)
Setting.save_default(:ds_digest_type, 2) Setting.save_default(:ds_digest_type, 2)

View file

@ -136,7 +136,7 @@ en:
taken: 'Nameserver already exists on this domain' taken: 'Nameserver already exists on this domain'
puny_to_long: 'Hostname puny label is too long (maximum is 63 characters)' puny_to_long: 'Hostname puny label is too long (maximum is 63 characters)'
ipv4: ipv4:
blank: 'IPv4 is missing' blank: 'IP is missing'
invalid: 'IPv4 is invalid' invalid: 'IPv4 is invalid'
ipv6: ipv6:
invalid: 'IPv6 is invalid' invalid: 'IPv6 is invalid'
@ -738,13 +738,13 @@ en:
no_invoices_were_binded: 'No invoices were binded' no_invoices_were_binded: 'No invoices were binded'
domain_general_help: domain_general_help:
<b>The Administrative Contact</b> <b>The Administrative Contact</b>
is an Estonian citizen or a citizen of another country in the European Union, European Economic Area or the Swiss Confederation with a registered place of residence in Estonia and an Estonian personal identification code who has the right to represent the registering entity in accordance with the current legislation of the Republic of Estonia (member of the management board) or on the basis of the written authorisation issued by a member of the management board. The Administrative Contact has the right to sign and submit in the name of the registering entity any applications connected with the domain name and also to receive and forward any information concerning the domain name(s). The Administrative Contact is responsible for the correctness and authenticity of the data and documents submitted about itself and the registering entity. is a natural person who is a legal representative of the Registrant or whom the Registrant has authorised in writing (authorised representative). The Administrative Contact does not have the right to delegate the authorisation. The Administrative Contact has the right to sign and submit Domain Name-related applications on behalf of the Registrant and to receive and forward any information pertaining to the Domain Name(s). The Administrative Contact is responsible for the correctness and genuiness of the data and documents submitted by him/her about the Registrant and about himself/herself. Registrant is obliged to guarantee that the person appointed as the Administrative Contact agrees to fulfil the duties of and Administrative Contact. There may be more than one person in this role (the registry system allows of up to 10 Administrative Contacts)
domain_admin_contact_help: domain_admin_contact_help:
<b>The Technical Contact</b> <b>The Technical Contact</b>
is a person who has the right to modify only such domain name server data that is connected with it. If the domain registering entity is using a website hosting service, it is recommended to register as the Technical Contact a representative of the corresponding provider company. If the domain registering entity manages its own servers, it can register itself as the Technical Contact. is a natural or legal person who, in the name of the Registrant, adds, changes or removes entries of the authoritative Name Servers for that particular domain and its DNSSEC records. The Technical Contact does not have the right to represent the Registrant in other registration services. The Registrant is obliged to guarantee that the person appointed as the Technical Contact agrees to fulfil the duties of and Technical Contact. There may be more than one person in this role (the registry system allows of up to 10 Technical Contacts)
domain_tech_contact_help: domain_tech_contact_help:
<b>The domain name server</b> <b>The domain name server</b>
is a computer that saves and forwards via a general-access data communications network such data that is connected with the domain name and corresponding IP addresses. Your IT helpdesk or Internet service provider will have the necessary information about the domain name servers. refers to the computer that saves and forwards notices related to the Domain Names and their corresponding IP addresses in the Internet.
account_activity: 'Account activity' account_activity: 'Account activity'
account_activities: 'Account activities' account_activities: 'Account activities'
receipt_date: 'Receipt date' receipt_date: 'Receipt date'
@ -959,4 +959,4 @@ en:
verified_confirm: 'Verified status is for cases when current registrant is the one applying for the update. Legal document signed by the registrant is required. Are you sure this update is properly verified with the registrant?' verified_confirm: 'Verified status is for cases when current registrant is the one applying for the update. Legal document signed by the registrant is required. Are you sure this update is properly verified with the registrant?'
verified: 'Verified' verified: 'Verified'
only_estonian_residets_can_signin: "Access currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID." only_estonian_residets_can_signin: "Access currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID."
deleted: 'Deleted' deleted: 'Deleted' cant_match_version: 'Impossible match version with request'

View file

@ -0,0 +1,6 @@
class ChangeContactStatusesDefault < ActiveRecord::Migration
def change
change_column_default :contacts, :statuses, []
Contact.where(statuses: nil). update_all(statuses: [])
end
end

View file

@ -11,8 +11,8 @@ class EppConstraint
# creates parsed_frame, detects epp request object # creates parsed_frame, detects epp request object
def matches?(request) def matches?(request)
# TODO: Maybe move this to controller to keep params clean # TODO: Maybe move this to controller to keep params clean
request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/) { |s| s.strip} request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/) { |s| s.strip} if request.params[:raw_frame]
request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame]) request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame] || request.params[:frame])
request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces! request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
unless [:keyrelay, :poll, :session, :not_found].include?(@type) unless [:keyrelay, :poll, :session, :not_found].include?(@type)