CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/config/application.rb
Views: 11704
1
require 'fiddle'
2
Fiddle.const_set(:VERSION, '0.0.0') unless Fiddle.const_defined?(:VERSION)
3
4
require 'rails'
5
require File.expand_path('../boot', __FILE__)
6
7
all_environments = [
8
:development,
9
:production,
10
:test
11
]
12
13
Bundler.require(
14
*Rails.groups(
15
coverage: [:test],
16
db: all_environments,
17
pcap: all_environments
18
)
19
)
20
21
#
22
# Railties
23
#
24
25
# For compatibility with jquery-rails (and other engines that need action_view) in pro
26
require 'action_controller/railtie'
27
require 'action_view/railtie'
28
29
#
30
# Project
31
#
32
33
require 'metasploit/framework/common_engine'
34
require 'metasploit/framework/database'
35
module Metasploit
36
module Framework
37
class Application < Rails::Application
38
include Metasploit::Framework::CommonEngine
39
40
config.paths['log'] = "#{Msf::Config.log_directory}/#{Rails.env}.log"
41
config.paths['config/database'] = [Metasploit::Framework::Database.configurations_pathname.try(:to_path)]
42
config.autoloader = :zeitwerk
43
44
case Rails.env
45
when "development"
46
config.eager_load = false
47
when "test"
48
config.eager_load = false
49
when "production"
50
config.eager_load = false
51
end
52
53
if ActiveRecord.respond_to?(:legacy_connection_handling=)
54
ActiveRecord.legacy_connection_handling = false
55
end
56
end
57
end
58
end
59
60
# Silence warnings about this defaulting to true
61
I18n.enforce_available_locales = true
62
require 'msfenv'
63
64