easymon 1.6.3 → 1.6.4
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.
- checksums.yaml +4 -4
- data/README.md +28 -12
- data/Rakefile +1 -1
- data/app/controllers/easymon/checks_controller.rb +6 -6
- data/config/routes.rb +2 -2
- data/lib/easymon/checklist.rb +7 -7
- data/lib/easymon/checks/active_record_check.rb +5 -5
- data/lib/easymon/checks/active_record_mysql_writeable_check.rb +1 -1
- data/lib/easymon/checks/http_check.rb +6 -6
- data/lib/easymon/checks/memcached_check.rb +6 -6
- data/lib/easymon/checks/multi_active_record_check.rb +52 -0
- data/lib/easymon/checks/redis_check.rb +3 -3
- data/lib/easymon/checks/redis_writeable_check.rb +1 -1
- data/lib/easymon/checks/semaphore_check.rb +6 -6
- data/lib/easymon/checks/split_active_record_check.rb +6 -16
- data/lib/easymon/checks/traffic_enabled_check.rb +2 -2
- data/lib/easymon/engine.rb +1 -1
- data/lib/easymon/repository.rb +5 -5
- data/lib/easymon/result.rb +2 -2
- data/lib/easymon/testing.rb +2 -2
- data/lib/easymon/version.rb +1 -1
- data/lib/easymon.rb +10 -9
- data/test/controllers/easymon/checks_controller_test.rb +10 -11
- data/test/dummy/Rakefile +2 -3
- data/test/dummy/app/assets/stylesheets/application.css +6 -4
- data/test/dummy/app/controllers/application_controller.rb +2 -1
- data/test/dummy/app/jobs/application_job.rb +7 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/application_record.rb +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +22 -9
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/app/views/pwa/manifest.json.erb +22 -0
- data/test/dummy/app/views/pwa/service-worker.js +26 -0
- data/test/dummy/bin/dev +2 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +34 -0
- data/test/dummy/config/application.rb +22 -50
- data/test/dummy/config/boot.rb +4 -9
- data/test/dummy/config/database.yml +25 -6
- data/test/dummy/config/environment.rb +4 -4
- data/test/dummy/config/environments/development.rb +55 -25
- data/test/dummy/config/environments/production.rb +64 -42
- data/test/dummy/config/environments/test.rb +35 -25
- data/test/dummy/config/initializers/assets.rb +7 -0
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/easymon.rb +2 -2
- data/test/dummy/config/initializers/filter_parameter_logging.rb +8 -0
- data/test/dummy/config/initializers/inflections.rb +10 -9
- data/test/dummy/config/locales/en.yml +28 -2
- data/test/dummy/config/puma.rb +38 -0
- data/test/dummy/config/redis.yml +5 -6
- data/test/dummy/config/routes.rb +13 -0
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/config.ru +4 -2
- data/test/dummy/public/400.html +114 -0
- data/test/dummy/public/404.html +113 -25
- data/test/dummy/public/406-unsupported-browser.html +114 -0
- data/test/dummy/public/422.html +113 -25
- data/test/dummy/public/500.html +113 -24
- data/test/dummy/public/icon.png +0 -0
- data/test/dummy/public/icon.svg +3 -0
- data/test/dummy/tmp/local_secret.txt +1 -0
- data/test/helpers/easymon/checks_helper_test.rb +1 -1
- data/test/integration/navigation_test.rb +1 -2
- data/test/test_helper.rb +3 -3
- data/test/unit/checklist_test.rb +5 -5
- data/test/unit/checks/active_record_check_on_postgresql_test.rb +1 -2
- data/test/unit/checks/active_record_check_test.rb +1 -2
- data/test/unit/checks/active_record_mysql_writeable_check_test.rb +2 -3
- data/test/unit/checks/http_check_test.rb +3 -3
- data/test/unit/checks/memcached_check_test.rb +6 -8
- data/test/unit/checks/multi_active_record_check_test.rb +73 -0
- data/test/unit/checks/redis_check_test.rb +8 -9
- data/test/unit/checks/redis_writeable_check_test.rb +2 -3
- data/test/unit/checks/semaphore_check_test.rb +2 -3
- data/test/unit/checks/split_active_record_check_test.rb +9 -24
- data/test/unit/checks/traffic_enabled_check_test.rb +2 -3
- data/test/unit/repository_test.rb +2 -3
- metadata +99 -75
- data/test/dummy/README.rdoc +0 -261
- data/test/dummy/app/assets/javascripts/application.js +0 -15
- data/test/dummy/app/assets/javascripts/easymon.js +0 -2
- data/test/dummy/app/assets/stylesheets/easymon.css +0 -4
- data/test/dummy/app/controllers/easymon_controller.rb +0 -7
- data/test/dummy/app/helpers/easymon_helper.rb +0 -2
- data/test/dummy/app/views/easymon/index.html.erb +0 -2
- data/test/dummy/app/views/easymon/show.html.erb +0 -2
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -6
- /data/test/dummy/{app/assets/config/manifest.js → log/test.log} +0 -0
data/test/dummy/Rakefile
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
#!/usr/bin/env rake
|
|
2
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
|
3
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
require_relative "config/application"
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
Rails.application.load_tasks
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* listed below.
|
|
4
4
|
*
|
|
5
5
|
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
-
* or vendor/assets/stylesheets
|
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
7
|
*
|
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the
|
|
9
|
-
* compiled file
|
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
|
11
|
+
* It is generally better to create a new file per style scope.
|
|
10
12
|
*
|
|
11
|
-
*= require_self
|
|
12
13
|
*= require_tree .
|
|
14
|
+
*= require_self
|
|
13
15
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
class ApplicationJob < ActiveJob::Base
|
|
2
|
+
# Automatically retry jobs that encountered a deadlock
|
|
3
|
+
# retry_on ActiveRecord::Deadlocked
|
|
4
|
+
|
|
5
|
+
# Most jobs are safe to ignore if the underlying records are no longer available
|
|
6
|
+
# discard_on ActiveJob::DeserializationError
|
|
7
|
+
end
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<title><%= content_for(:title) || "Dummy" %></title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
7
|
+
<meta name="mobile-web-app-capable" content="yes">
|
|
8
|
+
<%= csrf_meta_tags %>
|
|
9
|
+
<%= csp_meta_tag %>
|
|
10
10
|
|
|
11
|
-
<%= yield %>
|
|
11
|
+
<%= yield :head %>
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
|
|
14
|
+
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
|
|
15
|
+
|
|
16
|
+
<link rel="icon" href="/icon.png" type="image/png">
|
|
17
|
+
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
|
18
|
+
<link rel="apple-touch-icon" href="/icon.png">
|
|
19
|
+
|
|
20
|
+
<%# Includes all stylesheet files in app/assets/stylesheets %>
|
|
21
|
+
<%= stylesheet_link_tag :app %>
|
|
22
|
+
</head>
|
|
23
|
+
|
|
24
|
+
<body>
|
|
25
|
+
<%= yield %>
|
|
26
|
+
</body>
|
|
14
27
|
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= yield %>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Dummy",
|
|
3
|
+
"icons": [
|
|
4
|
+
{
|
|
5
|
+
"src": "/icon.png",
|
|
6
|
+
"type": "image/png",
|
|
7
|
+
"sizes": "512x512"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"src": "/icon.png",
|
|
11
|
+
"type": "image/png",
|
|
12
|
+
"sizes": "512x512",
|
|
13
|
+
"purpose": "maskable"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"start_url": "/",
|
|
17
|
+
"display": "standalone",
|
|
18
|
+
"scope": "/",
|
|
19
|
+
"description": "Dummy.",
|
|
20
|
+
"theme_color": "red",
|
|
21
|
+
"background_color": "red"
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Add a service worker for processing Web Push notifications:
|
|
2
|
+
//
|
|
3
|
+
// self.addEventListener("push", async (event) => {
|
|
4
|
+
// const { title, options } = await event.data.json()
|
|
5
|
+
// event.waitUntil(self.registration.showNotification(title, options))
|
|
6
|
+
// })
|
|
7
|
+
//
|
|
8
|
+
// self.addEventListener("notificationclick", function(event) {
|
|
9
|
+
// event.notification.close()
|
|
10
|
+
// event.waitUntil(
|
|
11
|
+
// clients.matchAll({ type: "window" }).then((clientList) => {
|
|
12
|
+
// for (let i = 0; i < clientList.length; i++) {
|
|
13
|
+
// let client = clientList[i]
|
|
14
|
+
// let clientPath = (new URL(client.url)).pathname
|
|
15
|
+
//
|
|
16
|
+
// if (clientPath == event.notification.data.path && "focus" in client) {
|
|
17
|
+
// return client.focus()
|
|
18
|
+
// }
|
|
19
|
+
// }
|
|
20
|
+
//
|
|
21
|
+
// if (clients.openWindow) {
|
|
22
|
+
// return clients.openWindow(event.notification.data.path)
|
|
23
|
+
// }
|
|
24
|
+
// })
|
|
25
|
+
// )
|
|
26
|
+
// })
|
data/test/dummy/bin/dev
ADDED
data/test/dummy/bin/rake
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require "fileutils"
|
|
3
|
+
|
|
4
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
|
5
|
+
|
|
6
|
+
def system!(*args)
|
|
7
|
+
system(*args, exception: true)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
FileUtils.chdir APP_ROOT do
|
|
11
|
+
# This script is a way to set up or update your development environment automatically.
|
|
12
|
+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
|
13
|
+
# Add necessary setup steps to this file.
|
|
14
|
+
|
|
15
|
+
puts "== Installing dependencies =="
|
|
16
|
+
system("bundle check") || system!("bundle install")
|
|
17
|
+
|
|
18
|
+
# puts "\n== Copying sample files =="
|
|
19
|
+
# unless File.exist?("config/database.yml")
|
|
20
|
+
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
|
|
21
|
+
# end
|
|
22
|
+
|
|
23
|
+
puts "\n== Preparing database =="
|
|
24
|
+
system! "bin/rails db:prepare"
|
|
25
|
+
|
|
26
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
27
|
+
system! "bin/rails log:clear tmp:clear"
|
|
28
|
+
|
|
29
|
+
unless ARGV.include?("--skip-server")
|
|
30
|
+
puts "\n== Starting development server =="
|
|
31
|
+
STDOUT.flush # flush the output before exec(2) so that it displays
|
|
32
|
+
exec "bin/dev"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -1,59 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
require_relative "boot"
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require "rails/all"
|
|
4
4
|
|
|
5
|
+
# Require the gems listed in Gemfile, including any gems
|
|
6
|
+
# you've limited to :test, :development, or :production.
|
|
5
7
|
Bundler.require(*Rails.groups)
|
|
8
|
+
|
|
6
9
|
require "easymon"
|
|
7
10
|
|
|
8
11
|
module Dummy
|
|
9
12
|
class Application < Rails::Application
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
# config.
|
|
27
|
-
|
|
28
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
29
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
30
|
-
# config.i18n.default_locale = :de
|
|
31
|
-
|
|
32
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
|
33
|
-
config.encoding = "utf-8"
|
|
34
|
-
|
|
35
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
|
36
|
-
config.filter_parameters += [:password]
|
|
37
|
-
|
|
38
|
-
# Enable escaping HTML in JSON.
|
|
39
|
-
config.active_support.escape_html_entities_in_json = true
|
|
40
|
-
|
|
41
|
-
# Use SQL instead of Active Record's schema dumper when creating the database.
|
|
42
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
43
|
-
# like if you have constraints or database-specific column types
|
|
44
|
-
# config.active_record.schema_format = :sql
|
|
45
|
-
|
|
46
|
-
# Enforce whitelist mode for mass assignment.
|
|
47
|
-
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
|
48
|
-
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
|
49
|
-
# parameters by using an attr_accessible or attr_protected declaration.
|
|
50
|
-
# config.active_record.whitelist_attributes = true
|
|
51
|
-
|
|
52
|
-
# Enable the asset pipeline
|
|
53
|
-
config.assets.enabled = true
|
|
54
|
-
|
|
55
|
-
# Version of your assets, change this if you want to expire all your assets
|
|
56
|
-
config.assets.version = '1.0'
|
|
13
|
+
config.load_defaults Rails::VERSION::STRING.to_f
|
|
14
|
+
|
|
15
|
+
# For compatibility with applications that use this config
|
|
16
|
+
config.action_controller.include_all_helpers = false
|
|
17
|
+
|
|
18
|
+
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
|
19
|
+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
|
20
|
+
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
|
21
|
+
config.autoload_lib(ignore: %w[assets tasks])
|
|
22
|
+
|
|
23
|
+
# Configuration for the application, engines, and railties goes here.
|
|
24
|
+
#
|
|
25
|
+
# These settings can be overridden in specific environments using the files
|
|
26
|
+
# in config/environments, which are processed later.
|
|
27
|
+
#
|
|
28
|
+
# config.time_zone = "Central Time (US & Canada)"
|
|
29
|
+
# config.eager_load_paths << Rails.root.join("extras")
|
|
57
30
|
end
|
|
58
31
|
end
|
|
59
|
-
|
data/test/dummy/config/boot.rb
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# Set up gems listed in the Gemfile.
|
|
2
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
|
|
3
3
|
|
|
4
|
-
if File.exist?(
|
|
5
|
-
|
|
6
|
-
require 'bundler'
|
|
7
|
-
Bundler.setup
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
|
4
|
+
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
|
5
|
+
$LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
|
|
@@ -10,12 +10,31 @@ development:
|
|
|
10
10
|
# re-generated from your development database when you run "rake".
|
|
11
11
|
# Do not set this db to the same as development or production.
|
|
12
12
|
test:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
primary:
|
|
14
|
+
adapter: mysql2
|
|
15
|
+
encoding: utf8
|
|
16
|
+
database: dummy_test
|
|
17
|
+
username: root
|
|
18
|
+
host: 127.0.0.1
|
|
19
|
+
port: 3306
|
|
20
|
+
|
|
21
|
+
primary_replica:
|
|
22
|
+
adapter: mysql2
|
|
23
|
+
encoding: utf8
|
|
24
|
+
database: dummy_test
|
|
25
|
+
username: root
|
|
26
|
+
host: 127.0.0.1
|
|
27
|
+
port: 3306
|
|
28
|
+
replica: true
|
|
29
|
+
|
|
30
|
+
other_replica:
|
|
31
|
+
adapter: mysql2
|
|
32
|
+
encoding: utf8
|
|
33
|
+
database: dummy_test
|
|
34
|
+
username: root
|
|
35
|
+
host: 127.0.0.1
|
|
36
|
+
port: 3306
|
|
37
|
+
replica: true
|
|
19
38
|
|
|
20
39
|
test_replica:
|
|
21
40
|
adapter: mysql2
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Load the
|
|
2
|
-
|
|
1
|
+
# Load the Rails application.
|
|
2
|
+
require_relative "application"
|
|
3
3
|
|
|
4
|
-
# Initialize the
|
|
5
|
-
|
|
4
|
+
# Initialize the Rails application.
|
|
5
|
+
Rails.application.initialize!
|
|
@@ -1,39 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
#
|
|
6
|
-
# since you don't have to restart the web server when you make code changes.
|
|
7
|
-
config.cache_classes = false
|
|
3
|
+
Rails.application.configure do
|
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
8
5
|
|
|
9
|
-
#
|
|
10
|
-
|
|
6
|
+
# Make code changes take effect immediately without server restart.
|
|
7
|
+
config.enable_reloading = true
|
|
11
8
|
|
|
12
|
-
#
|
|
13
|
-
config.
|
|
14
|
-
config.action_controller.perform_caching = false
|
|
9
|
+
# Do not eager load code on boot.
|
|
10
|
+
config.eager_load = false
|
|
15
11
|
|
|
16
|
-
#
|
|
12
|
+
# Show full error reports.
|
|
13
|
+
config.consider_all_requests_local = true
|
|
14
|
+
|
|
15
|
+
# Enable server timing.
|
|
16
|
+
config.server_timing = true
|
|
17
|
+
|
|
18
|
+
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
|
|
19
|
+
# Run rails dev:cache to toggle Action Controller caching.
|
|
20
|
+
if Rails.root.join("tmp/caching-dev.txt").exist?
|
|
21
|
+
config.action_controller.perform_caching = true
|
|
22
|
+
config.action_controller.enable_fragment_cache_logging = true
|
|
23
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
|
|
24
|
+
else
|
|
25
|
+
config.action_controller.perform_caching = false
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Change to :null_store to avoid any caching.
|
|
29
|
+
config.cache_store = :memory_store
|
|
30
|
+
|
|
31
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
|
32
|
+
config.active_storage.service = :local
|
|
33
|
+
|
|
34
|
+
# Don't care if the mailer can't send.
|
|
17
35
|
config.action_mailer.raise_delivery_errors = false
|
|
18
36
|
|
|
19
|
-
#
|
|
37
|
+
# Make template changes take effect immediately.
|
|
38
|
+
config.action_mailer.perform_caching = false
|
|
39
|
+
|
|
40
|
+
# Set localhost to be used by links generated in mailer templates.
|
|
41
|
+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
|
|
42
|
+
|
|
43
|
+
# Print deprecation notices to the Rails logger.
|
|
20
44
|
config.active_support.deprecation = :log
|
|
21
45
|
|
|
22
|
-
#
|
|
23
|
-
config.
|
|
46
|
+
# Raise an error on page load if there are pending migrations.
|
|
47
|
+
config.active_record.migration_error = :page_load
|
|
48
|
+
|
|
49
|
+
# Highlight code that triggered database queries in logs.
|
|
50
|
+
config.active_record.verbose_query_logs = true
|
|
51
|
+
|
|
52
|
+
# Append comments with runtime information tags to SQL queries in logs.
|
|
53
|
+
config.active_record.query_log_tags_enabled = true
|
|
24
54
|
|
|
25
|
-
#
|
|
26
|
-
|
|
55
|
+
# Highlight code that enqueued background job in logs.
|
|
56
|
+
config.active_job.verbose_enqueue_logs = true
|
|
27
57
|
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#config.active_record.auto_explain_threshold_in_seconds = 0.5
|
|
58
|
+
# Raises error for missing translations.
|
|
59
|
+
# config.i18n.raise_on_missing_translations = true
|
|
31
60
|
|
|
32
|
-
#
|
|
33
|
-
config.
|
|
61
|
+
# Annotate rendered view with file names.
|
|
62
|
+
config.action_view.annotate_rendered_view_with_filenames = true
|
|
34
63
|
|
|
35
|
-
#
|
|
36
|
-
config.
|
|
64
|
+
# Uncomment if you wish to allow Action Cable access from any origin.
|
|
65
|
+
# config.action_cable.disable_request_forgery_protection = true
|
|
37
66
|
|
|
38
|
-
|
|
67
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
|
68
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
|
39
69
|
end
|
|
@@ -1,67 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
config.
|
|
3
|
+
Rails.application.configure do
|
|
4
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
|
6
5
|
|
|
7
|
-
#
|
|
8
|
-
config.
|
|
9
|
-
|
|
6
|
+
# Code is not reloaded between requests.
|
|
7
|
+
config.enable_reloading = false
|
|
8
|
+
|
|
9
|
+
# Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
|
|
10
|
+
config.eager_load = true
|
|
10
11
|
|
|
11
|
-
#
|
|
12
|
-
config.
|
|
12
|
+
# Full error reports are disabled.
|
|
13
|
+
config.consider_all_requests_local = false
|
|
13
14
|
|
|
14
|
-
#
|
|
15
|
-
config.
|
|
15
|
+
# Turn on fragment caching in view templates.
|
|
16
|
+
config.action_controller.perform_caching = true
|
|
16
17
|
|
|
17
|
-
#
|
|
18
|
-
config.
|
|
18
|
+
# Cache assets for far-future expiry since they are all digest stamped.
|
|
19
|
+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
|
|
19
20
|
|
|
20
|
-
#
|
|
21
|
-
config.
|
|
21
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
|
22
|
+
# config.asset_host = "http://assets.example.com"
|
|
22
23
|
|
|
23
|
-
#
|
|
24
|
-
|
|
24
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
|
25
|
+
config.active_storage.service = :local
|
|
25
26
|
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
|
27
|
+
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
|
28
|
+
config.assume_ssl = true
|
|
29
29
|
|
|
30
30
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
|
31
|
-
|
|
31
|
+
config.force_ssl = true
|
|
32
32
|
|
|
33
|
-
#
|
|
34
|
-
# config.
|
|
33
|
+
# Skip http-to-https redirect for the default health check endpoint.
|
|
34
|
+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
|
35
35
|
|
|
36
|
-
#
|
|
37
|
-
|
|
36
|
+
# Log to STDOUT with the current request id as a default log tag.
|
|
37
|
+
config.log_tags = [ :request_id ]
|
|
38
|
+
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
|
|
38
39
|
|
|
39
|
-
#
|
|
40
|
-
|
|
40
|
+
# Change to "debug" to log everything (including potentially personally-identifiable information!)
|
|
41
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
|
41
42
|
|
|
42
|
-
#
|
|
43
|
-
|
|
43
|
+
# Prevent health checks from clogging up the logs.
|
|
44
|
+
config.silence_healthcheck_path = "/up"
|
|
44
45
|
|
|
45
|
-
#
|
|
46
|
-
|
|
46
|
+
# Don't log any deprecations.
|
|
47
|
+
config.active_support.report_deprecations = false
|
|
47
48
|
|
|
48
|
-
#
|
|
49
|
-
# config.
|
|
49
|
+
# Replace the default in-process memory cache store with a durable alternative.
|
|
50
|
+
# config.cache_store = :mem_cache_store
|
|
51
|
+
|
|
52
|
+
# Replace the default in-process and non-durable queuing backend for Active Job.
|
|
53
|
+
# config.active_job.queue_adapter = :resque
|
|
50
54
|
|
|
51
|
-
#
|
|
55
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
|
56
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
|
52
57
|
# config.action_mailer.raise_delivery_errors = false
|
|
53
58
|
|
|
54
|
-
#
|
|
55
|
-
|
|
59
|
+
# Set host to be used by links generated in mailer templates.
|
|
60
|
+
config.action_mailer.default_url_options = { host: "example.com" }
|
|
61
|
+
|
|
62
|
+
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
|
|
63
|
+
# config.action_mailer.smtp_settings = {
|
|
64
|
+
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
|
|
65
|
+
# password: Rails.application.credentials.dig(:smtp, :password),
|
|
66
|
+
# address: "smtp.example.com",
|
|
67
|
+
# port: 587,
|
|
68
|
+
# authentication: :plain
|
|
69
|
+
# }
|
|
56
70
|
|
|
57
71
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
58
|
-
# the I18n.default_locale when a translation
|
|
72
|
+
# the I18n.default_locale when a translation cannot be found).
|
|
59
73
|
config.i18n.fallbacks = true
|
|
60
74
|
|
|
61
|
-
#
|
|
62
|
-
config.
|
|
75
|
+
# Do not dump schema after migrations.
|
|
76
|
+
config.active_record.dump_schema_after_migration = false
|
|
77
|
+
|
|
78
|
+
# Only use :id for inspections in production.
|
|
79
|
+
config.active_record.attributes_for_inspect = [ :id ]
|
|
63
80
|
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
81
|
+
# Enable DNS rebinding protection and other `Host` header attacks.
|
|
82
|
+
# config.hosts = [
|
|
83
|
+
# "example.com", # Allow requests from example.com
|
|
84
|
+
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
|
85
|
+
# ]
|
|
86
|
+
#
|
|
87
|
+
# Skip DNS rebinding protection for the default health check endpoint.
|
|
88
|
+
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
|
67
89
|
end
|