mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
basic whois doc
This commit is contained in:
parent
00837452a8
commit
c089544eae
2 changed files with 10 additions and 5 deletions
|
@ -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`
|
||||
``
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue