dryer-config 7.0.0 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -1
- data/.ruby-version +1 -1
- data/MIT-LICENSE +1 -1
- data/README.md +27 -31
- data/config/cable.yml +1 -1
- data/config/database.yml +10 -3
- data/config/environments/development.rb +16 -3
- data/config/environments/production.rb +36 -27
- data/config/environments/test.rb +18 -9
- data/config/importmap.rb +4 -4
- data/config/initializers/content_security_policy.rb +6 -7
- data/config/initializers/filter_parameter_logging.rb +4 -2
- data/config/initializers/permissions_policy.rb +11 -9
- data/config/puma.rb +24 -34
- data/dryer-config.gemspec +2 -9
- data/lib/dryer-config/version.rb +8 -6
- metadata +6 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a57a7166f57fe0471ff1a67bef363d5349e80e6fef7f09a013b7c1aa8fb957b
|
4
|
+
data.tar.gz: 489a56d888d75769ca1a47b6fb063e6a343c072dca5897d8e9df73e60a5934ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 075f212f7fe337c4e8571041def92f57326a729eef1413dc64c7c86a8c6348d2cb2911441ddc3aea16054a8cadfcd768aee4737c177a34834edfc402d9f4b4ff
|
7
|
+
data.tar.gz: 2412955b4412abdc786a3427b986a4d12d4523e0354f2edb1b018e9aac7eeffec15b2fab31dd59a097f581e0a839ec6f1fe2535d68d9f4ba067716a2ede3ef20
|
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rails-7.
|
1
|
+
rails-7.2
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-3.
|
1
|
+
ruby-3.3.4
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
DryerConfig
|
2
|
-
|
1
|
+
# DryerConfig
|
2
|
+
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/dryer-config.png)](http://badge.fury.io/rb/dryer-config)
|
4
4
|
|
5
|
-
Contains most of the files of a pristine
|
5
|
+
Contains most of the files of a pristine `rails new` `config` directories.
|
6
6
|
They will be available to your application by
|
7
7
|
the engine nature of this gem.
|
8
8
|
|
9
|
-
Your private
|
9
|
+
Your private `config` directory (and your repository)
|
10
10
|
will contain just your particular requirements/options
|
11
|
-
(e.g. config/database.yml).
|
11
|
+
(e.g. `config/database.yml`).
|
12
12
|
|
13
13
|
Version numbering is according to the Rails versions, e.g. use
|
14
14
|
|
@@ -18,37 +18,36 @@ or
|
|
18
18
|
|
19
19
|
gem 'dryer-config', '~> 5.2' # expected to serve Rails 5.2.*
|
20
20
|
|
21
|
-
in your Gemfile
|
21
|
+
in your `Gemfile`.
|
22
22
|
|
23
|
-
It is expected that the version
|
24
|
-
complete Rails
|
23
|
+
It is expected that the version 7.0.0 is fine for the
|
24
|
+
complete Rails 7 serie.
|
25
25
|
If not, a new version of this gem will be released (hopefully).
|
26
26
|
|
27
|
-
Why
|
28
|
-
---
|
27
|
+
## Why
|
29
28
|
|
30
29
|
Usually I run several applications based on the same Rails on one server.
|
31
30
|
There is no need to waste disk space (mostly irrelevant today,
|
32
31
|
but I still don't like wasting).
|
33
32
|
|
34
|
-
Several
|
33
|
+
Several `config` files will be out of the way (less attention)
|
35
34
|
for the developer.
|
36
35
|
|
37
36
|
Lastly, during the port of a Rails application to another version
|
38
37
|
a pristine configuration is handy.
|
39
|
-
The few remaining options in your
|
38
|
+
The few remaining options in your `config` files needs
|
40
39
|
less attention/work.
|
41
40
|
|
42
|
-
Installation
|
43
|
-
------------
|
44
|
-
To install add the following to your Gemfile (e.g.):
|
45
|
-
|
46
|
-
gem 'dryer-config', '~> 6.0'
|
41
|
+
## Installation
|
47
42
|
|
48
|
-
|
43
|
+
As usual:
|
44
|
+
```ruby
|
45
|
+
# Gemfile
|
46
|
+
gem "dryer-config", "~> 7.1"
|
47
|
+
```
|
48
|
+
and run `bundle install`.
|
49
49
|
|
50
|
-
Rails 6.0.0
|
51
|
-
-----------
|
50
|
+
## Rails 7.1.0, 7.0.0, 6.0.0, 5.2.0
|
52
51
|
|
53
52
|
See also "Configuration" below.
|
54
53
|
|
@@ -58,15 +57,6 @@ Create your own (there are still there for inspection):
|
|
58
57
|
|
59
58
|
The Webpacker files may require your attention:
|
60
59
|
|
61
|
-
Rails 5.2.0
|
62
|
-
-----------
|
63
|
-
|
64
|
-
See also Configuration below.
|
65
|
-
|
66
|
-
Create your own (there are still there for inspection):
|
67
|
-
|
68
|
-
./config/storage.yml
|
69
|
-
|
70
60
|
Configuration
|
71
61
|
-------------
|
72
62
|
|
@@ -97,7 +87,13 @@ The following file requires your attention:
|
|
97
87
|
|
98
88
|
Create your own. It will run after the one from the gem.
|
99
89
|
|
100
|
-
See also
|
101
|
-
--------
|
90
|
+
## See also
|
102
91
|
|
103
92
|
http://railsdiff.org/
|
93
|
+
|
94
|
+
## Miscellaneous
|
95
|
+
|
96
|
+
Copyright (c) 2016-2024 Dittmar Krall (www.matiq.com),
|
97
|
+
released under the MIT license:
|
98
|
+
|
99
|
+
* https://opensource.org/licenses/MIT
|
data/config/cable.yml
CHANGED
data/config/database.yml
CHANGED
@@ -11,15 +11,22 @@ default: &default
|
|
11
11
|
|
12
12
|
development:
|
13
13
|
<<: *default
|
14
|
-
database:
|
14
|
+
database: storage/development.sqlite3
|
15
15
|
|
16
16
|
# Warning: The database defined as "test" will be erased and
|
17
17
|
# re-generated from your development database when you run "rake".
|
18
18
|
# Do not set this db to the same as development or production.
|
19
19
|
test:
|
20
20
|
<<: *default
|
21
|
-
database:
|
21
|
+
database: storage/test.sqlite3
|
22
22
|
|
23
|
+
|
24
|
+
# SQLite3 write its data on the local filesystem, as such it requires
|
25
|
+
# persistent disks. If you are deploying to a managed service, you should
|
26
|
+
# make sure it provides disk persistence, as many don't.
|
27
|
+
#
|
28
|
+
# Similarly, if you deploy your application as a Docker container, you must
|
29
|
+
# ensure the database is located in a persisted volume.
|
23
30
|
production:
|
24
31
|
<<: *default
|
25
|
-
database:
|
32
|
+
# database: path/to/persistent/storage/production.sqlite3
|
@@ -6,7 +6,7 @@ Rails.application.configure do
|
|
6
6
|
# In the development environment your application's code is reloaded any time
|
7
7
|
# it changes. This slows down response time but is perfect for development
|
8
8
|
# since you don't have to restart the web server when you make code changes.
|
9
|
-
config.
|
9
|
+
config.enable_reloading = true
|
10
10
|
|
11
11
|
# Do not eager load code on boot.
|
12
12
|
config.eager_load = false
|
@@ -14,7 +14,7 @@ Rails.application.configure do
|
|
14
14
|
# Show full error reports.
|
15
15
|
config.consider_all_requests_local = true
|
16
16
|
|
17
|
-
# Enable server timing
|
17
|
+
# Enable server timing.
|
18
18
|
config.server_timing = true
|
19
19
|
|
20
20
|
# Enable/disable caching. By default caching is disabled.
|
@@ -39,8 +39,12 @@ Rails.application.configure do
|
|
39
39
|
# Don't care if the mailer can't send.
|
40
40
|
config.action_mailer.raise_delivery_errors = false
|
41
41
|
|
42
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
43
|
+
# caching is enabled.
|
42
44
|
config.action_mailer.perform_caching = false
|
43
45
|
|
46
|
+
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
|
47
|
+
|
44
48
|
# Print deprecation notices to the Rails logger.
|
45
49
|
config.active_support.deprecation = :log
|
46
50
|
|
@@ -56,6 +60,9 @@ Rails.application.configure do
|
|
56
60
|
# Highlight code that triggered database queries in logs.
|
57
61
|
config.active_record.verbose_query_logs = true
|
58
62
|
|
63
|
+
# Highlight code that enqueued background job in logs.
|
64
|
+
config.active_job.verbose_enqueue_logs = true
|
65
|
+
|
59
66
|
# Suppress logger output for asset requests.
|
60
67
|
config.assets.quiet = true
|
61
68
|
|
@@ -63,8 +70,14 @@ Rails.application.configure do
|
|
63
70
|
# config.i18n.raise_on_missing_translations = true
|
64
71
|
|
65
72
|
# Annotate rendered view with file names.
|
66
|
-
|
73
|
+
config.action_view.annotate_rendered_view_with_filenames = true
|
67
74
|
|
68
75
|
# Uncomment if you wish to allow Action Cable access from any origin.
|
69
76
|
# config.action_cable.disable_request_forgery_protection = true
|
77
|
+
|
78
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
79
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
80
|
+
|
81
|
+
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
|
82
|
+
# config.generators.apply_rubocop_autocorrect_after_generate!
|
70
83
|
end
|
@@ -4,7 +4,7 @@ Rails.application.configure do
|
|
4
4
|
# Settings specified here will take precedence over those in config/application.rb.
|
5
5
|
|
6
6
|
# Code is not reloaded between requests.
|
7
|
-
config.
|
7
|
+
config.enable_reloading = false
|
8
8
|
|
9
9
|
# Eager load code on boot. This eager loads most of Rails and
|
10
10
|
# your application in memory, allowing both threaded web servers
|
@@ -13,21 +13,20 @@ Rails.application.configure do
|
|
13
13
|
config.eager_load = true
|
14
14
|
|
15
15
|
# Full error reports are disabled and caching is turned on.
|
16
|
-
config.consider_all_requests_local
|
16
|
+
config.consider_all_requests_local = false
|
17
17
|
config.action_controller.perform_caching = true
|
18
18
|
|
19
|
-
# Ensures that a master key has been made available in
|
20
|
-
#
|
19
|
+
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
|
20
|
+
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
|
21
21
|
# config.require_master_key = true
|
22
22
|
|
23
|
-
# Disable serving static files from
|
24
|
-
#
|
25
|
-
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
23
|
+
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
|
24
|
+
# config.public_file_server.enabled = false
|
26
25
|
|
27
26
|
# Compress CSS using a preprocessor.
|
28
27
|
# config.assets.css_compressor = :sass
|
29
28
|
|
30
|
-
# Do not
|
29
|
+
# Do not fall back to assets pipeline if a precompiled asset is missed.
|
31
30
|
config.assets.compile = false
|
32
31
|
|
33
32
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
@@ -45,23 +44,38 @@ Rails.application.configure do
|
|
45
44
|
# config.action_cable.url = "wss://example.com/cable"
|
46
45
|
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
|
47
46
|
|
47
|
+
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
48
|
+
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
|
49
|
+
# config.assume_ssl = true
|
50
|
+
|
48
51
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
49
|
-
|
52
|
+
config.force_ssl = true
|
53
|
+
|
54
|
+
# Skip http-to-https redirect for the default health check endpoint.
|
55
|
+
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
50
56
|
|
51
|
-
#
|
52
|
-
|
53
|
-
|
57
|
+
# Log to STDOUT by default
|
58
|
+
config.logger = ActiveSupport::Logger.new(STDOUT)
|
59
|
+
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
60
|
+
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
54
61
|
|
55
62
|
# Prepend all log lines with the following tags.
|
56
63
|
config.log_tags = [ :request_id ]
|
57
64
|
|
65
|
+
# "info" includes generic and useful information about system operation, but avoids logging too much
|
66
|
+
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
|
67
|
+
# want to log everything, set the level to "debug".
|
68
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
69
|
+
|
58
70
|
# Use a different cache store in production.
|
59
71
|
# config.cache_store = :mem_cache_store
|
60
72
|
|
61
73
|
# Use a real queuing backend for Active Job (and separate queues per environment).
|
62
|
-
# config.active_job.queue_adapter
|
63
|
-
# config.active_job.queue_name_prefix = "
|
74
|
+
# config.active_job.queue_adapter = :resque
|
75
|
+
# config.active_job.queue_name_prefix = "7.2.0_production"
|
64
76
|
|
77
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
78
|
+
# caching is enabled.
|
65
79
|
config.action_mailer.perform_caching = false
|
66
80
|
|
67
81
|
# Ignore bad email addresses and do not raise email delivery errors.
|
@@ -75,19 +89,14 @@ Rails.application.configure do
|
|
75
89
|
# Don't log any deprecations.
|
76
90
|
config.active_support.report_deprecations = false
|
77
91
|
|
78
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
|
-
config.log_formatter = ::Logger::Formatter.new
|
80
|
-
|
81
|
-
# Use a different logger for distributed setups.
|
82
|
-
# require "syslog/logger"
|
83
|
-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
|
84
|
-
|
85
|
-
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
86
|
-
logger = ActiveSupport::Logger.new(STDOUT)
|
87
|
-
logger.formatter = config.log_formatter
|
88
|
-
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
89
|
-
end
|
90
|
-
|
91
92
|
# Do not dump schema after migrations.
|
92
93
|
config.active_record.dump_schema_after_migration = false
|
94
|
+
|
95
|
+
# Enable DNS rebinding protection and other `Host` header attacks.
|
96
|
+
# config.hosts = [
|
97
|
+
# "example.com", # Allow requests from example.com
|
98
|
+
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
99
|
+
# ]
|
100
|
+
# Skip DNS rebinding protection for the default health check endpoint.
|
101
|
+
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
93
102
|
end
|
data/config/environments/test.rb
CHANGED
@@ -8,27 +8,27 @@ require "active_support/core_ext/integer/time"
|
|
8
8
|
Rails.application.configure do
|
9
9
|
# Settings specified here will take precedence over those in config/application.rb.
|
10
10
|
|
11
|
-
#
|
12
|
-
config.
|
11
|
+
# While tests run files are not watched, reloading is not necessary.
|
12
|
+
config.enable_reloading = false
|
13
13
|
|
14
|
-
# Eager loading loads your
|
15
|
-
# this
|
16
|
-
#
|
14
|
+
# Eager loading loads your entire application. When running a single test locally,
|
15
|
+
# this is usually not necessary, and can slow down your test suite. However, it's
|
16
|
+
# recommended that you enable it in continuous integration systems to ensure eager
|
17
|
+
# loading is working properly before deploying your code.
|
17
18
|
config.eager_load = ENV["CI"].present?
|
18
19
|
|
19
20
|
# Configure public file server for tests with Cache-Control for performance.
|
20
|
-
config.public_file_server.enabled = true
|
21
21
|
config.public_file_server.headers = {
|
22
22
|
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
23
23
|
}
|
24
24
|
|
25
25
|
# Show full error reports and disable caching.
|
26
|
-
config.consider_all_requests_local
|
26
|
+
config.consider_all_requests_local = true
|
27
27
|
config.action_controller.perform_caching = false
|
28
28
|
config.cache_store = :null_store
|
29
29
|
|
30
|
-
#
|
31
|
-
config.action_dispatch.show_exceptions =
|
30
|
+
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
31
|
+
config.action_dispatch.show_exceptions = :rescuable
|
32
32
|
|
33
33
|
# Disable request forgery protection in test environment.
|
34
34
|
config.action_controller.allow_forgery_protection = false
|
@@ -36,6 +36,8 @@ Rails.application.configure do
|
|
36
36
|
# Store uploaded files on the local file system in a temporary directory.
|
37
37
|
config.active_storage.service = :test
|
38
38
|
|
39
|
+
# Disable caching for Action Mailer templates even if Action Controller
|
40
|
+
# caching is enabled.
|
39
41
|
config.action_mailer.perform_caching = false
|
40
42
|
|
41
43
|
# Tell Action Mailer not to deliver emails to the real world.
|
@@ -43,6 +45,10 @@ Rails.application.configure do
|
|
43
45
|
# ActionMailer::Base.deliveries array.
|
44
46
|
config.action_mailer.delivery_method = :test
|
45
47
|
|
48
|
+
# Unlike controllers, the mailer instance doesn't have any context about the
|
49
|
+
# incoming request so you'll need to provide the :host parameter yourself.
|
50
|
+
config.action_mailer.default_url_options = { host: "www.example.com" }
|
51
|
+
|
46
52
|
# Print deprecation notices to the stderr.
|
47
53
|
config.active_support.deprecation = :stderr
|
48
54
|
|
@@ -57,4 +63,7 @@ Rails.application.configure do
|
|
57
63
|
|
58
64
|
# Annotate rendered view with file names.
|
59
65
|
# config.action_view.annotate_rendered_view_with_filenames = true
|
66
|
+
|
67
|
+
# Raise error when a before_action's only/except options reference missing actions.
|
68
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
60
69
|
end
|
data/config/importmap.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Pin npm packages by running ./bin/importmap
|
2
2
|
|
3
|
-
pin "application"
|
4
|
-
pin "@hotwired/turbo-rails", to: "turbo.min.js"
|
5
|
-
pin "@hotwired/stimulus", to: "stimulus.min.js"
|
6
|
-
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
|
3
|
+
pin "application"
|
4
|
+
pin "@hotwired/turbo-rails", to: "turbo.min.js"
|
5
|
+
pin "@hotwired/stimulus", to: "stimulus.min.js"
|
6
|
+
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
|
7
7
|
pin_all_from "app/javascript/controllers", under: "controllers"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# Define an application-wide content security policy
|
4
|
-
#
|
5
|
-
# https://
|
3
|
+
# Define an application-wide content security policy.
|
4
|
+
# See the Securing Rails Applications Guide for more information:
|
5
|
+
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
6
6
|
|
7
7
|
# Rails.application.configure do
|
8
8
|
# config.content_security_policy do |policy|
|
@@ -16,11 +16,10 @@
|
|
16
16
|
# # policy.report_uri "/csp-violation-report-endpoint"
|
17
17
|
# end
|
18
18
|
#
|
19
|
-
# # Generate session nonces for permitted importmap and inline
|
19
|
+
# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
|
20
20
|
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
21
|
-
# config.content_security_policy_nonce_directives = %w(script-src)
|
21
|
+
# config.content_security_policy_nonce_directives = %w(script-src style-src)
|
22
22
|
#
|
23
|
-
# # Report
|
24
|
-
# # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
23
|
+
# # Report violations without enforcing the policy.
|
25
24
|
# # config.content_security_policy_report_only = true
|
26
25
|
# end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# Configure
|
3
|
+
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
|
4
|
+
# Use this to limit dissemination of sensitive information.
|
5
|
+
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
4
6
|
Rails.application.config.filter_parameters += [
|
5
|
-
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
7
|
+
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
6
8
|
]
|
@@ -1,11 +1,13 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
1
3
|
# Define an application-wide HTTP permissions policy. For further
|
2
|
-
# information see https://developers.google.com/web/updates/2018/06/feature-policy
|
3
|
-
|
4
|
-
# Rails.application.config.permissions_policy do |
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
4
|
+
# information see: https://developers.google.com/web/updates/2018/06/feature-policy
|
5
|
+
|
6
|
+
# Rails.application.config.permissions_policy do |policy|
|
7
|
+
# policy.camera :none
|
8
|
+
# policy.gyroscope :none
|
9
|
+
# policy.microphone :none
|
10
|
+
# policy.usb :none
|
11
|
+
# policy.fullscreen :self
|
12
|
+
# policy.payment :self, "https://secure.example.com"
|
11
13
|
# end
|
data/config/puma.rb
CHANGED
@@ -1,43 +1,33 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
|
-
# and maximum; this matches the default thread size of Active Record.
|
6
|
-
#
|
7
|
-
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
8
|
-
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
9
|
-
threads min_threads_count, max_threads_count
|
1
|
+
# This configuration file will be evaluated by Puma. The top-level methods that
|
2
|
+
# are invoked here are part of Puma's configuration DSL. For more information
|
3
|
+
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
|
10
4
|
|
11
|
-
#
|
12
|
-
#
|
5
|
+
# Puma starts a configurable number of processes (workers) and each process
|
6
|
+
# serves each request in a thread from an internal thread pool.
|
13
7
|
#
|
14
|
-
|
15
|
-
|
16
|
-
#
|
8
|
+
# The ideal number of threads per worker depends both on how much time the
|
9
|
+
# application spends waiting for IO operations and on how much you wish to
|
10
|
+
# to prioritize throughput over latency.
|
17
11
|
#
|
18
|
-
|
19
|
-
|
20
|
-
#
|
12
|
+
# As a rule of thumb, increasing the number of threads will increase how much
|
13
|
+
# traffic a given process can handle (throughput), but due to CRuby's
|
14
|
+
# Global VM Lock (GVL) it has diminishing returns and will degrade the
|
15
|
+
# response time (latency) of the application.
|
21
16
|
#
|
22
|
-
|
23
|
-
|
24
|
-
# Specifies the `pidfile` that Puma will use.
|
25
|
-
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
26
|
-
|
27
|
-
# Specifies the number of `workers` to boot in clustered mode.
|
28
|
-
# Workers are forked web server processes. If using threads and workers together
|
29
|
-
# the concurrency of the application would be max `threads` * `workers`.
|
30
|
-
# Workers do not work on JRuby or Windows (both of which do not support
|
31
|
-
# processes).
|
17
|
+
# The default is set to 3 threads as it's deemed a decent compromise between
|
18
|
+
# throughput and latency for the average Rails application.
|
32
19
|
#
|
33
|
-
#
|
20
|
+
# Any libraries that use a connection pool or another resource pool should
|
21
|
+
# be configured to provide at least as many connections as the number of
|
22
|
+
# threads. This includes Active Record's `pool` parameter in `database.yml`.
|
23
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
|
24
|
+
threads threads_count, threads_count
|
34
25
|
|
35
|
-
#
|
36
|
-
|
37
|
-
# before forking the application. This takes advantage of Copy On Write
|
38
|
-
# process behavior so workers use less memory.
|
39
|
-
#
|
40
|
-
# preload_app!
|
26
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
27
|
+
port ENV.fetch("PORT", 3000)
|
41
28
|
|
42
29
|
# Allow puma to be restarted by `bin/rails restart` command.
|
43
30
|
plugin :tmp_restart
|
31
|
+
|
32
|
+
# Only use a pidfile when requested
|
33
|
+
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
|
data/dryer-config.gemspec
CHANGED
@@ -9,20 +9,13 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.summary = "Several pristine Rails config files."
|
10
10
|
s.description = "Outsource several config files to a gem."
|
11
11
|
s.authors = ['Dittmar Krall']
|
12
|
-
s.email = ['dittmar.krall@
|
13
|
-
s.homepage = '
|
12
|
+
s.email = ['dittmar.krall@matiq.com']
|
13
|
+
s.homepage = 'https://github.com/matique/dryer-config'
|
14
14
|
s.license = 'MIT'
|
15
15
|
s.platform = Gem::Platform::RUBY
|
16
16
|
|
17
|
-
s.metadata['source_code_uri'] = 'https://github.com/matique/dryer-config'
|
18
|
-
|
19
17
|
s.files = `git ls-files`.split("\n")
|
20
|
-
# s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
-
# s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
18
|
s.require_paths = ["lib"]
|
23
19
|
|
24
20
|
s.add_development_dependency 'bundler'
|
25
|
-
s.add_development_dependency 'rake'
|
26
|
-
|
27
|
-
s.add_development_dependency 'minitest'
|
28
21
|
end
|
data/lib/dryer-config/version.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
module DryerConfig
|
2
|
-
VERSION = '7.
|
3
|
-
# VERSION = '
|
4
|
-
# VERSION = '
|
5
|
-
# VERSION = '6.
|
6
|
-
# VERSION = '6.0.
|
7
|
-
# VERSION = '
|
2
|
+
VERSION = '7.2.0' # 2024-08-23
|
3
|
+
# VERSION = '7.1.0' # 2023-10-15
|
4
|
+
# VERSION = '7.0.0' # 2021-12-18
|
5
|
+
# VERSION = '6.1.4' # 2021-06-27
|
6
|
+
# VERSION = '6.0.3' # 2020-05-08
|
7
|
+
# VERSION = '6.0.2' # 2020-02-25
|
8
|
+
# VERSION = '6.0.0' # 2019-10-07
|
9
|
+
# VERSION = '5.2.0'
|
8
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dryer-config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dittmar Krall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,37 +24,9 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: minitest
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
27
|
description: Outsource several config files to a gem.
|
56
28
|
email:
|
57
|
-
- dittmar.krall@
|
29
|
+
- dittmar.krall@matiq.com
|
58
30
|
executables: []
|
59
31
|
extensions: []
|
60
32
|
extra_rdoc_files: []
|
@@ -85,11 +57,10 @@ files:
|
|
85
57
|
- lib/dryer-config.rb
|
86
58
|
- lib/dryer-config/engine.rb
|
87
59
|
- lib/dryer-config/version.rb
|
88
|
-
homepage:
|
60
|
+
homepage: https://github.com/matique/dryer-config
|
89
61
|
licenses:
|
90
62
|
- MIT
|
91
|
-
metadata:
|
92
|
-
source_code_uri: https://github.com/matique/dryer-config
|
63
|
+
metadata: {}
|
93
64
|
post_install_message:
|
94
65
|
rdoc_options: []
|
95
66
|
require_paths:
|
@@ -105,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
76
|
- !ruby/object:Gem::Version
|
106
77
|
version: '0'
|
107
78
|
requirements: []
|
108
|
-
rubygems_version: 3.
|
79
|
+
rubygems_version: 3.5.11
|
109
80
|
signing_key:
|
110
81
|
specification_version: 4
|
111
82
|
summary: Several pristine Rails config files.
|