Description:
rails 6
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r819:60250a6ea113 - - 21 files changed: 301 inserted, 112 deleted
@@ -0,0 +1,14 | |||
|
1 | + #!/usr/bin/env ruby | |
|
2 | + if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) | |
|
3 | + gem "bundler" | |
|
4 | + require "bundler" | |
|
5 | + | |
|
6 | + # Load Spring without loading other gems in the Gemfile, for speed. | |
|
7 | + Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring| | |
|
8 | + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path | |
|
9 | + gem "spring", spring.version | |
|
10 | + require "spring/binstub" | |
|
11 | + rescue Gem::LoadError | |
|
12 | + # Ignore when Spring is not installed. | |
|
13 | + end | |
|
14 | + end |
@@ -0,0 +1,67 | |||
|
1 | + # Be sure to restart your server when you modify this file. | |
|
2 | + # | |
|
3 | + # This file contains migration options to ease your Rails 6.1 upgrade. | |
|
4 | + # | |
|
5 | + # Once upgraded flip defaults one by one to migrate to the new default. | |
|
6 | + # | |
|
7 | + # Read the Guide for Upgrading Ruby on Rails for more info on each option. | |
|
8 | + | |
|
9 | + # Support for inversing belongs_to -> has_many Active Record associations. | |
|
10 | + # Rails.application.config.active_record.has_many_inversing = true | |
|
11 | + | |
|
12 | + # Track Active Storage variants in the database. | |
|
13 | + # Rails.application.config.active_storage.track_variants = true | |
|
14 | + | |
|
15 | + # Apply random variation to the delay when retrying failed jobs. | |
|
16 | + # Rails.application.config.active_job.retry_jitter = 0.15 | |
|
17 | + | |
|
18 | + # Stop executing `after_enqueue`/`after_perform` callbacks if | |
|
19 | + # `before_enqueue`/`before_perform` respectively halts with `throw :abort`. | |
|
20 | + # Rails.application.config.active_job.skip_after_callbacks_if_terminated = true | |
|
21 | + | |
|
22 | + # Specify cookies SameSite protection level: either :none, :lax, or :strict. | |
|
23 | + # | |
|
24 | + # This change is not backwards compatible with earlier Rails versions. | |
|
25 | + # It's best enabled when your entire app is migrated and stable on 6.1. | |
|
26 | + # Rails.application.config.action_dispatch.cookies_same_site_protection = :lax | |
|
27 | + | |
|
28 | + # Generate CSRF tokens that are encoded in URL-safe Base64. | |
|
29 | + # | |
|
30 | + # This change is not backwards compatible with earlier Rails versions. | |
|
31 | + # It's best enabled when your entire app is migrated and stable on 6.1. | |
|
32 | + # Rails.application.config.action_controller.urlsafe_csrf_tokens = true | |
|
33 | + | |
|
34 | + # Specify whether `ActiveSupport::TimeZone.utc_to_local` returns a time with an | |
|
35 | + # UTC offset or a UTC time. | |
|
36 | + # ActiveSupport.utc_to_local_returns_utc_offset_times = true | |
|
37 | + | |
|
38 | + # Change the default HTTP status code to `308` when redirecting non-GET/HEAD | |
|
39 | + # requests to HTTPS in `ActionDispatch::SSL` middleware. | |
|
40 | + # Rails.application.config.action_dispatch.ssl_default_redirect_status = 308 | |
|
41 | + | |
|
42 | + # Use new connection handling API. For most applications this won't have any | |
|
43 | + # effect. For applications using multiple databases, this new API provides | |
|
44 | + # support for granular connection swapping. | |
|
45 | + # Rails.application.config.active_record.legacy_connection_handling = false | |
|
46 | + | |
|
47 | + # Make `form_with` generate non-remote forms by default. | |
|
48 | + # Rails.application.config.action_view.form_with_generates_remote_forms = false | |
|
49 | + | |
|
50 | + # Set the default queue name for the analysis job to the queue adapter default. | |
|
51 | + # Rails.application.config.active_storage.queues.analysis = nil | |
|
52 | + | |
|
53 | + # Set the default queue name for the purge job to the queue adapter default. | |
|
54 | + # Rails.application.config.active_storage.queues.purge = nil | |
|
55 | + | |
|
56 | + # Set the default queue name for the incineration job to the queue adapter default. | |
|
57 | + # Rails.application.config.action_mailbox.queues.incineration = nil | |
|
58 | + | |
|
59 | + # Set the default queue name for the routing job to the queue adapter default. | |
|
60 | + # Rails.application.config.action_mailbox.queues.routing = nil | |
|
61 | + | |
|
62 | + # Set the default queue name for the mail deliver job to the queue adapter default. | |
|
63 | + # Rails.application.config.action_mailer.deliver_later_queue_name = nil | |
|
64 | + | |
|
65 | + # Generate a `Link` header that gives a hint to modern browsers about | |
|
66 | + # preloading assets when using `javascript_include_tag` and `stylesheet_link_tag`. | |
|
67 | + # Rails.application.config.action_view.preload_links_header = true |
@@ -0,0 +1,11 | |||
|
1 | + # 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 |f| | |
|
5 | + # f.camera :none | |
|
6 | + # f.gyroscope :none | |
|
7 | + # f.microphone :none | |
|
8 | + # f.usb :none | |
|
9 | + # f.fullscreen :self | |
|
10 | + # f.payment :self, "https://secure.example.com" | |
|
11 | + # end |
@@ -2,7 +2,7 | |||
|
2 | 2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } |
|
3 | 3 | |
|
4 | 4 | #rails |
|
5 |
- gem 'rails', '~> |
|
|
5 | + gem 'rails', '~>6.0' | |
|
6 | 6 | gem 'activerecord-session_store' |
|
7 | 7 | gem 'puma' |
|
8 | 8 |
@@ -5,57 +5,74 | |||
|
5 | 5 | ZenTest (~> 4.3) |
|
6 | 6 | ZenTest (4.12.0) |
|
7 | 7 | ace-rails-ap (4.4) |
|
8 |
- actioncable ( |
|
|
9 |
- actionpack (= |
|
|
8 | + actioncable (6.1.4.4) | |
|
9 | + actionpack (= 6.1.4.4) | |
|
10 | + activesupport (= 6.1.4.4) | |
|
10 | 11 | nio4r (~> 2.0) |
|
11 | 12 | websocket-driver (>= 0.6.1) |
|
12 |
- actionmail |
|
|
13 |
- actionpack (= |
|
|
14 |
- acti |
|
|
15 |
- active |
|
|
13 | + actionmailbox (6.1.4.4) | |
|
14 | + actionpack (= 6.1.4.4) | |
|
15 | + activejob (= 6.1.4.4) | |
|
16 | + activerecord (= 6.1.4.4) | |
|
17 | + activestorage (= 6.1.4.4) | |
|
18 | + activesupport (= 6.1.4.4) | |
|
19 | + mail (>= 2.7.1) | |
|
20 | + actionmailer (6.1.4.4) | |
|
21 | + actionpack (= 6.1.4.4) | |
|
22 | + actionview (= 6.1.4.4) | |
|
23 | + activejob (= 6.1.4.4) | |
|
24 | + activesupport (= 6.1.4.4) | |
|
16 | 25 | mail (~> 2.5, >= 2.5.4) |
|
17 | 26 | rails-dom-testing (~> 2.0) |
|
18 |
- actionpack ( |
|
|
19 |
- actionview (= |
|
|
20 |
- activesupport (= |
|
|
21 |
- rack (~> 2.0, >= 2.0. |
|
|
27 | + actionpack (6.1.4.4) | |
|
28 | + actionview (= 6.1.4.4) | |
|
29 | + activesupport (= 6.1.4.4) | |
|
30 | + rack (~> 2.0, >= 2.0.9) | |
|
22 | 31 | rack-test (>= 0.6.3) |
|
23 | 32 | rails-dom-testing (~> 2.0) |
|
24 |
- rails-html-sanitizer (~> 1.0, >= 1. |
|
|
25 |
- action |
|
|
26 |
- acti |
|
|
33 | + rails-html-sanitizer (~> 1.0, >= 1.2.0) | |
|
34 | + actiontext (6.1.4.4) | |
|
35 | + actionpack (= 6.1.4.4) | |
|
36 | + activerecord (= 6.1.4.4) | |
|
37 | + activestorage (= 6.1.4.4) | |
|
38 | + activesupport (= 6.1.4.4) | |
|
39 | + nokogiri (>= 1.8.5) | |
|
40 | + actionview (6.1.4.4) | |
|
41 | + activesupport (= 6.1.4.4) | |
|
27 | 42 | builder (~> 3.1) |
|
28 | 43 | erubi (~> 1.4) |
|
29 | 44 | rails-dom-testing (~> 2.0) |
|
30 |
- rails-html-sanitizer (~> 1. |
|
|
31 |
- activejob ( |
|
|
32 |
- activesupport (= |
|
|
45 | + rails-html-sanitizer (~> 1.1, >= 1.2.0) | |
|
46 | + activejob (6.1.4.4) | |
|
47 | + activesupport (= 6.1.4.4) | |
|
33 | 48 | globalid (>= 0.3.6) |
|
34 |
- activemodel ( |
|
|
35 |
- activesupport (= |
|
|
36 |
- activerecord ( |
|
|
37 |
- activemodel (= |
|
|
38 |
- activesupport (= |
|
|
39 | - arel (>= 9.0) | |
|
49 | + activemodel (6.1.4.4) | |
|
50 | + activesupport (= 6.1.4.4) | |
|
51 | + activerecord (6.1.4.4) | |
|
52 | + activemodel (= 6.1.4.4) | |
|
53 | + activesupport (= 6.1.4.4) | |
|
40 | 54 | activerecord-session_store (2.0.0) |
|
41 | 55 | actionpack (>= 5.2.4.1) |
|
42 | 56 | activerecord (>= 5.2.4.1) |
|
43 | 57 | multi_json (~> 1.11, >= 1.11.2) |
|
44 | 58 | rack (>= 2.0.8, < 3) |
|
45 | 59 | railties (>= 5.2.4.1) |
|
46 |
- activestorage ( |
|
|
47 |
- actionpack (= |
|
|
48 |
- active |
|
|
60 | + activestorage (6.1.4.4) | |
|
61 | + actionpack (= 6.1.4.4) | |
|
62 | + activejob (= 6.1.4.4) | |
|
63 | + activerecord (= 6.1.4.4) | |
|
64 | + activesupport (= 6.1.4.4) | |
|
49 | 65 | marcel (~> 1.0.0) |
|
50 | - activesupport (5.2.6) | |
|
66 | + mini_mime (>= 1.1.0) | |
|
67 | + activesupport (6.1.4.4) | |
|
51 | 68 | concurrent-ruby (~> 1.0, >= 1.0.2) |
|
52 |
- i18n (>= |
|
|
53 |
- minitest ( |
|
|
54 |
- tzinfo (~> |
|
|
69 | + i18n (>= 1.6, < 2) | |
|
70 | + minitest (>= 5.1) | |
|
71 | + tzinfo (~> 2.0) | |
|
72 | + zeitwerk (~> 2.3) | |
|
55 | 73 | addressable (2.8.0) |
|
56 | 74 | public_suffix (>= 2.0.2, < 5.0) |
|
57 | 75 | ansi (1.5.0) |
|
58 | - arel (9.0.0) | |
|
59 | 76 | autoprefixer-rails (10.4.2.0) |
|
60 | 77 | execjs (~> 2) |
|
61 | 78 | best_in_place (3.0.3) |
@@ -166,18 +183,20 | |||
|
166 | 183 | rack (2.2.3) |
|
167 | 184 | rack-test (1.1.0) |
|
168 | 185 | rack (>= 1.0, < 3) |
|
169 |
- rails ( |
|
|
170 |
- actioncable (= |
|
|
171 |
- actionmail |
|
|
172 |
- action |
|
|
173 |
- action |
|
|
174 |
- acti |
|
|
175 |
- acti |
|
|
176 |
- active |
|
|
177 |
- active |
|
|
178 |
- active |
|
|
179 | - bundler (>= 1.3.0) | |
|
180 |
- |
|
|
186 | + rails (6.1.4.4) | |
|
187 | + actioncable (= 6.1.4.4) | |
|
188 | + actionmailbox (= 6.1.4.4) | |
|
189 | + actionmailer (= 6.1.4.4) | |
|
190 | + actionpack (= 6.1.4.4) | |
|
191 | + actiontext (= 6.1.4.4) | |
|
192 | + actionview (= 6.1.4.4) | |
|
193 | + activejob (= 6.1.4.4) | |
|
194 | + activemodel (= 6.1.4.4) | |
|
195 | + activerecord (= 6.1.4.4) | |
|
196 | + activestorage (= 6.1.4.4) | |
|
197 | + activesupport (= 6.1.4.4) | |
|
198 | + bundler (>= 1.15.0) | |
|
199 | + railties (= 6.1.4.4) | |
|
181 | 200 | sprockets-rails (>= 2.0.0) |
|
182 | 201 | rails-controller-testing (1.0.5) |
|
183 | 202 | actionpack (>= 5.0.1.rc1) |
@@ -190,12 +209,12 | |||
|
190 | 209 | loofah (~> 2.3) |
|
191 | 210 | rails_bootstrap_sortable (2.0.7) |
|
192 | 211 | momentjs-rails (>= 2.8.3) |
|
193 |
- railties ( |
|
|
194 |
- actionpack (= |
|
|
195 |
- activesupport (= |
|
|
212 | + railties (6.1.4.4) | |
|
213 | + actionpack (= 6.1.4.4) | |
|
214 | + activesupport (= 6.1.4.4) | |
|
196 | 215 | method_source |
|
197 |
- rake (>= 0. |
|
|
198 |
- thor (> |
|
|
216 | + rake (>= 0.13) | |
|
217 | + thor (~> 1.0) | |
|
199 | 218 | rake (13.0.6) |
|
200 | 219 | rb-fsevent (0.11.0) |
|
201 | 220 | rb-inotify (0.10.1) |
@@ -240,17 +259,16 | |||
|
240 | 259 | sqlite3 (1.4.2) |
|
241 | 260 | temple (0.8.2) |
|
242 | 261 | thor (1.2.1) |
|
243 | - thread_safe (0.3.6) | |
|
244 | 262 | tilt (2.0.10) |
|
245 |
- tzinfo ( |
|
|
246 | - thread_safe (~> 0.1) | |
|
263 | + tzinfo (2.0.4) | |
|
264 | + concurrent-ruby (~> 1.0) | |
|
247 | 265 | uglifier (4.2.0) |
|
248 | 266 | execjs (>= 0.3.0, < 3) |
|
249 |
- web-console ( |
|
|
250 |
- actionview (>= |
|
|
251 |
- activemodel (>= |
|
|
267 | + web-console (4.2.0) | |
|
268 | + actionview (>= 6.0.0) | |
|
269 | + activemodel (>= 6.0.0) | |
|
252 | 270 | bindex (>= 0.4.0) |
|
253 |
- railties (>= |
|
|
271 | + railties (>= 6.0.0) | |
|
254 | 272 | webdriver (0.19.0) |
|
255 | 273 | websocket-driver (0.7.5) |
|
256 | 274 | websocket-extensions (>= 0.1.0) |
@@ -260,6 +278,7 | |||
|
260 | 278 | yaml_db (0.7.0) |
|
261 | 279 | rails (>= 3.0) |
|
262 | 280 | rake (>= 0.8.7) |
|
281 | + zeitwerk (2.5.3) | |
|
263 | 282 | |
|
264 | 283 | PLATFORMS |
|
265 | 284 | ruby |
@@ -293,7 +312,7 | |||
|
293 | 312 | momentjs-rails (>= 2.9.0) |
|
294 | 313 | mysql2 |
|
295 | 314 | puma |
|
296 |
- rails (~> |
|
|
315 | + rails (~> 6.0) | |
|
297 | 316 | rails-controller-testing |
|
298 | 317 | rails_bootstrap_sortable |
|
299 | 318 | rdiscount |
@@ -1,4 +1,5 | |||
|
1 | 1 | #!/usr/bin/env ruby |
|
2 | + load File.expand_path("spring", __dir__) | |
|
2 | 3 | APP_PATH = File.expand_path('../config/application', __dir__) |
|
3 |
- require_relative |
|
|
4 |
- require |
|
|
4 | + require_relative "../config/boot" | |
|
5 | + require "rails/commands" |
@@ -1,4 +1,5 | |||
|
1 | 1 | #!/usr/bin/env ruby |
|
2 | - require_relative '../config/boot' | |
|
3 | - require 'rake' | |
|
2 | + load File.expand_path("spring", __dir__) | |
|
3 | + require_relative "../config/boot" | |
|
4 | + require "rake" | |
|
4 | 5 | Rake.application.run |
@@ -1,6 +1,5 | |||
|
1 | 1 | #!/usr/bin/env ruby |
|
2 |
- require |
|
|
3 | - include FileUtils | |
|
2 | + require "fileutils" | |
|
4 | 3 | |
|
5 | 4 | # path to your application root. |
|
6 | 5 | APP_ROOT = File.expand_path('..', __dir__) |
@@ -9,24 +8,25 | |||
|
9 | 8 | system(*args) || abort("\n== Command #{args} failed ==") |
|
10 | 9 | end |
|
11 | 10 | |
|
12 | - chdir APP_ROOT do | |
|
13 | - # This script is a starting point to setup your application. | |
|
11 | + FileUtils.chdir APP_ROOT do | |
|
12 | + # This script is a way to set up or update your development environment automatically. | |
|
13 | + # This script is idempotent, so that you can run it at any time and get an expectable outcome. | |
|
14 | 14 | # Add necessary setup steps to this file. |
|
15 | 15 | |
|
16 | 16 | puts '== Installing dependencies ==' |
|
17 | 17 | system! 'gem install bundler --conservative' |
|
18 | 18 | system('bundle check') || system!('bundle install') |
|
19 | 19 | |
|
20 |
- # Install JavaScript dependencies |
|
|
21 |
- |
|
|
20 | + # Install JavaScript dependencies | |
|
21 | + system! 'bin/yarn' | |
|
22 | 22 | |
|
23 | 23 | # puts "\n== Copying sample files ==" |
|
24 | 24 | # unless File.exist?('config/database.yml') |
|
25 | - # cp 'config/database.yml.sample', 'config/database.yml' | |
|
25 | + # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' | |
|
26 | 26 | # end |
|
27 | 27 | |
|
28 | 28 | puts "\n== Preparing database ==" |
|
29 |
- system! 'bin/rails db: |
|
|
29 | + system! 'bin/rails db:prepare' | |
|
30 | 30 | |
|
31 | 31 | puts "\n== Removing old logs and tempfiles ==" |
|
32 | 32 | system! 'bin/rails log:clear tmp:clear' |
@@ -1,9 +1,15 | |||
|
1 | 1 | #!/usr/bin/env ruby |
|
2 | 2 | APP_ROOT = File.expand_path('..', __dir__) |
|
3 | 3 | Dir.chdir(APP_ROOT) do |
|
4 | - begin | |
|
5 | - exec "yarnpkg", *ARGV | |
|
6 | - rescue Errno::ENOENT | |
|
4 | + yarn = ENV["PATH"].split(File::PATH_SEPARATOR). | |
|
5 | + select { |dir| File.expand_path(dir) != __dir__ }. | |
|
6 | + product(["yarn", "yarn.cmd", "yarn.ps1"]). | |
|
7 | + map { |dir, file| File.expand_path(file, dir) }. | |
|
8 | + find { |file| File.executable?(file) } | |
|
9 | + | |
|
10 | + if yarn | |
|
11 | + exec yarn, *ARGV | |
|
12 | + else | |
|
7 | 13 | $stderr.puts "Yarn executable was not detected in the system." |
|
8 | 14 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" |
|
9 | 15 | exit 1 |
@@ -1,4 +1,6 | |||
|
1 | 1 | # This file is used by Rack-based servers to start the application. |
|
2 | 2 | |
|
3 | - require ::File.expand_path('../config/environment', __FILE__) | |
|
4 | - run CafeGrader::Application | |
|
3 | + require_relative "config/environment" | |
|
4 | + | |
|
5 | + run Rails.application | |
|
6 | + Rails.application.load_server |
@@ -1,4 +1,4 | |||
|
1 | 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) |
|
2 | 2 | |
|
3 |
- require |
|
|
4 |
- require |
|
|
3 | + require "bundler/setup" # Set up gems listed in the Gemfile. | |
|
4 | + require "bootsnap/setup" # Speed up boot time by caching expensive operations. |
@@ -2,7 +2,7 | |||
|
2 | 2 | adapter: async |
|
3 | 3 | |
|
4 | 4 | test: |
|
5 |
- adapter: |
|
|
5 | + adapter: test | |
|
6 | 6 | |
|
7 | 7 | production: |
|
8 | 8 | adapter: redis |
@@ -1,5 +1,5 | |||
|
1 | 1 | # Load the Rails application. |
|
2 |
- require_relative |
|
|
2 | + require_relative "application" | |
|
3 | 3 | |
|
4 | 4 | # Initialize the Rails application. |
|
5 | 5 | Rails.application.initialize! |
@@ -1,8 +1,8 | |||
|
1 | 1 | Rails.application.configure do |
|
2 | 2 | # Settings specified here will take precedence over those in config/application.rb. |
|
3 | 3 | |
|
4 |
- # In the development environment your application's code is reloaded |
|
|
5 |
- # |
|
|
4 | + # In the development environment your application's code is reloaded any time | |
|
5 | + # it changes. This slows down response time but is perfect for development | |
|
6 | 6 | # since you don't have to restart the web server when you make code changes. |
|
7 | 7 | config.cache_classes = false |
|
8 | 8 | |
@@ -16,6 +16,7 | |||
|
16 | 16 | # Run rails dev:cache to toggle caching. |
|
17 | 17 | if Rails.root.join('tmp', 'caching-dev.txt').exist? |
|
18 | 18 | config.action_controller.perform_caching = true |
|
19 | + config.action_controller.enable_fragment_cache_logging = true | |
|
19 | 20 | |
|
20 | 21 | config.cache_store = :memory_store |
|
21 | 22 | config.public_file_server.headers = { |
@@ -27,7 +28,7 | |||
|
27 | 28 | config.cache_store = :null_store |
|
28 | 29 | end |
|
29 | 30 | |
|
30 | - # Store uploaded files on the local file system (see config/storage.yml for options) | |
|
31 | + # Store uploaded files on the local file system (see config/storage.yml for options). | |
|
31 | 32 | config.active_storage.service = :local |
|
32 | 33 | |
|
33 | 34 | # Don't care if the mailer can't send. |
@@ -38,6 +39,12 | |||
|
38 | 39 | # Print deprecation notices to the Rails logger. |
|
39 | 40 | config.active_support.deprecation = :log |
|
40 | 41 | |
|
42 | + # Raise exceptions for disallowed deprecations. | |
|
43 | + config.active_support.disallowed_deprecation = :raise | |
|
44 | + | |
|
45 | + # Tell Active Support which deprecation messages to disallow. | |
|
46 | + config.active_support.disallowed_deprecation_warnings = [] | |
|
47 | + | |
|
41 | 48 | # Raise an error on page load if there are pending migrations. |
|
42 | 49 | config.active_record.migration_error = :page_load |
|
43 | 50 | |
@@ -52,10 +59,16 | |||
|
52 | 59 | # Suppress logger output for asset requests. |
|
53 | 60 | config.assets.quiet = true |
|
54 | 61 | |
|
55 | - # Raises error for missing translations | |
|
56 |
- # config. |
|
|
62 | + # Raises error for missing translations. | |
|
63 | + # config.i18n.raise_on_missing_translations = true | |
|
64 | + | |
|
65 | + # Annotate rendered view with file names. | |
|
66 | + # config.action_view.annotate_rendered_view_with_filenames = true | |
|
57 | 67 | |
|
58 | 68 | # Use an evented file watcher to asynchronously detect changes in source code, |
|
59 | 69 | # routes, locales, etc. This feature depends on the listen gem. |
|
60 | 70 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker |
|
71 | + | |
|
72 | + # Uncomment if you wish to allow Action Cable access from any origin. | |
|
73 | + # config.action_cable.disable_request_forgery_protection = true | |
|
61 | 74 | end |
@@ -22,26 +22,23 | |||
|
22 | 22 | # Apache or NGINX already handles this. |
|
23 | 23 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? |
|
24 | 24 | |
|
25 | - # Compress JavaScripts and CSS. | |
|
26 | - config.assets.js_compressor = :uglifier | |
|
25 | + # Compress CSS using a preprocessor. | |
|
27 | 26 | # config.assets.css_compressor = :sass |
|
28 | 27 | |
|
29 | 28 | # Do not fallback to assets pipeline if a precompiled asset is missed. |
|
30 | 29 | config.assets.compile = false |
|
31 | 30 | |
|
32 | - # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb | |
|
33 | - | |
|
34 | 31 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. |
|
35 |
- # config.a |
|
|
32 | + # config.asset_host = 'http://assets.example.com' | |
|
36 | 33 | |
|
37 | 34 | # Specifies the header that your server uses for sending files. |
|
38 | 35 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache |
|
39 | 36 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX |
|
40 | 37 | |
|
41 | - # Store uploaded files on the local file system (see config/storage.yml for options) | |
|
38 | + # Store uploaded files on the local file system (see config/storage.yml for options). | |
|
42 | 39 | config.active_storage.service = :local |
|
43 | 40 | |
|
44 | - # Mount Action Cable outside main process or domain | |
|
41 | + # Mount Action Cable outside main process or domain. | |
|
45 | 42 | # config.action_cable.mount_path = nil |
|
46 | 43 | # config.action_cable.url = 'wss://example.com/cable' |
|
47 | 44 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] |
@@ -49,9 +46,9 | |||
|
49 | 46 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. |
|
50 | 47 | # config.force_ssl = true |
|
51 | 48 | |
|
52 | - # Use the lowest log level to ensure availability of diagnostic information | |
|
53 | - # when problems arise. | |
|
54 |
- config.log_level = : |
|
|
49 | + # Include generic and useful information about system operation, but avoid logging too much | |
|
50 | + # information to avoid inadvertent exposure of personally identifiable information (PII). | |
|
51 | + config.log_level = :info | |
|
55 | 52 | |
|
56 | 53 | # Prepend all log lines with the following tags. |
|
57 | 54 | config.log_tags = [ :request_id ] |
@@ -59,9 +56,9 | |||
|
59 | 56 | # Use a different cache store in production. |
|
60 | 57 | # config.cache_store = :mem_cache_store |
|
61 | 58 | |
|
62 | - # Use a real queuing backend for Active Job (and separate queues per environment) | |
|
59 | + # Use a real queuing backend for Active Job (and separate queues per environment). | |
|
63 | 60 | # config.active_job.queue_adapter = :resque |
|
64 |
- # config.active_job.queue_name_prefix = "cafe_grader_ |
|
|
61 | + # config.active_job.queue_name_prefix = "cafe_grader_production" | |
|
65 | 62 | |
|
66 | 63 | config.action_mailer.perform_caching = false |
|
67 | 64 | |
@@ -76,6 +73,12 | |||
|
76 | 73 | # Send deprecation notices to registered listeners. |
|
77 | 74 | config.active_support.deprecation = :notify |
|
78 | 75 | |
|
76 | + # Log disallowed deprecations. | |
|
77 | + config.active_support.disallowed_deprecation = :log | |
|
78 | + | |
|
79 | + # Tell Active Support which deprecation messages to disallow. | |
|
80 | + config.active_support.disallowed_deprecation_warnings = [] | |
|
81 | + | |
|
79 | 82 | # Use default logging formatter so that PID and timestamp are not suppressed. |
|
80 | 83 | config.log_formatter = ::Logger::Formatter.new |
|
81 | 84 | |
@@ -91,4 +94,25 | |||
|
91 | 94 | |
|
92 | 95 | # Do not dump schema after migrations. |
|
93 | 96 | config.active_record.dump_schema_after_migration = false |
|
97 | + | |
|
98 | + # Inserts middleware to perform automatic connection switching. | |
|
99 | + # The `database_selector` hash is used to pass options to the DatabaseSelector | |
|
100 | + # middleware. The `delay` is used to determine how long to wait after a write | |
|
101 | + # to send a subsequent read to the primary. | |
|
102 | + # | |
|
103 | + # The `database_resolver` class is used by the middleware to determine which | |
|
104 | + # database is appropriate to use based on the time delay. | |
|
105 | + # | |
|
106 | + # The `database_resolver_context` class is used by the middleware to set | |
|
107 | + # timestamps for the last write to the primary. The resolver uses the context | |
|
108 | + # class timestamps to determine how long to wait before reading from the | |
|
109 | + # replica. | |
|
110 | + # | |
|
111 | + # By default Rails will store a last write timestamp in the session. The | |
|
112 | + # DatabaseSelector middleware is designed as such you can define your own | |
|
113 | + # strategy for connection switching and pass that into the middleware through | |
|
114 | + # these configuration options. | |
|
115 | + # config.active_record.database_selector = { delay: 2.seconds } | |
|
116 | + # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver | |
|
117 | + # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session | |
|
94 | 118 | end |
@@ -1,11 +1,15 | |||
|
1 | - Rails.application.configure do | |
|
2 | - # Settings specified here will take precedence over those in config/application.rb. | |
|
1 | + require "active_support/core_ext/integer/time" | |
|
3 | 2 | |
|
4 | 3 |
|
|
5 | 4 |
|
|
6 | 5 |
|
|
7 | 6 |
|
|
8 | - config.cache_classes = true | |
|
7 | + | |
|
8 | + Rails.application.configure do | |
|
9 | + # Settings specified here will take precedence over those in config/application.rb. | |
|
10 | + | |
|
11 | + config.cache_classes = false | |
|
12 | + config.action_view.cache_template_loading = true | |
|
9 | 13 | |
|
10 | 14 | # Do not eager load code on boot. This avoids loading your whole application |
|
11 | 15 | # just for the purpose of running a single test. If you are using a tool that |
@@ -21,6 +25,7 | |||
|
21 | 25 | # Show full error reports and disable caching. |
|
22 | 26 | config.consider_all_requests_local = true |
|
23 | 27 | config.action_controller.perform_caching = false |
|
28 | + config.cache_store = :null_store | |
|
24 | 29 | |
|
25 | 30 | # Raise exceptions instead of rendering exception templates. |
|
26 | 31 | config.action_dispatch.show_exceptions = false |
@@ -28,7 +33,7 | |||
|
28 | 33 | # Disable request forgery protection in test environment. |
|
29 | 34 | config.action_controller.allow_forgery_protection = false |
|
30 | 35 | |
|
31 | - # Store uploaded files on the local file system in a temporary directory | |
|
36 | + # Store uploaded files on the local file system in a temporary directory. | |
|
32 | 37 | config.active_storage.service = :test |
|
33 | 38 | |
|
34 | 39 | config.action_mailer.perform_caching = false |
@@ -41,6 +46,15 | |||
|
41 | 46 | # Print deprecation notices to the stderr. |
|
42 | 47 | config.active_support.deprecation = :stderr |
|
43 | 48 | |
|
44 |
- # Raise |
|
|
45 | - # config.action_view.raise_on_missing_translations = true | |
|
49 | + # Raise exceptions for disallowed deprecations. | |
|
50 | + config.active_support.disallowed_deprecation = :raise | |
|
51 | + | |
|
52 | + # Tell Active Support which deprecation messages to disallow. | |
|
53 | + config.active_support.disallowed_deprecation_warnings = [] | |
|
54 | + | |
|
55 | + # Raises error for missing translations. | |
|
56 | + # config.i18n.raise_on_missing_translations = true | |
|
57 | + | |
|
58 | + # Annotate rendered view with file names. | |
|
59 | + # config.action_view.annotate_rendered_view_with_filenames = true | |
|
46 | 60 | end |
@@ -1,7 +1,8 | |||
|
1 | 1 | # Be sure to restart your server when you modify this file. |
|
2 | 2 | |
|
3 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. |
|
4 |
- # Rails.backtrace_cleaner.add_silencer { |line| |
|
|
4 | + # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } | |
|
5 | 5 | |
|
6 |
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code |
|
|
7 | - # Rails.backtrace_cleaner.remove_silencers! | |
|
6 | + # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code | |
|
7 | + # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". | |
|
8 | + Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] |
@@ -11,6 +11,8 | |||
|
11 | 11 | # policy.object_src :none |
|
12 | 12 | # policy.script_src :self, :https |
|
13 | 13 | # policy.style_src :self, :https |
|
14 | + # # If you are using webpack-dev-server then specify webpack-dev-server host | |
|
15 | + # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? | |
|
14 | 16 | |
|
15 | 17 | # # Specify URI for violation reports |
|
16 | 18 | # # policy.report_uri "/csp-violation-report-endpoint" |
@@ -19,6 +21,9 | |||
|
19 | 21 | # If you are using UJS then enable automatic nonce generation |
|
20 | 22 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } |
|
21 | 23 | |
|
24 | + # Set the nonce only to specific directives | |
|
25 | + # Rails.application.config.content_security_policy_nonce_directives = %w(script-src) | |
|
26 | + | |
|
22 | 27 | # Report CSP violations to a specified URI |
|
23 | 28 | # For further information see the following documentation: |
|
24 | 29 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only |
@@ -1,4 +1,6 | |||
|
1 | 1 | # Be sure to restart your server when you modify this file. |
|
2 | 2 | |
|
3 | 3 | # Configure sensitive parameters which will be filtered from the log file. |
|
4 |
- Rails.application.config.filter_parameters += [ |
|
|
4 | + Rails.application.config.filter_parameters += [ | |
|
5 | + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn | |
|
6 | + ] |
@@ -4,8 +4,14 | |||
|
4 | 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum |
|
5 | 5 | # and maximum; this matches the default thread size of Active Record. |
|
6 | 6 | # |
|
7 | - threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } | |
|
8 | - threads threads_count, threads_count | |
|
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 | |
|
10 | + | |
|
11 | + # Specifies the `worker_timeout` threshold that Puma will use to wait before | |
|
12 | + # terminating a worker in development environments. | |
|
13 | + # | |
|
14 | + worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" | |
|
9 | 15 | |
|
10 | 16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. |
|
11 | 17 | # |
@@ -15,6 +21,9 | |||
|
15 | 21 | # |
|
16 | 22 | environment ENV.fetch("RAILS_ENV") { "development" } |
|
17 | 23 | |
|
24 | + # Specifies the `pidfile` that Puma will use. | |
|
25 | + pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } | |
|
26 | + | |
|
18 | 27 | # Specifies the number of `workers` to boot in clustered mode. |
|
19 | 28 | # Workers are forked webserver processes. If using threads and workers together |
|
20 | 29 | # the concurrency of the application would be max `threads` * `workers`. |
You need to be logged in to leave comments.
Login now