diff --git a/doc/whois.rm b/doc/whois.rm index aaa45b87c..a8dd672dd 100644 --- a/doc/whois.rm +++ b/doc/whois.rm @@ -9,8 +9,15 @@ Delayed jobs migration and everything else will still be installed tho. Basic whois logic - we save whois data to 2 separate databases - whois private and public. Those two databases are streamed to appropriate whois servers. -NB! Migration with rake tasks for whois part of the code is available in whois app repo. +Setting the databases up +__________________________________ +Make sure username and password in DATABASES at lib/tasks/whois.rb are correct ( match the ones +in config/database.yml whois_public and whois_private attributes ). We don't load them from +config/database.yml at the moment. So you might have to change them manually. +Finally set the whois app to connect to your whois_public/whois_private database and you're good to go. + +Then run `rake whois:create` to create and migrate the databases. For development, delayed_job queue can be handled by rake task `rake jobs:work` or if you wish to be fancy you can use a daemon with `bin/delayed_job start` `` diff --git a/lib/tasks/whois.rake b/lib/tasks/whois.rake index ebb6746e0..ff18c39cf 100644 --- a/lib/tasks/whois.rake +++ b/lib/tasks/whois.rake @@ -5,16 +5,14 @@ DATABASES = [ pool: '5', username: 'whois', password: 'test', port: '5432' } ] - namespace :whois do task :load_config do require 'active_record' require 'pg' end - desc 'Create whois databases' - task :create => [ :load_config ] do + task create: [:load_config] do DATABASES.each do |conf| create_database(conf) migrate @@ -22,7 +20,7 @@ namespace :whois do end task 'Migrate whois databases' - task :migrate => [ :load_config ] do + task migrate: [:load_config] do DATABASES.each do |conf| ActiveRecord::Base.establish_connection(conf) migrate