:desc => "The CA file used to verify the SSL connection.",
:wizard => true)
Config.register Config::StringValue.new('server.ssl_ca_path',
- :default => '', :requires_restart => true,
+ :default => default_ssl_ca_path, :requires_restart => true,
:desc => "Alternativly a directory that includes CA PEM files used to verify the SSL connection.",
:wizard => true)
Config.register Config::StringValue.new('server.password',
},
:desc => "Percentage of IRC penalty to consider when sending messages to prevent being disconnected for excess flood. Set to 0 to disable penalty control.")
Config.register Config::StringValue.new('core.db',
- :default => "dbm",
- :wizard => true, :default => "dbm",
+ :default => default_db,
+ :wizard => true,
:validate => Proc.new { |v| Registry::formats.include? v },
:requires_restart => true,
:desc => "DB adaptor to use for storing the plugin data/registries. Options: " + Registry::formats.join(', '))
end
@registry_factory = Registry.new @config['core.db']
+ @registry_factory.migrate_registry_folder(path)
@logfile = @config['log.file']
if @logfile.class!=String || @logfile.empty?
end
end
+ def default_ssl_ca_path
+ file = default_ssl_ca_file
+ File.dirname file if file
+ end
+
+ # Determine if tokyocabinet is installed, if it is use it as a default.
+ def default_db
+ begin
+ require 'tokyocabinet'
+ return 'tc'
+ rescue LoadError
+ return 'dbm'
+ end
+ end
+
def repopulate_botclass_directory
template_dir = File.join Config::datadir, 'templates'
if FileTest.directory? @botclass