X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Fcommon%2Fconfiguration.rb;h=caeab92a655a8dd92aa9b4dfa8784b2edc64ff14;hp=b2a37d01177551cb51c56752e601c7a66f43a976;hb=371cc929cd8832f2a45ef75d7ed8db3e6ea3ed7c;hpb=61c80543fa4fa57c89c5acc17f6842dc937206a4 diff --git a/lib/common/configuration.rb b/lib/common/configuration.rb index b2a37d0..caeab92 100644 --- a/lib/common/configuration.rb +++ b/lib/common/configuration.rb @@ -5,13 +5,13 @@ class Configuration USERCONF_PATH = ENV['HOME'] + '/.mailshears.conf.yml' @dict = {} - def initialize() + def initialize(path = USERCONF_PATH) cfg = default_configuration() # Now, load the user configuration which will override the # variables defined above. begin - user_config = YAML.load(File.open(USERCONF_PATH)) + user_config = YAML.load(File.open(path)) # Write our own update() method for Ruby 1.8. user_config.each do |key, value| @@ -40,26 +40,11 @@ class Configuration d = {} d['i_mean_business'] = false - - d['dbhost'] = 'localhost' - d['dbport'] = 5432 - d['dbopts'] = '' - d['dbtty'] = '' - d['dbuser'] = 'postgres' - d['dbpass'] = '' - d['dbname'] = 'postfix' - - d['plugins'] = ['dovecot_mailstore', 'roundcube_db'] - - d['mail_root'] = '/var/spool/mail/vhosts' - - d['roundcube_dbhost'] = 'localhost' - d['roundcube_dbport'] = 5432 - d['roundcube_dbopts'] = '' - d['roundcube_dbtty'] = '' - d['roundcube_dbuser'] = 'postgres' - d['roundcube_dbpass'] = '' - d['roundcube_dbname'] = 'roundcube' + d['plugins'] = ['agendav', + 'davical', + 'dovecot', + 'postfixadmin', + 'roundcube'] d['agendav_dbhost'] = 'localhost' d['agendav_dbport'] = 5432 @@ -77,6 +62,24 @@ class Configuration d['davical_dbpass'] = '' d['davical_dbname'] = 'davical' + d['dovecot_mail_root'] = '/var/spool/mail/vhosts' + + d['postfixadmin_dbhost'] = 'localhost' + d['postfixadmin_dbport'] = 5432 + d['postfixadmin_dbopts'] = '' + d['postfixadmin_dbtty'] = '' + d['postfixadmin_dbuser'] = 'postgres' + d['postfixadmin_dbpass'] = '' + d['postfixadmin_dbname'] = 'postfixadmin' + + d['roundcube_dbhost'] = 'localhost' + d['roundcube_dbport'] = 5432 + d['roundcube_dbopts'] = '' + d['roundcube_dbtty'] = '' + d['roundcube_dbuser'] = 'postgres' + d['roundcube_dbpass'] = '' + d['roundcube_dbname'] = 'roundcube' + return d end