mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 18:59:38 +02:00
Merge branch 'alpha' into staging
This commit is contained in:
commit
185959f440
10 changed files with 266 additions and 9 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
22.06.2015
|
||||||
|
* Update zonefile
|
||||||
|
|
||||||
16.06.2015
|
16.06.2015
|
||||||
|
|
||||||
* Application time_zone should be defined at application.yml, updated application-exaple.yml
|
* Application time_zone should be defined at application.yml, updated application-exaple.yml
|
||||||
|
|
|
@ -56,7 +56,10 @@ class Registrant::SessionsController < Devise::SessionsController
|
||||||
session[:user_country] = response.user_country
|
session[:user_country] = response.user_country
|
||||||
session[:user_id_code] = response.user_id_code
|
session[:user_id_code] = response.user_id_code
|
||||||
session[:mid_session_code] = client.session_code
|
session[:mid_session_code] = client.session_code
|
||||||
render json: { message: t(:check_your_phone_for_confirmation_code) }, status: :ok
|
|
||||||
|
render json: {
|
||||||
|
message: t(:confirmation_sms_was_sent_to_your_phone_verification_code_is, { code: response.challenge_id })
|
||||||
|
}, status: :ok
|
||||||
else
|
else
|
||||||
render json: { message: t(:no_such_user) }, status: :unauthorized
|
render json: { message: t(:no_such_user) }, status: :unauthorized
|
||||||
end
|
end
|
||||||
|
|
|
@ -111,7 +111,10 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
if @user.persisted?
|
if @user.persisted?
|
||||||
session[:user_id_code] = response.user_id_code
|
session[:user_id_code] = response.user_id_code
|
||||||
session[:mid_session_code] = client.session_code
|
session[:mid_session_code] = client.session_code
|
||||||
render json: { message: t(:check_your_phone_for_confirmation_code) }, status: :ok
|
|
||||||
|
render json: {
|
||||||
|
message: t(:confirmation_sms_was_sent_to_your_phone_verification_code_is, { code: response.challenge_id })
|
||||||
|
}, status: :ok
|
||||||
else
|
else
|
||||||
render json: { message: t(:no_such_user) }, status: :unauthorized
|
render json: { message: t(:no_such_user) }, status: :unauthorized
|
||||||
end
|
end
|
||||||
|
|
5
app/models/legacy/zone_ns.rb
Normal file
5
app/models/legacy/zone_ns.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
module Legacy
|
||||||
|
class ZoneNs < Db
|
||||||
|
self.table_name = :zone_ns
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,3 +1,4 @@
|
||||||
if !Rails.env.test? && ENV['new_relic_app_name'].present?
|
if !Rails.env.test? && ENV['new_relic_app_name'].present?
|
||||||
|
require 'newrelic'
|
||||||
NewRelic::Agent.config[:app_name] = "#{ENV['new_relic_app_name']} - #{Rails.env}"
|
NewRelic::Agent.config[:app_name] = "#{ENV['new_relic_app_name']} - #{Rails.env}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -513,7 +513,7 @@ en:
|
||||||
log_in: 'Log in'
|
log_in: 'Log in'
|
||||||
phone_no: 'Phone number'
|
phone_no: 'Phone number'
|
||||||
log_in_with_mid: 'Log in with mobile-id'
|
log_in_with_mid: 'Log in with mobile-id'
|
||||||
check_your_phone_for_confirmation_code: 'Check your phone for confirmation code'
|
confirmation_sms_was_sent_to_your_phone_verification_code_is: 'Confirmation sms was sent to your phone. Verification code is %{code}.'
|
||||||
user_signature_is_invalid: 'User signature is invalid'
|
user_signature_is_invalid: 'User signature is invalid'
|
||||||
session_timeout: 'Session timeout'
|
session_timeout: 'Session timeout'
|
||||||
user_cancelled: 'User cancelled'
|
user_cancelled: 'User cancelled'
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
class RefactorDomainStatuses < ActiveRecord::Migration
|
class RefactorDomainStatuses < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
Domain.all.each do |x|
|
Domain.find_each do |x|
|
||||||
x.statuses = []
|
statuses = []
|
||||||
x.domain_statuses.each do |ds|
|
x.domain_statuses.each do |ds|
|
||||||
x.statuses << ds.value
|
statuses << ds.value
|
||||||
end
|
end
|
||||||
x.save
|
x.update_column('statuses', statuses)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ ZonefileSetting.where({
|
||||||
Registrar.where(
|
Registrar.where(
|
||||||
name: 'EIS',
|
name: 'EIS',
|
||||||
reg_no: '90010019',
|
reg_no: '90010019',
|
||||||
phone: '+372 727 1000',
|
phone: '+3727271000',
|
||||||
country_code: 'EE',
|
country_code: 'EE',
|
||||||
vat_no: 'EE101286464',
|
vat_no: 'EE101286464',
|
||||||
email: 'info@internet.ee',
|
email: 'info@internet.ee',
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace :import do
|
||||||
Rake::Task['import:registrars'].invoke
|
Rake::Task['import:registrars'].invoke
|
||||||
Rake::Task['import:contacts'].invoke
|
Rake::Task['import:contacts'].invoke
|
||||||
Rake::Task['import:domains'].invoke
|
Rake::Task['import:domains'].invoke
|
||||||
|
Rake::Task['import:eis_domains'].invoke
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Import registrars'
|
desc 'Import registrars'
|
||||||
|
@ -469,4 +470,245 @@ namespace :import do
|
||||||
|
|
||||||
puts "-----> Imported #{count} new domains in #{(Time.zone.now.to_f - start).round(2)} seconds"
|
puts "-----> Imported #{count} new domains in #{(Time.zone.now.to_f - start).round(2)} seconds"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc 'Import EIS domains'
|
||||||
|
task eis_domains: :environment do
|
||||||
|
start = Time.zone.now.to_f
|
||||||
|
puts '-----> Importing EIS domains...'
|
||||||
|
|
||||||
|
eis = Registrar.where(
|
||||||
|
name: 'EIS',
|
||||||
|
reg_no: '90010019',
|
||||||
|
phone: '+3727271000',
|
||||||
|
country_code: 'EE',
|
||||||
|
vat_no: 'EE101286464',
|
||||||
|
email: 'info@internet.ee',
|
||||||
|
state: 'Harjumaa',
|
||||||
|
city: 'Tallinn',
|
||||||
|
street: 'Paldiski mnt 80',
|
||||||
|
zip: '10617',
|
||||||
|
url: 'www.internet.ee',
|
||||||
|
code: 'EIS'
|
||||||
|
).first_or_create!
|
||||||
|
|
||||||
|
unless eis.cash_account
|
||||||
|
eis.accounts.create(account_type: Account::CASH, currency: 'EUR')
|
||||||
|
eis.save
|
||||||
|
end
|
||||||
|
|
||||||
|
c = Registrant.where(
|
||||||
|
name: 'Eesti Interneti Sihtasutus',
|
||||||
|
phone: '+372.7271000',
|
||||||
|
email: 'info@internet.ee',
|
||||||
|
ident: '90010019',
|
||||||
|
ident_type: 'passport',
|
||||||
|
city: 'Tallinn',
|
||||||
|
country_code: 'ee',
|
||||||
|
street: 'Paldiski mnt 80',
|
||||||
|
zip: '10617',
|
||||||
|
registrar: eis
|
||||||
|
).first_or_create!
|
||||||
|
|
||||||
|
# ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 1).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# edu.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 6).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'edu.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# aip.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 9).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'aip.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# org.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 10).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'org.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# pri.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 2).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'pri.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# med.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 3).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'med.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# fie.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 4).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'fie.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# com.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 5).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'com.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# gov.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 7).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'gov.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
# riik.ee
|
||||||
|
ns_list = []
|
||||||
|
Legacy::ZoneNs.where(zone: 8).each do |x|
|
||||||
|
ipv4 = x.addrs.select { |addr| addr.ipv4? }.first
|
||||||
|
ipv6 = x.addrs.select { |addr| addr.ipv6? }.first
|
||||||
|
ns_list << Nameserver.new(hostname: x.fqdn, ipv4: ipv4, ipv6: ipv6)
|
||||||
|
end
|
||||||
|
|
||||||
|
Domain.create!(
|
||||||
|
name: 'riik.ee',
|
||||||
|
valid_to: Date.new(9999, 1, 1),
|
||||||
|
period: 1,
|
||||||
|
period_unit: 'y',
|
||||||
|
registrant: c,
|
||||||
|
nameservers: ns_list,
|
||||||
|
admin_contacts: [c],
|
||||||
|
tech_contacts: [c],
|
||||||
|
registrar: eis
|
||||||
|
)
|
||||||
|
|
||||||
|
puts "-----> Imported EIS domains in #{(Time.zone.now.to_f - start).round(2)} seconds"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace :zonefile do
|
||||||
SELECT concat(d.name_puny, '. IN NS ', ns.hostname, '.')
|
SELECT concat(d.name_puny, '. IN NS ', ns.hostname, '.')
|
||||||
FROM domains d
|
FROM domains d
|
||||||
JOIN nameservers ns ON ns.domain_id = d.id
|
JOIN nameservers ns ON ns.domain_id = d.id
|
||||||
WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
|
WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter OR d.name = i_origin
|
||||||
ORDER BY d.name
|
ORDER BY d.name
|
||||||
),
|
),
|
||||||
chr(10)
|
chr(10)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue