From 5d5abd60129282ac6a8ee61a027b140c021d8599 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Mon, 1 Jun 2015 11:41:42 +0300 Subject: [PATCH 1/5] Added dedicated data migartion #2659 --- CHANGELOG.md | 8 ++++++++ Gemfile | 3 +++ Gemfile.lock | 9 +++++++++ .../20150601083516_add_cert_common_name.rb} | 8 ++++++-- .../20150601083800_add_cert_md5.rb} | 8 ++++++-- 5 files changed, 32 insertions(+), 4 deletions(-) rename db/{migrate/20150525075550_update_certs_add_cn_from_csr.rb => data/20150601083516_add_cert_common_name.rb} (66%) rename db/{migrate/20150522164020_update_certs.rb => data/20150601083800_add_cert_md5.rb} (85%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 685670a92..04d4a0053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +01.06.2015 + +* Added separate data update, all data migration locate at db/data, more info 'rake -T data' + +29.05.2015 + +* Removed old 'iptables_counter_update_command' and added 'iptables_counter_enabled' + 26.05.2015 * Updated deploy script, now staging comes from staging branch diff --git a/Gemfile b/Gemfile index ee11fae90..4776ba7ab 100644 --- a/Gemfile +++ b/Gemfile @@ -53,6 +53,9 @@ gem 'isikukood' # for EE-id validation # deploy gem 'whenever', '~> 0.9.4', require: false +gem 'data_migrate', + github: 'gitlabeu/data_migrate', + ref: '35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81' # monitors gem 'newrelic_rpm', '~> 3.9.9.275' diff --git a/Gemfile.lock b/Gemfile.lock index 859830bbf..f1e5e2863 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,6 +8,14 @@ GIT activesupport (>= 3.0, < 6.0) request_store (~> 1.1.0) +GIT + remote: git://github.com/gitlabeu/data_migrate.git + revision: 35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81 + ref: 35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81 + specs: + data_migrate (1.3.0) + rails (>= 4.1.0) + GIT remote: git://github.com/gitlabeu/epp.git revision: 505c3f2739eb1da918e54111aecfb138a822739d @@ -507,6 +515,7 @@ DEPENDENCIES coderay (~> 1.1.0) coffee-rails (~> 4.1.0) countries (~> 0.10.0) + data_migrate! database_cleaner (~> 1.3.0) deep_cloneable (~> 2.1.1) devise (~> 3.4.1) diff --git a/db/migrate/20150525075550_update_certs_add_cn_from_csr.rb b/db/data/20150601083516_add_cert_common_name.rb similarity index 66% rename from db/migrate/20150525075550_update_certs_add_cn_from_csr.rb rename to db/data/20150601083516_add_cert_common_name.rb index ab56b0c8a..ef401b871 100644 --- a/db/migrate/20150525075550_update_certs_add_cn_from_csr.rb +++ b/db/data/20150601083516_add_cert_common_name.rb @@ -1,5 +1,5 @@ -class UpdateCertsAddCnFromCsr < ActiveRecord::Migration - def change +class AddCertCommonName < ActiveRecord::Migration + def self.up Certificate.all.each do |x| if x.crt.blank? && x.csr.present? pc = x.parsed_csr.try(:subject).try(:to_s) || '' @@ -9,4 +9,8 @@ class UpdateCertsAddCnFromCsr < ActiveRecord::Migration x.save end end + + def self.down + raise ActiveRecord::IrreversibleMigration + end end diff --git a/db/migrate/20150522164020_update_certs.rb b/db/data/20150601083800_add_cert_md5.rb similarity index 85% rename from db/migrate/20150522164020_update_certs.rb rename to db/data/20150601083800_add_cert_md5.rb index 5cdaa7549..5efe4e596 100644 --- a/db/migrate/20150522164020_update_certs.rb +++ b/db/data/20150601083800_add_cert_md5.rb @@ -1,5 +1,5 @@ -class UpdateCerts < ActiveRecord::Migration - def change +class AddCertMd5 < ActiveRecord::Migration + def self.up Certificate.all.each do |x| if x.crt.present? && x.csr.present? x.interface = Certificate::REGISTRAR @@ -21,4 +21,8 @@ class UpdateCerts < ActiveRecord::Migration x.save end end + + def self.down + raise ActiveRecord::IrreversibleMigration + end end From b8597d636db8ca70a0ee334909946634b65d0e5c Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Mon, 8 Jun 2015 11:23:01 +0300 Subject: [PATCH 2/5] Fix zonefile sql #2633 --- app/models/zonefile_setting.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/zonefile_setting.rb b/app/models/zonefile_setting.rb index 76e4aa24f..8747a11ca 100644 --- a/app/models/zonefile_setting.rb +++ b/app/models/zonefile_setting.rb @@ -13,8 +13,10 @@ class ZonefileSetting < ActiveRecord::Base filename = "#{origin}.zone" STDOUT << "#{Time.zone.now.utc} - Generating zonefile #{filename}\n" - sanitized_query = sanitize_sql("select generate_zonefile(?)", origin) - zf = ActiveRecord::Base.connection.execute(sanitized_query)[0]['generate_zonefile'] + + zf = ActiveRecord::Base.connection.execute( + "select generate_zonefile('#{origin}')" + )[0]['generate_zonefile'] File.open("#{ENV['zonefile_export_dir']}/#{filename}", 'w') { |f| f.write(zf) } From f3d6846a11e879839b0f74dd2fd373310dd3c9fb Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Mon, 8 Jun 2015 12:40:32 +0300 Subject: [PATCH 3/5] Configure sk service name #2619 --- app/controllers/registrar/sessions_controller.rb | 2 +- config/application-example.yml | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/registrar/sessions_controller.rb b/app/controllers/registrar/sessions_controller.rb index 5a45f22e0..1fcd1e914 100644 --- a/app/controllers/registrar/sessions_controller.rb +++ b/app/controllers/registrar/sessions_controller.rb @@ -98,7 +98,7 @@ class Registrar::SessionsController < Devise::SessionsController response = client.authenticate( phone: "+372#{phone}", message_to_display: 'Authenticating', - service_name: 'Testing' + service_name: ENV['sk_digi_doc_service_name'] || 'Testing' ) if response.faultcode diff --git a/config/application-example.yml b/config/application-example.yml index 050216cee..63060db96 100644 --- a/config/application-example.yml +++ b/config/application-example.yml @@ -9,7 +9,6 @@ legal_documents_dir: 'import/legal_documents' # Example: 'Admin, EPP, REPP' will have name 'Admin, EPP, REPP - production' at New Relic. new_relic_app_name: 'Admin, EPP, REPP, Registrar, Registrant' - # You can use `rake secret` to generate a secure secret key. # Your secret key is used for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! @@ -30,8 +29,11 @@ webclient_cert_common_name: 'webclient' # and returns 2306 "Parameter value policy error" contact_org_enabled: 'false' -# Firewall countrer update command -# iptables_counter_update_command: '' +# Enable iptables counter updater +# iptables_counter_enabled: 'true' + +# Custom legal document types +# legal_document_types: "pdf,bdoc,ddoc,zip,rar,gz,tar,7z,odt,doc,docx" # DEPP server configuration (both for Registrar/Registrant servers) show_ds_data_fields: 'false' @@ -64,6 +66,7 @@ registrant_url: 'https:/registrant.example.com' # for valid email body registran # SK DigiDocService sk_digi_doc_service_endpoint: 'https://openxades.org:9443/DigiDocService' +sk_digi_doc_service_name: 'EIS test' # Autotest config overwrites test: From 373a4c7db65b213c6adacba97aac305390e8b640 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Mon, 8 Jun 2015 14:22:34 +0300 Subject: [PATCH 4/5] MID service name for registrant #2620 --- app/controllers/registrant/sessions_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/registrant/sessions_controller.rb b/app/controllers/registrant/sessions_controller.rb index 8155ec323..ee2eabffd 100644 --- a/app/controllers/registrant/sessions_controller.rb +++ b/app/controllers/registrant/sessions_controller.rb @@ -41,7 +41,7 @@ class Registrant::SessionsController < Devise::SessionsController response = client.authenticate( phone: "+372#{phone}", message_to_display: 'Authenticating', - service_name: 'Testing' + service_name: ENV['sk_digi_doc_service_name'] || 'Testing' ) if response.faultcode From 27cdd1ab4390d5a6127b59fedb85d5364baf59e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20V=C3=B5hmar?= Date: Sun, 21 Jun 2015 18:00:10 +0300 Subject: [PATCH 5/5] Update repp-doc.md unified source for rfcs --- doc/repp-doc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/repp-doc.md b/doc/repp-doc.md index dbdad9a59..9896f34da 100644 --- a/doc/repp-doc.md +++ b/doc/repp-doc.md @@ -1,6 +1,6 @@ # REPP integration specification -REPP uses HTTP/1.1 protocol (http://www.ietf.org/rfc/rfc2616.txt) and +REPP uses HTTP/1.1 protocol (http://tools.ietf.org/html/rfc2616) and Basic Authentication (http://tools.ietf.org/html/rfc2617#section-2) using Secure Transport (https://tools.ietf.org/html/rfc5246) with certificate and key (https://tools.ietf.org/html/rfc5280).