class RailsPwnerer::Scaffolds::Config

sets up the configuration repository

Public Class Methods

go() click to toggle source

standalone runner

   # File lib/rails_pwnerer/scaffolds/config.rb
36 def self.go
37   self.new.run
38 end

Public Instance Methods

run() click to toggle source

runner

   # File lib/rails_pwnerer/scaffolds/config.rb
 7 def run
 8   # paths
 9   paths_db = RailsPwnerer::Config.create_db :paths
10   # the directory containing the nginx config files
11   paths_db[:nginx_configs] = '/etc/nginx/sites-enabled'
12   # the directory containing the ddclient configuration
13   paths_db[:ddclient_config] = '/etc/ddclient.conf'
14   RailsPwnerer::Config.flush_db :paths
15   
16   # host info
17   host_info = RailsPwnerer::Config.create_db :host
18   # the default instance name -- DNS names have dashes, but mySQL hates that
19   host_info[:instance] = Socket.gethostname().split('.').first.gsub('-', '_')
20   # the computer's name (if we ever do status reports)
21   host_info[:name] = Socket.gethostname()
22   # username for creating / dropping databases
23   host_info[:dbroot_name] = 'root'
24   # password for creating / dropping databases
25   host_info[:dbroot_pass] = ''
26   # the user owning the /prod subtrees
27   host_info[:pwnerer_user] = current_user
28   
29   RailsPwnerer::Config.flush_db :host
30   
31   # the free port list
32   RailsPwnerer::Config.init_ports    
33 end