Commit Graph

9 Commits (20ab14d7a34743220865a98a917c81e41e9e9fb3)

Author SHA1 Message Date
Luke Imhoff 951ce15b44
Move database.yml selection to Metasploit::Framework::Database
MSP-11153

Test the following paths in order and only return them if the path
exists:

1. MSF_DATABASE_CONFIG environment variable
2. ~/.msf4/database.yml
3. <project>/config/database.yml
2014-08-27 12:01:43 -05:00
Luke Imhoff 7013a2755b
Favor MSF_DATABASE_CONFIG for paths['config/database']
MSP-10848

Use these locations, in order for
Metasploit::Framework::Application.config.paths['config/database']:

1. MSF_DATABASE_CONFIG environment variable
2. ~/.msf4/database.yml (if it exists)
3. config/database.yml
2014-08-05 10:16:33 -05:00
Luke Imhoff d56dd318b9
require 'action_view/railtie' for pro compatibility
MSP-10848

Other railties, like jquery-rails, need 'action_view/railtie', but don't
require it themselves, so require it explictly in
`config/application.rb` to prevent msfconsole boot errors.
2014-08-04 20:12:28 -05:00
Luke Imhoff ba4891bca0
Restore Rails.groups arguments
MSP-10905

They don't cause a problem.
2014-07-29 15:50:52 -05:00
Luke Imhoff 04541ac724
Parse msfconsole options before initializing Rails
MSP-10905
2014-07-29 14:07:14 -05:00
James Lee 2eea95e120
Silence warnings about I18n defaults 2014-07-18 11:49:49 -05:00
Luke Imhoff 9d326fcb24
Extra common engine and fix default encoding
MSP-9653

Extra config and initializers that can we shared between
Metasploit::Framework::Application and the future
Metasploit::Framework::Engine.  Move the default encoding setup from
lib/msf/sanity.rb to a before_initialize callback for the shared config
so that gems, like gherkin that depend on the utf-8 default internal
encoding can be loaded.
2014-06-02 12:57:48 -05:00
Luke Imhoff b1598e83c3
Re-enable `bundle install --without db` support
MSP-9606

Catch LoadError in config/application.rb when trying to require
'active_record/railtie` so that end-users can run without any of the
database gems installed.  NOTE: you can't run in the development or
test environment without the database because factory_girl needs
ActiveRecord.
2014-05-12 15:39:34 -05:00
Luke Imhoff 3370465d84
Use railties to load Metasploit::Credential correctly
MSP-9606

In order to support Metasploit::Credential correctly,
metasploit-framework needs to support Metasploit::Concern, which does
all its magic using a Rails::Engine initializer, so the easiest path is
to make metasploit-framework be able to use Rails::Engines.  To make
Rails::Engine use Rails::Engine, make a dummy Rails::Application
subclass so that all the initializers will be run when anything requires
msfenv.
2014-05-12 15:03:51 -05:00