middleware_healthcheck 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -0
  3. data/CODE_OF_CONDUCT.md +76 -0
  4. data/CONTRIBUTING.md +48 -0
  5. data/Dockerfile +14 -0
  6. data/Gemfile +21 -0
  7. data/Gemfile.lock +167 -0
  8. data/LICENSE +0 -0
  9. data/README.md +6 -1
  10. data/Rakefile +2 -6
  11. data/lib/middleware_healthcheck.rb +8 -6
  12. data/lib/middleware_healthcheck/configuration.rb +10 -8
  13. data/lib/middleware_healthcheck/default_checkers.rb +3 -3
  14. data/lib/middleware_healthcheck/default_checkers/active_record_checker.rb +6 -5
  15. data/lib/middleware_healthcheck/main_checker.rb +9 -6
  16. data/lib/middleware_healthcheck/middleware.rb +3 -1
  17. data/lib/middleware_healthcheck/rails.rb +3 -1
  18. data/lib/middleware_healthcheck/version.rb +3 -1
  19. data/spec/dummy/Rakefile +8 -0
  20. data/spec/dummy/app/assets/config/manifest.js +4 -0
  21. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  22. data/spec/dummy/app/assets/javascripts/cable.js +13 -0
  23. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  24. data/spec/dummy/app/channels/application_cable/channel.rb +6 -0
  25. data/spec/dummy/app/channels/application_cable/connection.rb +6 -0
  26. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  27. data/spec/dummy/app/controllers/home_controller.rb +5 -0
  28. data/spec/dummy/app/helpers/application_helper.rb +4 -0
  29. data/spec/dummy/app/jobs/application_job.rb +4 -0
  30. data/spec/dummy/app/mailers/application_mailer.rb +6 -0
  31. data/spec/dummy/app/models/application_record.rb +5 -0
  32. data/spec/dummy/app/views/home/show.html.erb +1 -0
  33. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  34. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  35. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  36. data/spec/dummy/bin/bundle +5 -0
  37. data/spec/dummy/bin/rails +6 -0
  38. data/spec/dummy/bin/rake +6 -0
  39. data/spec/dummy/bin/setup +36 -0
  40. data/spec/dummy/bin/update +31 -0
  41. data/spec/dummy/config.ru +7 -0
  42. data/spec/dummy/config/application.rb +24 -0
  43. data/spec/dummy/config/boot.rb +7 -0
  44. data/spec/dummy/config/cable.yml +9 -0
  45. data/spec/dummy/config/database.yml +25 -0
  46. data/spec/dummy/config/environment.rb +7 -0
  47. data/spec/dummy/config/environments/development.rb +56 -0
  48. data/spec/dummy/config/environments/production.rb +88 -0
  49. data/spec/dummy/config/environments/test.rb +44 -0
  50. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  51. data/spec/dummy/config/initializers/assets.rb +13 -0
  52. data/spec/dummy/config/initializers/backtrace_silencers.rb +9 -0
  53. data/spec/dummy/config/initializers/cookies_serializer.rb +7 -0
  54. data/spec/dummy/config/initializers/filter_parameter_logging.rb +6 -0
  55. data/spec/dummy/config/initializers/inflections.rb +18 -0
  56. data/spec/dummy/config/initializers/mime_types.rb +6 -0
  57. data/spec/dummy/config/initializers/new_framework_defaults.rb +26 -0
  58. data/spec/dummy/config/initializers/session_store.rb +5 -0
  59. data/spec/dummy/config/initializers/wrap_parameters.rb +16 -0
  60. data/spec/dummy/config/locales/en.yml +23 -0
  61. data/spec/dummy/config/puma.rb +49 -0
  62. data/spec/dummy/config/routes.rb +5 -0
  63. data/spec/dummy/config/secrets.yml +22 -0
  64. data/spec/dummy/config/spring.rb +8 -0
  65. data/spec/dummy/db/test.sqlite3 +0 -0
  66. data/spec/dummy/log/test.log +80 -0
  67. data/spec/dummy/public/404.html +67 -0
  68. data/spec/dummy/public/422.html +67 -0
  69. data/spec/dummy/public/500.html +66 -0
  70. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  71. data/spec/dummy/public/apple-touch-icon.png +0 -0
  72. data/spec/dummy/public/favicon.ico +0 -0
  73. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1Z/1ZqiErdTkUSevJyliQcE6Uv0PPfRzU66d94xoZ3dSfw.cache +1 -0
  74. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7w/7w6Uz6xnLkTSMI9uPVNZTvew3_SuE2eFtCp2AMFxQeE.cache +1 -0
  75. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cc/CcEKUCZOP7lJ_9fy6W8fGxHeo_pLX0_lh0F7JlaDl5I.cache +0 -0
  76. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/D_/D_apOMXJIIn679o4LoHlmz-NyTG64xuWe4ro7TKyzpU.cache +1 -0
  77. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/G0/G0qRtrgh65rOsfS-37uSF2UQdaiDRjEmjqhbpW0pBJA.cache +0 -0
  78. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/GD/GDi3vpM2thf3K_zCKYCjKfpt48sxKHSiGGGpyPoOmfw.cache +3 -0
  79. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/H8/H8v7a_YYGdXSKky0FMxhQ8ym_KD2BX6oGxi3jjzxFSg.cache +1 -0
  80. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Iw/IwkARxo4EFYR8P7KFYOqyI2hltfnkf4RBi2GUjeEltU.cache +1 -0
  81. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Jh/Jhvq9MvG2JctlJCzxUeOKtKWOu-CErXP0g6EYcMi8pk.cache +0 -0
  82. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/K2/K2fQCerqynseUF9eeLrwQyQhjV_SJOnR35ahxOQOH4Y.cache +1 -0
  83. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ls/LsCysQmA8eOxqOj2xfTI5HT0hmFxkgb9T-79Vfpkphk.cache +1 -0
  84. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Nq/NqQL4uxBADGd-m9HPI6owT0X79j5Ih03H3Tj1zUv0fc.cache +1 -0
  85. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/RN/RN_c4-q-QAwblsfNBzf70NZ91k0xUW5abQ85cDmIFZ8.cache +1 -0
  86. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/T_/T_SzItfIMNw-VpC5cTm_V-MwdXicKcejykRA_eZGBcg.cache +0 -0
  87. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VQ/VQUXuiYfRkz_txe0ySlqGpjumXvwUZs4UQ3LdhtnLqo.cache +2 -0
  88. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Zg/ZguUWQxNrtIUWwdZcTog89HWZjwlg1b4B10YtdmGYxo.cache +1 -0
  89. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b_/b_Itlk9QZZd7Rvf8kcA4yLP1R5Acu7jB-m1xQiSU0qE.cache +2 -0
  90. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dC/dCU95oHfJgwqhciDDqBRfdPqRoYltk9RsJijdjFJDFs.cache +0 -0
  91. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dt/dtA0dxun-aGWHDbilfOw6VkR_pXBQ6Hclrh-DQvu-E4.cache +1 -0
  92. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gg/ggjn9TAGF7zuNOkhChHWmsgBW1JVopRz-Y2hMUg7810.cache +1 -0
  93. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gy/gyVskbQyIOYyz_cK-QTT4kgiBOAsnZC9gN84kLLDYdE.cache +1 -0
  94. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/l_/l__yndgwOVdnrXF0F2Y92la2fbJ-bY8flE0NFs12AGY.cache +1 -0
  95. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mX/mX1nlsL_SWOB4y22W5FheRX0YEONKyOY7xUeIvRiHco.cache +2 -0
  96. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache +2 -0
  97. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nx/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache +2 -0
  98. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/p7/p7shbLzQVrz5OW2TM-TaNcMg8gsq9aZWwa93dkSMTQY.cache +1 -0
  99. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rJ/rJkoK89nBrho66t78LEv5znjqvofPuVMzAQMTuQbVBg.cache +0 -0
  100. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wD/wD6mw4ORb1J88B71fVPpf5RbRJ3TVgfnA77wJFO8xj4.cache +1 -0
  101. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/x7/x7PYh8DJvPykcEqpVab2vcY9-GFz-3cqtoMlRAu94Uc.cache +2 -0
  102. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/y_/y_wGqfMY79V5Y8Hzbzuc2ChuexYsrFvBkUfKNuMyTQI.cache +0 -0
  103. data/spec/rails_helper.rb +60 -0
  104. data/spec/requests/healthcheck_spec.rb +46 -0
  105. data/spec/spec_helper.rb +99 -0
  106. metadata +198 -22
  107. data/lib/tasks/middleware_healthcheck_tasks.rake +0 -4
@@ -0,0 +1,9 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
@@ -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
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Load the Rails application.
4
+ require_relative 'application'
5
+
6
+ # Initialize the Rails application.
7
+ Rails.application.initialize!
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # In the development environment your application's code is reloaded on
7
+ # every request. This slows down response time but is perfect for development
8
+ # since you don't have to restart the web server when you make code changes.
9
+ config.cache_classes = false
10
+
11
+ # Do not eager load code on boot.
12
+ config.eager_load = false
13
+
14
+ # Show full error reports.
15
+ config.consider_all_requests_local = true
16
+
17
+ # Enable/disable caching. By default caching is disabled.
18
+ if Rails.root.join('tmp', 'caching-dev.txt').exist?
19
+ config.action_controller.perform_caching = true
20
+
21
+ config.cache_store = :memory_store
22
+ config.public_file_server.headers = {
23
+ 'Cache-Control' => 'public, max-age=172800'
24
+ }
25
+ else
26
+ config.action_controller.perform_caching = false
27
+
28
+ config.cache_store = :null_store
29
+ end
30
+
31
+ # Don't care if the mailer can't send.
32
+ config.action_mailer.raise_delivery_errors = false
33
+
34
+ config.action_mailer.perform_caching = false
35
+
36
+ # Print deprecation notices to the Rails logger.
37
+ config.active_support.deprecation = :log
38
+
39
+ # Raise an error on page load if there are pending migrations.
40
+ config.active_record.migration_error = :page_load
41
+
42
+ # Debug mode disables concatenation and preprocessing of assets.
43
+ # This option may cause significant delays in view rendering with a large
44
+ # number of complex assets.
45
+ config.assets.debug = true
46
+
47
+ # Suppress logger output for asset requests.
48
+ config.assets.quiet = true
49
+
50
+ # Raises error for missing translations
51
+ # config.action_view.raise_on_missing_translations = true
52
+
53
+ # Use an evented file watcher to asynchronously detect changes in source code,
54
+ # routes, locales, etc. This feature depends on the listen gem.
55
+ # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
56
+ end
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Code is not reloaded between requests.
7
+ config.cache_classes = true
8
+
9
+ # Eager load code on boot. This eager loads most of Rails and
10
+ # your application in memory, allowing both threaded web servers
11
+ # and those relying on copy on write to perform better.
12
+ # Rake tasks automatically ignore this option for performance.
13
+ config.eager_load = true
14
+
15
+ # Full error reports are disabled and caching is turned on.
16
+ config.consider_all_requests_local = false
17
+ config.action_controller.perform_caching = true
18
+
19
+ # Disable serving static files from the `/public` folder by default since
20
+ # Apache or NGINX already handles this.
21
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
22
+
23
+ # Compress JavaScripts and CSS.
24
+ config.assets.js_compressor = :uglifier
25
+ # config.assets.css_compressor = :sass
26
+
27
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
28
+ config.assets.compile = false
29
+
30
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
31
+
32
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
33
+ # config.action_controller.asset_host = 'http://assets.example.com'
34
+
35
+ # Specifies the header that your server uses for sending files.
36
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
37
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
38
+
39
+ # Mount Action Cable outside main process or domain
40
+ # config.action_cable.mount_path = nil
41
+ # config.action_cable.url = 'wss://example.com/cable'
42
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
43
+
44
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # config.force_ssl = true
46
+
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
50
+
51
+ # Prepend all log lines with the following tags.
52
+ config.log_tags = [:request_id]
53
+
54
+ # Use a different cache store in production.
55
+ # config.cache_store = :mem_cache_store
56
+
57
+ # Use a real queuing backend for Active Job (and separate queues per environment)
58
+ # config.active_job.queue_adapter = :resque
59
+ # config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
60
+ config.action_mailer.perform_caching = false
61
+
62
+ # Ignore bad email addresses and do not raise email delivery errors.
63
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
64
+ # config.action_mailer.raise_delivery_errors = false
65
+
66
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
67
+ # the I18n.default_locale when a translation cannot be found).
68
+ config.i18n.fallbacks = true
69
+
70
+ # Send deprecation notices to registered listeners.
71
+ config.active_support.deprecation = :notify
72
+
73
+ # Use default logging formatter so that PID and timestamp are not suppressed.
74
+ config.log_formatter = ::Logger::Formatter.new
75
+
76
+ # Use a different logger for distributed setups.
77
+ # require 'syslog/logger'
78
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
79
+
80
+ if ENV['RAILS_LOG_TO_STDOUT'].present?
81
+ logger = ActiveSupport::Logger.new(STDOUT)
82
+ logger.formatter = config.log_formatter
83
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
84
+ end
85
+
86
+ # Do not dump schema after migrations.
87
+ config.active_record.dump_schema_after_migration = false
88
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # The test environment is used exclusively to run your application's
7
+ # test suite. You never need to work with it otherwise. Remember that
8
+ # your test database is "scratch space" for the test suite and is wiped
9
+ # and recreated between test runs. Don't rely on the data there!
10
+ config.cache_classes = true
11
+
12
+ # Do not eager load code on boot. This avoids loading your whole application
13
+ # just for the purpose of running a single test. If you are using a tool that
14
+ # preloads Rails for running tests, you may have to set it to true.
15
+ config.eager_load = false
16
+
17
+ # Configure public file server for tests with Cache-Control for performance.
18
+ config.public_file_server.enabled = true
19
+ config.public_file_server.headers = {
20
+ 'Cache-Control' => 'public, max-age=3600'
21
+ }
22
+
23
+ # Show full error reports and disable caching.
24
+ config.consider_all_requests_local = true
25
+ config.action_controller.perform_caching = false
26
+
27
+ # Raise exceptions instead of rendering exception templates.
28
+ config.action_dispatch.show_exceptions = false
29
+
30
+ # Disable request forgery protection in test environment.
31
+ config.action_controller.allow_forgery_protection = false
32
+ config.action_mailer.perform_caching = false
33
+
34
+ # Tell Action Mailer not to deliver emails to the real world.
35
+ # The :test delivery method accumulates sent emails in the
36
+ # ActionMailer::Base.deliveries array.
37
+ config.action_mailer.delivery_method = :test
38
+
39
+ # Print deprecation notices to the stderr.
40
+ config.active_support.deprecation = :stderr
41
+
42
+ # Raises error for missing translations
43
+ # config.action_view.raise_on_missing_translations = true
44
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # ApplicationController.renderer.defaults.merge!(
6
+ # http_host: 'example.org',
7
+ # https: false
8
+ # )
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Version of your assets, change this if you want to expire all your assets.
6
+ Rails.application.config.assets.version = '1.0'
7
+
8
+ # Add additional assets to the asset load path
9
+ # Rails.application.config.assets.paths << Emoji.images_path
10
+
11
+ # Precompile additional assets.
12
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
13
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
6
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
7
+
8
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
9
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Specify a serializer for the signed and encrypted cookie jars.
6
+ # Valid options are :json, :marshal, and :hybrid.
7
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Configure sensitive parameters which will be filtered from the log file.
6
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new inflection rules using the following format. Inflections
6
+ # are locale specific, and you may define rules for as many different
7
+ # locales as you wish. All of these examples are active by default:
8
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
9
+ # inflect.plural /^(ox)$/i, '\1en'
10
+ # inflect.singular /^(ox)en/i, '\1'
11
+ # inflect.irregular 'person', 'people'
12
+ # inflect.uncountable %w( fish sheep )
13
+ # end
14
+
15
+ # These inflection rules are supported but not enabled by default:
16
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
17
+ # inflect.acronym 'RESTful'
18
+ # end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add new mime types for use in respond_to blocks:
6
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+ #
5
+ # This file contains migration options to ease your Rails 5.0 upgrade.
6
+ #
7
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8
+
9
+ # Enable per-form CSRF tokens. Previous versions had false.
10
+ Rails.application.config.action_controller.per_form_csrf_tokens = true
11
+
12
+ # Enable origin-checking CSRF mitigation. Previous versions had false.
13
+ Rails.application.config.action_controller.forgery_protection_origin_check = true
14
+
15
+ # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
16
+ # Previous versions had false.
17
+ ActiveSupport.to_time_preserves_timezone = true
18
+
19
+ # Require `belongs_to` associations by default. Previous versions had false.
20
+ Rails.application.config.active_record.belongs_to_required_by_default = true
21
+
22
+ # Do not halt callback chains when a callback returns false. Previous versions had true.
23
+ ActiveSupport.halt_callback_chains_on_return_false = false
24
+
25
+ # Configure SSL options to enable HSTS with subdomains. Previous versions had false.
26
+ Rails.application.config.ssl_options = { hsts: { subdomains: true } }
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # This file contains settings for ActionController::ParamsWrapper which
6
+ # is enabled by default.
7
+
8
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
9
+ ActiveSupport.on_load(:action_controller) do
10
+ wrap_parameters format: [:json]
11
+ end
12
+
13
+ # To enable root element in JSON for ActiveRecord objects.
14
+ # ActiveSupport.on_load(:active_record) do
15
+ # self.include_root_in_json = true
16
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Puma can serve each request in a thread from an internal thread pool.
4
+ # The `threads` method setting takes two numbers a minimum and maximum.
5
+ # Any libraries that use thread pools should be configured to match
6
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
7
+ # and maximum, this matches the default thread size of Active Record.
8
+ #
9
+ threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }.to_i
10
+ threads threads_count, threads_count
11
+
12
+ # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
13
+ #
14
+ port ENV.fetch('PORT') { 3000 }
15
+
16
+ # Specifies the `environment` that Puma will run in.
17
+ #
18
+ environment ENV.fetch('RAILS_ENV') { 'development' }
19
+
20
+ # Specifies the number of `workers` to boot in clustered mode.
21
+ # Workers are forked webserver processes. If using threads and workers together
22
+ # the concurrency of the application would be max `threads` * `workers`.
23
+ # Workers do not work on JRuby or Windows (both of which do not support
24
+ # processes).
25
+ #
26
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
27
+
28
+ # Use the `preload_app!` method when specifying a `workers` number.
29
+ # This directive tells Puma to first boot the application and load code
30
+ # before forking the application. This takes advantage of Copy On Write
31
+ # process behavior so workers use less memory. If you use this option
32
+ # you need to make sure to reconnect any threads in the `on_worker_boot`
33
+ # block.
34
+ #
35
+ # preload_app!
36
+
37
+ # The code in the `on_worker_boot` will be called if you are using
38
+ # clustered mode by specifying a number of `workers`. After each worker
39
+ # process is booted this block will be run, if you are using `preload_app!`
40
+ # option you will want to use this block to reconnect to any threads
41
+ # or connections that may have been created at application boot, Ruby
42
+ # cannot share connections between processes.
43
+ #
44
+ # on_worker_boot do
45
+ # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
46
+ # end
47
+
48
+ # Allow puma to be restarted by `rails restart` command.
49
+ plugin :tmp_restart