mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 13:36:15 +02:00
Merge branch 'master' into enable-trimming-dnskey
This commit is contained in:
commit
ae738aa11e
70 changed files with 1089 additions and 464 deletions
|
@ -48,7 +48,6 @@ exclude_patterns:
|
||||||
- "config/"
|
- "config/"
|
||||||
- "db/"
|
- "db/"
|
||||||
- "lib/core_monkey_patches/"
|
- "lib/core_monkey_patches/"
|
||||||
- "lib/daemons/"
|
|
||||||
- "lib/gem_monkey_patches/"
|
- "lib/gem_monkey_patches/"
|
||||||
- "lib/tasks/api_log.rake"
|
- "lib/tasks/api_log.rake"
|
||||||
- "lib/tasks/bootstrap.rake"
|
- "lib/tasks/bootstrap.rake"
|
||||||
|
|
3
Gemfile
3
Gemfile
|
@ -62,13 +62,10 @@ gem 'omniauth-tara', github: 'internetee/omniauth-tara'
|
||||||
# gem 'omniauth-tara', path: 'vendor/gems/omniauth-tara'
|
# gem 'omniauth-tara', path: 'vendor/gems/omniauth-tara'
|
||||||
|
|
||||||
gem 'airbrake'
|
gem 'airbrake'
|
||||||
gem 'daemons-rails', '1.2.1'
|
|
||||||
gem 'epp', github: 'internetee/epp', branch: :master
|
gem 'epp', github: 'internetee/epp', branch: :master
|
||||||
gem 'epp-xml', '1.2.0', github: 'internetee/epp-xml', branch: :master
|
gem 'epp-xml', '1.2.0', github: 'internetee/epp-xml', branch: :master
|
||||||
gem 'jquery-ui-rails', '6.0.1'
|
gem 'jquery-ui-rails', '6.0.1'
|
||||||
gem 'pdfkit'
|
gem 'pdfkit'
|
||||||
gem 'que'
|
|
||||||
gem 'que-web'
|
|
||||||
gem 'sidekiq', '>= 6.4.1'
|
gem 'sidekiq', '>= 6.4.1'
|
||||||
|
|
||||||
gem 'company_register', github: 'internetee/company_register',
|
gem 'company_register', github: 'internetee/company_register',
|
||||||
|
|
26
Gemfile.lock
26
Gemfile.lock
|
@ -202,10 +202,6 @@ GEM
|
||||||
crack (0.4.5)
|
crack (0.4.5)
|
||||||
rexml
|
rexml
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
daemons (1.3.1)
|
|
||||||
daemons-rails (1.2.1)
|
|
||||||
daemons
|
|
||||||
multi_json (~> 1.0)
|
|
||||||
data_migrate (8.0.0)
|
data_migrate (8.0.0)
|
||||||
activerecord (>= 5.0)
|
activerecord (>= 5.0)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
|
@ -227,7 +223,6 @@ GEM
|
||||||
domain_name (0.5.20190701)
|
domain_name (0.5.20190701)
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
erubi (1.10.0)
|
erubi (1.10.0)
|
||||||
erubis (2.7.0)
|
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
ffi (1.15.0)
|
ffi (1.15.0)
|
||||||
figaro (1.2.0)
|
figaro (1.2.0)
|
||||||
|
@ -318,9 +313,6 @@ GEM
|
||||||
money (~> 6.13.2)
|
money (~> 6.13.2)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
msgpack (1.4.2)
|
msgpack (1.4.2)
|
||||||
multi_json (1.15.0)
|
|
||||||
mustermann (1.1.1)
|
|
||||||
ruby2_keywords (~> 0.0.1)
|
|
||||||
netrc (0.11.0)
|
netrc (0.11.0)
|
||||||
newrelic-infinite_tracing (8.1.0)
|
newrelic-infinite_tracing (8.1.0)
|
||||||
grpc (~> 1.34)
|
grpc (~> 1.34)
|
||||||
|
@ -353,7 +345,7 @@ GEM
|
||||||
paper_trail (12.1.0)
|
paper_trail (12.1.0)
|
||||||
activerecord (>= 5.2)
|
activerecord (>= 5.2)
|
||||||
request_store (~> 1.1)
|
request_store (~> 1.1)
|
||||||
pdfkit (0.8.5)
|
pdfkit (0.8.7)
|
||||||
pg (1.4.3)
|
pg (1.4.3)
|
||||||
pg_query (2.1.2)
|
pg_query (2.1.2)
|
||||||
google-protobuf (>= 3.17.1)
|
google-protobuf (>= 3.17.1)
|
||||||
|
@ -365,11 +357,6 @@ GEM
|
||||||
public_suffix (4.0.6)
|
public_suffix (4.0.6)
|
||||||
puma (5.6.4)
|
puma (5.6.4)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
que (0.14.3)
|
|
||||||
que-web (0.7.2)
|
|
||||||
erubis
|
|
||||||
que (~> 0.8)
|
|
||||||
sinatra
|
|
||||||
racc (1.6.0)
|
racc (1.6.0)
|
||||||
rack (2.2.4)
|
rack (2.2.4)
|
||||||
rack-oauth2 (1.16.0)
|
rack-oauth2 (1.16.0)
|
||||||
|
@ -378,8 +365,6 @@ GEM
|
||||||
httpclient
|
httpclient
|
||||||
json-jwt (>= 1.11.0)
|
json-jwt (>= 1.11.0)
|
||||||
rack (>= 2.1.0)
|
rack (>= 2.1.0)
|
||||||
rack-protection (2.2.0)
|
|
||||||
rack
|
|
||||||
rack-test (1.1.0)
|
rack-test (1.1.0)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
rails (6.1.4.1)
|
rails (6.1.4.1)
|
||||||
|
@ -427,7 +412,6 @@ GEM
|
||||||
mime-types (>= 1.16, < 4.0)
|
mime-types (>= 1.16, < 4.0)
|
||||||
netrc (~> 0.8)
|
netrc (~> 0.8)
|
||||||
rexml (3.2.5)
|
rexml (3.2.5)
|
||||||
ruby2_keywords (0.0.5)
|
|
||||||
rubyzip (2.3.2)
|
rubyzip (2.3.2)
|
||||||
sass-rails (6.0.0)
|
sass-rails (6.0.0)
|
||||||
sassc-rails (~> 2.1, >= 2.1.1)
|
sassc-rails (~> 2.1, >= 2.1.1)
|
||||||
|
@ -463,11 +447,6 @@ GEM
|
||||||
simplecov-html (0.10.2)
|
simplecov-html (0.10.2)
|
||||||
simpleidn (0.2.1)
|
simpleidn (0.2.1)
|
||||||
unf (~> 0.1.4)
|
unf (~> 0.1.4)
|
||||||
sinatra (2.2.0)
|
|
||||||
mustermann (~> 1.0)
|
|
||||||
rack (~> 2.2)
|
|
||||||
rack-protection (= 2.2.0)
|
|
||||||
tilt (~> 2.0)
|
|
||||||
sixarm_ruby_unaccent (1.2.0)
|
sixarm_ruby_unaccent (1.2.0)
|
||||||
socksify (1.7.1)
|
socksify (1.7.1)
|
||||||
sprockets (4.0.2)
|
sprockets (4.0.2)
|
||||||
|
@ -546,7 +525,6 @@ DEPENDENCIES
|
||||||
coffee-rails (>= 5.0)
|
coffee-rails (>= 5.0)
|
||||||
company_register!
|
company_register!
|
||||||
countries
|
countries
|
||||||
daemons-rails (= 1.2.1)
|
|
||||||
data_migrate (~> 8.0)
|
data_migrate (~> 8.0)
|
||||||
database_cleaner
|
database_cleaner
|
||||||
devise (~> 4.8)
|
devise (~> 4.8)
|
||||||
|
@ -582,8 +560,6 @@ DEPENDENCIES
|
||||||
pghero
|
pghero
|
||||||
pry (= 0.14.1)
|
pry (= 0.14.1)
|
||||||
puma
|
puma
|
||||||
que
|
|
||||||
que-web
|
|
||||||
rails (~> 6.1.4)
|
rails (~> 6.1.4)
|
||||||
ransack (~> 2.6.0)
|
ransack (~> 2.6.0)
|
||||||
rest-client
|
rest-client
|
||||||
|
|
|
@ -390,7 +390,6 @@ sudo apt-get install libxext-dev libxrender1 fontconfig
|
||||||
### Deployment
|
### Deployment
|
||||||
|
|
||||||
* [Application build and update](/doc/application_build_doc.md)
|
* [Application build and update](/doc/application_build_doc.md)
|
||||||
* [Registry que server](/doc/que/README.md)
|
|
||||||
|
|
||||||
### Autotesting
|
### Autotesting
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,7 @@ module Admin
|
||||||
|
|
||||||
if @api_user.valid?
|
if @api_user.valid?
|
||||||
@api_user.save!
|
@api_user.save!
|
||||||
redirect_to admin_registrar_api_user_path(@api_user.registrar, @api_user),
|
redirect_to admin_registrar_api_user_path(@api_user.registrar, @api_user), notice: t('.created')
|
||||||
notice: t('.created')
|
|
||||||
else
|
else
|
||||||
render 'new'
|
render 'new'
|
||||||
end
|
end
|
||||||
|
@ -35,8 +34,7 @@ module Admin
|
||||||
|
|
||||||
if @api_user.valid?
|
if @api_user.valid?
|
||||||
@api_user.save!
|
@api_user.save!
|
||||||
redirect_to admin_registrar_api_user_path(@api_user.registrar, @api_user),
|
redirect_to admin_registrar_api_user_path(@api_user.registrar, @api_user), notice: t('.updated')
|
||||||
notice: t('.updated')
|
|
||||||
else
|
else
|
||||||
render 'edit'
|
render 'edit'
|
||||||
end
|
end
|
||||||
|
@ -47,8 +45,45 @@ module Admin
|
||||||
redirect_to admin_registrar_path(@api_user.registrar), notice: t('.deleted')
|
redirect_to admin_registrar_path(@api_user.registrar), notice: t('.deleted')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_test_date_to_api_user
|
||||||
|
user_api = User.find(params[:user_api_id])
|
||||||
|
|
||||||
|
uri = URI.parse((ENV['registry_demo_registrar_api_user_url']) + "?username=#{user_api.username}&identity_code=#{user_api.identity_code}")
|
||||||
|
|
||||||
|
response = base_get_request(uri: uri, port: ENV['registry_demo_registrar_port'])
|
||||||
|
|
||||||
|
if response.code == "200"
|
||||||
|
result = JSON.parse(response.body)
|
||||||
|
demo_user_api = result['user_api']
|
||||||
|
|
||||||
|
Actions::RecordDateOfTest.record_result_to_api_user(api_user:user_api,
|
||||||
|
date: demo_user_api['accreditation_date']) unless demo_user_api.empty?
|
||||||
|
return redirect_to request.referrer, notice: 'User Api found'
|
||||||
|
else
|
||||||
|
return redirect_to request.referrer, notice: 'User Api no found or not accriditated yet'
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect_to request.referrer, notice: 'Something goes wrong'
|
||||||
|
end
|
||||||
|
|
||||||
|
def remove_test_date_to_api_user
|
||||||
|
user_api = User.find(params[:user_api_id])
|
||||||
|
user_api.accreditation_date = nil
|
||||||
|
user_api.accreditation_expire_date = nil
|
||||||
|
user_api.save
|
||||||
|
|
||||||
|
redirect_to request.referrer
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def base_get_request(uri:, port:)
|
||||||
|
http = Net::HTTP.new(uri.host, port)
|
||||||
|
req = Net::HTTP::Get.new(uri.request_uri)
|
||||||
|
|
||||||
|
http.request(req)
|
||||||
|
end
|
||||||
|
|
||||||
def api_user_params
|
def api_user_params
|
||||||
params.require(:api_user).permit(:username, :plain_text_password, :active,
|
params.require(:api_user).permit(:username, :plain_text_password, :active,
|
||||||
:identity_code, { roles: [] })
|
:identity_code, { roles: [] })
|
||||||
|
|
|
@ -53,6 +53,18 @@ module Admin
|
||||||
redirect_to admin_auctions_path
|
redirect_to admin_auctions_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
auction = Auction.find(params[:id])
|
||||||
|
|
||||||
|
if auction.destroy
|
||||||
|
flash[:notice] = I18n.t('record_deleted')
|
||||||
|
else
|
||||||
|
flash.now[:alert] = I18n.t('failed_to_delete_record')
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect_to admin_auctions_path
|
||||||
|
end
|
||||||
|
|
||||||
def upload_spreadsheet
|
def upload_spreadsheet
|
||||||
if params[:q].nil?
|
if params[:q].nil?
|
||||||
flash[:alert] = 'No file upload! Look at the left of upload button!'
|
flash[:alert] = 'No file upload! Look at the left of upload button!'
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Admin
|
||||||
class DomainsController < BaseController
|
class DomainsController < BaseController
|
||||||
DEFAULT_VERSIONS_PER_PAGE = 10
|
DEFAULT_VERSIONS_PER_PAGE = 10
|
||||||
|
|
||||||
before_action :set_domain, only: %i[show edit update keep]
|
before_action :set_domain, only: %i[show edit update download keep]
|
||||||
authorize_resource
|
authorize_resource
|
||||||
|
|
||||||
# rubocop:disable Metrics/MethodLength
|
# rubocop:disable Metrics/MethodLength
|
||||||
|
@ -65,6 +65,11 @@ module Admin
|
||||||
.per(DEFAULT_VERSIONS_PER_PAGE)
|
.per(DEFAULT_VERSIONS_PER_PAGE)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def download
|
||||||
|
filename = "#{@domain.name}.pdf"
|
||||||
|
send_data @domain.as_pdf, filename: filename
|
||||||
|
end
|
||||||
|
|
||||||
def keep
|
def keep
|
||||||
@domain.keep
|
@domain.keep
|
||||||
redirect_to edit_admin_domain_url(@domain), notice: t('.kept')
|
redirect_to edit_admin_domain_url(@domain), notice: t('.kept')
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require 'net/http'
|
||||||
|
|
||||||
module Admin
|
module Admin
|
||||||
class RegistrarsController < BaseController # rubocop:disable Metrics/ClassLength
|
class RegistrarsController < BaseController # rubocop:disable Metrics/ClassLength
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
@ -55,8 +57,56 @@ module Admin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_test_date
|
||||||
|
registrar = Registrar.find(params[:registrar_id])
|
||||||
|
|
||||||
|
uri = URI.parse((ENV['registry_demo_registrar_results_url']) + "?registrar_name=#{registrar.name}")
|
||||||
|
|
||||||
|
response = base_get_request(uri: uri, port: ENV['registry_demo_registrar_port'])
|
||||||
|
|
||||||
|
if response.code == "200"
|
||||||
|
return record_result_for_each_api_user(response: response)
|
||||||
|
else
|
||||||
|
return redirect_to request.referer, notice: 'Registrar no found'
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect_to request.referer, notice: 'Something goes wrong'
|
||||||
|
end
|
||||||
|
|
||||||
|
def remove_test_date
|
||||||
|
registrar = Registrar.find(params[:registrar_id])
|
||||||
|
registrar.api_users.each do |api|
|
||||||
|
api.accreditation_date = nil
|
||||||
|
api.accreditation_expire_date = nil
|
||||||
|
api.save
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect_to request.referer
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def record_result_for_each_api_user(response:)
|
||||||
|
result = JSON.parse(response.body)
|
||||||
|
registrar_users = result['registrar_users']
|
||||||
|
|
||||||
|
return redirect_to request.referer, notice: 'Registrar found, but not accreditated yet' if registrar_users.empty?
|
||||||
|
|
||||||
|
registrar_users.each do |api|
|
||||||
|
a = ApiUser.find_by(username: api['username'], identity_code: api['identity_code'])
|
||||||
|
Actions::RecordDateOfTest.record_result_to_api_user(api_user: a, date: api['accreditation_date']) unless a.nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect_to request.referer, notice: 'Registrar found'
|
||||||
|
end
|
||||||
|
|
||||||
|
def base_get_request(uri:, port:)
|
||||||
|
http = Net::HTTP.new(uri.host, port)
|
||||||
|
req = Net::HTTP::Get.new(uri.request_uri)
|
||||||
|
|
||||||
|
http.request(req)
|
||||||
|
end
|
||||||
|
|
||||||
def filter_by_status
|
def filter_by_status
|
||||||
case params[:status]
|
case params[:status]
|
||||||
when 'Active'
|
when 'Active'
|
||||||
|
|
|
@ -4,6 +4,7 @@ module Api
|
||||||
module V1
|
module V1
|
||||||
module AccreditationCenter
|
module AccreditationCenter
|
||||||
class BaseController < ActionController::API
|
class BaseController < ActionController::API
|
||||||
|
if Feature.allow_accr_endspoints?
|
||||||
rescue_from ActiveRecord::RecordNotFound, with: :show_not_found_error
|
rescue_from ActiveRecord::RecordNotFound, with: :show_not_found_error
|
||||||
rescue_from ActiveRecord::RecordInvalid, with: :show_invalid_record_error
|
rescue_from ActiveRecord::RecordInvalid, with: :show_invalid_record_error
|
||||||
rescue_from(ActionController::ParameterMissing) do |parameter_missing_exception|
|
rescue_from(ActionController::ParameterMissing) do |parameter_missing_exception|
|
||||||
|
@ -25,4 +26,5 @@ module Api
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
require 'serializers/repp/contact'
|
||||||
|
|
||||||
|
module Api
|
||||||
|
module V1
|
||||||
|
module AccreditationCenter
|
||||||
|
class ResultsController < ::Api::V1::AccreditationCenter::BaseController
|
||||||
|
def show
|
||||||
|
accr_users = []
|
||||||
|
registrar = Registrar.find_by(name: params[:registrar_name])
|
||||||
|
|
||||||
|
return render json: { errors: 'Registrar not found' }, status: :not_found if registrar.nil?
|
||||||
|
|
||||||
|
registrar.api_users.where.not(accreditation_date: nil).each do |u|
|
||||||
|
accr_users << u
|
||||||
|
end
|
||||||
|
|
||||||
|
render json: { code: 1000, registrar_users: accr_users }
|
||||||
|
end
|
||||||
|
|
||||||
|
def show_api_user
|
||||||
|
user_api = User.find_by(username: params[:username], identity_code: params[:identity_code])
|
||||||
|
|
||||||
|
return render json: { errors: 'User not found' }, status: :not_found if user_api.nil?
|
||||||
|
|
||||||
|
return render json: { errors: 'No accreditated yet' }, status: :not_found if user_api.accreditation_date.nil?
|
||||||
|
|
||||||
|
render json: { code: 1000, user_api: user_api }
|
||||||
|
end
|
||||||
|
|
||||||
|
def list_accreditated_api_users
|
||||||
|
users = User.where.not(accreditation_date: nil)
|
||||||
|
|
||||||
|
return render json: { errors: 'Accreditated users not found' }, status: :not_found if users.empty?
|
||||||
|
|
||||||
|
render json: { code: 1000, users: users }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -31,6 +31,7 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
auction.mark_deadline(params[:registration_deadline]) if params[:registration_deadline]
|
auction.mark_deadline(params[:registration_deadline]) if params[:registration_deadline]
|
||||||
|
auction.platform = params[:platform] == 'english' ? :manual : :auto
|
||||||
|
|
||||||
if auction.payment_not_received? || auction.domain_not_registered?
|
if auction.payment_not_received? || auction.domain_not_registered?
|
||||||
update_whois_from_auction(Auction.pending(auction.domain))
|
update_whois_from_auction(Auction.pending(auction.domain))
|
||||||
|
|
|
@ -10,9 +10,7 @@ module EisBilling
|
||||||
|
|
||||||
bank = create_bank_transfer(invoice: invoice, sum: params[:standing_amount], paid_at: params[:transaction_time])
|
bank = create_bank_transfer(invoice: invoice, sum: params[:standing_amount], paid_at: params[:transaction_time])
|
||||||
create_payment_order(invoice: invoice, everypay_response: params, payment_status: payment_status)
|
create_payment_order(invoice: invoice, everypay_response: params, payment_status: payment_status)
|
||||||
|
bank.bind_invoice(params[:order_reference])
|
||||||
registrar = invoice.buyer
|
|
||||||
bank.create_activity(registrar, invoice)
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json do
|
format.json do
|
||||||
|
|
|
@ -2,6 +2,7 @@ module Repp
|
||||||
module V1
|
module V1
|
||||||
module Registrar
|
module Registrar
|
||||||
class AccreditationInfoController < BaseController
|
class AccreditationInfoController < BaseController
|
||||||
|
if Feature.allow_accr_endspoints?
|
||||||
api :GET, 'repp/v1/registrar/accreditation/get_info'
|
api :GET, 'repp/v1/registrar/accreditation/get_info'
|
||||||
desc 'check login user and return data'
|
desc 'check login user and return data'
|
||||||
|
|
||||||
|
@ -35,4 +36,5 @@ module Repp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,7 @@ module Repp
|
||||||
module V1
|
module V1
|
||||||
module Registrar
|
module Registrar
|
||||||
class AccreditationResultsController < ActionController::API
|
class AccreditationResultsController < ActionController::API
|
||||||
|
if Feature.allow_accr_endspoints?
|
||||||
before_action :authenticate_shared_key
|
before_action :authenticate_shared_key
|
||||||
|
|
||||||
TEMPORARY_SECRET_KEY = ENV['accreditation_secret'].freeze
|
TEMPORARY_SECRET_KEY = ENV['accreditation_secret'].freeze
|
||||||
|
@ -25,7 +26,6 @@ module Repp
|
||||||
user = ApiUser.find_by(username: username)
|
user = ApiUser.find_by(username: username)
|
||||||
|
|
||||||
raise ActiveRecord::RecordNotFound if user.nil?
|
raise ActiveRecord::RecordNotFound if user.nil?
|
||||||
|
|
||||||
user.accreditation_date = DateTime.current
|
user.accreditation_date = DateTime.current
|
||||||
user.accreditation_expire_date = user.accreditation_date + EXPIRE_DEADLINE
|
user.accreditation_expire_date = user.accreditation_date + EXPIRE_DEADLINE
|
||||||
|
|
||||||
|
@ -79,4 +79,5 @@ module Repp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
13
app/interactions/actions/record_date_of_test.rb
Normal file
13
app/interactions/actions/record_date_of_test.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
module Actions
|
||||||
|
module RecordDateOfTest
|
||||||
|
extend self
|
||||||
|
|
||||||
|
TEST_DEADLINE = 1.year.freeze
|
||||||
|
|
||||||
|
def record_result_to_api_user(api_user:, date:)
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + TEST_DEADLINE
|
||||||
|
api_user.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
27
app/jobs/sync_accredited_users_job.rb
Normal file
27
app/jobs/sync_accredited_users_job.rb
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
class SyncAccreditedUsersJob < ApplicationJob
|
||||||
|
def perform
|
||||||
|
uri = URI.parse(ENV['registry_demo_accredited_users_url'])
|
||||||
|
response = base_get_request(uri: uri, port: ENV['registry_demo_registrar_port'])
|
||||||
|
|
||||||
|
if response.code == '200'
|
||||||
|
result = JSON.parse(response.body)
|
||||||
|
result['users'].each do |api|
|
||||||
|
a = ApiUser.find_by(username: api.username, identity_code: api.identity_code)
|
||||||
|
Actions::RecordDateOfTest.record_result_to_api_user(a, api.accreditation_date) unless a.nil?
|
||||||
|
end
|
||||||
|
else
|
||||||
|
logger.warn 'User not found'
|
||||||
|
end
|
||||||
|
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def base_get_request(uri:, port:)
|
||||||
|
http = Net::HTTP.new(uri.host, port)
|
||||||
|
req = Net::HTTP::Get.new(uri.request_uri)
|
||||||
|
|
||||||
|
http.request(req)
|
||||||
|
end
|
||||||
|
end
|
|
@ -56,6 +56,16 @@ class ApiUser < User
|
||||||
username
|
username
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def accredited?
|
||||||
|
!accreditation_date.nil?
|
||||||
|
end
|
||||||
|
|
||||||
|
def accreditation_expired?
|
||||||
|
return false if accreditation_expire_date.nil?
|
||||||
|
|
||||||
|
accreditation_expire_date < Time.zone.now
|
||||||
|
end
|
||||||
|
|
||||||
def unread_notifications
|
def unread_notifications
|
||||||
registrar.notifications.unread
|
registrar.notifications.unread
|
||||||
end
|
end
|
||||||
|
|
|
@ -84,7 +84,9 @@ class Auction < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def restart
|
def restart
|
||||||
new_auction = self.class.new(domain: domain)
|
new_platform = platform.nil? ? :auto : platform
|
||||||
|
|
||||||
|
new_auction = self.class.new(domain: domain, platform: new_platform)
|
||||||
new_auction.start
|
new_auction.start
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,16 @@ class BankTransaction < ApplicationRecord
|
||||||
errors.add(:base, I18n.t('invoice_and_transaction_sums_do_not_match')) if invoice.total != sum
|
errors.add(:base, I18n.t('invoice_and_transaction_sums_do_not_match')) if invoice.total != sum
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def parsed_ref_number
|
||||||
|
reference_no || ref_number_from_description
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
def create_activity(registrar, invoice)
|
def create_activity(registrar, invoice)
|
||||||
|
validate_invoice_data(invoice)
|
||||||
|
return if errors.any?
|
||||||
|
|
||||||
activity = AccountActivity.new(account: registrar.cash_account, bank_transaction: self,
|
activity = AccountActivity.new(account: registrar.cash_account, bank_transaction: self,
|
||||||
invoice: invoice, sum: invoice.subtotal,
|
invoice: invoice, sum: invoice.subtotal,
|
||||||
currency: currency, description: description,
|
currency: currency, description: description,
|
||||||
|
@ -102,12 +111,6 @@ class BankTransaction < ApplicationRecord
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def parsed_ref_number
|
|
||||||
reference_no || ref_number_from_description
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def reset_pending_registrar_balance_reload(registrar)
|
def reset_pending_registrar_balance_reload(registrar)
|
||||||
return unless registrar.settings['balance_auto_reload']
|
return unless registrar.settings['balance_auto_reload']
|
||||||
|
|
||||||
|
|
|
@ -743,6 +743,12 @@ class Domain < ApplicationRecord
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def as_pdf
|
||||||
|
domain_html = ApplicationController.render(template: 'domain/pdf', assigns: { domain: self })
|
||||||
|
generator = PDFKit.new(domain_html)
|
||||||
|
generator.to_pdf
|
||||||
|
end
|
||||||
|
|
||||||
def registrant_name
|
def registrant_name
|
||||||
return registrant.name if registrant
|
return registrant.name if registrant
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,18 @@ class Feature
|
||||||
|
|
||||||
ENV['billing_system_integrated'] || false
|
ENV['billing_system_integrated'] || false
|
||||||
end
|
end
|
||||||
|
# def self.obj_and_extensions_statuses_enabled?
|
||||||
|
# return false if ENV['obj_and_extensions_prohibited'] == 'false'
|
||||||
|
#
|
||||||
|
# ENV['obj_and_extensions_prohibited'] || false
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# def self.enable_lock_domain_with_new_statuses?
|
||||||
|
# return false if ENV['enable_lock_domain_with_new_statuses'] == 'false'
|
||||||
|
#
|
||||||
|
# ENV['enable_lock_domain_with_new_statuses'] || false
|
||||||
|
# end
|
||||||
|
def self.allow_accr_endspoints?
|
||||||
|
ENV['allow_accr_endspoints'] == 'true'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
class QueJob < ApplicationRecord
|
|
||||||
self.primary_key = 'job_id'
|
|
||||||
end
|
|
|
@ -190,6 +190,16 @@ class Registrar < ApplicationRecord # rubocop:disable Metrics/ClassLength
|
||||||
white_ips.api.include_ip?(ip)
|
white_ips.api.include_ip?(ip)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def accredited?
|
||||||
|
api_users.any? do |a|
|
||||||
|
return true unless a.accreditation_date.nil?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def accreditation_expired?
|
||||||
|
api_users.all? { |api| api.accreditation_expired? }
|
||||||
|
end
|
||||||
|
|
||||||
# Audit log is needed, therefore no raw SQL
|
# Audit log is needed, therefore no raw SQL
|
||||||
def replace_nameservers(hostname, new_attributes, domains: [])
|
def replace_nameservers(hostname, new_attributes, domains: [])
|
||||||
transaction do
|
transaction do
|
||||||
|
|
|
@ -2,4 +2,16 @@
|
||||||
<td><%= link_to api_user, admin_registrar_api_user_path(api_user.registrar, api_user) %></td>
|
<td><%= link_to api_user, admin_registrar_api_user_path(api_user.registrar, api_user) %></td>
|
||||||
<td><%= link_to api_user.registrar, admin_registrar_path(api_user.registrar) %></td>
|
<td><%= link_to api_user.registrar, admin_registrar_path(api_user.registrar) %></td>
|
||||||
<td><%= api_user.active %></td>
|
<td><%= api_user.active %></td>
|
||||||
|
<td style="text-align: center;">
|
||||||
|
|
||||||
|
<% if !api_user.accredited? || api_user.accreditation_expired? %>
|
||||||
|
<%= button_to t(:set_test_btn),
|
||||||
|
{ controller: 'api_users', action: 'set_test_date_to_api_user', user_api_id: api_user.id },
|
||||||
|
{ method: :post, class: 'btn btn-primary'} %>
|
||||||
|
<% else %>
|
||||||
|
<%= button_to t(:remove_test_btn),
|
||||||
|
{ controller: 'api_users', action: 'remove_test_date_to_api_user', user_api_id: api_user.id },
|
||||||
|
{ method: :post, class: 'btn btn-danger'} %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -10,15 +10,18 @@
|
||||||
<table class="table table-hover table-bordered table-condensed">
|
<table class="table table-hover table-bordered table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-xs-2">
|
<th class="col-xs-3">
|
||||||
<%= sort_link(@q, 'username') %>
|
<%= sort_link(@q, 'username') %>
|
||||||
</th>
|
</th>
|
||||||
<th class="col-xs-2">
|
<th class="col-xs-3">
|
||||||
<%= sort_link(@q, 'registrar_name', Registrar.model_name.human) %>
|
<%= sort_link(@q, 'registrar_name', Registrar.model_name.human) %>
|
||||||
</th>
|
</th>
|
||||||
<th class="col-xs-2">
|
<th class="col-xs-3">
|
||||||
<%= sort_link(@q, 'active', ApiUser.human_attribute_name(:active)) %>
|
<%= sort_link(@q, 'active', ApiUser.human_attribute_name(:active)) %>
|
||||||
</th>
|
</th>
|
||||||
|
<th class="col-xs-1">
|
||||||
|
Test status
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="row">
|
<div class="row" style="display: flex; flex-direction: row; align-items: baseline;">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<h1><%= @api_user.username %></h1>
|
<h1><%= @api_user.username %></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-4 text-right">
|
<div class="col-sm-4 text-right" style="display: flex; flex-direction: row; align-items: baseline; justify-content: space-evenly;">
|
||||||
<%= link_to t('.edit_btn'), edit_admin_registrar_api_user_path(@api_user.registrar,
|
<%= link_to t('.edit_btn'), edit_admin_registrar_api_user_path(@api_user.registrar,
|
||||||
@api_user),
|
@api_user),
|
||||||
class: 'btn btn-primary' %>
|
class: 'btn btn-primary' %>
|
||||||
|
@ -20,6 +20,16 @@
|
||||||
method: :delete,
|
method: :delete,
|
||||||
data: { confirm: t('.delete_btn_confirm') },
|
data: { confirm: t('.delete_btn_confirm') },
|
||||||
class: 'btn btn-default' %>
|
class: 'btn btn-default' %>
|
||||||
|
|
||||||
|
<% if !@api_user.accredited? || @api_user.accreditation_expired? %>
|
||||||
|
<%= button_to t(:set_test_btn),
|
||||||
|
{ controller: 'api_users', action: 'set_test_date_to_api_user', user_api_id: @api_user.id },
|
||||||
|
{ method: :post, class: 'btn btn-primary'} %>
|
||||||
|
<% else %>
|
||||||
|
<%= button_to t(:remove_test_btn),
|
||||||
|
{ controller: 'api_users', action: 'remove_test_date_to_api_user', user_api_id: @api_user.id },
|
||||||
|
{ method: :post, class: 'btn btn-danger'} %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -129,6 +129,7 @@
|
||||||
<td style="width: 100px !important; word-break: break-all;"><%= auction.registration_code %></td>
|
<td style="width: 100px !important; word-break: break-all;"><%= auction.registration_code %></td>
|
||||||
<td><%= auction.registration_deadline %></td>
|
<td><%= auction.registration_deadline %></td>
|
||||||
<td><%= auction.platform.nil? ? 'auto' : auction.platform %></td>
|
<td><%= auction.platform.nil? ? 'auto' : auction.platform %></td>
|
||||||
|
<td><%= link_to(t(:delete), admin_auction_path(auction), method: :delete, data: { confirm: t(:are_you_sure_you_want_to_delete_auction) }, class: 'btn btn-danger', id: "delete-auction-#{auction.id}") %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -39,7 +39,9 @@
|
||||||
%li= link_to t('.bounced_email_addresses'), admin_bounced_mail_addresses_path
|
%li= link_to t('.bounced_email_addresses'), admin_bounced_mail_addresses_path
|
||||||
%li= link_to t('.epp_log'), admin_epp_logs_path(created_after: 'today')
|
%li= link_to t('.epp_log'), admin_epp_logs_path(created_after: 'today')
|
||||||
%li= link_to t('.repp_log'), admin_repp_logs_path(created_after: 'today')
|
%li= link_to t('.repp_log'), admin_repp_logs_path(created_after: 'today')
|
||||||
%li= link_to t('.que'), '/admin/que'
|
%li.divider
|
||||||
|
%li.dropdown-header= t('.tasks')
|
||||||
|
%li= link_to t('.sidekiq'), admin_sidekiq_web_path
|
||||||
|
|
||||||
%ul.nav.navbar-nav.navbar-right
|
%ul.nav.navbar-nav.navbar-right
|
||||||
%li= link_to t('.sign_out'), destroy_admin_user_session_path, method: :delete,
|
%li= link_to t('.sign_out'), destroy_admin_user_session_path, method: :delete,
|
||||||
|
|
|
@ -6,11 +6,12 @@
|
||||||
|
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-7">
|
||||||
<h1><%= domain.name_with_status %></h1>
|
<h1><%= domain.name_with_status %></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-4 text-right">
|
<div class="col-sm-5 text-right">
|
||||||
|
<%= link_to t('.download_btn'), download_admin_domain_path(@domain), class: 'btn btn-primary' %>
|
||||||
<%= link_to t('.edit_btn'), edit_admin_domain_path(@domain), class: 'btn btn-primary' %>
|
<%= link_to t('.edit_btn'), edit_admin_domain_path(@domain), class: 'btn btn-primary' %>
|
||||||
<%= link_to t('.history_btn'), admin_domain_domain_versions_path(@domain),
|
<%= link_to t('.history_btn'), admin_domain_domain_versions_path(@domain),
|
||||||
class: 'btn btn-primary' %>
|
class: 'btn btn-primary' %>
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
<th class="col-xs-4">
|
<th class="col-xs-4">
|
||||||
<%= t(:emails) %>
|
<%= t(:emails) %>
|
||||||
</th>
|
</th>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
Test status
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -58,6 +62,17 @@
|
||||||
<%= content_tag(:span, x[:billing_email]) %>
|
<%= content_tag(:span, x[:billing_email]) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<% if !x.accredited? || x.accreditation_expired? %>
|
||||||
|
<%= button_to t('.set_test_btn'),
|
||||||
|
{ controller: 'registrars', action: 'set_test_date', registrar_id: x.id},
|
||||||
|
{ method: :post, class: 'btn btn-primary'} %>
|
||||||
|
<% else %>
|
||||||
|
<%= button_to t('.remove_test_btn'),
|
||||||
|
{ controller: 'registrars', action: 'remove_test_date', registrar_id: x.id},
|
||||||
|
{ method: :post, class: 'btn btn-danger'} %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-xs-6"><%= ApiUser.human_attribute_name :username %></th>
|
<th class="col-xs-6"><%= ApiUser.human_attribute_name :username %></th>
|
||||||
<th class="col-xs-6"><%= ApiUser.human_attribute_name :active %></th>
|
<th class="col-xs-6"><%= ApiUser.human_attribute_name :active %></th>
|
||||||
|
<th class="col-xs-6">Test Results</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
@ -16,6 +17,18 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to api_user, admin_registrar_api_user_path(api_user.registrar, api_user) %></td>
|
<td><%= link_to api_user, admin_registrar_api_user_path(api_user.registrar, api_user) %></td>
|
||||||
<td><%= api_user.active %></td>
|
<td><%= api_user.active %></td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<% if !api_user.accredited? || api_user.accreditation_expired? %>
|
||||||
|
<%= button_to t('.set_test_btn'),
|
||||||
|
{ controller: 'api_users', action: 'set_test_date_to_api_user', user_api_id: api_user.id },
|
||||||
|
{ method: :post, class: 'btn btn-primary'} %>
|
||||||
|
<% else %>
|
||||||
|
<%= button_to t('.remove_test_btn'),
|
||||||
|
{ controller: 'api_users', action: 'remove_test_date_to_api_user', user_api_id: api_user.id },
|
||||||
|
{ method: :post, class: 'btn btn-danger'} %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
241
app/views/domain/pdf.haml
Normal file
241
app/views/domain/pdf.haml
Normal file
|
@ -0,0 +1,241 @@
|
||||||
|
%html{lang: 'et'}
|
||||||
|
%head
|
||||||
|
%meta{charset: "utf-8"}
|
||||||
|
:css
|
||||||
|
.container {
|
||||||
|
margin: auto;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.col-md-12 {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.col-xs-4 {
|
||||||
|
width: 33%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
dt {
|
||||||
|
float: left;
|
||||||
|
width: 100px;
|
||||||
|
clear: left;
|
||||||
|
text-align: right;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 1.42857;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
margin-left: 120px;
|
||||||
|
line-height: 1.42857;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
text-align: left;
|
||||||
|
border: 0px;
|
||||||
|
border-top: 1px solid #DDD;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
thead th {
|
||||||
|
border-bottom: 2px solid #DDD;
|
||||||
|
border-top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
border-top: 1px solid #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
color: #DDD;
|
||||||
|
background-color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pull-down {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
position: relative;
|
||||||
|
min-height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 106px;
|
||||||
|
height: 102px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header-content {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
width: 99%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blue {
|
||||||
|
color: #0098da;
|
||||||
|
}
|
||||||
|
|
||||||
|
%body
|
||||||
|
.container
|
||||||
|
#header.row
|
||||||
|
.col-sm-6.left
|
||||||
|
#header-content
|
||||||
|
%h1= "#{@domain.name} (#{Time.zone.now.to_date.strftime("%d/%m/%Y")})"
|
||||||
|
.col-sm-6.right
|
||||||
|
%img{src: "#{Rails.root}/public/eis-logo-black-et.png"}
|
||||||
|
.clear
|
||||||
|
%hr
|
||||||
|
.row
|
||||||
|
.col-sm-8.left
|
||||||
|
%h3 Üldine
|
||||||
|
%hr
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt Nimi
|
||||||
|
%dd= @domain.name
|
||||||
|
%dt Registreeritud
|
||||||
|
%dd= @domain.registered_at.to_date.strftime("%d/%m/%Y")
|
||||||
|
%dt Aegub
|
||||||
|
%dd= @domain.valid_to.to_date.strftime("%d/%m/%Y")
|
||||||
|
%dt Registripidaja
|
||||||
|
%dd= "#{@domain.registrar} #{@domain.registrar.website}"
|
||||||
|
|
||||||
|
.col-sm-4.right
|
||||||
|
%h3 Registreerija
|
||||||
|
%hr
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt.left_25 Nimi
|
||||||
|
%dd.left_25= @domain.registrant
|
||||||
|
|
||||||
|
%dt.left_25 Isikukood
|
||||||
|
%dd.left_25= @domain.registrant.ident_human_description
|
||||||
|
|
||||||
|
%dt.left_25 E-mail
|
||||||
|
%dd.left_25= @domain.registrant.email
|
||||||
|
|
||||||
|
%dt.left_25 Telefon
|
||||||
|
%dd.left_25= @domain.registrant.phone
|
||||||
|
|
||||||
|
.clear
|
||||||
|
.row.pull-down
|
||||||
|
.col-md-12
|
||||||
|
%h3 Halduskontaktid
|
||||||
|
%hr
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-3'} Nimi
|
||||||
|
%th{class: 'col-xs-3'} Isikukood
|
||||||
|
%th{class: 'col-xs-3'} E-mail
|
||||||
|
%th{class: 'col-xs-3'} Telefon
|
||||||
|
%tbody
|
||||||
|
- @domain.admin_contacts.each do |ac|
|
||||||
|
%tr
|
||||||
|
%td= ac.name
|
||||||
|
%td= ac.ident_human_description
|
||||||
|
%td= ac.email
|
||||||
|
%td= ac.phone
|
||||||
|
|
||||||
|
.clear
|
||||||
|
.row.pull-down
|
||||||
|
.col-md-12
|
||||||
|
%h3 Tehnilised kontaktid
|
||||||
|
%hr
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-3'} Nimi
|
||||||
|
%th{class: 'col-xs-3'} Isikukood
|
||||||
|
%th{class: 'col-xs-3'} E-mail
|
||||||
|
%th{class: 'col-xs-3'} Telefon
|
||||||
|
%tbody
|
||||||
|
- @domain.tech_contacts.each do |tc|
|
||||||
|
%tr
|
||||||
|
%td= tc.name
|
||||||
|
%td= tc.ident_human_description
|
||||||
|
%td= tc.email
|
||||||
|
%td= tc.phone
|
||||||
|
|
||||||
|
.clear
|
||||||
|
.row.pull-down
|
||||||
|
.col-md-12
|
||||||
|
%h3 Nimeserverid
|
||||||
|
%hr
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-4'} Hostinimi
|
||||||
|
%th{class: 'col-xs-4'}= t(:ipv4)
|
||||||
|
%th{class: 'col-xs-4'}= t(:ipv6)
|
||||||
|
%tbody
|
||||||
|
- @domain.nameservers.each do |x|
|
||||||
|
%tr
|
||||||
|
%td= x
|
||||||
|
%td= x.ipv4
|
||||||
|
%td= x.ipv6
|
||||||
|
.clear
|
||||||
|
.row.pull-down
|
||||||
|
.col-md-12
|
||||||
|
%h3= t(:dnskeys)
|
||||||
|
%hr
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-1'} Lipp
|
||||||
|
%th{class: 'col-xs-1'} Protokolli
|
||||||
|
%th{class: 'col-xs-1'} Algoritm
|
||||||
|
%th{class: 'col-xs-9'} Avalik võti
|
||||||
|
%tbody
|
||||||
|
- @domain.dnskeys.each do |x|
|
||||||
|
%tr
|
||||||
|
%td= x.flags
|
||||||
|
%td= x.protocol
|
||||||
|
%td= x.alg
|
||||||
|
%td= x.public_key
|
||||||
|
#footer
|
||||||
|
%hr
|
||||||
|
%p{class: 'blue'} Eesti Interneti SA
|
||||||
|
%p Paldiski mnt 80, 10617 Tallinn, Estonia T +372 727 1000 E info@internet.ee www.internet.ee
|
||||||
|
%p Reg. nr 90010019 KMKR EE101286464
|
|
@ -1,4 +1,5 @@
|
||||||
<%= t(:you_have_a_new_invoice) %>
|
<%= t(:you_have_a_new_invoice) %><br>
|
||||||
|
<%= t(:monthly_invoice) if @invoice.monthly_invoice %>
|
||||||
<br><br>
|
<br><br>
|
||||||
<%= t(:sincerely) %>,<br>
|
<%= t(:sincerely) %>,<br>
|
||||||
<%= Setting.registry_invoice_contact %><br>
|
<%= Setting.registry_invoice_contact %><br>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<%= t(:you_have_a_new_invoice) %>
|
<%= t(:you_have_a_new_invoice) %>
|
||||||
|
<%= t(:monthly_invoice) if @invoice.monthly_invoice %>
|
||||||
|
|
||||||
<%= t(:sincerely) %>,
|
<%= t(:sincerely) %>,
|
||||||
<%= Setting.registry_invoice_contact %>
|
<%= Setting.registry_invoice_contact %>
|
||||||
|
|
|
@ -2,12 +2,3 @@
|
||||||
|
|
||||||
require_relative 'config/environment'
|
require_relative 'config/environment'
|
||||||
run Rails.application
|
run Rails.application
|
||||||
|
|
||||||
# turn automatic que temp off
|
|
||||||
# if defined?(PhusionPassenger)
|
|
||||||
# PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
|
||||||
# if forked
|
|
||||||
# Que.mode = :async
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
|
@ -242,4 +242,3 @@ billing_system_integrated: 'true'
|
||||||
secret_access_word: 'please-Give-Me-accesS'
|
secret_access_word: 'please-Give-Me-accesS'
|
||||||
secret_word: 'this-secret-should-be-change'
|
secret_word: 'this-secret-should-be-change'
|
||||||
allow_accr_endspoints: 'true'
|
allow_accr_endspoints: 'true'
|
||||||
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
dir_mode: script
|
|
||||||
dir: ../../log/que
|
|
||||||
multiple: true
|
|
||||||
backtrace: true
|
|
||||||
monitor: true
|
|
||||||
ontop: false
|
|
||||||
app_name: 'que'
|
|
||||||
user: <%= ENV['QUE_USER'] || 'registry' %>
|
|
||||||
group: <%= ENV['QUE_GROUP'] || ENV['QUE_USER'] || 'registry' %>
|
|
|
@ -15,7 +15,6 @@ set :deploy_to, '$HOME/registry'
|
||||||
set :repository, 'https://github.com/domify/registry' # dev repo
|
set :repository, 'https://github.com/domify/registry' # dev repo
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
set :rails_env, 'alpha'
|
set :rails_env, 'alpha'
|
||||||
set :que_restart, true
|
|
||||||
set :cron_group, 'registry'
|
set :cron_group, 'registry'
|
||||||
|
|
||||||
# alpha branch, only use for heavy debugging
|
# alpha branch, only use for heavy debugging
|
||||||
|
@ -25,7 +24,6 @@ task :epp do
|
||||||
set :repository, 'https://github.com/domify/registry' # dev repo
|
set :repository, 'https://github.com/domify/registry' # dev repo
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
set :rails_env, 'alpha'
|
set :rails_env, 'alpha'
|
||||||
set :que_restart, false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# alpha branch, only use for heavy debugging
|
# alpha branch, only use for heavy debugging
|
||||||
|
@ -35,7 +33,6 @@ task :registrar do
|
||||||
set :repository, 'https://github.com/domify/registry' # dev repo
|
set :repository, 'https://github.com/domify/registry' # dev repo
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
set :rails_env, 'alpha'
|
set :rails_env, 'alpha'
|
||||||
set :que_restart, false
|
|
||||||
set :cron_group, 'registrar'
|
set :cron_group, 'registrar'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -46,7 +43,6 @@ task :registrant do
|
||||||
set :repository, 'https://github.com/domify/registry' # dev repo
|
set :repository, 'https://github.com/domify/registry' # dev repo
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
set :rails_env, 'alpha'
|
set :rails_env, 'alpha'
|
||||||
set :que_restart, false
|
|
||||||
set :cron_group, 'registrant'
|
set :cron_group, 'registrant'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -57,7 +53,6 @@ task :st do
|
||||||
set :repository, 'https://github.com/internetee/registry' # production repo
|
set :repository, 'https://github.com/internetee/registry' # production repo
|
||||||
set :branch, 'staging'
|
set :branch, 'staging'
|
||||||
set :rails_env, 'staging'
|
set :rails_env, 'staging'
|
||||||
set :que_restart, true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# staging
|
# staging
|
||||||
|
@ -67,7 +62,6 @@ task :eppst do
|
||||||
set :repository, 'https://github.com/internetee/registry' # production repo
|
set :repository, 'https://github.com/internetee/registry' # production repo
|
||||||
set :branch, 'staging'
|
set :branch, 'staging'
|
||||||
set :rails_env, 'staging'
|
set :rails_env, 'staging'
|
||||||
set :que_restart, false
|
|
||||||
set :cron_group, 'epp'
|
set :cron_group, 'epp'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -78,7 +72,6 @@ task :registrarst do
|
||||||
set :repository, 'https://github.com/internetee/registry' # production repo
|
set :repository, 'https://github.com/internetee/registry' # production repo
|
||||||
set :branch, 'staging'
|
set :branch, 'staging'
|
||||||
set :rails_env, 'staging'
|
set :rails_env, 'staging'
|
||||||
set :que_restart, false
|
|
||||||
set :cron_group, 'registrar'
|
set :cron_group, 'registrar'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -89,7 +82,6 @@ task :registrantst do
|
||||||
set :repository, 'https://github.com/internetee/registry' # production repo
|
set :repository, 'https://github.com/internetee/registry' # production repo
|
||||||
set :branch, 'staging'
|
set :branch, 'staging'
|
||||||
set :rails_env, 'staging'
|
set :rails_env, 'staging'
|
||||||
set :que_restart, false
|
|
||||||
set :cron_group, 'registrant'
|
set :cron_group, 'registrant'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -100,7 +92,6 @@ task :pr do
|
||||||
set :repository, 'https://github.com/internetee/registry' # production repo
|
set :repository, 'https://github.com/internetee/registry' # production repo
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
set :rails_env, 'production'
|
set :rails_env, 'production'
|
||||||
set :que_restart, true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# production
|
# production
|
||||||
|
@ -110,7 +101,6 @@ task :epppr do
|
||||||
set :repository, 'https://github.com/internetee/registry' # production repo
|
set :repository, 'https://github.com/internetee/registry' # production repo
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
set :rails_env, 'production'
|
set :rails_env, 'production'
|
||||||
set :que_restart, false
|
|
||||||
set :cron_group, 'epp'
|
set :cron_group, 'epp'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -121,7 +111,6 @@ task :registrarpr do
|
||||||
set :repository, 'https://github.com/internetee/registry' # production repo
|
set :repository, 'https://github.com/internetee/registry' # production repo
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
set :rails_env, 'production'
|
set :rails_env, 'production'
|
||||||
set :que_restart, false
|
|
||||||
set :cron_group, 'registrar'
|
set :cron_group, 'registrar'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -132,7 +121,6 @@ task :registrantpr do
|
||||||
set :repository, 'https://github.com/internetee/registry' # production repo
|
set :repository, 'https://github.com/internetee/registry' # production repo
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
set :rails_env, 'production'
|
set :rails_env, 'production'
|
||||||
set :que_restart, false
|
|
||||||
set :cron_group, 'registrant'
|
set :cron_group, 'registrant'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -193,9 +181,6 @@ task setup: :environment do
|
||||||
queue! %(mkdir -p "#{deploy_to}/shared/import/legal_documents")
|
queue! %(mkdir -p "#{deploy_to}/shared/import/legal_documents")
|
||||||
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/import/legal_documents")
|
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/import/legal_documents")
|
||||||
|
|
||||||
queue! %(mkdir -p "#{deploy_to}/shared/log/que")
|
|
||||||
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/log/que")
|
|
||||||
|
|
||||||
queue! %(touch "#{deploy_to}/shared/config/database.yml")
|
queue! %(touch "#{deploy_to}/shared/config/database.yml")
|
||||||
deploy do
|
deploy do
|
||||||
invoke :'git:clone'
|
invoke :'git:clone'
|
||||||
|
@ -217,8 +202,6 @@ task deploy: :environment do
|
||||||
invoke :load_commit_hash
|
invoke :load_commit_hash
|
||||||
|
|
||||||
# TEMP until all servers are updated
|
# TEMP until all servers are updated
|
||||||
queue! %(mkdir -p "#{deploy_to}/shared/log/que")
|
|
||||||
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/log/que")
|
|
||||||
|
|
||||||
invoke :'deploy:link_shared_paths'
|
invoke :'deploy:link_shared_paths'
|
||||||
invoke :'bundle:install'
|
invoke :'bundle:install'
|
||||||
|
@ -258,11 +241,6 @@ task restart: :environment do
|
||||||
queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"
|
queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Restart que server'
|
|
||||||
task que_restart: :environment do
|
|
||||||
queue "/etc/init.d/que restart"
|
|
||||||
end
|
|
||||||
|
|
||||||
namespace :cron do
|
namespace :cron do
|
||||||
desc 'Setup cron tasks.'
|
desc 'Setup cron tasks.'
|
||||||
task setup: :environment do
|
task setup: :environment do
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
Que::Adapters::Base::CAST_PROCS[1184] = lambda do |value|
|
|
||||||
case value
|
|
||||||
when Time then value
|
|
||||||
when String then Time.parse(value)
|
|
||||||
else raise "Unexpected time class: #{value.class} (#{value.inspect})"
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -3,6 +3,8 @@ en:
|
||||||
api_users:
|
api_users:
|
||||||
index:
|
index:
|
||||||
header: API users
|
header: API users
|
||||||
|
set_test_btn: Set Test
|
||||||
|
remove_test_btn: Remove Test
|
||||||
|
|
||||||
new:
|
new:
|
||||||
header: New API user
|
header: New API user
|
||||||
|
|
|
@ -6,6 +6,7 @@ en:
|
||||||
registrant: Registrant
|
registrant: Registrant
|
||||||
|
|
||||||
show:
|
show:
|
||||||
|
download_btn: Download PDF
|
||||||
edit_btn: Edit statuses
|
edit_btn: Edit statuses
|
||||||
history_btn: History
|
history_btn: History
|
||||||
|
|
||||||
|
|
|
@ -19,4 +19,5 @@ en:
|
||||||
mass_actions: Mass actions
|
mass_actions: Mass actions
|
||||||
epp_log: EPP log
|
epp_log: EPP log
|
||||||
repp_log: REPP log
|
repp_log: REPP log
|
||||||
que: Que
|
sidekiq: Sidekiq
|
||||||
|
tasks: Tasks
|
||||||
|
|
|
@ -4,6 +4,8 @@ en:
|
||||||
index:
|
index:
|
||||||
header: Registrars
|
header: Registrars
|
||||||
new_btn: New registrar
|
new_btn: New registrar
|
||||||
|
set_test_btn: Set Test
|
||||||
|
remove_test_btn: Remove Test
|
||||||
|
|
||||||
new:
|
new:
|
||||||
header: New registrar
|
header: New registrar
|
||||||
|
@ -28,6 +30,8 @@ en:
|
||||||
api_users:
|
api_users:
|
||||||
header: API Users
|
header: API Users
|
||||||
new_btn: New API user
|
new_btn: New API user
|
||||||
|
set_test_btn: Set Test
|
||||||
|
remove_test_btn: Remove Test
|
||||||
|
|
||||||
white_ips:
|
white_ips:
|
||||||
header: Whitelisted IPs
|
header: Whitelisted IPs
|
||||||
|
|
|
@ -440,6 +440,7 @@ en:
|
||||||
exDate: 'Valid to'
|
exDate: 'Valid to'
|
||||||
dequeue: 'Dequeue'
|
dequeue: 'Dequeue'
|
||||||
are_you_sure_you_want_to_delete_domain: 'Are you sure you want to delete domain %{domain}?'
|
are_you_sure_you_want_to_delete_domain: 'Are you sure you want to delete domain %{domain}?'
|
||||||
|
are_you_sure_you_want_to_delete_auction: 'Warning: Are you sure you want to delete this record? Be advised that doing so will remove the record only from registry database and will make the domain available for anyone to register. This will not affect auction system if the auction record is already created there. You will need to delete the record in auction system first to remove the domain from auction.'
|
||||||
upload_key: 'Upload key'
|
upload_key: 'Upload key'
|
||||||
legal_document: 'Legal document'
|
legal_document: 'Legal document'
|
||||||
legal_document_max_size: '(max. 8MB)'
|
legal_document_max_size: '(max. 8MB)'
|
||||||
|
@ -543,6 +544,7 @@ en:
|
||||||
bind_manually: 'Bind manually'
|
bind_manually: 'Bind manually'
|
||||||
client: 'Client'
|
client: 'Client'
|
||||||
you_have_a_new_invoice: 'You have a new invoice.'
|
you_have_a_new_invoice: 'You have a new invoice.'
|
||||||
|
monthly_invoice: "Here comes the report with the last month's credit account activities."
|
||||||
sincerely: 'Sincerely'
|
sincerely: 'Sincerely'
|
||||||
expiry: 'Expiry'
|
expiry: 'Expiry'
|
||||||
failed_to_create_crt_csr_already_signed: 'Failed to create certificate: CSR is already signed'
|
failed_to_create_crt_csr_already_signed: 'Failed to create certificate: CSR is already signed'
|
||||||
|
@ -635,6 +637,8 @@ en:
|
||||||
registrant_ident: 'Registrant ident'
|
registrant_ident: 'Registrant ident'
|
||||||
contact_ident: 'Contact ident'
|
contact_ident: 'Contact ident'
|
||||||
results_per_page: 'Results per page'
|
results_per_page: 'Results per page'
|
||||||
|
set_test_btn: Set Test
|
||||||
|
remove_test_btn: Remove Test
|
||||||
nameserver_hostname: 'Nameserver hostname'
|
nameserver_hostname: 'Nameserver hostname'
|
||||||
result_count:
|
result_count:
|
||||||
zero: 'No results'
|
zero: 'No results'
|
||||||
|
|
|
@ -14,3 +14,6 @@ et:
|
||||||
already_paid: " (juba makstud)"
|
already_paid: " (juba makstud)"
|
||||||
monthly_invoice: " (kuuaruanne)"
|
monthly_invoice: " (kuuaruanne)"
|
||||||
monthly_invoice_description: 'Kuuaruanne'
|
monthly_invoice_description: 'Kuuaruanne'
|
||||||
|
you_have_a_new_invoice: 'Teil on uus arve.'
|
||||||
|
monthly_invoice: "Siit tuleb aruanne möödunud kuul ettemaksukontoga seotud tasuliste toimingutega."
|
||||||
|
sincerely: 'Lugupidamisega'
|
||||||
|
|
|
@ -176,10 +176,13 @@ Rails.application.routes.draw do
|
||||||
namespace :accreditation_center do
|
namespace :accreditation_center do
|
||||||
# At the moment invoice_status endpoint returns only cancelled invoices. But in future logic of this enpoint can change.
|
# At the moment invoice_status endpoint returns only cancelled invoices. But in future logic of this enpoint can change.
|
||||||
# And it will need to return invoices of different statuses. I decided to leave the name of the endpoint "invoice_status"
|
# And it will need to return invoices of different statuses. I decided to leave the name of the endpoint "invoice_status"
|
||||||
resources :invoice_status, only: [:index]
|
resources :invoice_status, only: [ :index ]
|
||||||
resource :domains, only: [:show], param: :name
|
resource :domains, only: [ :show ], param: :name
|
||||||
resource :contacts, only: [:show], param: :id
|
resource :contacts, only: [ :show ], param: :id
|
||||||
|
resource :results, only: [ :show ], param: :name
|
||||||
# resource :auth, only: [ :index ]
|
# resource :auth, only: [ :index ]
|
||||||
|
get 'show_api_user', to: 'results#show_api_user'
|
||||||
|
get 'list_accreditated_api_users', to: 'results#list_accreditated_api_users'
|
||||||
get 'auth', to: 'auth#index'
|
get 'auth', to: 'auth#index'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -303,7 +306,7 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
resources :accounts
|
resources :accounts
|
||||||
resources :account_activities
|
resources :account_activities
|
||||||
resources :auctions, only: [ :index, :create ] do
|
resources :auctions, only: %i[index create destroy] do
|
||||||
collection do
|
collection do
|
||||||
post 'upload_spreadsheet', to: 'auctions#upload_spreadsheet', as: :upload_spreadsheet
|
post 'upload_spreadsheet', to: 'auctions#upload_spreadsheet', as: :upload_spreadsheet
|
||||||
end
|
end
|
||||||
|
@ -340,6 +343,7 @@ Rails.application.routes.draw do
|
||||||
resource :registry_lock, controller: 'domains/registry_lock', only: :destroy
|
resource :registry_lock, controller: 'domains/registry_lock', only: :destroy
|
||||||
|
|
||||||
member do
|
member do
|
||||||
|
get :download
|
||||||
patch :keep
|
patch :keep
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -393,6 +397,13 @@ Rails.application.routes.draw do
|
||||||
resources :registrars do
|
resources :registrars do
|
||||||
resources :api_users, except: %i[index]
|
resources :api_users, except: %i[index]
|
||||||
resources :white_ips
|
resources :white_ips
|
||||||
|
|
||||||
|
collection do
|
||||||
|
post 'set_test_date', to: 'registrars#set_test_date', as: 'set_test_date'
|
||||||
|
post 'remove_test_date', to: 'registrars#remove_test_date', as: 'remove_test_date'
|
||||||
|
post 'set_test_date_to_api_user', to: 'api_users#set_test_date_to_api_user', as: 'set_test_date_to_api_user'
|
||||||
|
post 'remove_test_date_to_api_user', to: 'api_users#remove_test_date_to_api_user', as: 'remove_test_date_to_api_user'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :contacts do
|
resources :contacts do
|
||||||
|
@ -421,7 +432,6 @@ Rails.application.routes.draw do
|
||||||
resources :bounced_mail_addresses, only: %i[index show destroy]
|
resources :bounced_mail_addresses, only: %i[index show destroy]
|
||||||
|
|
||||||
authenticate :admin_user do
|
authenticate :admin_user do
|
||||||
mount Que::Web, at: 'que'
|
|
||||||
mount Sidekiq::Web, at: 'sidekiq'
|
mount Sidekiq::Web, at: 'sidekiq'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
class AddQue < ActiveRecord::Migration[6.0]
|
class AddQue < ActiveRecord::Migration[6.0]
|
||||||
def self.up
|
def self.up
|
||||||
# The current version as of this migration's creation.
|
# The current version as of this migration's creation.
|
||||||
Que.migrate! :version => 3
|
# Que.migrate! :version => 3
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.down
|
def self.down
|
||||||
# Completely removes Que's job queue.
|
# Completely removes Que's job queue.
|
||||||
Que.migrate! :version => 0
|
# Que.migrate! :version => 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
5
db/migrate/20220406085500_remove_que_jobs.rb
Normal file
5
db/migrate/20220406085500_remove_que_jobs.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class RemoveQueJobs < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
# drop_table :que_jobs
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class ChangeNotificationTextTypeToText < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
change_column :notifications, :text, :text
|
||||||
|
end
|
||||||
|
end
|
|
@ -2216,7 +2216,7 @@ ALTER SEQUENCE public.nameservers_id_seq OWNED BY public.nameservers.id;
|
||||||
CREATE TABLE public.notifications (
|
CREATE TABLE public.notifications (
|
||||||
id integer NOT NULL,
|
id integer NOT NULL,
|
||||||
registrar_id integer NOT NULL,
|
registrar_id integer NOT NULL,
|
||||||
text character varying NOT NULL,
|
text text NOT NULL,
|
||||||
attached_obj_type character varying,
|
attached_obj_type character varying,
|
||||||
attached_obj_id integer,
|
attached_obj_id integer,
|
||||||
read boolean NOT NULL,
|
read boolean NOT NULL,
|
||||||
|
@ -5415,6 +5415,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
||||||
('20220413084748'),
|
('20220413084748'),
|
||||||
('20220504090512'),
|
('20220504090512'),
|
||||||
('20220524130709'),
|
('20220524130709'),
|
||||||
|
('20220701113409'),
|
||||||
('20220818075833');
|
('20220818075833');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
- [RFC5734 - Transport over TCP](http://tools.ietf.org/html/rfc5734)
|
- [RFC5734 - Transport over TCP](http://tools.ietf.org/html/rfc5734)
|
||||||
- [RFC5910 - DNSSEC Mapping](http://tools.ietf.org/html/rfc5910)
|
- [RFC5910 - DNSSEC Mapping](http://tools.ietf.org/html/rfc5910)
|
||||||
- [RFC3735 - Guidelines for Extending the EPP](http://tools.ietf.org/html/rfc3735)
|
- [RFC3735 - Guidelines for Extending the EPP](http://tools.ietf.org/html/rfc3735)
|
||||||
- [Change Poll Draft v0.8](https://tools.ietf.org/html/draft-ietf-regext-change-poll-08)
|
- [RFC8590 - Change Poll](https://www.rfc-editor.org/rfc/rfc8590)
|
||||||
|
|
||||||
## XML schemas
|
## XML schemas
|
||||||
|
|
||||||
|
@ -28,12 +28,10 @@
|
||||||
* [changePoll-1.0.xsd](/lib/schemas/changePoll-1.0.xsd)
|
* [changePoll-1.0.xsd](/lib/schemas/changePoll-1.0.xsd)
|
||||||
|
|
||||||
### .ee-specific
|
### .ee-specific
|
||||||
* [all-ee-1.0.xsd](/lib/schemas/all-ee-1.0.xsd)
|
* [all-ee-1.3.xsd](/lib/schemas/all-ee-1.3.xsd)
|
||||||
* [all-ee-1.1.xsd](/lib/schemas/all-ee-1.1.xsd)
|
|
||||||
* [eis-1.0.xsd](/lib/schemas/eis-1.0.xsd)
|
* [eis-1.0.xsd](/lib/schemas/eis-1.0.xsd)
|
||||||
* [epp-ee-1.0.xsd](/lib/schemas/epp-ee-1.0.xsd)
|
* [epp-ee-1.0.xsd](/lib/schemas/epp-ee-1.0.xsd)
|
||||||
* [domain-eis-1.0.xsd](/lib/schemas/domain-eis-1.0.xsd)
|
* [domain-ee-1.2.xsd](/lib/schemas/domain-ee-1.2.xsd)
|
||||||
* [contact-eis-1.0.xsd](/lib/schemas/contact-eis-1.0.xsd)
|
|
||||||
* [contact-ee-1.1.xsd](/lib/schemas/contact-ee-1.1.xsd)
|
* [contact-ee-1.1.xsd](/lib/schemas/contact-ee-1.1.xsd)
|
||||||
|
|
||||||
More info about The Extensible Provisioning Protocol (EPP):
|
More info about The Extensible Provisioning Protocol (EPP):
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
Registry que server
|
|
||||||
===================
|
|
||||||
|
|
||||||
Que server responsibilites:
|
|
||||||
|
|
||||||
* handle write type of communication between Registrant and Registry
|
|
||||||
* handle future jobs for Registry
|
|
||||||
* handle heavy load jobs for Registry
|
|
||||||
|
|
||||||
Installation
|
|
||||||
------------
|
|
||||||
|
|
||||||
Que can deploy either separaetly or along to Registry server depends on real load situation.
|
|
||||||
In both serarious que requires working Registry deployment and full access to Registry databases.
|
|
||||||
|
|
||||||
Installation at deployed server:
|
|
||||||
|
|
||||||
cd /home/registry/registry/current
|
|
||||||
sudo cp doc/que/que_init_sample /etc/init.d/que # and edit it
|
|
||||||
sudo chmod +x /etc/init.d/que
|
|
||||||
sudo /etc/init.d/que # for help and other commands
|
|
||||||
sudo /etc/init.d/que start # for manual start
|
|
||||||
sudo update-rc.d que defaults # for start in server boot
|
|
||||||
|
|
||||||
PID files
|
|
||||||
---------
|
|
||||||
|
|
||||||
All pid files are at log/que directory.
|
|
||||||
|
|
||||||
Debugging
|
|
||||||
---------
|
|
||||||
|
|
||||||
You can run que manually as well for debugging:
|
|
||||||
|
|
||||||
cd /home/registry/registry/current
|
|
||||||
|
|
||||||
For all manual que tasks:
|
|
||||||
|
|
||||||
RAILS_ENV=production bundle exec rake -T que # for all que tasks for manual control
|
|
||||||
rake que:clear # Clear Que's job table
|
|
||||||
rake que:drop # Drop Que's job table
|
|
||||||
rake que:migrate # Migrate Que's job table to the most recent version (creating it if it doesn't exist)
|
|
||||||
rake que:work # Process Que's jobs using a worker pool
|
|
||||||
|
|
||||||
For all que daemon tasks what inist script uses
|
|
||||||
|
|
||||||
RAILS_ENV=production bundle exec rake -T daemon # for all que daemon tasks what init script uses
|
|
||||||
rake daemon:que # Start que script
|
|
||||||
rake daemon:que:restart # Restart que daemon
|
|
||||||
rake daemon:que:start # Start que daemon
|
|
||||||
rake daemon:que:status # Status que daemon
|
|
||||||
rake daemon:que:stop # Stop que daemon
|
|
|
@ -1,48 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: Registry que server
|
|
||||||
# Required-Start: $all
|
|
||||||
# Required-Stop: $network $local_fs $syslog
|
|
||||||
# Default-Start: 2 3 4 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: Enable Registry que server
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
set -u
|
|
||||||
set -e
|
|
||||||
|
|
||||||
### CHANGES
|
|
||||||
APP_HOME="/home/registry/registry"
|
|
||||||
APP_ROOT="$APP_HOME/current"
|
|
||||||
QUE_USER=registry # or use some other unprivileged OS user what your registry servers uses
|
|
||||||
RAILS_ENV=production
|
|
||||||
RUBY_BUNDLE=/home/$QUE_USER/.rbenv/shims/bundle
|
|
||||||
QUE_INSTANCES=1 # or as many really needed based on real load info
|
|
||||||
### END OF CHANGES
|
|
||||||
|
|
||||||
cd $APP_ROOT || exit 1
|
|
||||||
|
|
||||||
case ${1-help} in
|
|
||||||
status)
|
|
||||||
cd $APP_ROOT && RAILS_ENV=$RAILS_ENV $RUBY_BUNDLE exec lib/daemons/que_ctl status
|
|
||||||
;;
|
|
||||||
start)
|
|
||||||
echo "$1 que monitor and server"
|
|
||||||
for i in `seq 1 $QUE_INSTANCES`; do
|
|
||||||
cd $APP_ROOT && QUE_WORKER_COUNT=1 RAILS_ENV=$RAILS_ENV QUE_USER=$QUE_USER $RUBY_BUNDLE exec rake daemon:que:start
|
|
||||||
echo 'que instance started'
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
echo "$1 que monitor and server"
|
|
||||||
cd $APP_ROOT && RAILS_ENV=$RAILS_ENV $RUBY_BUNDLE exec lib/daemons/que_ctl stop
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
echo "$1 que monitor and server"
|
|
||||||
cd $APP_ROOT && RAILS_ENV=$RAILS_ENV QUE_USER=$QUE_USER $RUBY_BUNDLE exec rake daemon:que:restart
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo >&2 "Usage: $0 <status|start|stop|restart>"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env ruby
|
|
||||||
results = []
|
|
||||||
Dir[File.dirname(__FILE__) + "/*_ctl"].each { |f| results << `ruby #{f} #{ARGV.first}` }
|
|
||||||
results.delete_if { |result| result.nil? || result.empty? }
|
|
||||||
puts results.join unless results.empty?
|
|
|
@ -1,43 +0,0 @@
|
||||||
#!/usr/bin/env ruby
|
|
||||||
|
|
||||||
ENV["RAILS_ENV"] ||= "production"
|
|
||||||
|
|
||||||
root = File.expand_path(File.dirname(__FILE__))
|
|
||||||
root = File.dirname(root) until File.exist?(File.join(root, 'config'))
|
|
||||||
Dir.chdir(root)
|
|
||||||
|
|
||||||
require File.join(root, "config", "environment")
|
|
||||||
|
|
||||||
# from que gem rake task
|
|
||||||
if defined?(::Rails) && Rails.respond_to?(:application)
|
|
||||||
# ActiveSupport's dependency autoloading isn't threadsafe, and Que uses
|
|
||||||
# multiple threads, which means that eager loading is necessary. Rails
|
|
||||||
# explicitly prevents eager loading when the environment task is invoked,
|
|
||||||
# so we need to manually eager load the app here.
|
|
||||||
Rails.application.eager_load!
|
|
||||||
end
|
|
||||||
|
|
||||||
Que.logger.level = Logger.const_get((ENV['QUE_LOG_LEVEL'] || 'INFO').upcase)
|
|
||||||
Que.worker_count = 1
|
|
||||||
Que.wake_interval = (ENV['QUE_WAKE_INTERVAL'] || 1).to_f
|
|
||||||
Que.mode = :async
|
|
||||||
|
|
||||||
# When changing how signals are caught, be sure to test the behavior with
|
|
||||||
# the rake task in tasks/safe_shutdown.rb.
|
|
||||||
|
|
||||||
stop = false
|
|
||||||
%w( INT ).each do |signal|
|
|
||||||
trap(signal) { stop = true }
|
|
||||||
end
|
|
||||||
|
|
||||||
at_exit do
|
|
||||||
$stdout.puts "Finishing Que's current jobs before exiting..."
|
|
||||||
Que.worker_count = 0
|
|
||||||
Que.mode = :off
|
|
||||||
$stdout.puts "Que's jobs finished, exiting..."
|
|
||||||
end
|
|
||||||
|
|
||||||
loop do
|
|
||||||
sleep 1
|
|
||||||
break if stop
|
|
||||||
end
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env ruby
|
|
||||||
require 'rubygems'
|
|
||||||
require 'daemons/rails/config'
|
|
||||||
config = Daemons::Rails::Config.for_controller(File.expand_path(__FILE__))
|
|
||||||
Daemons::Rails.run config[:script], config.to_hash
|
|
|
@ -1,31 +0,0 @@
|
||||||
namespace :migrate_jobs do
|
|
||||||
task all: :environment do
|
|
||||||
QueJob.all.each do |job|
|
|
||||||
process_que_job(job)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
task first: :environment do
|
|
||||||
job = QueJob.first
|
|
||||||
process_que_job(job)
|
|
||||||
end
|
|
||||||
|
|
||||||
def process_que_job(que_job)
|
|
||||||
return unless que_job
|
|
||||||
|
|
||||||
if skip_condition(que_job)
|
|
||||||
puts "Skipped Que job migration: #{que_job.inspect}"
|
|
||||||
else
|
|
||||||
args = que_job.args
|
|
||||||
time = que_job.run_at
|
|
||||||
time = Time.zone.now + 1.minute if time < Time.zone.now
|
|
||||||
|
|
||||||
que_job.job_class.constantize.set(wait_until: time).perform_later(*args)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def skip_condition(que_job)
|
|
||||||
que_job.last_error.present? || !(que_job.job_class.constantize < ApplicationJob) ||
|
|
||||||
!(que_job.job_class == 'DomainExpireEmailJob')
|
|
||||||
end
|
|
||||||
end
|
|
41
test/integration/admin_area/api_users_test.rb
Normal file
41
test/integration/admin_area/api_users_test.rb
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class AdminAreaRegistrarsIntegrationTest < ActionDispatch::IntegrationTest
|
||||||
|
include Devise::Test::IntegrationHelpers
|
||||||
|
|
||||||
|
setup do
|
||||||
|
ENV['registry_demo_registrar_api_user_url'] = 'http://registry.test:3000/api/v1/accreditation_center/show_api_user'
|
||||||
|
ENV['registry_demo_registrar_port'] = '3000'
|
||||||
|
@api_user = users(:api_bestnames)
|
||||||
|
sign_in users(:admin)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_set_test_date_to_api_user
|
||||||
|
# ENV['registry_demo_registrar_api_user_url'] = 'http://testapi.test'
|
||||||
|
|
||||||
|
date = Time.zone.now - 10.minutes
|
||||||
|
|
||||||
|
api_user = @api_user.dup
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
assert_nil @api_user.accreditation_date
|
||||||
|
assert_equal api_user.accreditation_date, date
|
||||||
|
|
||||||
|
# api_v1_accreditation_center_show_api_user_url
|
||||||
|
stub_request(:get, "http://registry.test:3000/api/v1/accreditation_center/show_api_user?username=#{@api_user.username}&identity_code=#{@api_user.identity_code}")
|
||||||
|
.with(
|
||||||
|
headers: {
|
||||||
|
'Accept' => '*/*',
|
||||||
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
||||||
|
'User-Agent' => 'Ruby'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.to_return(status: 200, body: { code: 200, user_api: api_user }.to_json, headers: {})
|
||||||
|
post set_test_date_to_api_user_admin_registrars_path, params: { user_api_id: @api_user.id }, headers: { 'HTTP_REFERER' => root_path }
|
||||||
|
@api_user.reload
|
||||||
|
assert_equal @api_user.accreditation_date.to_date, api_user.accreditation_date.to_date
|
||||||
|
assert_equal @api_user.accreditation_expire_date.to_date, api_user.accreditation_expire_date.to_date
|
||||||
|
end
|
||||||
|
end
|
|
@ -170,4 +170,15 @@ class AdminAreaAuctionIntegrationTest < ApplicationSystemTestCase
|
||||||
find(:id, "reserved-modal", match: :first).click
|
find(:id, "reserved-modal", match: :first).click
|
||||||
assert_text 'Reserved domains'
|
assert_text 'Reserved domains'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_delete_auction
|
||||||
|
visit admin_auctions_path
|
||||||
|
domain = Auction.first
|
||||||
|
|
||||||
|
find(:id, "delete-auction-#{domain.id}", match: :first).click
|
||||||
|
|
||||||
|
assert_raises ActiveRecord::RecordNotFound do
|
||||||
|
domain.reload
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
18
test/integration/admin_area/domain_show_test.rb
Normal file
18
test/integration/admin_area/domain_show_test.rb
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class DomainShowTest < ApplicationIntegrationTest
|
||||||
|
setup do
|
||||||
|
@domain = domains(:shop)
|
||||||
|
sign_in users(:admin)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_downloads_domain
|
||||||
|
filename = "#{@domain.name}.pdf"
|
||||||
|
get download_admin_domain_path(@domain)
|
||||||
|
|
||||||
|
assert_response :ok
|
||||||
|
assert_equal 'application/pdf', response.headers['Content-Type']
|
||||||
|
assert_equal "attachment; filename=\"#{filename}\"; filename*=UTF-8''#{filename}", response.headers['Content-Disposition']
|
||||||
|
assert_not_empty response.body
|
||||||
|
end
|
||||||
|
end
|
|
@ -4,6 +4,8 @@ class AdminAreaRegistrarsIntegrationTest < ActionDispatch::IntegrationTest
|
||||||
include Devise::Test::IntegrationHelpers
|
include Devise::Test::IntegrationHelpers
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
|
ENV['registry_demo_registrar_results_url'] = 'http://registry.test:3000/api/v1/accreditation_center/results'
|
||||||
|
ENV['registry_demo_registrar_port'] = '3000'
|
||||||
@registrar = registrars(:bestnames)
|
@registrar = registrars(:bestnames)
|
||||||
sign_in users(:admin)
|
sign_in users(:admin)
|
||||||
end
|
end
|
||||||
|
@ -17,4 +19,29 @@ class AdminAreaRegistrarsIntegrationTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
assert_equal new_iban, @registrar.iban
|
assert_equal new_iban, @registrar.iban
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_set_test_date
|
||||||
|
api_user = @registrar.api_users.first.dup
|
||||||
|
api_user.accreditation_date = Time.zone.now - 10.minutes
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
assert_nil @registrar.api_users.first.accreditation_date
|
||||||
|
|
||||||
|
stub_request(:get, "http://registry.test:3000/api/v1/accreditation_center/results?registrar_name=#{@registrar.name}")
|
||||||
|
.with(
|
||||||
|
headers: {
|
||||||
|
'Accept' => '*/*',
|
||||||
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
||||||
|
'User-Agent' => 'Ruby'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.to_return(status: 200, body: { code: 200, registrar_users: [api_user] }.to_json, headers: {})
|
||||||
|
|
||||||
|
post set_test_date_admin_registrars_path, params: { registrar_id: @registrar.id }, headers: { 'HTTP_REFERER' => root_path }
|
||||||
|
@registrar.reload
|
||||||
|
|
||||||
|
assert_equal @registrar.api_users.first.accreditation_date.to_date, api_user.accreditation_date.to_date
|
||||||
|
assert_equal @registrar.api_users.first.accreditation_expire_date.to_date, api_user.accreditation_expire_date.to_date
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,7 @@ class ApiV1AuctionUpdateTest < ActionDispatch::IntegrationTest
|
||||||
assert_equal ({ 'id' => '1b3ee442-e8fe-4922-9492-8fcb9dccc69c',
|
assert_equal ({ 'id' => '1b3ee442-e8fe-4922-9492-8fcb9dccc69c',
|
||||||
'domain' => 'auction.test',
|
'domain' => 'auction.test',
|
||||||
'status' => Auction.statuses[:awaiting_payment],
|
'status' => Auction.statuses[:awaiting_payment],
|
||||||
'platform' => nil }), ActiveSupport::JSON.decode(response.body)
|
'platform' => "auto" }), ActiveSupport::JSON.decode(response.body)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_marks_as_awaiting_payment
|
def test_marks_as_awaiting_payment
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ReppV1AccreditationInfoTest < ActionDispatch::IntegrationTest
|
class ReppV1AccreditationInfoTest < ActionDispatch::IntegrationTest
|
||||||
|
if Feature.allow_accr_endspoints?
|
||||||
def setup
|
def setup
|
||||||
@user = users(:api_bestnames)
|
@user = users(:api_bestnames)
|
||||||
token = Base64.encode64("#{@user.username}:#{@user.plain_text_password}")
|
token = Base64.encode64("#{@user.username}:#{@user.plain_text_password}")
|
||||||
|
@ -32,4 +33,5 @@ class ReppV1AccreditationInfoTest < ActionDispatch::IntegrationTest
|
||||||
assert_response :unauthorized
|
assert_response :unauthorized
|
||||||
assert_equal json[:message], 'Invalid authorization information'
|
assert_equal json[:message], 'Invalid authorization information'
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ReppV1AccreditationResultsTest < ActionDispatch::IntegrationTest
|
class ReppV1AccreditationResultsTest < ActionDispatch::IntegrationTest
|
||||||
|
if Feature.allow_accr_endspoints?
|
||||||
TEMPORARY_SECRET_KEY = ENV['accreditation_secret'].freeze
|
TEMPORARY_SECRET_KEY = ENV['accreditation_secret'].freeze
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
|
@ -49,4 +50,5 @@ class ReppV1AccreditationResultsTest < ActionDispatch::IntegrationTest
|
||||||
assert_equal json[:code], 2303
|
assert_equal json[:code], 2303
|
||||||
assert_equal json[:message], "Object 'chungachanga' does not exist"
|
assert_equal json[:message], "Object 'chungachanga' does not exist"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
22
test/interactions/record_date_of_test_test.rb
Normal file
22
test/interactions/record_date_of_test_test.rb
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class RecordDateOfTestTest < ActiveSupport::TestCase
|
||||||
|
setup do
|
||||||
|
@api_bestname = users(:api_bestnames)
|
||||||
|
@api_bestname.accreditation_date = Time.zone.now - 10.minutes
|
||||||
|
@api_bestname.accreditation_expire_date = @api_bestname.accreditation_date + 1.year
|
||||||
|
@api_bestname.save
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_record_data_to_apiuser
|
||||||
|
api_goodname = users(:api_goodnames)
|
||||||
|
|
||||||
|
assert_nil api_goodname.accreditation_date
|
||||||
|
assert_nil api_goodname.accreditation_expire_date
|
||||||
|
|
||||||
|
Actions::RecordDateOfTest.record_result_to_api_user(api_user: api_goodname, date: @api_bestname.accreditation_date)
|
||||||
|
|
||||||
|
assert_equal api_goodname.accreditation_date, @api_bestname.accreditation_date
|
||||||
|
assert_equal api_goodname.accreditation_expire_date, @api_bestname.accreditation_expire_date
|
||||||
|
end
|
||||||
|
end
|
|
@ -131,6 +131,49 @@ class AuctionTest < ActiveSupport::TestCase
|
||||||
assert_not @auction.domain_registrable?('')
|
assert_not @auction.domain_registrable?('')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_restart_new_auction_should_with_previous_manual_platform
|
||||||
|
@auction.update(platform: 'manual')
|
||||||
|
@auction.reload
|
||||||
|
|
||||||
|
assert_equal @auction.platform, 'manual'
|
||||||
|
|
||||||
|
assert_difference 'Auction.count' do
|
||||||
|
@auction.restart
|
||||||
|
end
|
||||||
|
|
||||||
|
new_auction = Auction.last
|
||||||
|
assert_equal new_auction.platform, 'manual'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_restart_new_auction_should_with_previous_auto_platform
|
||||||
|
@auction.update(platform: 'auto')
|
||||||
|
@auction.reload
|
||||||
|
|
||||||
|
assert_equal @auction.platform, 'auto'
|
||||||
|
|
||||||
|
assert_difference 'Auction.count' do
|
||||||
|
@auction.restart
|
||||||
|
end
|
||||||
|
|
||||||
|
new_auction = Auction.last
|
||||||
|
assert_equal new_auction.platform, 'auto'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_restart_new_auction_should_with_auto_if_platform_is_nil
|
||||||
|
@auction.update(platform: nil)
|
||||||
|
@auction.reload
|
||||||
|
|
||||||
|
assert_nil @auction.platform
|
||||||
|
|
||||||
|
assert_difference 'Auction.count' do
|
||||||
|
@auction.restart
|
||||||
|
end
|
||||||
|
|
||||||
|
new_auction = Auction.last
|
||||||
|
assert_equal new_auction.platform, 'auto'
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def test_restarts_an_auction
|
def test_restarts_an_auction
|
||||||
assert_equal 'auction.test', @auction.domain
|
assert_equal 'auction.test', @auction.domain
|
||||||
|
|
||||||
|
@ -142,4 +185,30 @@ class AuctionTest < ActiveSupport::TestCase
|
||||||
assert_equal 'auction.test', new_auction.domain
|
assert_equal 'auction.test', new_auction.domain
|
||||||
assert new_auction.started?
|
assert new_auction.started?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_auction_restart_should_assign_the_previous_manual_platform
|
||||||
|
assert_equal 'auction.test', @auction.domain
|
||||||
|
@auction.update(platform: :manual)
|
||||||
|
@auction.reload
|
||||||
|
|
||||||
|
assert_difference 'Auction.count' do
|
||||||
|
@auction.restart
|
||||||
|
end
|
||||||
|
|
||||||
|
auctions = Auction.where(domain: @auction.domain)
|
||||||
|
assert_equal auctions.first.platform, auctions.last.platform
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_auction_restart_should_assign_the_previous_auto_platform
|
||||||
|
assert_equal 'auction.test', @auction.domain
|
||||||
|
@auction.update(platform: :auto)
|
||||||
|
@auction.reload
|
||||||
|
|
||||||
|
assert_difference 'Auction.count' do
|
||||||
|
@auction.restart
|
||||||
|
end
|
||||||
|
|
||||||
|
auctions = Auction.where(domain: @auction.domain)
|
||||||
|
assert_equal auctions.first.platform, auctions.last.platform
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -37,8 +37,7 @@ class BankTransactionTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
first_transaction = BankTransaction.new(sum: 10,
|
first_transaction = BankTransaction.new(sum: 10,
|
||||||
description: 'Order nr 1 from registrar 1234567 second number 2345678')
|
description: 'Order nr 1 from registrar 1234567 second number 2345678')
|
||||||
|
first_transaction.bind_invoice(another_invoice.number)
|
||||||
first_transaction.create_activity(another_invoice.buyer, another_invoice)
|
|
||||||
|
|
||||||
transaction = BankTransaction.new(sum: 10,
|
transaction = BankTransaction.new(sum: 10,
|
||||||
description: 'Order nr 1 from registrar 1234567 second number 2345678')
|
description: 'Order nr 1 from registrar 1234567 second number 2345678')
|
||||||
|
|
|
@ -3,6 +3,7 @@ require 'application_system_test_case'
|
||||||
class AdminApiUsersSystemTest < ApplicationSystemTestCase
|
class AdminApiUsersSystemTest < ApplicationSystemTestCase
|
||||||
setup do
|
setup do
|
||||||
sign_in users(:admin)
|
sign_in users(:admin)
|
||||||
|
@registrar = registrars(:bestnames)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_shows_api_user_list
|
def test_shows_api_user_list
|
||||||
|
@ -11,4 +12,71 @@ class AdminApiUsersSystemTest < ApplicationSystemTestCase
|
||||||
api_user = users(:api_bestnames)
|
api_user = users(:api_bestnames)
|
||||||
assert_link api_user.username, href: admin_registrar_api_user_path(api_user.registrar, api_user)
|
assert_link api_user.username, href: admin_registrar_api_user_path(api_user.registrar, api_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_should_display_tests_button_in_api_user
|
||||||
|
visit admin_api_users_path
|
||||||
|
|
||||||
|
assert_button 'Set Test'
|
||||||
|
assert_no_button 'Remove Test'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_display_remove_test_if_there_accreditated_apiuser
|
||||||
|
date = Time.zone.now - 10.minutes
|
||||||
|
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
visit admin_api_users_path
|
||||||
|
|
||||||
|
assert_button 'Remove Test'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_not_display_remove_test_if_api_user_accreditation_date_is_expired
|
||||||
|
date = Time.zone.now - 1.year - 10.minutes
|
||||||
|
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
visit admin_api_users_path
|
||||||
|
|
||||||
|
assert_no_button 'Remove'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_display_tests_button_in_api_user_details
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
|
||||||
|
visit admin_api_user_path(api_user)
|
||||||
|
assert_button 'Set Test'
|
||||||
|
assert_no_button 'Remove Test'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_display_remove_test_in_api_user_details_if_there_accreditated_apiuser
|
||||||
|
date = Time.zone.now - 10.minutes
|
||||||
|
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
visit admin_api_user_path(api_user)
|
||||||
|
|
||||||
|
assert_button 'Remove Test'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_not_display_remove_test_if_api_user_accreditation_date_is_expired_in_api_details
|
||||||
|
date = Time.zone.now - 1.year - 10.minutes
|
||||||
|
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
visit admin_api_user_path(api_user)
|
||||||
|
|
||||||
|
assert_no_button 'Remove'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -93,4 +93,70 @@ class AdminRegistrarsSystemTest < ApplicationSystemTestCase
|
||||||
assert_text 'Language English'
|
assert_text 'Language English'
|
||||||
assert_text 'billing@bestnames.test'
|
assert_text 'billing@bestnames.test'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_should_display_btn_for_set_test_date
|
||||||
|
visit admin_registrars_path
|
||||||
|
|
||||||
|
assert_button 'Set Test'
|
||||||
|
assert_no_button 'Remove Test'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_display_remove_test_if_there_accreditated_registrars
|
||||||
|
date = Time.zone.now - 10.minutes
|
||||||
|
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
visit admin_registrars_path
|
||||||
|
|
||||||
|
assert_button 'Remove Test'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_not_display_remove_test_if_accreditation_date_is_expired
|
||||||
|
date = Time.zone.now - 1.year - 10.minutes
|
||||||
|
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
visit admin_registrars_path
|
||||||
|
|
||||||
|
assert_no_button 'Remove'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_display_tests_button_in_registrar_deftails
|
||||||
|
visit admin_registrar_path(@registrar)
|
||||||
|
|
||||||
|
assert_button 'Set Test'
|
||||||
|
assert_no_button 'Remove Test'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_display_remove_test_if_there_accreditated_registrars_in_registrar_details
|
||||||
|
date = Time.zone.now - 10.minutes
|
||||||
|
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
visit admin_registrar_path(@registrar)
|
||||||
|
|
||||||
|
assert_button 'Remove Test'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_should_not_display_remove_test_if_accreditation_date_is_expired_in_registrar_details
|
||||||
|
date = Time.zone.now - 1.year - 10.minutes
|
||||||
|
|
||||||
|
api_user = @registrar.api_users.first
|
||||||
|
api_user.accreditation_date = date
|
||||||
|
api_user.accreditation_expire_date = api_user.accreditation_date + 1.year
|
||||||
|
api_user.save
|
||||||
|
|
||||||
|
visit admin_registrar_path(@registrar)
|
||||||
|
|
||||||
|
assert_no_button 'Remove'
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -4,7 +4,6 @@ if ENV['COVERAGE']
|
||||||
add_filter '/app/models/version/'
|
add_filter '/app/models/version/'
|
||||||
add_filter '/lib/action_controller/'
|
add_filter '/lib/action_controller/'
|
||||||
add_filter '/lib/core_monkey_patches/'
|
add_filter '/lib/core_monkey_patches/'
|
||||||
add_filter '/lib/daemons/'
|
|
||||||
add_filter '/lib/gem_monkey_patches/'
|
add_filter '/lib/gem_monkey_patches/'
|
||||||
add_filter '/lib/tasks/'
|
add_filter '/lib/tasks/'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue