redis_monitor 0.1 → 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.travis.yml +1 -2
  4. data/Gemfile +2 -1
  5. data/README.md +1 -1
  6. data/Rakefile +5 -0
  7. data/bin/redis_monitor +2 -2
  8. data/lib/{server/command_line_parser.rb → command_line_parser.rb} +0 -3
  9. data/lib/engine/.gitignore +16 -0
  10. data/lib/engine/.rspec +2 -0
  11. data/lib/engine/Gemfile +5 -0
  12. data/lib/engine/Rakefile +6 -0
  13. data/lib/engine/app/assets/images/.keep +0 -0
  14. data/lib/engine/app/controllers/application_controller.rb +10 -0
  15. data/lib/engine/app/controllers/concerns/.keep +0 -0
  16. data/lib/engine/app/controllers/content_controller.rb +34 -0
  17. data/lib/engine/app/controllers/info_controller.rb +6 -0
  18. data/lib/engine/app/controllers/performance_controller.rb +8 -0
  19. data/lib/engine/app/helpers/application_helper.rb +21 -0
  20. data/lib/engine/app/helpers/database_helper.rb +36 -0
  21. data/lib/engine/app/helpers/pagination_helper.rb +8 -0
  22. data/lib/engine/app/lib/backend.rb +45 -0
  23. data/lib/{modules → engine/app/lib}/performance_stats.rb +0 -0
  24. data/lib/engine/app/lib/security/authentication.rb +14 -0
  25. data/lib/engine/app/lib/security/authorization.rb +16 -0
  26. data/lib/engine/app/mailers/.keep +0 -0
  27. data/lib/engine/app/models/.keep +0 -0
  28. data/lib/engine/app/models/concerns/.keep +0 -0
  29. data/lib/{views → engine/app/views}/content/_search_form.haml +0 -0
  30. data/lib/engine/app/views/content/index.haml +1 -0
  31. data/lib/{views → engine/app/views}/content/search.haml +5 -5
  32. data/lib/{views/info/info.haml → engine/app/views/info/index.haml} +1 -1
  33. data/lib/engine/app/views/layouts/application.haml +23 -0
  34. data/lib/{views → engine/app/views}/performance/check.haml +1 -1
  35. data/lib/{views/performance/warning.haml → engine/app/views/performance/index.haml} +0 -0
  36. data/lib/engine/bin/bundle +3 -0
  37. data/lib/engine/bin/rails +4 -0
  38. data/lib/engine/bin/rake +4 -0
  39. data/lib/engine/config/application.rb +34 -0
  40. data/lib/engine/config/boot.rb +4 -0
  41. data/lib/engine/config/database.yml +25 -0
  42. data/lib/engine/config/environment.rb +5 -0
  43. data/lib/engine/config/environments/development.rb +25 -0
  44. data/lib/engine/config/environments/production.rb +65 -0
  45. data/lib/engine/config/environments/test.rb +36 -0
  46. data/lib/engine/config/initializers/backtrace_silencers.rb +7 -0
  47. data/lib/engine/config/initializers/configuration.rb +5 -0
  48. data/lib/engine/config/initializers/filter_parameter_logging.rb +4 -0
  49. data/lib/engine/config/initializers/haml.rb +1 -0
  50. data/lib/engine/config/initializers/inflections.rb +16 -0
  51. data/lib/engine/config/initializers/mime_types.rb +5 -0
  52. data/lib/engine/config/initializers/secret_token.rb +12 -0
  53. data/lib/engine/config/initializers/session_store.rb +3 -0
  54. data/lib/engine/config/initializers/will_paginate.rb +1 -0
  55. data/lib/engine/config/initializers/wrap_parameters.rb +14 -0
  56. data/lib/engine/config/locales/en.bootstrap.yml +18 -0
  57. data/lib/engine/config/locales/en.yml +23 -0
  58. data/lib/engine/config/routes.rb +73 -0
  59. data/lib/engine/config.ru +4 -0
  60. data/lib/engine/db/seeds.rb +7 -0
  61. data/lib/engine/lib/assets/.keep +0 -0
  62. data/lib/engine/lib/tasks/.keep +0 -0
  63. data/lib/engine/log/.keep +0 -0
  64. data/lib/engine/public/404.html +58 -0
  65. data/lib/engine/public/422.html +58 -0
  66. data/lib/engine/public/500.html +57 -0
  67. data/lib/engine/public/favicon.ico +0 -0
  68. data/lib/{static/scripts → engine/public/javascripts}/app.js +0 -0
  69. data/lib/{static/scripts → engine/public/javascripts}/bootstrap-select.min.js +0 -0
  70. data/lib/{static/scripts → engine/public/javascripts}/bootstrap.min.js +0 -0
  71. data/lib/{static/scripts → engine/public/javascripts}/jquery-2.0.3.min.js +0 -0
  72. data/lib/engine/public/robots.txt +5 -0
  73. data/lib/{static/styles → engine/public/stylesheets}/bootstrap-select.min.css +0 -0
  74. data/lib/{static/styles → engine/public/stylesheets}/bootstrap.min.css +0 -0
  75. data/lib/{static/styles → engine/public/stylesheets}/custom.css +0 -0
  76. data/lib/engine/spec/controllers/content_controller_spec.rb +28 -0
  77. data/lib/engine/spec/controllers/info_controller_spec.rb +10 -0
  78. data/lib/engine/spec/controllers/performance_controller_spec.rb +10 -0
  79. data/{spec/modules → lib/engine/spec/lib}/backend_spec.rb +3 -3
  80. data/{spec/modules → lib/engine/spec/lib}/performance_stats_spec.rb +1 -1
  81. data/lib/engine/spec/lib/security/authentication_spec.rb +23 -0
  82. data/{spec/modules → lib/engine/spec/lib}/security/authorization_spec.rb +1 -1
  83. data/lib/engine/spec/spec_helper.rb +47 -0
  84. data/lib/engine/test/controllers/.keep +0 -0
  85. data/lib/engine/test/fixtures/.keep +0 -0
  86. data/lib/engine/test/helpers/.keep +0 -0
  87. data/lib/engine/test/integration/.keep +0 -0
  88. data/lib/engine/test/mailers/.keep +0 -0
  89. data/lib/engine/test/models/.keep +0 -0
  90. data/lib/engine/test/test_helper.rb +15 -0
  91. data/lib/engine/vendor/assets/javascripts/.keep +0 -0
  92. data/lib/engine/vendor/assets/stylesheets/.keep +0 -0
  93. data/lib/redis_monitor.rb +14 -10
  94. data/lib/{modules/version.rb → version.rb} +1 -1
  95. data/redis_monitor.gemspec +14 -4
  96. metadata +153 -100
  97. data/lib/controllers/base_controller.rb +0 -53
  98. data/lib/controllers/content_controller.rb +0 -37
  99. data/lib/controllers/info_controller.rb +0 -14
  100. data/lib/controllers/performance_controller.rb +0 -19
  101. data/lib/errors/errors.rb +0 -1
  102. data/lib/errors/redis_not_available.rb +0 -7
  103. data/lib/helpers/base_helper.rb +0 -13
  104. data/lib/helpers/database_helper.rb +0 -40
  105. data/lib/helpers/layouts_helper.rb +0 -29
  106. data/lib/helpers/pagination_helper.rb +0 -10
  107. data/lib/modules/backend.rb +0 -49
  108. data/lib/modules/controllers.rb +0 -5
  109. data/lib/modules/helpers.rb +0 -15
  110. data/lib/modules/router.rb +0 -26
  111. data/lib/modules/security/authentication.rb +0 -29
  112. data/lib/modules/security/authorization.rb +0 -18
  113. data/lib/server/server.rb +0 -27
  114. data/lib/views/content/index.haml +0 -1
  115. data/lib/views/errors/redis_not_available.haml +0 -2
  116. data/lib/views/layouts/main.haml +0 -21
  117. data/spec/controllers/base_controller_spec.rb +0 -34
  118. data/spec/controllers/content_controller_spec.rb +0 -41
  119. data/spec/controllers/info_controller_spec.rb +0 -22
  120. data/spec/controllers/performance_controller_spec.rb +0 -21
  121. data/spec/modules/security/authentication_spec.rb +0 -48
  122. data/spec/server/command_line_parser_spec.rb +0 -42
  123. data/spec/spec_helper.rb +0 -23
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0ff1b1686ad016eb88f4b708cac2efb620c32add
4
+ data.tar.gz: 7724f8bb31f5823191ebdd6ea088c92128f0ff58
5
+ SHA512:
6
+ metadata.gz: a75d85f681f8f0ef8c7c25b16c63a96bd670fb9d45be4273299ca288bf8508b918b7b27bddbb7ddcc0fa4095143f1a3f88543ea5365725ef7636d8140c5db651
7
+ data.tar.gz: 16f7a6580468f0daff350e9b24cb9afd120d8879e9d637353f4dcaf4d9550c94bd10cddb17a347867fa938387f7adfd3d5bf2e6de9454b87434aaa5e5651a3f4
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ test/version_tmp
17
17
  tmp
18
18
  .rvmrc
19
19
  .idea
20
+ *.rdb
data/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
4
  - 2.0.0
6
5
  - jruby-19mode
7
6
 
8
- script: bundle exec rspec spec
7
+ script: rake spec
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in redis_monitor.gemspec
4
3
  gemspec
4
+
5
+ eval(File.read('lib/engine/Gemfile'))
data/README.md CHANGED
@@ -39,4 +39,4 @@ For more information about the parameters:
39
39
 
40
40
  Please write meaningful test, if you need to execute them:
41
41
 
42
- $ rspec spec
42
+ $ rake spec
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec) do |config|
5
+ config.rspec_opts = '--default-path lib/engine/spec'
6
+ end
data/bin/redis_monitor CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require 'redis_monitor'
4
- RedisMonitor.run
3
+ RedisMonitor.run
4
+
@@ -13,9 +13,6 @@ module RedisMonitor
13
13
  arguments = DEFAULTS.dup
14
14
 
15
15
  parser = OptionParser.new do |op|
16
- op.on('--http-server server', 'specify rack server/handler (default is thin)') do |val|
17
- arguments[:http_server] = val
18
- end
19
16
  op.on('--http-port port', 'specify http port (default is 6369)') do |val|
20
17
  arguments[:http_port] = val.to_i
21
18
  end
@@ -0,0 +1,16 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
data/lib/engine/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
@@ -0,0 +1,5 @@
1
+ begin
2
+ gemspec
3
+ rescue
4
+ gemspec(path: '../..')
5
+ end
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Engine::Application.load_tasks
File without changes
@@ -0,0 +1,10 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+
6
+ if Authentication.authentication_required?
7
+ http_basic_authenticate_with name: Authentication.credentials[:user], password: Authentication.credentials[:password]
8
+ end
9
+
10
+ end
File without changes
@@ -0,0 +1,34 @@
1
+ class ContentController < ApplicationController
2
+ skip_before_action :verify_authenticity_token
3
+ before_action :load_section
4
+
5
+ def index
6
+ end
7
+
8
+ def search
9
+ @results = Backend.search(params[:key]).paginate(:page => params[:page], :per_page => 20)
10
+ end
11
+
12
+ def delete
13
+ Backend.remove(params[:key])
14
+ redirect_to :back
15
+ end
16
+
17
+ def change_database
18
+ set_database(params[:database])
19
+ redirect_to :back
20
+ end
21
+
22
+ private
23
+ def load_section
24
+ @section = 'content'
25
+ end
26
+
27
+ def set_database(database)
28
+ session[:database] = database
29
+ Backend.change_database(database)
30
+ end
31
+ end
32
+
33
+
34
+
@@ -0,0 +1,6 @@
1
+ class InfoController < ApplicationController
2
+ def index
3
+ @section = 'info'
4
+ @info = Backend.info
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ class PerformanceController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ def check
6
+ @stats = Backend.performance_stats
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ module ApplicationHelper
2
+ def selected_is_selected(section, selected)
3
+ 'active' if section == selected
4
+ end
5
+
6
+ def section(opts = {})
7
+ haml_tag :li, class: selected_is_selected(opts[:name], opts[:selected_section]) do
8
+ haml_tag :a, opts[:title], href: opts[:url]
9
+ end
10
+ end
11
+
12
+ def content_menu(selected_section)
13
+ capture_haml do
14
+ haml_tag :ul, class: 'nav navbar-nav' do
15
+ section(name: 'info', title: 'Info', url: '/info', selected_section: selected_section)
16
+ section(name: 'content', title: 'Content', url: '/content', selected_section: selected_section)
17
+ section(name: 'performance', title: 'Performance', url: '/performance', selected_section: selected_section)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,36 @@
1
+ module DatabaseHelper
2
+ def current_database
3
+ session[:database].to_i
4
+ end
5
+
6
+ def databases
7
+ Backend.databases.each do |database|
8
+ database_option(database)
9
+ end
10
+ end
11
+
12
+ def database_option(database)
13
+ haml_tag :option, {selected: (database.to_i == current_database.to_i)} do
14
+ haml_concat database
15
+ end
16
+ end
17
+
18
+ def choose_database_select
19
+ capture_haml do
20
+ haml_tag :form, action: '/content/change_database', method: 'post' do
21
+ haml_tag :div, class: 'form-group' do
22
+ haml_tag :label, for: 'database_select' do
23
+ haml_concat 'Select database'
24
+ end
25
+
26
+ haml_tag :select, id: 'database_select', name: 'database', class: 'selectpicker form-control', data: {style: 'btn-info'} do
27
+ databases
28
+ end
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+
35
+ end
36
+
@@ -0,0 +1,8 @@
1
+ require 'will_paginate-bootstrap'
2
+
3
+ module PaginationHelper
4
+ def bootstrap_paginate(results)
5
+ will_paginate results, renderer: BootstrapPagination::Rails
6
+ end
7
+ end
8
+
@@ -0,0 +1,45 @@
1
+ require 'redis'
2
+ require 'forwardable'
3
+
4
+ class Backend
5
+ extend SingleForwardable
6
+
7
+ def_delegators :redis, :get, :set, :info, :keys, :dbsize, :select
8
+
9
+ def self.config(arguments)
10
+ @@host = arguments[:redis_host]
11
+ @@port = arguments[:redis_port]
12
+ end
13
+
14
+ def self.host
15
+ @@host
16
+ end
17
+
18
+ def self.port
19
+ @@port
20
+ end
21
+
22
+ def self.redis
23
+ @@redis ||= Redis.new(:host => host, :port => port)
24
+ end
25
+
26
+ def self.performance_stats
27
+ PerformanceStats.new(self).results
28
+ end
29
+
30
+ def self.search(key)
31
+ keys(key).map{|found| {key: found, value: get(found)} }
32
+ end
33
+
34
+ def self.change_database(*args)
35
+ select(*args)
36
+ end
37
+
38
+ def self.remove(key)
39
+ redis.del(key) if Authorization.authorized_for?(:remove_content)
40
+ end
41
+
42
+ def self.databases
43
+ info.keys.map{|d| d.match(/db(\d+)/);$1}.compact
44
+ end
45
+ end
@@ -0,0 +1,14 @@
1
+ module Authentication
2
+
3
+ def self.config(credentials)
4
+ @@credentials = credentials
5
+ end
6
+
7
+ def self.authentication_required?
8
+ !!credentials
9
+ end
10
+
11
+ def self.credentials
12
+ @@credentials
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ class Authorization
2
+ DEFAULTS = {remove_content: true}
3
+
4
+ def self.config(opts = {})
5
+ opts = {} unless opts
6
+ @@permissions = DEFAULTS.merge(opts)
7
+ end
8
+
9
+ def self.permissions
10
+ @@permissions
11
+ end
12
+
13
+ def self.authorized_for?(action)
14
+ !!permissions[action]
15
+ end
16
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ = render 'search_form'
@@ -1,4 +1,4 @@
1
- = haml 'content/_search_form'.to_sym, locals: {search_term: params[:key]}
1
+ = render 'search_form', locals: {search_term: params[:key]}
2
2
 
3
3
  %table.table.table-striped
4
4
  %thead
@@ -7,22 +7,22 @@
7
7
  Key
8
8
  %th
9
9
  Value
10
- - if RedisMonitor::Authorization.authorized_for?(:remove_content)
10
+ - if Authorization.authorized_for?(:remove_content)
11
11
  %th
12
12
  Actions
13
13
 
14
14
  %tbody
15
- - results.each do |result|
15
+ - @results.each do |result|
16
16
  %tr
17
17
  %td
18
18
  = result[:key]
19
19
  %td
20
20
  = result[:value]
21
- - if RedisMonitor::Authorization.authorized_for?(:remove_content)
21
+ - if Authorization.authorized_for?(:remove_content)
22
22
  %td
23
23
  %form{action: '/content/delete', method: 'post'}
24
24
  %input{type: 'hidden', name: 'key', value: result[:key]}
25
25
  %button.btn.btn-danger
26
26
  Delete
27
27
 
28
- = bootstrap_paginate results
28
+ = bootstrap_paginate @results
@@ -7,7 +7,7 @@
7
7
  Value
8
8
 
9
9
  %tbody
10
- - info.each do |parameter, value|
10
+ - @info.each do |parameter, value|
11
11
  %tr
12
12
  %td
13
13
  = parameter
@@ -0,0 +1,23 @@
1
+ %html
2
+ %head
3
+ %meta{name: 'viewport', content: 'width=device-width, initial-scale=1.0'}
4
+ = stylesheet_link_tag 'bootstrap.min', media: 'all'
5
+ = stylesheet_link_tag 'bootstrap-select.min', media: 'all'
6
+ = stylesheet_link_tag 'custom', media: 'all'
7
+
8
+ = javascript_include_tag 'jquery-2.0.3.min'
9
+ = javascript_include_tag 'bootstrap.min'
10
+ = javascript_include_tag 'bootstrap-select.min'
11
+ = javascript_include_tag 'app'
12
+
13
+ %body
14
+ .navbar.navbar-inverse.navbar-fixed-top
15
+ .container
16
+ .navbar-header
17
+ %a.navbar-brand{href: '/'}
18
+ Redis Monitor
19
+ .collapse.navbar-collapse
20
+ = content_menu(@section)
21
+
22
+ .container
23
+ = yield
@@ -8,7 +8,7 @@
8
8
  Value
9
9
 
10
10
  %tbody
11
- - stats.each do |parameter, value|
11
+ - @stats.each do |parameter, value|
12
12
  %tr
13
13
  %td
14
14
  = parameter
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,34 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ # require "sprockets/railtie"
8
+ require "rails/test_unit/railtie"
9
+
10
+ # Require the gems listed in Gemfile, including any gems
11
+ # you've limited to :test, :development, or :production.
12
+ Bundler.require(:default, Rails.env)
13
+
14
+ module Engine
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
21
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
22
+ # config.time_zone = 'Central Time (US & Canada)'
23
+
24
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
+ # config.i18n.default_locale = :de
27
+
28
+ # Disable the asset pipeline.
29
+ config.autoload_paths += Dir["#{config.root}/app/lib/**/"]
30
+ config.assets.enabled = false
31
+
32
+ ::REDIS_MONITOR_OPTS = Marshal.load(Base64.decode64(ENV['REDIS_MONITOR_OPTS'])) if ENV['REDIS_MONITOR_OPTS']
33
+ end
34
+ end
@@ -0,0 +1,4 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Engine::Application.initialize!
@@ -0,0 +1,25 @@
1
+ Engine::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
+
25
+ end
@@ -0,0 +1,65 @@
1
+ Engine::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both thread web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
24
+
25
+
26
+ # Specifies the header that your server uses for sending files.
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # Set to :debug to see everything in the log.
34
+ config.log_level = :info
35
+
36
+ # Prepend all log lines with the following tags.
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups.
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production.
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+
49
+ # Ignore bad email addresses and do not raise email delivery errors.
50
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
51
+ # config.action_mailer.raise_delivery_errors = false
52
+
53
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
54
+ # the I18n.default_locale when a translation can not be found).
55
+ config.i18n.fallbacks = true
56
+
57
+ # Send deprecation notices to registered listeners.
58
+ config.active_support.deprecation = :notify
59
+
60
+ # Disable automatic flushing of the log to improve performance.
61
+ # config.autoflush_log = false
62
+
63
+ # Use default logging formatter so that PID and timestamp are not suppressed.
64
+ config.log_formatter = ::Logger::Formatter.new
65
+ end
@@ -0,0 +1,36 @@
1
+ Engine::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,5 @@
1
+ if defined?(REDIS_MONITOR_OPTS)
2
+ Backend.config(redis_host: REDIS_MONITOR_OPTS[:redis_host], redis_port: REDIS_MONITOR_OPTS[:redis_port])
3
+ Authorization.config(REDIS_MONITOR_OPTS[:permissions])
4
+ Authentication.config(REDIS_MONITOR_OPTS[:credentials])
5
+ end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]