railties 6.0.0 → 7.1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +699 -245
- data/MIT-LICENSE +1 -1
- data/RDOC_MAIN.md +99 -0
- data/README.rdoc +7 -8
- data/lib/minitest/rails_plugin.rb +80 -2
- data/lib/rails/all.rb +0 -1
- data/lib/rails/api/task.rb +37 -5
- data/lib/rails/app_updater.rb +9 -6
- data/lib/rails/application/bootstrap.rb +52 -14
- data/lib/rails/application/configuration.rb +327 -86
- data/lib/rails/application/default_middleware_stack.rb +33 -7
- data/lib/rails/application/dummy_config.rb +19 -0
- data/lib/rails/application/finisher.rb +94 -113
- data/lib/rails/application/routes_reloader.rb +17 -3
- data/lib/rails/application.rb +258 -201
- data/lib/rails/application_controller.rb +3 -4
- data/lib/rails/autoloaders/inflector.rb +21 -0
- data/lib/rails/autoloaders.rb +42 -42
- data/lib/rails/backtrace_cleaner.rb +13 -8
- data/lib/rails/cli.rb +5 -2
- data/lib/rails/code_statistics.rb +6 -4
- data/lib/rails/code_statistics_calculator.rb +16 -7
- data/lib/rails/command/actions.rb +10 -12
- data/lib/rails/command/base.rb +66 -46
- data/lib/rails/command/behavior.rb +3 -3
- data/lib/rails/command/environment_argument.rb +33 -17
- data/lib/rails/command/helpers/editor.rb +17 -12
- data/lib/rails/command.rb +90 -32
- data/lib/rails/commands/about/about_command.rb +14 -0
- data/lib/rails/commands/application/application_command.rb +2 -0
- data/lib/rails/commands/console/console_command.rb +17 -13
- data/lib/rails/commands/credentials/USAGE +54 -39
- data/lib/rails/commands/credentials/credentials_command/diffing.rb +53 -0
- data/lib/rails/commands/credentials/credentials_command.rb +83 -60
- data/lib/rails/commands/db/system/change/change_command.rb +8 -2
- data/lib/rails/commands/dbconsole/dbconsole_command.rb +39 -124
- data/lib/rails/commands/destroy/destroy_command.rb +3 -2
- data/lib/rails/commands/dev/dev_command.rb +1 -6
- data/lib/rails/commands/encrypted/USAGE +15 -20
- data/lib/rails/commands/encrypted/encrypted_command.rb +46 -35
- data/lib/rails/commands/gem_help/USAGE +16 -0
- data/lib/rails/commands/gem_help/gem_help_command.rb +13 -0
- data/lib/rails/commands/generate/generate_command.rb +3 -3
- data/lib/rails/commands/help/USAGE +15 -14
- data/lib/rails/commands/help/help_command.rb +21 -2
- data/lib/rails/commands/initializers/initializers_command.rb +1 -4
- data/lib/rails/commands/middleware/middleware_command.rb +17 -0
- data/lib/rails/commands/new/new_command.rb +2 -0
- data/lib/rails/commands/notes/notes_command.rb +5 -14
- data/lib/rails/commands/plugin/plugin_command.rb +2 -0
- data/lib/rails/commands/rake/rake_command.rb +27 -23
- data/lib/rails/commands/restart/restart_command.rb +14 -0
- data/lib/rails/commands/routes/routes_command.rb +13 -1
- data/lib/rails/commands/runner/USAGE +14 -12
- data/lib/rails/commands/runner/runner_command.rb +34 -21
- data/lib/rails/commands/secret/secret_command.rb +13 -0
- data/lib/rails/commands/secrets/USAGE +44 -43
- data/lib/rails/commands/secrets/secrets_command.rb +20 -38
- data/lib/rails/commands/server/server_command.rb +40 -64
- data/lib/rails/commands/test/USAGE +14 -0
- data/lib/rails/commands/test/test_command.rb +58 -16
- data/lib/rails/commands/unused_routes/unused_routes_command.rb +75 -0
- data/lib/rails/commands/version/version_command.rb +1 -0
- data/lib/rails/configuration.rb +53 -23
- data/lib/rails/console/app.rb +1 -4
- data/lib/rails/console/helpers.rb +2 -2
- data/lib/rails/deprecator.rb +7 -0
- data/lib/rails/engine/configuration.rb +54 -9
- data/lib/rails/engine/updater.rb +1 -1
- data/lib/rails/engine.rb +105 -81
- data/lib/rails/gem_version.rb +5 -5
- data/lib/rails/generators/actions/create_migration.rb +9 -5
- data/lib/rails/generators/actions.rb +275 -97
- data/lib/rails/generators/active_model.rb +28 -14
- data/lib/rails/generators/app_base.rb +487 -165
- data/lib/rails/generators/app_name.rb +3 -14
- data/lib/rails/generators/base.rb +42 -31
- data/lib/rails/generators/database.rb +41 -4
- data/lib/rails/generators/erb/mailer/mailer_generator.rb +0 -1
- data/lib/rails/generators/erb/mailer/templates/layout.html.erb.tt +1 -1
- data/lib/rails/generators/erb/scaffold/scaffold_generator.rb +2 -1
- data/lib/rails/generators/erb/scaffold/templates/_form.html.erb.tt +11 -11
- data/lib/rails/generators/erb/scaffold/templates/edit.html.erb.tt +8 -4
- data/lib/rails/generators/erb/scaffold/templates/index.html.erb.tt +11 -28
- data/lib/rails/generators/erb/scaffold/templates/new.html.erb.tt +7 -3
- data/lib/rails/generators/erb/scaffold/templates/partial.html.erb.tt +17 -0
- data/lib/rails/generators/erb/scaffold/templates/show.html.erb.tt +8 -17
- data/lib/rails/generators/erb.rb +1 -2
- data/lib/rails/generators/generated_attribute.rb +60 -19
- data/lib/rails/generators/migration.rb +4 -8
- data/lib/rails/generators/model_helpers.rb +29 -4
- data/lib/rails/generators/named_base.rb +15 -15
- data/lib/rails/generators/rails/app/USAGE +23 -6
- data/lib/rails/generators/rails/app/app_generator.rb +151 -80
- data/lib/rails/generators/rails/app/templates/Dockerfile.tt +103 -0
- data/lib/rails/generators/rails/app/templates/Gemfile.tt +44 -54
- data/lib/rails/generators/rails/app/templates/Rakefile.tt +1 -1
- data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css.tt +2 -2
- data/lib/rails/generators/rails/app/templates/app/mailers/application_mailer.rb.tt +2 -2
- data/lib/rails/generators/rails/app/templates/app/models/application_record.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +4 -9
- data/lib/rails/generators/rails/app/templates/app/views/layouts/mailer.html.erb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/bin/rails.tt +3 -3
- data/lib/rails/generators/rails/app/templates/bin/rake.tt +2 -2
- data/lib/rails/generators/rails/app/templates/bin/setup.tt +19 -15
- data/lib/rails/generators/rails/app/templates/config/application.rb.tt +18 -23
- data/lib/rails/generators/rails/app/templates/config/boot.rb.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml.tt +5 -6
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml.tt +12 -11
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml.tt +17 -16
- data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml.tt +5 -5
- data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml.tt +12 -11
- data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml.tt +12 -11
- data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml.tt +17 -18
- data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml.tt +4 -4
- data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml.tt +14 -13
- data/lib/rails/generators/rails/app/templates/config/databases/trilogy.yml.tt +59 -0
- data/lib/rails/generators/rails/app/templates/config/environment.rb.tt +1 -1
- data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +32 -14
- data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +42 -55
- data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +27 -15
- data/lib/rails/generators/rails/app/templates/config/initializers/assets.rb.tt +3 -5
- data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt +21 -28
- data/lib/rails/generators/rails/app/templates/config/initializers/cors.rb.tt +3 -3
- data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt +6 -2
- data/lib/rails/generators/rails/app/templates/config/initializers/inflections.rb.tt +4 -4
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt +284 -0
- data/lib/rails/generators/rails/app/templates/config/initializers/permissions_policy.rb.tt +13 -0
- data/lib/rails/generators/rails/app/templates/config/locales/en.yml +13 -15
- data/lib/rails/generators/rails/app/templates/config/puma.rb.tt +17 -20
- data/lib/rails/generators/rails/app/templates/config/routes.rb.tt +8 -1
- data/lib/rails/generators/rails/app/templates/config/storage.yml.tt +5 -5
- data/lib/rails/generators/rails/app/templates/config.ru.tt +2 -1
- data/lib/rails/generators/rails/app/templates/db/seeds.rb.tt +7 -5
- data/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +10 -0
- data/lib/rails/generators/rails/app/templates/dockerignore.tt +43 -0
- data/lib/rails/generators/rails/app/templates/gitattributes.tt +9 -0
- data/lib/rails/generators/rails/app/templates/gitignore.tt +12 -9
- data/lib/rails/generators/rails/app/templates/node-version.tt +1 -0
- data/lib/rails/generators/rails/app/templates/test/channels/application_cable/connection_test.rb.tt +10 -8
- data/lib/rails/generators/rails/app/templates/test/test_helper.rb.tt +13 -11
- data/lib/rails/generators/rails/application_record/application_record_generator.rb +4 -0
- data/lib/rails/generators/rails/benchmark/USAGE +19 -0
- data/lib/rails/generators/rails/benchmark/benchmark_generator.rb +30 -0
- data/lib/rails/generators/rails/benchmark/templates/benchmark.rb.tt +15 -0
- data/lib/rails/generators/rails/controller/USAGE +13 -5
- data/lib/rails/generators/rails/controller/controller_generator.rb +7 -42
- data/lib/rails/generators/rails/controller/templates/controller.rb.tt +1 -5
- data/lib/rails/generators/rails/credentials/credentials_generator.rb +30 -25
- data/lib/rails/generators/rails/credentials/templates/credentials.yml.tt +8 -0
- data/lib/rails/generators/rails/db/system/change/change_generator.rb +31 -1
- data/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +6 -2
- data/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +1 -2
- data/lib/rails/generators/rails/generator/USAGE +2 -2
- data/lib/rails/generators/rails/generator/generator_generator.rb +0 -1
- data/lib/rails/generators/rails/generator/templates/%file_name%_generator.rb.tt +1 -1
- data/lib/rails/generators/rails/generator/templates/USAGE.tt +1 -1
- data/lib/rails/generators/rails/helper/USAGE +2 -3
- data/lib/rails/generators/rails/integration_test/USAGE +2 -2
- data/lib/rails/generators/rails/migration/USAGE +22 -12
- data/lib/rails/generators/rails/model/model_generator.rb +4 -0
- data/lib/rails/generators/rails/plugin/USAGE +17 -6
- data/lib/rails/generators/rails/plugin/plugin_generator.rb +86 -46
- data/lib/rails/generators/rails/plugin/templates/%name%.gemspec.tt +15 -20
- data/lib/rails/generators/rails/plugin/templates/Gemfile.tt +10 -39
- data/lib/rails/generators/rails/plugin/templates/MIT-LICENSE.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/README.md.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/Rakefile.tt +4 -18
- data/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt +0 -1
- data/lib/rails/generators/rails/plugin/templates/app/mailers/%namespaced_name%/application_mailer.rb.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +0 -3
- data/lib/rails/generators/rails/plugin/templates/bin/rails.tt +7 -22
- data/lib/rails/generators/rails/plugin/templates/gitignore.tt +10 -14
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/engine.rb.tt +2 -2
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%/version.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/lib/%namespaced_name%.rb.tt +1 -0
- data/lib/rails/generators/rails/plugin/templates/rails/boot.rb.tt +3 -3
- data/lib/rails/generators/rails/plugin/templates/test/%namespaced_name%_test.rb.tt +4 -4
- data/lib/rails/generators/rails/plugin/templates/test/integration/navigation_test.rb.tt +1 -1
- data/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt +6 -14
- data/lib/rails/generators/rails/resource/USAGE +4 -4
- data/lib/rails/generators/rails/resource/resource_generator.rb +6 -0
- data/lib/rails/generators/rails/resource_route/resource_route_generator.rb +2 -27
- data/lib/rails/generators/rails/scaffold/USAGE +5 -5
- data/lib/rails/generators/rails/scaffold/scaffold_generator.rb +2 -20
- data/lib/rails/generators/rails/scaffold_controller/USAGE +2 -2
- data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +7 -2
- data/lib/rails/generators/rails/scaffold_controller/templates/api_controller.rb.tt +2 -6
- data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt +7 -11
- data/lib/rails/generators/rails/system_test/USAGE +2 -2
- data/lib/rails/generators/rails/task/USAGE +3 -3
- data/lib/rails/generators/resource_helpers.rb +2 -2
- data/lib/rails/generators/test_case.rb +3 -3
- data/lib/rails/generators/test_unit/controller/controller_generator.rb +2 -0
- data/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +3 -3
- data/lib/rails/generators/test_unit/generator/generator_generator.rb +0 -1
- data/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +3 -3
- data/lib/rails/generators/test_unit/integration/integration_generator.rb +0 -1
- data/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/job/templates/unit_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/model/templates/fixtures.yml.tt +3 -3
- data/lib/rails/generators/test_unit/model/templates/unit_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/plugin/templates/%file_name%_test.rb.tt +1 -1
- data/lib/rails/generators/test_unit/plugin/templates/test_helper.rb +2 -2
- data/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +4 -5
- data/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt +6 -6
- data/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +8 -8
- data/lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt +9 -11
- data/lib/rails/generators/testing/assertions.rb +2 -2
- data/lib/rails/generators/testing/{behaviour.rb → behavior.rb} +8 -7
- data/lib/rails/generators.rb +43 -45
- data/lib/rails/health_controller.rb +55 -0
- data/lib/rails/info.rb +4 -4
- data/lib/rails/info_controller.rb +30 -13
- data/lib/rails/initializable.rb +1 -1
- data/lib/rails/mailers_controller.rb +18 -9
- data/lib/rails/paths.rb +28 -19
- data/lib/rails/rack/logger.rb +17 -17
- data/lib/rails/rackup/server.rb +15 -0
- data/lib/rails/railtie/configurable.rb +0 -1
- data/lib/rails/railtie/configuration.rb +15 -3
- data/lib/rails/railtie.rb +80 -37
- data/lib/rails/ruby_version_check.rb +5 -3
- data/lib/rails/secrets.rb +14 -9
- data/lib/rails/source_annotation_extractor.rb +69 -34
- data/lib/rails/tasks/engine.rake +8 -11
- data/lib/rails/tasks/framework.rake +4 -6
- data/lib/rails/tasks/log.rake +1 -1
- data/lib/rails/tasks/misc.rake +4 -15
- data/lib/rails/tasks/statistics.rake +9 -6
- data/lib/rails/tasks/tmp.rake +13 -6
- data/lib/rails/tasks/yarn.rake +17 -6
- data/lib/rails/tasks/zeitwerk.rake +16 -41
- data/lib/rails/tasks.rb +0 -6
- data/lib/rails/templates/layouts/application.html.erb +15 -0
- data/lib/rails/templates/rails/mailers/email.html.erb +46 -11
- data/lib/rails/templates/rails/mailers/index.html.erb +14 -7
- data/lib/rails/templates/rails/mailers/mailer.html.erb +11 -5
- data/lib/rails/templates/rails/welcome/index.html.erb +65 -48
- data/lib/rails/test_help.rb +13 -14
- data/lib/rails/test_unit/line_filtering.rb +1 -1
- data/lib/rails/test_unit/railtie.rb +0 -4
- data/lib/rails/test_unit/reporter.rb +8 -3
- data/lib/rails/test_unit/runner.rb +61 -19
- data/lib/rails/test_unit/test_parser.rb +88 -0
- data/lib/rails/test_unit/testing.rake +17 -36
- data/lib/rails/testing/maintain_test_schema.rb +16 -0
- data/lib/rails/version.rb +1 -1
- data/lib/rails/welcome_controller.rb +1 -0
- data/lib/rails/zeitwerk_checker.rb +15 -0
- data/lib/rails.rb +31 -23
- metadata +89 -58
- data/RDOC_MAIN.rdoc +0 -98
- data/lib/rails/application/dummy_erb_compiler.rb +0 -18
- data/lib/rails/command/spellchecker.rb +0 -58
- data/lib/rails/generators/css/assets/assets_generator.rb +0 -15
- data/lib/rails/generators/css/assets/templates/stylesheet.css +0 -4
- data/lib/rails/generators/css/scaffold/scaffold_generator.rb +0 -18
- data/lib/rails/generators/rails/app/templates/app/javascript/channels/consumer.js +0 -6
- data/lib/rails/generators/rails/app/templates/app/javascript/channels/index.js +0 -5
- data/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt +0 -23
- data/lib/rails/generators/rails/app/templates/bin/yarn.tt +0 -10
- data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml.tt +0 -50
- data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml.tt +0 -86
- data/lib/rails/generators/rails/app/templates/config/initializers/application_controller_renderer.rb.tt +0 -8
- data/lib/rails/generators/rails/app/templates/config/initializers/backtrace_silencers.rb.tt +0 -7
- data/lib/rails/generators/rails/app/templates/config/initializers/cookies_serializer.rb.tt +0 -5
- data/lib/rails/generators/rails/app/templates/config/initializers/mime_types.rb.tt +0 -4
- data/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_6_0.rb.tt +0 -45
- data/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt +0 -16
- data/lib/rails/generators/rails/app/templates/config/spring.rb.tt +0 -6
- data/lib/rails/generators/rails/app/templates/package.json.tt +0 -11
- data/lib/rails/generators/rails/assets/USAGE +0 -17
- data/lib/rails/generators/rails/assets/assets_generator.rb +0 -26
- data/lib/rails/generators/rails/assets/templates/stylesheet.css +0 -4
- data/lib/rails/generators/rails/model/USAGE +0 -114
- data/lib/rails/generators/rails/plugin/templates/rails/application.rb.tt +0 -23
- data/lib/rails/generators/rails/scaffold/templates/scaffold.css +0 -80
- data/lib/rails/tasks/annotations.rake +0 -22
- data/lib/rails/tasks/dev.rake +0 -11
- data/lib/rails/tasks/initializers.rake +0 -9
- data/lib/rails/tasks/middleware.rake +0 -9
- data/lib/rails/tasks/restart.rake +0 -9
- data/lib/rails/tasks/routes.rake +0 -9
@@ -0,0 +1,59 @@
|
|
1
|
+
# MySQL. Versions 5.5.8 and up are supported.
|
2
|
+
#
|
3
|
+
# Install the MySQL driver
|
4
|
+
# gem install trilogy
|
5
|
+
#
|
6
|
+
# Ensure the MySQL gem is defined in your Gemfile
|
7
|
+
# gem "trilogy"
|
8
|
+
#
|
9
|
+
# And be sure to use new-style password hashing:
|
10
|
+
# https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html
|
11
|
+
#
|
12
|
+
default: &default
|
13
|
+
adapter: trilogy
|
14
|
+
encoding: utf8mb4
|
15
|
+
pool: <%%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
16
|
+
username: root
|
17
|
+
password:
|
18
|
+
<% if mysql_socket -%>
|
19
|
+
socket: <%= mysql_socket %>
|
20
|
+
<% else -%>
|
21
|
+
host: localhost
|
22
|
+
<% end -%>
|
23
|
+
|
24
|
+
development:
|
25
|
+
<<: *default
|
26
|
+
database: <%= app_name %>_development
|
27
|
+
|
28
|
+
# Warning: The database defined as "test" will be erased and
|
29
|
+
# re-generated from your development database when you run "rake".
|
30
|
+
# Do not set this db to the same as development or production.
|
31
|
+
test:
|
32
|
+
<<: *default
|
33
|
+
database: <%= app_name %>_test
|
34
|
+
|
35
|
+
# As with config/credentials.yml, you never want to store sensitive information,
|
36
|
+
# like your database password, in your source code. If your source code is
|
37
|
+
# ever seen by anyone, they now have access to your database.
|
38
|
+
#
|
39
|
+
# Instead, provide the password or a full connection URL as an environment
|
40
|
+
# variable when you boot the app. For example:
|
41
|
+
#
|
42
|
+
# DATABASE_URL="trilogy://myuser:mypass@localhost/somedatabase"
|
43
|
+
#
|
44
|
+
# If the connection URL is provided in the special DATABASE_URL environment
|
45
|
+
# variable, Rails will automatically merge its configuration values on top of
|
46
|
+
# the values provided in this file. Alternatively, you can specify a connection
|
47
|
+
# URL environment variable explicitly:
|
48
|
+
#
|
49
|
+
# production:
|
50
|
+
# url: <%%= ENV["MY_APP_DATABASE_URL"] %>
|
51
|
+
#
|
52
|
+
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
|
53
|
+
# for a full overview on how database connection configuration can be specified.
|
54
|
+
#
|
55
|
+
production:
|
56
|
+
<<: *default
|
57
|
+
database: <%= app_name %>_production
|
58
|
+
username: <%= app_name %>
|
59
|
+
password: <%%= ENV["<%= app_name.upcase %>_DATABASE_PASSWORD"] %>
|
@@ -1,10 +1,12 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
1
3
|
Rails.application.configure do
|
2
4
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
5
|
|
4
|
-
# In the development environment your application's code is reloaded
|
5
|
-
#
|
6
|
+
# In the development environment your application's code is reloaded any time
|
7
|
+
# it changes. This slows down response time but is perfect for development
|
6
8
|
# since you don't have to restart the web server when you make code changes.
|
7
|
-
config.
|
9
|
+
config.enable_reloading = true
|
8
10
|
|
9
11
|
# Do not eager load code on boot.
|
10
12
|
config.eager_load = false
|
@@ -12,9 +14,12 @@ Rails.application.configure do
|
|
12
14
|
# Show full error reports.
|
13
15
|
config.consider_all_requests_local = true
|
14
16
|
|
17
|
+
# Enable server timing
|
18
|
+
config.server_timing = true
|
19
|
+
|
15
20
|
# Enable/disable caching. By default caching is disabled.
|
16
21
|
# Run rails dev:cache to toggle caching.
|
17
|
-
if Rails.root.join(
|
22
|
+
if Rails.root.join("tmp/caching-dev.txt").exist?
|
18
23
|
<%- unless options.api? -%>
|
19
24
|
config.action_controller.perform_caching = true
|
20
25
|
config.action_controller.enable_fragment_cache_logging = true
|
@@ -22,7 +27,7 @@ Rails.application.configure do
|
|
22
27
|
<%- end -%>
|
23
28
|
config.cache_store = :memory_store
|
24
29
|
config.public_file_server.headers = {
|
25
|
-
|
30
|
+
"Cache-Control" => "public, max-age=#{2.days.to_i}"
|
26
31
|
}
|
27
32
|
else
|
28
33
|
config.action_controller.perform_caching = false
|
@@ -45,6 +50,12 @@ Rails.application.configure do
|
|
45
50
|
# Print deprecation notices to the Rails logger.
|
46
51
|
config.active_support.deprecation = :log
|
47
52
|
|
53
|
+
# Raise exceptions for disallowed deprecations.
|
54
|
+
config.active_support.disallowed_deprecation = :raise
|
55
|
+
|
56
|
+
# Tell Active Support which deprecation messages to disallow.
|
57
|
+
config.active_support.disallowed_deprecation_warnings = []
|
58
|
+
|
48
59
|
<%- unless options.skip_active_record? -%>
|
49
60
|
# Raise an error on page load if there are pending migrations.
|
50
61
|
config.active_record.migration_error = :page_load
|
@@ -53,20 +64,27 @@ Rails.application.configure do
|
|
53
64
|
config.active_record.verbose_query_logs = true
|
54
65
|
|
55
66
|
<%- end -%>
|
56
|
-
<%- unless options
|
57
|
-
#
|
58
|
-
|
59
|
-
# number of complex assets.
|
60
|
-
config.assets.debug = true
|
67
|
+
<%- unless options[:skip_active_job] -%>
|
68
|
+
# Highlight code that enqueued background job in logs.
|
69
|
+
config.active_job.verbose_enqueue_logs = true
|
61
70
|
|
71
|
+
<%- end -%>
|
72
|
+
<%- unless skip_sprockets? -%>
|
62
73
|
# Suppress logger output for asset requests.
|
63
74
|
config.assets.quiet = true
|
64
75
|
<%- end -%>
|
65
76
|
|
66
77
|
# Raises error for missing translations.
|
67
|
-
# config.
|
78
|
+
# config.i18n.raise_on_missing_translations = true
|
79
|
+
|
80
|
+
# Annotate rendered view with file names.
|
81
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
68
82
|
|
69
|
-
|
70
|
-
#
|
71
|
-
|
83
|
+
<%- unless skip_action_cable? -%>
|
84
|
+
# Uncomment if you wish to allow Action Cable access from any origin.
|
85
|
+
# config.action_cable.disable_request_forgery_protection = true
|
86
|
+
|
87
|
+
<%- end -%>
|
88
|
+
# Raise error when a before_action's only/except options reference missing actions
|
89
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
72
90
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
1
3
|
Rails.application.configure do
|
2
4
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
5
|
|
4
6
|
# Code is not reloaded between requests.
|
5
|
-
config.
|
7
|
+
config.enable_reloading = false
|
6
8
|
|
7
9
|
# Eager load code on boot. This eager loads most of Rails and
|
8
10
|
# your application in memory, allowing both threaded web servers
|
@@ -11,63 +13,74 @@ Rails.application.configure do
|
|
11
13
|
config.eager_load = true
|
12
14
|
|
13
15
|
# Full error reports are disabled and caching is turned on.
|
14
|
-
config.consider_all_requests_local
|
16
|
+
config.consider_all_requests_local = false
|
15
17
|
<%- unless options.api? -%>
|
16
18
|
config.action_controller.perform_caching = true
|
17
19
|
<%- end -%>
|
18
20
|
|
19
|
-
# Ensures that a master key has been made available in
|
20
|
-
#
|
21
|
+
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
|
22
|
+
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
|
21
23
|
# config.require_master_key = true
|
22
24
|
|
23
|
-
# Disable serving static files from
|
24
|
-
#
|
25
|
-
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
25
|
+
# Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
|
26
|
+
# config.public_file_server.enabled = false
|
26
27
|
|
27
|
-
<%- unless
|
28
|
+
<%- unless skip_sprockets? -%>
|
28
29
|
# Compress CSS using a preprocessor.
|
29
30
|
# config.assets.css_compressor = :sass
|
30
31
|
|
31
|
-
# Do not
|
32
|
+
# Do not fall back to assets pipeline if a precompiled asset is missed.
|
32
33
|
config.assets.compile = false
|
33
34
|
|
34
35
|
<%- end -%>
|
35
36
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
36
|
-
# config.
|
37
|
+
# config.asset_host = "http://assets.example.com"
|
37
38
|
|
38
39
|
# Specifies the header that your server uses for sending files.
|
39
|
-
# config.action_dispatch.x_sendfile_header =
|
40
|
-
# config.action_dispatch.x_sendfile_header =
|
40
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
|
41
|
+
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
41
42
|
|
42
43
|
<%- unless skip_active_storage? -%>
|
43
44
|
# Store uploaded files on the local file system (see config/storage.yml for options).
|
44
45
|
config.active_storage.service = :local
|
45
46
|
|
46
47
|
<%- end -%>
|
47
|
-
<%- unless
|
48
|
+
<%- unless skip_action_cable? -%>
|
48
49
|
# Mount Action Cable outside main process or domain.
|
49
50
|
# config.action_cable.mount_path = nil
|
50
|
-
# config.action_cable.url =
|
51
|
-
# config.action_cable.allowed_request_origins = [
|
51
|
+
# config.action_cable.url = "wss://example.com/cable"
|
52
|
+
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
|
52
53
|
|
53
54
|
<%- end -%>
|
55
|
+
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
56
|
+
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
|
57
|
+
# config.assume_ssl = true
|
58
|
+
|
54
59
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
55
|
-
|
60
|
+
config.force_ssl = true
|
56
61
|
|
57
|
-
#
|
58
|
-
|
59
|
-
|
62
|
+
# Log to STDOUT by default
|
63
|
+
config.logger = ActiveSupport::Logger.new(STDOUT)
|
64
|
+
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
65
|
+
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
60
66
|
|
61
67
|
# Prepend all log lines with the following tags.
|
62
68
|
config.log_tags = [ :request_id ]
|
63
69
|
|
70
|
+
# "info" includes generic and useful information about system operation, but avoids logging too much
|
71
|
+
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
|
72
|
+
# want to log everything, set the level to "debug".
|
73
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
74
|
+
|
64
75
|
# Use a different cache store in production.
|
65
76
|
# config.cache_store = :mem_cache_store
|
66
77
|
|
78
|
+
<%- unless options[:skip_active_job] -%>
|
67
79
|
# Use a real queuing backend for Active Job (and separate queues per environment).
|
68
|
-
# config.active_job.queue_adapter
|
80
|
+
# config.active_job.queue_adapter = :resque
|
69
81
|
# config.active_job.queue_name_prefix = "<%= app_name %>_production"
|
70
82
|
|
83
|
+
<%- end -%>
|
71
84
|
<%- unless options.skip_action_mailer? -%>
|
72
85
|
config.action_mailer.perform_caching = false
|
73
86
|
|
@@ -80,45 +93,19 @@ Rails.application.configure do
|
|
80
93
|
# the I18n.default_locale when a translation cannot be found).
|
81
94
|
config.i18n.fallbacks = true
|
82
95
|
|
83
|
-
#
|
84
|
-
config.active_support.
|
85
|
-
|
86
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
87
|
-
config.log_formatter = ::Logger::Formatter.new
|
88
|
-
|
89
|
-
# Use a different logger for distributed setups.
|
90
|
-
# require 'syslog/logger'
|
91
|
-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
92
|
-
|
93
|
-
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
94
|
-
logger = ActiveSupport::Logger.new(STDOUT)
|
95
|
-
logger.formatter = config.log_formatter
|
96
|
-
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
97
|
-
end
|
96
|
+
# Don't log any deprecations.
|
97
|
+
config.active_support.report_deprecations = false
|
98
98
|
<%- unless options.skip_active_record? -%>
|
99
99
|
|
100
100
|
# Do not dump schema after migrations.
|
101
101
|
config.active_record.dump_schema_after_migration = false
|
102
102
|
<%- end -%>
|
103
103
|
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
# The `database_resolver_context` class is used by the middleware to set
|
113
|
-
# timestamps for the last write to the primary. The resolver uses the context
|
114
|
-
# class timestamps to determine how long to wait before reading from the
|
115
|
-
# replica.
|
116
|
-
#
|
117
|
-
# By default Rails will store a last write timestamp in the session. The
|
118
|
-
# DatabaseSelector middleware is designed as such you can define your own
|
119
|
-
# strategy for connection switching and pass that into the middleware through
|
120
|
-
# these configuration options.
|
121
|
-
# config.active_record.database_selector = { delay: 2.seconds }
|
122
|
-
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
|
123
|
-
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
104
|
+
# Enable DNS rebinding protection and other `Host` header attacks.
|
105
|
+
# config.hosts = [
|
106
|
+
# "example.com", # Allow requests from example.com
|
107
|
+
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
108
|
+
# ]
|
109
|
+
# Skip DNS rebinding protection for the default health check endpoint.
|
110
|
+
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
124
111
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
1
3
|
# The test environment is used exclusively to run your application's
|
2
4
|
# test suite. You never need to work with it otherwise. Remember that
|
3
5
|
# your test database is "scratch space" for the test suite and is wiped
|
@@ -5,31 +7,29 @@
|
|
5
7
|
|
6
8
|
Rails.application.configure do
|
7
9
|
# Settings specified here will take precedence over those in config/application.rb.
|
8
|
-
<%# Spring executes the reloaders when files change. %>
|
9
|
-
<%- if spring_install? -%>
|
10
|
-
config.cache_classes = false
|
11
|
-
<%- else -%>
|
12
|
-
config.cache_classes = true
|
13
|
-
<%- end -%>
|
14
10
|
|
15
|
-
#
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
# While tests run files are not watched, reloading is not necessary.
|
12
|
+
config.enable_reloading = false
|
13
|
+
|
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.
|
18
|
+
config.eager_load = ENV["CI"].present?
|
19
19
|
|
20
20
|
# Configure public file server for tests with Cache-Control for performance.
|
21
21
|
config.public_file_server.enabled = true
|
22
22
|
config.public_file_server.headers = {
|
23
|
-
|
23
|
+
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
24
24
|
}
|
25
25
|
|
26
26
|
# Show full error reports and disable caching.
|
27
|
-
config.consider_all_requests_local
|
27
|
+
config.consider_all_requests_local = true
|
28
28
|
config.action_controller.perform_caching = false
|
29
29
|
config.cache_store = :null_store
|
30
30
|
|
31
|
-
#
|
32
|
-
config.action_dispatch.show_exceptions =
|
31
|
+
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
32
|
+
config.action_dispatch.show_exceptions = :rescuable
|
33
33
|
|
34
34
|
# Disable request forgery protection in test environment.
|
35
35
|
config.action_controller.allow_forgery_protection = false
|
@@ -51,6 +51,18 @@ Rails.application.configure do
|
|
51
51
|
# Print deprecation notices to the stderr.
|
52
52
|
config.active_support.deprecation = :stderr
|
53
53
|
|
54
|
+
# Raise exceptions for disallowed deprecations.
|
55
|
+
config.active_support.disallowed_deprecation = :raise
|
56
|
+
|
57
|
+
# Tell Active Support which deprecation messages to disallow.
|
58
|
+
config.active_support.disallowed_deprecation_warnings = []
|
59
|
+
|
54
60
|
# Raises error for missing translations.
|
55
|
-
# config.
|
61
|
+
# config.i18n.raise_on_missing_translations = true
|
62
|
+
|
63
|
+
# Annotate rendered view with file names.
|
64
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
65
|
+
|
66
|
+
# Raise error when a before_action's only/except options reference missing actions
|
67
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
56
68
|
end
|
@@ -1,16 +1,14 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
# Version of your assets, change this if you want to expire all your assets.
|
4
|
-
Rails.application.config.assets.version =
|
4
|
+
Rails.application.config.assets.version = "1.0"
|
5
5
|
|
6
6
|
# Add additional assets to the asset load path.
|
7
7
|
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
-
|
9
|
-
# Add Yarn node_modules folder to the asset load path.
|
10
|
-
Rails.application.config.assets.paths << Rails.root.join('node_modules')
|
11
|
-
<%- end -%>
|
8
|
+
<% if options[:asset_pipeline] == "sprockets" -%>
|
12
9
|
|
13
10
|
# Precompile additional assets.
|
14
11
|
# application.js, application.css, and all non-JS/CSS in the app/assets
|
15
12
|
# folder are already added.
|
16
13
|
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
14
|
+
<% end -%>
|
data/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.tt
CHANGED
@@ -1,32 +1,25 @@
|
|
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
|
-
# Rails.application.
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
|
15
|
-
#
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
# #
|
20
|
-
#
|
7
|
+
# Rails.application.configure do
|
8
|
+
# config.content_security_policy do |policy|
|
9
|
+
# policy.default_src :self, :https
|
10
|
+
# policy.font_src :self, :https, :data
|
11
|
+
# policy.img_src :self, :https, :data
|
12
|
+
# policy.object_src :none
|
13
|
+
# policy.script_src :self, :https
|
14
|
+
# policy.style_src :self, :https
|
15
|
+
# # Specify URI for violation reports
|
16
|
+
# # policy.report_uri "/csp-violation-report-endpoint"
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
|
20
|
+
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
21
|
+
# config.content_security_policy_nonce_directives = %w(script-src style-src)
|
22
|
+
#
|
23
|
+
# # Report violations without enforcing the policy.
|
24
|
+
# # config.content_security_policy_report_only = true
|
21
25
|
# end
|
22
|
-
|
23
|
-
# If you are using UJS then enable automatic nonce generation
|
24
|
-
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
25
|
-
|
26
|
-
# Set the nonce only to specific directives
|
27
|
-
# Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
|
28
|
-
|
29
|
-
# Report CSP violations to a specified URI
|
30
|
-
# For further information see the following documentation:
|
31
|
-
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
32
|
-
# Rails.application.config.content_security_policy_report_only = true
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
# Avoid CORS issues when API is called from the frontend app.
|
4
|
-
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin
|
4
|
+
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin Ajax requests.
|
5
5
|
|
6
6
|
# Read more: https://github.com/cyu/rack-cors
|
7
7
|
|
8
8
|
# Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
9
9
|
# allow do
|
10
|
-
# origins
|
10
|
+
# origins "example.com"
|
11
11
|
#
|
12
|
-
# resource
|
12
|
+
# resource "*",
|
13
13
|
# headers: :any,
|
14
14
|
# methods: [:get, :post, :put, :patch, :delete, :options, :head]
|
15
15
|
# end
|
data/lib/rails/generators/rails/app/templates/config/initializers/filter_parameter_logging.rb.tt
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# Configure
|
4
|
-
|
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.
|
6
|
+
Rails.application.config.filter_parameters += [
|
7
|
+
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
8
|
+
]
|
@@ -4,13 +4,13 @@
|
|
4
4
|
# are locale specific, and you may define rules for as many different
|
5
5
|
# locales as you wish. All of these examples are active by default:
|
6
6
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
-
# inflect.plural /^(ox)$/i,
|
8
|
-
# inflect.singular /^(ox)en/i,
|
9
|
-
# inflect.irregular
|
7
|
+
# inflect.plural /^(ox)$/i, "\\1en"
|
8
|
+
# inflect.singular /^(ox)en/i, "\\1"
|
9
|
+
# inflect.irregular "person", "people"
|
10
10
|
# inflect.uncountable %w( fish sheep )
|
11
11
|
# end
|
12
12
|
|
13
13
|
# These inflection rules are supported but not enabled by default:
|
14
14
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
-
# inflect.acronym
|
15
|
+
# inflect.acronym "RESTful"
|
16
16
|
# end
|