basic whois doc

This commit is contained in:
Andres Keskküla 2014-12-09 10:30:23 +02:00
parent 00837452a8
commit c089544eae
2 changed files with 10 additions and 5 deletions

View file

@ -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. Basic whois logic - we save whois data to 2 separate databases - whois private and public.
Those two databases are streamed to appropriate whois servers. 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 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` `rake jobs:work` or if you wish to be fancy you can use a daemon with `bin/delayed_job start`
`` ``

View file

@ -5,16 +5,14 @@ DATABASES = [
pool: '5', username: 'whois', password: 'test', port: '5432' } pool: '5', username: 'whois', password: 'test', port: '5432' }
] ]
namespace :whois do namespace :whois do
task :load_config do task :load_config do
require 'active_record' require 'active_record'
require 'pg' require 'pg'
end end
desc 'Create whois databases' desc 'Create whois databases'
task :create => [ :load_config ] do task create: [:load_config] do
DATABASES.each do |conf| DATABASES.each do |conf|
create_database(conf) create_database(conf)
migrate migrate
@ -22,7 +20,7 @@ namespace :whois do
end end
task 'Migrate whois databases' task 'Migrate whois databases'
task :migrate => [ :load_config ] do task migrate: [:load_config] do
DATABASES.each do |conf| DATABASES.each do |conf|
ActiveRecord::Base.establish_connection(conf) ActiveRecord::Base.establish_connection(conf)
migrate migrate