2014-05-12 20:03:51 +00:00
|
|
|
require 'rails'
|
|
|
|
require File.expand_path('../boot', __FILE__)
|
|
|
|
|
2014-07-29 20:50:52 +00:00
|
|
|
all_environments = [
|
|
|
|
:development,
|
|
|
|
:production,
|
|
|
|
:test
|
|
|
|
]
|
|
|
|
|
|
|
|
Bundler.require(
|
|
|
|
*Rails.groups(
|
2014-12-05 17:58:09 +00:00
|
|
|
coverage: [:test],
|
2014-07-29 20:50:52 +00:00
|
|
|
db: all_environments,
|
|
|
|
pcap: all_environments
|
|
|
|
)
|
|
|
|
)
|
2014-05-12 20:03:51 +00:00
|
|
|
|
2014-08-05 01:12:28 +00:00
|
|
|
#
|
|
|
|
# Railties
|
|
|
|
#
|
|
|
|
|
|
|
|
# For compatibility with jquery-rails (and other engines that need action_view) in pro
|
2014-09-04 18:06:14 +00:00
|
|
|
require 'action_controller/railtie'
|
2014-08-05 01:12:28 +00:00
|
|
|
require 'action_view/railtie'
|
|
|
|
|
2014-06-02 17:57:48 +00:00
|
|
|
#
|
|
|
|
# Project
|
|
|
|
#
|
|
|
|
|
|
|
|
require 'metasploit/framework/common_engine'
|
2014-08-27 17:01:43 +00:00
|
|
|
require 'metasploit/framework/database'
|
2014-05-12 20:03:51 +00:00
|
|
|
|
|
|
|
module Metasploit
|
|
|
|
module Framework
|
|
|
|
class Application < Rails::Application
|
2014-06-02 17:57:48 +00:00
|
|
|
include Metasploit::Framework::CommonEngine
|
|
|
|
|
2015-01-07 15:37:07 +00:00
|
|
|
config.paths['log'] = "#{Msf::Config.log_directory}/#{Rails.env}.log"
|
2014-08-27 17:01:43 +00:00
|
|
|
config.paths['config/database'] = [Metasploit::Framework::Database.configurations_pathname.try(:to_path)]
|
2015-04-23 19:18:51 +00:00
|
|
|
|
|
|
|
case Rails.env
|
|
|
|
when "development"
|
|
|
|
config.eager_load = false
|
|
|
|
when "test"
|
|
|
|
config.eager_load = false
|
|
|
|
when "production"
|
|
|
|
config.eager_load = true
|
|
|
|
end
|
2014-05-12 20:03:51 +00:00
|
|
|
end
|
|
|
|
end
|
2014-07-18 16:49:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Silence warnings about this defaulting to true
|
|
|
|
I18n.enforce_available_locales = true
|