Merge branch 'master' of github.com:domify/registry

This commit is contained in:
Martin Lensment 2015-01-20 17:49:26 +02:00
commit 508b822d3f
6 changed files with 181 additions and 147 deletions

View file

@ -1,3 +1,6 @@
20.01.2015
* Added dedicated mina cron:setup Now cron is not updated automatically and should update manually.
19.01.2015
* Added application-exapmle.yml and removed application.yml from repo, please

View file

@ -63,7 +63,6 @@ Production install (database schema should be loaded and seeds should be present
cd registry
cp current/config/application-example.yml shared/config/application.yml # and edit it
cp current/config/database-example.yml shared/config/database.yml # and edit it
cp current/config/initializers/devise_secret_example.rb.txt shared/config/initializers/devise_secret.rb # and edit it
vi /etc/apache2/sites-enabled/registry.conf # add conf and all needed serts
vi /etc/apache2/sites-enabled/epp.conf # add epp conf, restart apache
@ -202,9 +201,10 @@ Deployment
CRON
----
Crontab is automatically updated after each deploy. Jobs can be viewed [here](https://github.com/internetee/registry/blob/master/config/schedule.rb).
Crontab can be setup after deploy. Jobs can be viewed [here](https://github.com/internetee/registry/blob/master/config/schedule.rb).
Alternatively you can run `mina pr whenever:update` to update the crontab.
mina pr cron:setup # to update the crontab.
mina pr cron:clear # to clear crontab.
Autotesting
-----------

View file

@ -33,6 +33,14 @@ task :st do
set :branch, 'master' # same as production
end
# staging
task :eppst do
set :domain, 'epp-st'
set :deploy_to, '$HOME/epp'
set :repository, 'https://github.com/internetee/registry' # production repo
set :branch, 'master' # same as production
end
# production
task :pr do
set :domain, 'registry'
@ -41,6 +49,15 @@ task :pr do
set :branch, 'master' # same as staging
end
# production
task :epppr do
set :domain, 'epp'
set :deploy_to, '$HOME/epp'
set :repository, 'https://github.com/internetee/registry' # production repo
set :branch, 'master' # same as staging
end
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
# They will be linked in the 'deploy:link_shared_paths' step.
set :shared_paths, [
@ -108,7 +125,6 @@ task deploy: :environment do
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
to :launch do
invoke :'whenever:update'
invoke :restart
end
end
@ -122,7 +138,6 @@ task rollback: :environment do
ls -Art "#{deploy_to}/releases" | sort | tail -n 2 | head -n 1 |
xargs -I active ln -nfs "#{deploy_to}/releases/active" "#{deploy_to}/current"
)
invoke :'whenever:update'
to :launch do
invoke :restart
end
@ -141,6 +156,20 @@ task restart: :environment do
queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"
end
namespace :cron do
desc 'Setup cron tasks.'
task setup: :environment do
invoke :'rbenv:load'
invoke :'whenever:update'
end
desc 'Clear cron tasks.'
task clear: :environment do
invoke :'rbenv:load'
invoke :'whenever:clear'
end
end
# For help in making your deploy script, see the Mina documentation:
#
# - http://nadarei.co/mina

View file

@ -2,142 +2,142 @@
### Domain create
| Field name | Min-max | Field description |
| ----------------------- |---------|------------------ |
| `<create>` | 1 | |
| `-<domain:create>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" |
| `--<domain:name>` | 1 | Domain name. Can contain unicode characters. |
| `--<domain:period>` | 0-1 | Registration period for domain. Must add up to 1 / 2 / 3 years. Attribute: unit="y/m/d"|
| `--<domain:registrant>` | 1 | Contact reference to the registrant |
| `--<domain:contact>` | 0-n | Contact reference. Admin contact is required if registrant is a juridical person. Attribute: type="admin / tech" |
| `--<domain:ns>` | 1 | |
| `---<domain:hostAttr>` | 2-11 | |
| `----<domain:hostName>` | 1 | Hostname of the nameserver |
| `----<domain:hostAddr>` | 0-2 | Required if nameserver is under domain zone. Attribute ip="v4 / v6" |
| `<extension>` | 1 | |
| `-<secDNS:create>` | 0-1 | Attribute: xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" |
| `--<secDNS:keyData>` | 1-n | |
| `---<secDNS:flags>` | 1 | Allowed values: 0, 256, 257 |
| `---<secDNS:protocol>` | 1 | Allowed values: 3 |
| `---<secDNS:alg>` | 1 | Allowed values: 3, 5, 6, 7, 8, 252, 253, 254, 255 |
| `---<secDNS:pubKey>` | 1 | Public key |
| `-<eis:extdata>` | 1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" |
| `--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf" |
| `<clTRID>` | 0-1 | Client transaction id |
Field name | Min-max | Field description
----------------------- | ------- | -----------------
`<create>` | 1 |
`-<domain:create>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
`--<domain:name>` | 1 | Domain name. Can contain unicode characters.
`--<domain:period>` | 0-1 | Registration period for domain. Must add up to 1 / 2 / 3 years. <br> Attribute: unit="y/m/d"
`--<domain:registrant>` | 1 | Contact reference to the registrant
`--<domain:contact>` | 0-n | Contact reference. Admin contact is required if registrant is a <br> juridical person. Attribute: type="admin / tech"
`--<domain:ns>` | 1 |
`---<domain:hostAttr>` | 2-11 |
`----<domain:hostName>` | 1 | Hostname of the nameserver
`----<domain:hostAddr>` | 0-2 | Required if nameserver is under domain zone. Attribute ip="v4 / v6"
`<extension>` | 1 |
`-<secDNS:create>` | 0-1 | Attribute: xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1"
`--<secDNS:keyData>` | 1-n |
`---<secDNS:flags>` | 1 | Allowed values: 0, 256, 257
`---<secDNS:protocol>` | 1 | Allowed values: 3
`---<secDNS:alg>` | 1 | Allowed values: 3, 5, 6, 7, 8, 252, 253, 254, 255
`---<secDNS:pubKey>` | 1 | Public key
`-<eis:extdata>` | 1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
`--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf"
`<clTRID>` | 0-1 | Client transaction id
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-doc.md#epp-domain-with-valid-user-with-citizen-as-an-owner-creates-a-domain)
### Domain update
| Field name | Min-max | Field description |
| ------------------------ |---------|------------------ |
| `<update>` | 1 | |
| `-<domain:update>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" |
| `--<domain:name>` | 1 | Domain name. Can contain unicode characters. |
| `--<domain:chg>` | 0-1 | Attributes to change |
| `---<domain:registrant>` | 0-1 | Contact reference to the registrant |
| `--<domain:add>` | 0-1 | Objects to add |
| `---<domain:contact>` | 0-n | Contact reference. Attribute: type="admin / tech" |
| `---<domain:status>` | 0-n | Status description. Attribute: s="clientDeleteProhibited / clientHold / clientRenewProhibited / clientTransferProhibited / clientUpdateProhibited" |
| `---<domain:ns>` | 0-1 | |
| `----<domain:hostAttr>` | 1 | |
| `-----<domain:hostName>` | 1 | Hostname of the nameserver |
| `-----<domain:hostAddr>` | 0-2 | Required if nameserver is under domain zone. Attribute ip="v4 / v6" |
| `--<domain:rem>` | 0-1 | Objects to remove |
| `---<domain:contact>` | 0-n | Contact reference. Attribute: type="admin / tech" |
| `---<domain:status>` | 0-n | Attribute: s="clientDeleteProhibited / clientHold / clientRenewProhibited / clientTransferProhibited / clientUpdateProhibited" |
| `---<domain:ns>` | 0-1 | |
| `----<domain:hostAttr>` | 1 | |
| `-----<domain:hostName>` | 1 | Hostname of the nameserver |
| `<extension>` | 0-1 | Required if registrant is changing |
| `-<secDNS:update>` | 0-1 | Attribute: xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" |
| `--<secDNS:add>` | 0-1 | |
| `---<secDNS:keyData>` | 1-n | |
| `----<secDNS:flags>` | 1 | Allowed values: 0, 256, 257 |
| `----<secDNS:protocol>` | 1 | Allowed values: 3 |
| `----<secDNS:alg>` | 1 | Allowed values: 3, 5, 6, 7, 8, 252, 253, 254, 255 |
| `----<secDNS:pubKey>` | 1 | Public key |
| `--<secDNS:rem>` | 0-1 | |
| `---<secDNS:keyData>` | 1-n | |
| `----<secDNS:pubKey>` | 1 | Public key |
| `-<eis:extdata>` | 0-1 | Required if registrant is changing. Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" |
| `--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf" |
| `<clTRID>` | 0-1 | Client transaction id |
Field name | Min-max | Field description
------------------------ | -------- | -----------------
`<update>` | 1 |
`-<domain:update>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
`--<domain:name>` | 1 | Domain name. Can contain unicode characters.
`--<domain:chg>` | 0-1 | Attributes to change
`---<domain:registrant>` | 0-1 | Contact reference to the registrant
`--<domain:add>` | 0-1 | Objects to add
`---<domain:contact>` | 0-n | Contact reference. Attribute: type="admin / tech"
`---<domain:status>` | 0-n | Status description. Attribute: s="clientDeleteProhibited / clientHold / <br> clientRenewProhibited / clientTransferProhibited / clientUpdateProhibited"
`---<domain:ns>` | 0-1 |
`----<domain:hostAttr>` | 1 |
`-----<domain:hostName>` | 1 | Hostname of the nameserver
`-----<domain:hostAddr>` | 0-2 | Required if nameserver is under domain zone. Attribute ip="v4 / v6"
`--<domain:rem>` | 0-1 | Objects to remove
`---<domain:contact>` | 0-n | Contact reference. Attribute: type="admin / tech"
`---<domain:status>` | 0-n | Attribute: s="clientDeleteProhibited / clientHold / clientRenewProhibited / <br> clientTransferProhibited / clientUpdateProhibited"
`---<domain:ns>` | 0-1 |
`----<domain:hostAttr>` | 1 |
`-----<domain:hostName>` | 1 | Hostname of the nameserver
`<extension>` | 0-1 | Required if registrant is changing
`-<secDNS:update>` | 0-1 | Attribute: xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1"
`--<secDNS:add>` | 0-1 |
`---<secDNS:keyData>` | 1-n |
`----<secDNS:flags>` | 1 | Allowed values: 0, 256, 257
`----<secDNS:protocol>` | 1 | Allowed values: 3
`----<secDNS:alg>` | 1 | Allowed values: 3, 5, 6, 7, 8, 252, 253, 254, 255
`----<secDNS:pubKey>` | 1 | Public key
`--<secDNS:rem>` | 0-1 |
`---<secDNS:keyData>` | 1-n |
`----<secDNS:pubKey>` | 1 | Public key
`-<eis:extdata>` | 0-1 | Required if registrant is changing. <br> Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
`--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf"
`<clTRID>` | 0-1 | Client transaction id
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-doc.md#epp-domain-with-valid-user-with-valid-domain-updates-domain-and-adds-objects)
### Domain delete
| Field name | Min-max | Field description |
| ----------------------- |---------|------------------ |
| `<delete>` | 1 | |
| `-<domain:delete>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" |
| `--<domain:name>` | 1 | Domain name. Can contain unicode characters. |
| `<extension>` | 1 | |
| `-<eis:extdata>` | 1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" |
| `--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf" |
| `<clTRID>` | 0-1 | Client transaction id |
Field name | Min-max | Field description
----------------------- | ------- | -----------------
`<delete>` | 1 |
`-<domain:delete>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
`--<domain:name>` | 1 | Domain name. Can contain unicode characters.
`<extension>` | 1 |
`-<eis:extdata>` | 1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
`--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf"
`<clTRID>` | 0-1 | Client transaction id
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-doc.md#epp-domain-with-valid-user-with-valid-domain-deletes-domain)
### Domain info
| Field name | Min-max | Field description |
| ----------------------- |---------|------------------ |
| `<info>` | 1 | |
| `-<domain:info>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" |
| `--<domain:name>` | 1 | Domain name. Can contain unicode characters. Attribute: hosts="all / TODO" |
| `--<domain:authInfo>` | 0-1 | Required if registrar is not the owner of the domain. |
| `---<domain:pw>` | 1 | Domain password. Attribute: roid="String" |
| `<extension>` | 0-1 | |
| `-<eis:extdata>` | 0-1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" |
| `--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf" |
| `<clTRID>` | 0-1 | Client transaction id |
Field name | Min-max | Field description
----------------------- | ------- | -----------------
`<info>` | 1 |
`-<domain:info>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
`--<domain:name>` | 1 | Domain name. Can contain unicode characters. <br> Attribute: hosts="all / TODO"
`--<domain:authInfo>` | 0-1 | Required if registrar is not the owner of the domain.
`---<domain:pw>` | 1 | Domain password. Attribute: roid="String"
`<extension>` | 0-1 |
`-<eis:extdata>` | 0-1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
`--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf"
`<clTRID>` | 0-1 | Client transaction id
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-doc.md#epp-domain-with-valid-user-with-valid-domain-returns-domain-info)
### Domain renew
| Field name | Min-max | Field description |
| ----------------------- |---------|------------------ |
| `<renew>` | 1 | |
| `-<domain:renew>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" |
| `--<domain:name>` | 1 | Domain name. Can contain unicode characters. Attribute: hosts="all / TODO" |
| `--<domain:curExpDate>` | 1 | Current expiry date (ISO8601 format) |
| `--<domain:period>` | 1 | Registration period for domain. Must add up to 1 / 2 / 3 years. Attribute: unit="y/m/d" |
| `<extension>` | 0-1 | |
| `-<eis:extdata>` | 0-1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" |
| `--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf" |
| `<clTRID>` | 0-1 | Client transaction id |
Field name | Min-max | Field description
----------------------- | ------- | -----------------
`<renew>` | 1 |
`-<domain:renew>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
`--<domain:name>` | 1 | Domain name. Can contain unicode characters. <br> Attribute: hosts="all / TODO"
`--<domain:curExpDate>` | 1 | Current expiry date (ISO8601 format)
`--<domain:period>` | 1 | Registration period for domain. Must add up to 1 / 2 / 3 years. <br> Attribute: unit="y/m/d"
`<extension>` | 0-1 |
`-<eis:extdata>` | 0-1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
`--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf"
`<clTRID>` | 0-1 | Client transaction id
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-doc.md#epp-domain-with-valid-user-with-valid-domain-renews-a-domain)
### Domain transfer
| Field name | Min-max | Field description |
| ----------------------- |---------|------------------ |
| `<transfer>` | 1 | |
| `-<domain:transfer>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" |
| `--<domain:name>` | 1 | Domain name. Can contain unicode characters. Attribute: hosts="all / TODO" |
| `--<domain:authInfo>` | 1 | |
| `---<domain:pw>` | 1 | Domain password. Attribute: roid="String" |
| `<extension>` | 0-1 | |
| `-<eis:extdata>` | 0-1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" |
| `--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf" |
| `<clTRID>` | 0-1 | Client transaction id |
Field name | Min-max | Field description
----------------------- | ------- | -----------------
`<transfer>` | 1 |
`-<domain:transfer>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
`--<domain:name>` | 1 | Domain name. Can contain unicode characters. <br> Attribute: hosts="all / TODO"
`--<domain:authInfo>` | 1 |
`---<domain:pw>` | 1 | Domain password. Attribute: roid="String"
`<extension>` | 0-1 |
`-<eis:extdata>` | 0-1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
`--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf"
`<clTRID>` | 0-1 | Client transaction id
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-doc.md#epp-domain-with-valid-user-with-two-epp-users-transfers-a-domain)
### Domain check
| Field name | Min-max | Field description |
| ----------------------- |---------|------------------ |
| `<check>` | 1 | |
| `-<domain:check>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" |
| `--<domain:name>` | 1 | Domain name. Can contain unicode characters. Attribute: hosts="all / TODO" |
| `<extension>` | 0-1 | |
| `-<eis:extdata>` | 0-1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" |
| `--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf" |
| `<clTRID>` | 0-1 | Client transaction id |
Field name | Min-max | Field description
----------------------- | ------- | -----------------
`<check>` | 1 |
`-<domain:check>` | 1 | Attribute: xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
`--<domain:name>` | 1 | Domain name. Can contain unicode characters. <br> Attribute: hosts="all / TODO"
`<extension>` | 0-1 |
`-<eis:extdata>` | 0-1 | Attribute: xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"
`--<eis:legalDocument>` | 1 | Base64 encoded document. Attribute: type="pdf"
`<clTRID>` | 0-1 | Client transaction id
[EXAMPLE REQUEST AND RESPONSE](/doc/epp-doc.md#epp-domain-with-valid-user-checks-a-domain)

View file

@ -6,11 +6,11 @@ namespace :db do
def schema_file(db)
case db
when databases.first
'schema.rb'
when databases.second
'api_log_schema.rb'
when databases.third
when databases.second
'whois_schema.rb'
when databases.third
'schema.rb'
end
end

View file

@ -1,43 +1,45 @@
begin
require 'rspec/core/rake_task'
require 'open3'
if Rails.env.test? || Rails.env.development?
require 'rspec/core/rake_task'
require 'open3'
desc 'Run all specs against server'
task 'test' do
test_against_server { Rake::Task['spec'].invoke }
end
desc 'Run all specs against server'
task 'test' do
test_against_server { Rake::Task['spec'].invoke }
end
desc 'Run EPP specs against server'
task 'test:epp' do
test_against_server { Rake::Task['spec:epp'].invoke }
end
desc 'Run EPP specs against server'
task 'test:epp' do
test_against_server { Rake::Task['spec:epp'].invoke }
end
desc 'Run all but EPP specs'
RSpec::Core::RakeTask.new('test:other') do |t|
t.rspec_opts = '--tag ~epp'
end
desc 'Run all but EPP specs'
RSpec::Core::RakeTask.new('test:other') do |t|
t.rspec_opts = '--tag ~epp'
end
desc 'Run all but EPP specs'
RSpec::Core::RakeTask.new('test:all_but_features') do |t|
t.rspec_opts = '--tag ~feature'
end
desc 'Run all but EPP specs'
RSpec::Core::RakeTask.new('test:all_but_features') do |t|
t.rspec_opts = '--tag ~feature'
end
desc 'Generate EPP doc from specs'
RSpec::Core::RakeTask.new('test:epp_doc') do |t|
ENV['EPP_DOC'] = 'true'
t.rspec_opts = '--tag epp --require support/epp_doc.rb --format EppDoc'
end
desc 'Generate EPP doc from specs'
RSpec::Core::RakeTask.new('test:epp_doc') do |t|
ENV['EPP_DOC'] = 'true'
t.rspec_opts = '--tag epp --require support/epp_doc.rb --format EppDoc'
end
Rake::Task[:default].prerequisites.clear
task default: :test
Rake::Task[:default].prerequisites.clear
task default: :test
def test_against_server
_stdin, _stdout, _stderr, wait_thr = Open3.popen3('unicorn -E test -p 8989')
pid = wait_thr.pid
begin
yield
ensure
`kill #{pid}`
def test_against_server
_stdin, _stdout, _stderr, wait_thr = Open3.popen3('unicorn -E test -p 8989')
pid = wait_thr.pid
begin
yield
ensure
`kill #{pid}`
end
end
end
rescue LoadError => e