mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Merge branch 'master' of github.com:domify/registry
Conflicts: CHANGELOG.md app/mailers/domain_mailer.rb app/models/domain.rb app/views/layouts/registrant/application.haml config/application-example.yml config/locales/en.yml config/routes.rb spec/mailers/domain_mailer_spec.rb
This commit is contained in:
commit
412ececd9c
13 changed files with 82 additions and 25 deletions
|
@ -1,3 +1,7 @@
|
|||
14.05.2015
|
||||
|
||||
* Changed and added some new smtp enviroment variables. More info at application-example.yml
|
||||
|
||||
13.05.2015
|
||||
|
||||
* Added Registrant portal and apache config example
|
||||
|
|
5
app/controllers/registrant/whois_controller.rb
Normal file
5
app/controllers/registrant/whois_controller.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Registrant::WhoisController < RegistrantController
|
||||
def index
|
||||
authorize! :view, Registrant::Whois
|
||||
end
|
||||
end
|
|
@ -1,17 +1,17 @@
|
|||
class DomainMailer < ApplicationMailer
|
||||
def registrant_updated(domain)
|
||||
return if Rails.env.production? ? false : !TEST_EMAILS.include?(domain.registrant_email)
|
||||
@domain = domain
|
||||
return if Rails.env.production? ? false : !TEST_EMAILS.include?(@domain.registrant_email)
|
||||
# turn on delivery on specific request only, thus rake tasks does not deliver anything
|
||||
return if domain.deliver_emails != true
|
||||
if domain.registrant_verification_token.blank?
|
||||
return if @domain.deliver_emails != true
|
||||
if @domain.registrant_verification_token.blank?
|
||||
logger.warn "EMAIL DID NOT DELIVERED: registrant_verification_token is missing for #{@domain.name}"
|
||||
return
|
||||
end
|
||||
|
||||
@old_registrant = Registrant.find(domain.registrant_id_was)
|
||||
@old_registrant = Registrant.find(@domain.registrant_id_was)
|
||||
@verification_url = "#{ENV['registrant_url']}/etc/"
|
||||
|
||||
@domain = domain
|
||||
mail(to: @old_registrant.email,
|
||||
subject: "#{I18n.t(:domain_registrant_update_subject, name: @domain.name)} [#{@domain.name}]")
|
||||
end
|
||||
|
|
|
@ -13,6 +13,7 @@ class Ability
|
|||
when 'ApiUser'
|
||||
epp
|
||||
registrar
|
||||
registrant # refactor
|
||||
end
|
||||
|
||||
can :show, :dashboard
|
||||
|
@ -63,6 +64,10 @@ class Ability
|
|||
can :manage, :deposit
|
||||
end
|
||||
|
||||
def registrant
|
||||
can :manage, Registrant::Whois
|
||||
end
|
||||
|
||||
def user
|
||||
can :show, :dashboard
|
||||
end
|
||||
|
|
|
@ -63,6 +63,7 @@ class Domain < ActiveRecord::Base
|
|||
domain_statuses.build(value: DomainStatus::PENDING_UPDATE)
|
||||
DomainMailer.registrant_updated(self).deliver_now
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
before_save :touch_always_version
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
- active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil
|
||||
%li{class: active_class}= link_to t(:domains), registrant_domains_path
|
||||
|
||||
- active_class = %w(registrant/whois).include?(params[:controller]) ? 'active' :nil
|
||||
%li{class: active_class}= link_to t(:whois), registrant_whois_path
|
||||
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
- if user_signed_in?
|
||||
%li= link_to t(:log_out, user: current_user), '/registrant/logout'
|
||||
|
|
21
app/views/registrant/whois/index.haml
Normal file
21
app/views/registrant/whois/index.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
= render 'shared/title', name: t(:whois)
|
||||
|
||||
- if ENV['restful_whois_url'].blank?
|
||||
%p
|
||||
Registrant configuration issue: missing restful_whois_url
|
||||
- else
|
||||
.row
|
||||
.col-md-12{style: 'margin-bottom: -15px;'}
|
||||
= form_tag registrant_whois_path, class: 'form-horizontal', method: :get do
|
||||
.col-md-11
|
||||
.form-group
|
||||
= text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t(:domain_name), autocomplete: 'off', autofocus: true
|
||||
.col-md-1.text-right.text-center-xs
|
||||
.form-group
|
||||
%button.btn.btn-default
|
||||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
%hr
|
||||
- if @results
|
||||
= @results
|
|
@ -35,12 +35,23 @@ key_path: '/home/registry/registry/shared/ca/private/webclient.key.pem'
|
|||
epp_hostname: 'registry.gitlab.eu'
|
||||
repp_url: 'https://repp.gitlab.eu/repp/v1/'
|
||||
|
||||
# Registrant server configuration
|
||||
restful_whois_url: 'https://restful-whois.example.com'
|
||||
|
||||
# SMTP configuration (for Admin/EPP/Registrar/Registrant servers)
|
||||
address: 'server-hostname'
|
||||
port: '000'
|
||||
user_name: 'login'
|
||||
password: 'pw/key'
|
||||
domain: 'domain for HELO checking'
|
||||
smtp_address: 'server-hostname'
|
||||
smtp_port: '25' # 587, 465
|
||||
smtp_user_name: 'login'
|
||||
smtp_password: 'pw/key'
|
||||
# If you need to specify a HELO domain, you can do it here.
|
||||
smtp_domain: '' # 'domain for HELO checking'
|
||||
# Use "none" only when for a self-signed and/or wildcard certificate
|
||||
smtp_openssl_verify_mode: 'peer' # 'none', 'peer', 'client_once','fail_if_no_peer_cert'
|
||||
# Detects if STARTTLS is enabled in your SMTP server and starts to use it. Defaults to true.
|
||||
# Set this to false if there is a problem with your server certificate that you cannot resolve.
|
||||
smtp_enable_starttls_auto: 'true' # 'false'
|
||||
# If your mail server requires authentication, please change.
|
||||
smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5'
|
||||
registrant_url: 'https:/registrant.example.com' # for valid email body registrant links
|
||||
|
||||
# Autotest config overwrites
|
||||
|
|
|
@ -60,13 +60,14 @@ module Registry
|
|||
config.action_mailer.raise_delivery_errors = true
|
||||
|
||||
config.action_mailer.smtp_settings = {
|
||||
address: ENV['address'],
|
||||
port: ENV['port'],
|
||||
enable_starttls_auto: true,
|
||||
user_name: ENV['user_name'],
|
||||
password: ENV['password'],
|
||||
authentication: 'login',
|
||||
domain: ENV['domain']
|
||||
address: ENV['smtp_address'],
|
||||
port: ENV['smtp_port'],
|
||||
enable_starttls_auto: ENV['smtp_enable_starttls_auto'] == 'true',
|
||||
user_name: ENV['smtp_user_name'],
|
||||
password: ENV['smtp_password'],
|
||||
authentication: ENV['smtp_authentication'],
|
||||
domain: ENV['smtp_domain'],
|
||||
openssl_verify_mode: ENV['smtp_openssl_verify_mode']
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -766,3 +766,4 @@ en:
|
|||
contact_email_update_subject: 'Teie domeenide kontakt epostiaadress on muutunud / Contact e-mail addresses of your domains have changed'
|
||||
object_status_prohibits_operation: 'Object status prohibits operation'
|
||||
domain_registrant_update_subject: "Kinnitustaotlus domeeni %{name} registreerija vahetuseks / Application for approval for registrant chache of %{name}"
|
||||
whois: WHOIS
|
||||
|
|
|
@ -191,7 +191,7 @@ common: &default_settings
|
|||
development:
|
||||
<<: *default_settings
|
||||
# Turn on communication to New Relic service in development mode
|
||||
monitor_mode: true
|
||||
monitor_mode: false
|
||||
app_name: Registry (Development)
|
||||
|
||||
# Rails Only - when running in Developer Mode, the New Relic Agent will
|
||||
|
@ -199,7 +199,7 @@ development:
|
|||
# executed since starting the mongrel.
|
||||
# NOTE: There is substantial overhead when running in developer mode.
|
||||
# Do not use for production or load testing.
|
||||
developer_mode: true
|
||||
developer_mode: false
|
||||
|
||||
test:
|
||||
<<: *default_settings
|
||||
|
|
|
@ -126,6 +126,7 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :whois
|
||||
# resources :contacts do
|
||||
# member do
|
||||
# get 'delete'
|
||||
|
|
|
@ -31,6 +31,10 @@ describe DomainMailer do
|
|||
@new_registrant = Fabricate(:registrant, email: 'test@example.org')
|
||||
@domain = Fabricate(:domain, registrant: @registrant)
|
||||
@domain.deliver_emails = true
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
@domain.registrant_verification_token = '123'
|
||||
>>>>>>> 0ddd2b6f32fa7e9abec8b2e7c88173585a78f3dd
|
||||
@domain.registrant = @new_registrant
|
||||
@mail = DomainMailer.registrant_updated(@domain)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue