From 6bd18eb3316415cf3a8d404ca4013dbb6f4695cf Mon Sep 17 00:00:00 2001 From: Jessica Dussault Date: Thu, 19 Dec 2019 10:46:32 -0600 Subject: [PATCH 1/7] updates to rails 6 step one ran upgrade script and accepted all changes except to - routes (kept previous routes) - development.rb retained # LOCAL logging --- Gemfile | 2 +- Gemfile.lock | 126 ++++++++++-------- bin/setup | 10 +- config/application.rb | 6 +- config/cable.yml | 2 +- config/environments/development.rb | 9 +- config/environments/production.rb | 36 +++-- config/environments/test.rb | 16 ++- .../new_framework_defaults_6_0.rb | 45 +++++++ config/locales/en.yml | 2 +- config/puma.rb | 10 +- config/spring.rb | 12 +- 12 files changed, 175 insertions(+), 101 deletions(-) create mode 100644 config/initializers/new_framework_defaults_6_0.rb diff --git a/Gemfile b/Gemfile index 17883e5..88ac8b9 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.2.0' +gem 'rails', '~> 6.0.2' # Use sqlite3 as the database for Active Record gem 'sqlite3' # Use Puma as the app server diff --git a/Gemfile.lock b/Gemfile.lock index b581486..cdf040b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,49 +1,62 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.6) - actionpack (= 5.2.6) + actioncable (6.0.2.1) + actionpack (= 6.0.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.6) - actionpack (= 5.2.6) - actionview (= 5.2.6) - activejob (= 5.2.6) + actionmailbox (6.0.2.1) + actionpack (= 6.0.2.1) + activejob (= 6.0.2.1) + activerecord (= 6.0.2.1) + activestorage (= 6.0.2.1) + activesupport (= 6.0.2.1) + mail (>= 2.7.1) + actionmailer (6.0.2.1) + actionpack (= 6.0.2.1) + actionview (= 6.0.2.1) + activejob (= 6.0.2.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.6) - actionview (= 5.2.6) - activesupport (= 5.2.6) + actionpack (6.0.2.1) + actionview (= 6.0.2.1) + activesupport (= 6.0.2.1) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.6) - activesupport (= 5.2.6) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2.1) + actionpack (= 6.0.2.1) + activerecord (= 6.0.2.1) + activestorage (= 6.0.2.1) + activesupport (= 6.0.2.1) + nokogiri (>= 1.8.5) + actionview (6.0.2.1) + activesupport (= 6.0.2.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.6) - activesupport (= 5.2.6) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2.1) + activesupport (= 6.0.2.1) globalid (>= 0.3.6) - activemodel (5.2.6) - activesupport (= 5.2.6) - activerecord (5.2.6) - activemodel (= 5.2.6) - activesupport (= 5.2.6) - arel (>= 9.0) - activestorage (5.2.6) - actionpack (= 5.2.6) - activerecord (= 5.2.6) - marcel (~> 1.0.0) - activesupport (5.2.6) + activemodel (6.0.2.1) + activesupport (= 6.0.2.1) + activerecord (6.0.2.1) + activemodel (= 6.0.2.1) + activesupport (= 6.0.2.1) + activestorage (6.0.2.1) + actionpack (= 6.0.2.1) + activejob (= 6.0.2.1) + activerecord (= 6.0.2.1) + marcel (~> 0.3.1) + activesupport (6.0.2.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - arel (9.0.0) - bootsnap (1.8.1) + zeitwerk (~> 2.2) + bootsnap (1.4.5) msgpack (~> 1.0) builder (3.2.4) byebug (11.1.3) @@ -79,42 +92,42 @@ GEM minitest (5.14.4) msgpack (1.4.2) netrc (0.11.0) - nio4r (2.5.8) - nokogiri (1.12.4) - mini_portile2 (~> 2.6.1) - racc (~> 1.4) - puma (3.12.6) - racc (1.5.2) - rack (2.2.3) + nio4r (2.5.2) + nokogiri (1.10.7) + mini_portile2 (~> 2.4.0) + puma (3.12.2) + rack (2.0.8) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.2.6) - actioncable (= 5.2.6) - actionmailer (= 5.2.6) - actionpack (= 5.2.6) - actionview (= 5.2.6) - activejob (= 5.2.6) - activemodel (= 5.2.6) - activerecord (= 5.2.6) - activestorage (= 5.2.6) - activesupport (= 5.2.6) + rails (6.0.2.1) + actioncable (= 6.0.2.1) + actionmailbox (= 6.0.2.1) + actionmailer (= 6.0.2.1) + actionpack (= 6.0.2.1) + actiontext (= 6.0.2.1) + actionview (= 6.0.2.1) + activejob (= 6.0.2.1) + activemodel (= 6.0.2.1) + activerecord (= 6.0.2.1) + activestorage (= 6.0.2.1) + activesupport (= 6.0.2.1) bundler (>= 1.3.0) - railties (= 5.2.6) + railties (= 6.0.2.1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (5.2.6) - actionpack (= 5.2.6) - activesupport (= 5.2.6) + railties (6.0.2.1) + actionpack (= 6.0.2.1) + activesupport (= 6.0.2.1) method_source rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rake (13.0.6) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) + thor (>= 0.20.3, < 2.0) + rake (13.0.1) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) ffi (~> 1.0) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -134,7 +147,7 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.4.2) - thor (1.1.0) + thor (1.0.1) thread_safe (0.3.6) tzinfo (1.2.9) thread_safe (~> 0.1) @@ -143,7 +156,8 @@ GEM unf_ext (0.0.7.7) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) + websocket-extensions (0.1.4) + zeitwerk (2.2.2) PLATFORMS ruby @@ -153,7 +167,7 @@ DEPENDENCIES byebug listen (>= 3.0.5, < 3.2) puma (~> 3.7) - rails (~> 5.2.0) + rails (~> 6.0.2) rest-client (>= 2.1.0.rc1, < 2.2) spring spring-watcher-listen (~> 2.0.0) diff --git a/bin/setup b/bin/setup index a334d86..0e39e8c 100755 --- a/bin/setup +++ b/bin/setup @@ -1,6 +1,5 @@ #!/usr/bin/env ruby require 'fileutils' -include FileUtils # path to your application root. APP_ROOT = File.expand_path('..', __dir__) @@ -9,8 +8,9 @@ def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end -chdir APP_ROOT do - # This script is a starting point to setup your application. +FileUtils.chdir APP_ROOT do + # This script is a way to setup or update your development environment automatically. + # This script is idempotent, so that you can run it at anytime and get an expectable outcome. # Add necessary setup steps to this file. puts '== Installing dependencies ==' @@ -19,11 +19,11 @@ chdir APP_ROOT do # puts "\n== Copying sample files ==" # unless File.exist?('config/database.yml') - # cp 'config/database.yml.sample', 'config/database.yml' + # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' # end puts "\n== Preparing database ==" - system! 'bin/rails db:setup' + system! 'bin/rails db:prepare' puts "\n== Removing old logs and tempfiles ==" system! 'bin/rails log:clear tmp:clear' diff --git a/config/application.rb b/config/application.rb index c6d9b6c..b9c2970 100644 --- a/config/application.rb +++ b/config/application.rb @@ -8,6 +8,8 @@ require "active_storage/engine" require "action_controller/railtie" require "action_mailer/railtie" +require "action_mailbox/engine" +require "action_text/engine" require "action_view/railtie" require "action_cable/engine" # require "sprockets/railtie" @@ -19,7 +21,6 @@ module Api class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.0 @@ -32,8 +33,5 @@ class Application < Rails::Application # Middleware like session, flash, cookies can be added back manually. # Skip views, helpers and assets when generating a new resource. config.api_only = true - - # sets to avoid deprecation warning in terminal - Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true end end diff --git a/config/cable.yml b/config/cable.yml index 7ebfb60..61cfa97 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -2,7 +2,7 @@ development: adapter: async test: - adapter: async + adapter: test production: adapter: redis diff --git a/config/environments/development.rb b/config/environments/development.rb index 4bdb9c3..66429ed 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -15,8 +15,6 @@ # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. if Rails.root.join('tmp', 'caching-dev.txt').exist? - config.action_controller.perform_caching = true - config.cache_store = :memory_store config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{2.days.to_i}" @@ -27,7 +25,7 @@ config.cache_store = :null_store end - # Store uploaded files on the local file system (see config/storage.yml for options) + # Store uploaded files on the local file system (see config/storage.yml for options). config.active_storage.service = :local # Don't care if the mailer can't send. @@ -45,15 +43,12 @@ config.active_record.verbose_query_logs = true - # Raises error for missing translations + # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true # Use an evented file watcher to asynchronously detect changes in source code, # routes, locales, etc. This feature depends on the listen gem. config.file_watcher = ActiveSupport::EventedFileUpdateChecker - - - # LOCAL # Custom dev env logger to empty log more frequently config.logger = ActiveSupport::TaggedLogging.new( diff --git a/config/environments/production.rb b/config/environments/production.rb index d8f6c28..8cb401a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -12,7 +12,6 @@ # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false - config.action_controller.perform_caching = true # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). @@ -29,20 +28,16 @@ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - # Store uploaded files on the local file system (see config/storage.yml for options) + # Store uploaded files on the local file system (see config/storage.yml for options). config.active_storage.service = :local - # Mount Action Cable outside main process or domain + # Mount Action Cable outside main process or domain. # config.action_cable.mount_path = nil # config.action_cable.url = 'wss://example.com/cable' # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = true - - # Handle STS here instead of Apache, or Rails duplicates header contents - # Also unset cache-control header in HTTPS vhost for same reason - config.ssl_options = { hsts: { preload: true } } + # config.force_ssl = true # Use the lowest log level to ensure availability of diagnostic information # when problems arise. @@ -54,9 +49,9 @@ # Use a different cache store in production. # config.cache_store = :mem_cache_store - # Use a real queuing backend for Active Job (and separate queues per environment) + # Use a real queuing backend for Active Job (and separate queues per environment). # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "api_#{Rails.env}" + # config.active_job.queue_name_prefix = "api_production" config.action_mailer.perform_caching = false @@ -86,4 +81,25 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Inserts middleware to perform automatic connection switching. + # The `database_selector` hash is used to pass options to the DatabaseSelector + # middleware. The `delay` is used to determine how long to wait after a write + # to send a subsequent read to the primary. + # + # The `database_resolver` class is used by the middleware to determine which + # database is appropriate to use based on the time delay. + # + # The `database_resolver_context` class is used by the middleware to set + # timestamps for the last write to the primary. The resolver uses the context + # class timestamps to determine how long to wait before reading from the + # replica. + # + # By default Rails will store a last write timestamp in the session. The + # DatabaseSelector middleware is designed as such you can define your own + # strategy for connection switching and pass that into the middleware through + # these configuration options. + # config.active_record.database_selector = { delay: 2.seconds } + # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver + # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session end diff --git a/config/environments/test.rb b/config/environments/test.rb index 0a38fd3..1d62e91 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,11 +1,12 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true + config.cache_classes = false # Do not eager load code on boot. This avoids loading your whole application # just for the purpose of running a single test. If you are using a tool that @@ -21,6 +22,7 @@ # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false + config.cache_store = :null_store # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false @@ -28,7 +30,7 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - # Store uploaded files on the local file system in a temporary directory + # Store uploaded files on the local file system in a temporary directory. config.active_storage.service = :test config.action_mailer.perform_caching = false @@ -41,6 +43,6 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raises error for missing translations + # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true end diff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rb new file mode 100644 index 0000000..92240ef --- /dev/null +++ b/config/initializers/new_framework_defaults_6_0.rb @@ -0,0 +1,45 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains migration options to ease your Rails 6.0 upgrade. +# +# Once upgraded flip defaults one by one to migrate to the new default. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. + +# Don't force requests from old versions of IE to be UTF-8 encoded. +# Rails.application.config.action_view.default_enforce_utf8 = false + +# Embed purpose and expiry metadata inside signed and encrypted +# cookies for increased security. +# +# This option is not backwards compatible with earlier Rails versions. +# It's best enabled when your entire app is migrated and stable on 6.0. +# Rails.application.config.action_dispatch.use_cookies_with_metadata = true + +# Change the return value of `ActionDispatch::Response#content_type` to Content-Type header without modification. +# Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false + +# Return false instead of self when enqueuing is aborted from a callback. +# Rails.application.config.active_job.return_false_on_aborted_enqueue = true + +# Send Active Storage analysis and purge jobs to dedicated queues. +# Rails.application.config.active_storage.queues.analysis = :active_storage_analysis +# Rails.application.config.active_storage.queues.purge = :active_storage_purge + +# When assigning to a collection of attachments declared via `has_many_attached`, replace existing +# attachments instead of appending. Use #attach to add new attachments without replacing existing ones. +# Rails.application.config.active_storage.replace_on_assign_to_many = true + +# Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail. +# +# The default delivery jobs (ActionMailer::Parameterized::DeliveryJob, ActionMailer::DeliveryJob), +# will be removed in Rails 6.1. This setting is not backwards compatible with earlier Rails versions. +# If you send mail in the background, job workers need to have a copy of +# MailDeliveryJob to ensure all delivery jobs are processed properly. +# Make sure your entire app is migrated and stable on 6.0 before using this setting. +# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" + +# Enable the same cache key to be reused when the object being cached of type +# `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count) +# of the relation's cache key into the cache version to support recycling cache key. +# Rails.application.config.active_record.collection_cache_versioning = true diff --git a/config/locales/en.yml b/config/locales/en.yml index decc5a8..cf9b342 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -27,7 +27,7 @@ # 'true': 'foo' # # To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. +# available at https://guides.rubyonrails.org/i18n.html. en: hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb index a5eccf8..5ed4437 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -4,8 +4,9 @@ # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } -threads threads_count, threads_count +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # @@ -15,8 +16,11 @@ # environment ENV.fetch("RAILS_ENV") { "development" } +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + # Specifies the number of `workers` to boot in clustered mode. -# Workers are forked webserver processes. If using threads and workers together +# Workers are forked web server processes. If using threads and workers together # the concurrency of the application would be max `threads` * `workers`. # Workers do not work on JRuby or Windows (both of which do not support # processes). diff --git a/config/spring.rb b/config/spring.rb index 9fa7863..db5bf13 100644 --- a/config/spring.rb +++ b/config/spring.rb @@ -1,6 +1,6 @@ -%w[ - .ruby-version - .rbenv-vars - tmp/restart.txt - tmp/caching-dev.txt -].each { |path| Spring.watch(path) } +Spring.watch( + ".ruby-version", + ".rbenv-vars", + "tmp/restart.txt", + "tmp/caching-dev.txt" +) From a41a85645e045d0a494cdc2c9dd15f2c658e27f4 Mon Sep 17 00:00:00 2001 From: Jessica Dussault Date: Thu, 19 Dec 2019 10:59:26 -0600 Subject: [PATCH 2/7] suggested defaults for rails 6 --- .../initializers/new_framework_defaults_6_0.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rb index 92240ef..c2a4c7d 100644 --- a/config/initializers/new_framework_defaults_6_0.rb +++ b/config/initializers/new_framework_defaults_6_0.rb @@ -7,28 +7,28 @@ # Read the Guide for Upgrading Ruby on Rails for more info on each option. # Don't force requests from old versions of IE to be UTF-8 encoded. -# Rails.application.config.action_view.default_enforce_utf8 = false +Rails.application.config.action_view.default_enforce_utf8 = false # Embed purpose and expiry metadata inside signed and encrypted # cookies for increased security. # # This option is not backwards compatible with earlier Rails versions. # It's best enabled when your entire app is migrated and stable on 6.0. -# Rails.application.config.action_dispatch.use_cookies_with_metadata = true +Rails.application.config.action_dispatch.use_cookies_with_metadata = true # Change the return value of `ActionDispatch::Response#content_type` to Content-Type header without modification. -# Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false +Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false # Return false instead of self when enqueuing is aborted from a callback. -# Rails.application.config.active_job.return_false_on_aborted_enqueue = true +Rails.application.config.active_job.return_false_on_aborted_enqueue = true # Send Active Storage analysis and purge jobs to dedicated queues. -# Rails.application.config.active_storage.queues.analysis = :active_storage_analysis -# Rails.application.config.active_storage.queues.purge = :active_storage_purge +Rails.application.config.active_storage.queues.analysis = :active_storage_analysis +Rails.application.config.active_storage.queues.purge = :active_storage_purge # When assigning to a collection of attachments declared via `has_many_attached`, replace existing # attachments instead of appending. Use #attach to add new attachments without replacing existing ones. -# Rails.application.config.active_storage.replace_on_assign_to_many = true +Rails.application.config.active_storage.replace_on_assign_to_many = true # Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail. # @@ -37,9 +37,9 @@ # If you send mail in the background, job workers need to have a copy of # MailDeliveryJob to ensure all delivery jobs are processed properly. # Make sure your entire app is migrated and stable on 6.0 before using this setting. -# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" +Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" # Enable the same cache key to be reused when the object being cached of type # `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count) # of the relation's cache key into the cache version to support recycling cache key. -# Rails.application.config.active_record.collection_cache_versioning = true +Rails.application.config.active_record.collection_cache_versioning = true From 478befaccd16f985d6ccc9375ea9ef8e33dd717f Mon Sep 17 00:00:00 2001 From: Jessica Dussault Date: Thu, 19 Dec 2019 12:53:31 -0600 Subject: [PATCH 3/7] Not sure how we want to handle long term but required in rails 6 --- config/environments/development.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/environments/development.rb b/config/environments/development.rb index 66429ed..0169c31 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -57,4 +57,7 @@ 1, 32 * 1024 * 1024 ) ) + + # LOCAL change made specifically for CDRH + config.hosts << "cdrhdev1.unl.edu" end From e0857f9736b0a941da9e4aef5705249cb2960f49 Mon Sep 17 00:00:00 2001 From: Jessica Dussault Date: Mon, 6 Jan 2020 09:34:44 -0600 Subject: [PATCH 4/7] re-adds configuration removed in error describes it as a cdrh-specific change in comments --- config/environments/development.rb | 3 ++- config/environments/production.rb | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 0169c31..1e22e09 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -58,6 +58,7 @@ ) ) - # LOCAL change made specifically for CDRH + # CDRH CONFIGURATION + config.hosts << "cdrhdev1.unl.edu" end diff --git a/config/environments/production.rb b/config/environments/production.rb index 8cb401a..6ff6ee6 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -102,4 +102,9 @@ # config.active_record.database_selector = { delay: 2.seconds } # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session + + # CDRH CONFIGURATION + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + config.force_ssl = true end From 72825baf5d81fae380d80878493e093b81f68145 Mon Sep 17 00:00:00 2001 From: Jessica Dussault Date: Mon, 6 Jan 2020 10:05:57 -0600 Subject: [PATCH 5/7] updates gems --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index cdf040b..3d98fb3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -127,7 +127,7 @@ GEM thor (>= 0.20.3, < 2.0) rake (13.0.1) rb-fsevent (0.10.3) - rb-inotify (0.10.0) + rb-inotify (0.10.1) ffi (~> 1.0) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) From 88fa69a15bed183e64605cc19dfd8856ff8115ae Mon Sep 17 00:00:00 2001 From: Jessica Dussault Date: Mon, 6 Jan 2020 11:07:47 -0600 Subject: [PATCH 6/7] missed a few lines from old configuration --- config/environments/production.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index 6ff6ee6..1af1588 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -107,4 +107,7 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true + # Handle STS here instead of Apache, or Rails duplicates header contents + # Also unset cache-control header in HTTPS vhost for same reason + config.ssl_options = { hsts: { preload: true } } end From 0194f67c62fd3c0c937204aaf218e00ed1cbdebb Mon Sep 17 00:00:00 2001 From: William Dewey Date: Wed, 18 May 2022 13:48:00 -0500 Subject: [PATCH 7/7] update gems again --- Gemfile.lock | 164 ++++++++++++++++++++++++++------------------------- 1 file changed, 83 insertions(+), 81 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3d98fb3..c38a145 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,132 +1,134 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.0.2.1) - actionpack (= 6.0.2.1) + actioncable (6.0.5) + actionpack (= 6.0.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.2.1) - actionpack (= 6.0.2.1) - activejob (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + actionmailbox (6.0.5) + actionpack (= 6.0.5) + activejob (= 6.0.5) + activerecord (= 6.0.5) + activestorage (= 6.0.5) + activesupport (= 6.0.5) mail (>= 2.7.1) - actionmailer (6.0.2.1) - actionpack (= 6.0.2.1) - actionview (= 6.0.2.1) - activejob (= 6.0.2.1) + actionmailer (6.0.5) + actionpack (= 6.0.5) + actionview (= 6.0.5) + activejob (= 6.0.5) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.2.1) - actionview (= 6.0.2.1) - activesupport (= 6.0.2.1) + actionpack (6.0.5) + actionview (= 6.0.5) + activesupport (= 6.0.5) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.2.1) - actionpack (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + actiontext (6.0.5) + actionpack (= 6.0.5) + activerecord (= 6.0.5) + activestorage (= 6.0.5) + activesupport (= 6.0.5) nokogiri (>= 1.8.5) - actionview (6.0.2.1) - activesupport (= 6.0.2.1) + actionview (6.0.5) + activesupport (= 6.0.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.2.1) - activesupport (= 6.0.2.1) + activejob (6.0.5) + activesupport (= 6.0.5) globalid (>= 0.3.6) - activemodel (6.0.2.1) - activesupport (= 6.0.2.1) - activerecord (6.0.2.1) - activemodel (= 6.0.2.1) - activesupport (= 6.0.2.1) - activestorage (6.0.2.1) - actionpack (= 6.0.2.1) - activejob (= 6.0.2.1) - activerecord (= 6.0.2.1) - marcel (~> 0.3.1) - activesupport (6.0.2.1) + activemodel (6.0.5) + activesupport (= 6.0.5) + activerecord (6.0.5) + activemodel (= 6.0.5) + activesupport (= 6.0.5) + activestorage (6.0.5) + actionpack (= 6.0.5) + activejob (= 6.0.5) + activerecord (= 6.0.5) + marcel (~> 1.0) + activesupport (6.0.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - zeitwerk (~> 2.2) - bootsnap (1.4.5) - msgpack (~> 1.0) + zeitwerk (~> 2.2, >= 2.2.2) + bootsnap (1.11.1) + msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) crass (1.0.6) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) erubi (1.10.0) - ffi (1.15.3) - globalid (0.5.2) + ffi (1.15.5) + globalid (1.0.0) activesupport (>= 5.0) http-accept (1.7.0) http-cookie (1.0.4) domain_name (~> 0.5) - i18n (1.8.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - loofah (2.12.0) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (1.0.1) + marcel (1.0.2) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0704) - mini_mime (1.1.1) - mini_portile2 (2.6.1) - minitest (5.14.4) - msgpack (1.4.2) + mime-types-data (3.2022.0105) + mini_mime (1.1.2) + mini_portile2 (2.8.0) + minitest (5.15.0) + msgpack (1.5.1) netrc (0.11.0) - nio4r (2.5.2) - nokogiri (1.10.7) - mini_portile2 (~> 2.4.0) - puma (3.12.2) - rack (2.0.8) + nio4r (2.5.8) + nokogiri (1.13.6) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + puma (3.12.6) + racc (1.6.0) + rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.2.1) - actioncable (= 6.0.2.1) - actionmailbox (= 6.0.2.1) - actionmailer (= 6.0.2.1) - actionpack (= 6.0.2.1) - actiontext (= 6.0.2.1) - actionview (= 6.0.2.1) - activejob (= 6.0.2.1) - activemodel (= 6.0.2.1) - activerecord (= 6.0.2.1) - activestorage (= 6.0.2.1) - activesupport (= 6.0.2.1) + rails (6.0.5) + actioncable (= 6.0.5) + actionmailbox (= 6.0.5) + actionmailer (= 6.0.5) + actionpack (= 6.0.5) + actiontext (= 6.0.5) + actionview (= 6.0.5) + activejob (= 6.0.5) + activemodel (= 6.0.5) + activerecord (= 6.0.5) + activestorage (= 6.0.5) + activesupport (= 6.0.5) bundler (>= 1.3.0) - railties (= 6.0.2.1) + railties (= 6.0.5) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (6.0.2.1) - actionpack (= 6.0.2.1) - activesupport (= 6.0.2.1) + railties (6.0.5) + actionpack (= 6.0.5) + activesupport (= 6.0.5) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) - rake (13.0.1) - rb-fsevent (0.10.3) + rake (13.0.6) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) rest-client (2.1.0) @@ -139,25 +141,25 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.0.2) + sprockets (4.0.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) sqlite3 (1.4.2) - thor (1.0.1) + thor (1.2.1) thread_safe (0.3.6) tzinfo (1.2.9) thread_safe (~> 0.1) unf (0.1.4) unf_ext - unf_ext (0.0.7.7) + unf_ext (0.0.8.1) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.4) - zeitwerk (2.2.2) + websocket-extensions (0.1.5) + zeitwerk (2.5.4) PLATFORMS ruby