diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 952f449f1..000000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.6.6 \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev index ae0c4a12a..0cecb8292 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -2,8 +2,9 @@ FROM ruby:2.6.6-alpine # Build ENV vars ENV APP_PATH /var/app -ENV BUNDLE_VERSION 2.1.4 +ENV BUNDLE_VERSION 2.4.12 ENV BUNDLE_PATH /usr/local/bundle/gems +ENV GEM_HOME /usr/local/bundle/gems ENV TMP_PATH /tmp/ ENV RAILS_LOG_TO_STDOUT true @@ -49,12 +50,18 @@ RUN rm -rf /var/cache/apk/* \ RUN gem install bundler --version "$BUNDLE_VERSION" \ && rm -rf $GEM_HOME/cache/* +RUN gem install rubygems-update -v 3.4.22 + +RUN gem update --system + # install ember RUN npm install -g ember-cli # Change to app dir WORKDIR $APP_PATH +RUN gem install next_rails + EXPOSE $RAILS_PORT ENTRYPOINT [ "bundle", "exec" ] \ No newline at end of file diff --git a/Gemfile b/Gemfile index c2cbb5f11..22b9aaf0f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ +def next? + File.basename(__FILE__) == "Gemfile.next" +end source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } @@ -8,7 +11,13 @@ else end # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' -gem 'rails', '~> 6.1.5' +if next? + # Do things "the Rails 7.1 way" + gem 'rails', '~> 7.1' +else + # Do things "the Rails 6.1 way" + gem 'rails', '~> 6.1.5' +end # Use postgresql as the database for Active Record gem 'pg', '~> 1.1' # Use Puma as the app server @@ -27,7 +36,14 @@ gem 'jbuilder', '~> 2.7' # Use Active Storage variant gem 'image_processing', '~> 1.12' -gem 'ros-apartment', require: 'apartment' + +if next? + # Do things "the Rails 7.1 way" + gem 'ros-apartment', '3.1.0', require: 'apartment' +else + # Do things "the Rails 6.1 way" + gem 'ros-apartment', '2.9.0', require: 'apartment' +end gem 'ros-apartment-sidekiq', require: 'apartment-sidekiq' gem 'apartment-activejob' gem 'devise' @@ -38,7 +54,14 @@ gem 'gravatar_image_tag' gem 'wicked' # for multi-step forms gem 'devise_invitable' gem "aws-sdk-s3", require: false -gem 'meta-tags' +if next? + # Do things "the Rails 7.1 way" + gem 'meta-tags', "2.22.0" +else + # Do things "the Rails 6.1 way" + gem 'meta-tags', "2.14.0" +end + gem 'sitemap_generator' gem 'ahoy_matey' gem 'ransack' @@ -106,7 +129,15 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem "graphql", "~> 2.0" gem 'graphiql-rails' -gem "ember-cli-rails", "0.10.0" + +if next? + # Do things "the Rails 7.1 way" + p 'not loading ember-cli-rails in rails 7' +else + # Do things "the Rails 6.1 way" + gem "ember-cli-rails", "0.10.0" +end + # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 4.1.0' gem "exception_notification", "~> 4.5" @@ -120,7 +151,14 @@ gem "redis-namespace", "~> 1.8" gem 'stripe-rails' -gem 'devise-two-factor', "4.0.2" + +if next? + # Do things "the Rails 7.1 way" + gem 'devise-two-factor', "5.1.0" +else + # Do things "the Rails 6.1 way" + gem 'devise-two-factor', "4.0.2" +end gem "slowpoke" @@ -128,3 +166,5 @@ gem "strong_migrations" gem "simple_calendar", "~> 3.0" gem "icalendar", "~> 2.9" + +gem "next_rails", "~> 1.3" diff --git a/Gemfile.lock b/Gemfile.lock index 0b0451feb..a124ea5ff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,40 +38,40 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.1.5) - actionpack (= 6.1.5) - activesupport (= 6.1.5) + actioncable (6.1.7.8) + actionpack (= 6.1.7.8) + activesupport (= 6.1.7.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.5) - actionpack (= 6.1.5) - activejob (= 6.1.5) - activerecord (= 6.1.5) - activestorage (= 6.1.5) - activesupport (= 6.1.5) + actionmailbox (6.1.7.8) + actionpack (= 6.1.7.8) + activejob (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) mail (>= 2.7.1) - actionmailer (6.1.5) - actionpack (= 6.1.5) - actionview (= 6.1.5) - activejob (= 6.1.5) - activesupport (= 6.1.5) + actionmailer (6.1.7.8) + actionpack (= 6.1.7.8) + actionview (= 6.1.7.8) + activejob (= 6.1.7.8) + activesupport (= 6.1.7.8) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.1.5) - actionview (= 6.1.5) - activesupport (= 6.1.5) + actionpack (6.1.7.8) + actionview (= 6.1.7.8) + activesupport (= 6.1.7.8) rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.5) - actionpack (= 6.1.5) - activerecord (= 6.1.5) - activestorage (= 6.1.5) - activesupport (= 6.1.5) + actiontext (6.1.7.8) + actionpack (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) nokogiri (>= 1.8.5) - actionview (6.1.5) - activesupport (= 6.1.5) + actionview (6.1.7.8) + activesupport (= 6.1.7.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -79,22 +79,22 @@ GEM active_link_to (1.0.5) actionpack addressable - activejob (6.1.5) - activesupport (= 6.1.5) + activejob (6.1.7.8) + activesupport (= 6.1.7.8) globalid (>= 0.3.6) - activemodel (6.1.5) - activesupport (= 6.1.5) - activerecord (6.1.5) - activemodel (= 6.1.5) - activesupport (= 6.1.5) - activestorage (6.1.5) - actionpack (= 6.1.5) - activejob (= 6.1.5) - activerecord (= 6.1.5) - activesupport (= 6.1.5) + activemodel (6.1.7.8) + activesupport (= 6.1.7.8) + activerecord (6.1.7.8) + activemodel (= 6.1.7.8) + activesupport (= 6.1.7.8) + activestorage (6.1.7.8) + actionpack (= 6.1.7.8) + activejob (= 6.1.7.8) + activerecord (= 6.1.7.8) + activesupport (= 6.1.7.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.5) + activesupport (6.1.7.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -138,7 +138,7 @@ GEM bindex (0.8.1) bootsnap (1.7.3) msgpack (~> 1.0) - builder (3.2.4) + builder (3.3.0) byebug (11.1.3) capistrano (3.16.0) airbrussh (>= 1.0.0) @@ -174,13 +174,15 @@ GEM cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) coderay (1.1.3) + colorize (1.1.0) comfy_bootstrap_form (4.0.9) rails (>= 5.0.0) - concurrent-ruby (1.1.10) + concurrent-ruby (1.3.4) connection_pool (2.2.5) crack (0.4.5) rexml crass (1.0.6) + date (3.3.4) device_detector (1.0.5) devise (4.7.3) bcrypt (~> 3.0) @@ -209,7 +211,7 @@ GEM ember-cli-rails-assets (0.6.2) encryptor (3.0.0) errbase (0.2.1) - erubi (1.10.0) + erubi (1.13.0) exception_notification (4.5.0) actionmailer (>= 5.2, < 8) activesupport (>= 5.2, < 8) @@ -222,8 +224,8 @@ GEM friendly_id (5.4.2) activerecord (>= 4.0.0) geocoder (1.6.6) - globalid (1.0.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) graphiql-rails (1.8.0) railties sprockets-rails @@ -248,7 +250,7 @@ GEM httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) - i18n (1.10.0) + i18n (1.14.5) concurrent-ruby (~> 1.0) icalendar (2.9.0) ice_cube (~> 0.16) @@ -272,18 +274,21 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) local_time (2.1.0) - loofah (2.9.0) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp mailgun-ruby (1.2.4) rest-client (>= 2.0.2) - marcel (1.0.2) + marcel (1.0.4) memory_profiler (1.0.1) meta-tags (2.14.0) actionpack (>= 3.2.0, < 6.2) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2021.0225) @@ -291,20 +296,31 @@ GEM nokogiri (~> 1) rake mini_magick (4.11.0) - mini_mime (1.1.2) - mini_portile2 (2.8.0) - minitest (5.15.0) + mini_mime (1.1.5) + mini_portile2 (2.8.7) + minitest (5.25.1) mocha (1.12.0) msgpack (1.4.2) multi_xml (0.6.0) mustermann (1.1.1) ruby2_keywords (~> 0.0.1) + net-imap (0.3.7) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) + net-smtp (0.5.0) + net-protocol net-ssh (6.1.0) netrc (0.11.0) - nio4r (2.5.8) - nokogiri (1.13.6) + next_rails (1.3.0) + colorize (>= 0.8.1) + nio4r (2.7.3) + nokogiri (1.13.10) mini_portile2 (~> 2.8.0) racc (~> 1.4) orm_adapter (0.5.0) @@ -316,8 +332,8 @@ GEM public_suffix (4.0.6) puma (5.6.4) nio4r (~> 2.0) - racc (1.6.0) - rack (2.2.3.1) + racc (1.8.1) + rack (2.2.9) rack-accept (0.4.5) rack (>= 0.4) rack-cors (1.1.1) @@ -328,43 +344,44 @@ GEM rack rack-proxy (0.6.5) rack - rack-test (1.1.0) - rack (>= 1.0, < 3) + rack-test (2.1.0) + rack (>= 1.3) rack-timeout (0.6.3) - rails (6.1.5) - actioncable (= 6.1.5) - actionmailbox (= 6.1.5) - actionmailer (= 6.1.5) - actionpack (= 6.1.5) - actiontext (= 6.1.5) - actionview (= 6.1.5) - activejob (= 6.1.5) - activemodel (= 6.1.5) - activerecord (= 6.1.5) - activestorage (= 6.1.5) - activesupport (= 6.1.5) + rails (6.1.7.8) + actioncable (= 6.1.7.8) + actionmailbox (= 6.1.7.8) + actionmailer (= 6.1.7.8) + actionpack (= 6.1.7.8) + actiontext (= 6.1.7.8) + actionview (= 6.1.7.8) + activejob (= 6.1.7.8) + activemodel (= 6.1.7.8) + activerecord (= 6.1.7.8) + activestorage (= 6.1.7.8) + activesupport (= 6.1.7.8) bundler (>= 1.15.0) - railties (= 6.1.5) + railties (= 6.1.7.8) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) - loofah (~> 2.3) + rails-html-sanitizer (1.5.0) + loofah (~> 2.19, >= 2.19.1) rails-i18n (7.0.6) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (6.1.5) - actionpack (= 6.1.5) - activesupport (= 6.1.5) + railties (6.1.7.8) + actionpack (= 6.1.7.8) + activesupport (= 6.1.7.8) method_source rake (>= 12.2) thor (~> 1.0) - rake (13.0.6) + rake (13.2.1) ransack (2.4.2) activerecord (>= 5.2.4) activesupport (>= 5.2.4) @@ -440,12 +457,12 @@ GEM rack-timeout (>= 0.4) railties (>= 5.2) spring (2.1.1) - sprockets (4.0.3) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) sshkit (1.21.2) net-scp (>= 1.1.2) @@ -459,8 +476,9 @@ GEM strong_migrations (1.4.4) activerecord (>= 5.2) temple (0.10.0) - thor (1.2.1) + thor (1.3.2) tilt (2.0.10) + timeout (0.4.1) turbo-rails (1.1.1) actionpack (>= 6.0.0) activejob (>= 6.0.0) @@ -470,7 +488,7 @@ GEM rack (>= 1.3, < 3) rack-accept (~> 0.4) tilt (>= 1.4, < 3) - tzinfo (2.0.4) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext @@ -495,7 +513,7 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) whenever (1.0.0) @@ -505,7 +523,7 @@ GEM will_paginate (3.3.0) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.5.4) + zeitwerk (2.6.18) PLATFORMS ruby @@ -548,9 +566,10 @@ DEPENDENCIES local_time mailgun-ruby memory_profiler - meta-tags + meta-tags (= 2.14.0) mocha net-ssh (>= 6.0.2) + next_rails (~> 1.3) pg (~> 1.1) pry puma (~> 5.6) @@ -561,7 +580,7 @@ DEPENDENCIES ransack recaptcha redis-namespace (~> 1.8) - ros-apartment + ros-apartment (= 2.9.0) ros-apartment-sidekiq sass-rails (>= 6) selenium-webdriver @@ -587,7 +606,7 @@ DEPENDENCIES will_paginate RUBY VERSION - ruby 3.0.0p0 + ruby 2.6.6p146 BUNDLED WITH 2.1.4 diff --git a/Gemfile.next b/Gemfile.next new file mode 120000 index 000000000..6ab79009c --- /dev/null +++ b/Gemfile.next @@ -0,0 +1 @@ +Gemfile \ No newline at end of file diff --git a/Gemfile.next.lock b/Gemfile.next.lock new file mode 100644 index 000000000..433578fe4 --- /dev/null +++ b/Gemfile.next.lock @@ -0,0 +1,663 @@ +GIT + remote: https://github.com/restarone/comfortable-mexican-sofa + revision: ccf9415ae220453a199759b8ecbb8e9436c75c85 + tag: 3.5 + specs: + comfortable_mexican_sofa (2.0.19) + active_link_to (>= 1.0.0) + comfy_bootstrap_form (>= 4.0.0) + haml-rails (>= 1.0.0) + image_processing (>= 1.2) + jquery-rails (>= 4.3.1) + kramdown (>= 1.0.0) + mimemagic (>= 0.3.2) + mini_magick (>= 4.8.0) + rails (>= 5.2.0) + rails-i18n (>= 5.0.0) + sassc-rails (>= 2.0.0) + +GIT + remote: https://github.com/restarone/comfy-blog + revision: 767f3848165a3799db76c26ebe2901d5a9c3b93f + branch: master + specs: + comfy_blog (2.0.7) + comfortable_mexican_sofa (>= 2.0.14) + +GIT + remote: https://github.com/restarone/simple_discussion + revision: ccc76a4852210e0bb6195a93e1eb382f6f004c44 + branch: master + specs: + simple_discussion (1.3.0) + font-awesome-sass (>= 5.13.0) + friendly_id (>= 5.2.0) + rails (>= 4.2) + will_paginate (>= 3.1.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.4) + actionpack (= 7.1.4) + activesupport (= 7.1.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.4) + actionpack (= 7.1.4) + activejob (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.4) + actionpack (= 7.1.4) + actionview (= 7.1.4) + activejob (= 7.1.4) + activesupport (= 7.1.4) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.4) + actionview (= 7.1.4) + activesupport (= 7.1.4) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.4) + actionpack (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.4) + activesupport (= 7.1.4) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + active_link_to (1.0.5) + actionpack + addressable + activejob (7.1.4) + activesupport (= 7.1.4) + globalid (>= 0.3.6) + activemodel (7.1.4) + activesupport (= 7.1.4) + activerecord (7.1.4) + activemodel (= 7.1.4) + activesupport (= 7.1.4) + timeout (>= 0.4.0) + activestorage (7.1.4) + actionpack (= 7.1.4) + activejob (= 7.1.4) + activerecord (= 7.1.4) + activesupport (= 7.1.4) + marcel (~> 1.0) + activesupport (7.1.4) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + ahoy_matey (5.2.0) + activesupport (>= 6.1) + device_detector (>= 1) + safely_block (>= 0.4) + airbrussh (1.5.3) + sshkit (>= 1.6.1, != 1.7.0) + apartment (0.24.3) + activerecord (>= 3.1.2) + rack (>= 1.3.6) + apartment-activejob (0.0.1) + activesupport + apartment + aws-eventstream (1.3.0) + aws-partitions (1.971.0) + aws-sdk-core (3.203.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.9) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.89.0) + aws-sdk-core (~> 3, >= 3.203.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.160.0) + aws-sdk-core (~> 3, >= 3.203.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.9.1) + aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + bcrypt (3.1.20) + bcrypt_pbkdf (1.1.1) + bigdecimal (3.1.8) + bindex (0.8.1) + bootsnap (1.18.4) + msgpack (~> 1.2) + builder (3.3.0) + byebug (11.1.3) + capistrano (3.19.1) + airbrussh (>= 1.0.0) + i18n + rake (>= 10.0.0) + sshkit (>= 1.9.0) + capistrano-bundler (2.1.1) + capistrano (~> 3.1) + capistrano-local-precompile (1.2.0) + capistrano (>= 3.8) + capistrano-rails (1.6.3) + capistrano (~> 3.1) + capistrano-bundler (>= 1.1, < 3) + capistrano-rbenv (2.2.0) + capistrano (~> 3.1) + sshkit (~> 1.3) + capistrano3-puma (5.2.0) + capistrano (~> 3.7) + capistrano-bundler + puma (>= 4.0, < 6.0) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + chartkick (5.1.0) + chronic (0.10.2) + climate_control (0.2.0) + cocaine (0.5.8) + climate_control (>= 0.0.3, < 1.0) + coderay (1.1.3) + colorize (1.1.0) + comfy_bootstrap_form (4.0.9) + rails (>= 5.0.0) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) + crack (1.0.0) + bigdecimal + rexml + crass (1.0.6) + csv (3.3.0) + date (3.3.4) + device_detector (1.1.3) + devise (4.9.4) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 4.1.0) + responders + warden (~> 1.2.3) + devise-two-factor (5.1.0) + activesupport (~> 7.0) + devise (~> 4.0) + railties (~> 7.0) + rotp (~> 6.0) + devise_invitable (2.0.9) + actionmailer (>= 5.0) + devise (>= 4.6) + docile (1.4.1) + domain_name (0.6.20240107) + drb (2.2.1) + ed25519 (1.3.0) + ember-cli-rails (0.10.0) + cocaine (~> 0.5.8) + ember-cli-rails-assets (~> 0.6.2) + html_page (~> 0.1.0) + railties (>= 3.2) + ember-cli-rails-assets (0.6.2) + erubi (1.13.0) + exception_notification (4.5.0) + actionmailer (>= 5.2, < 8) + activesupport (>= 5.2, < 8) + faker (3.4.2) + i18n (>= 1.8.11, < 2) + ffi (1.17.0) + fiber-storage (1.0.0) + flamegraph (0.9.5) + font-awesome-sass (6.5.2) + sassc (~> 2.0) + friendly_id (5.5.1) + activerecord (>= 4.0.0) + globalid (1.2.1) + activesupport (>= 6.1) + graphiql-rails (1.10.1) + railties + graphql (2.3.14) + base64 + fiber-storage + gravatar_image_tag (1.2.0) + groupdate (6.4.0) + activesupport (>= 6.1) + haml (6.3.0) + temple (>= 0.8.2) + thor + tilt + haml-rails (2.1.0) + actionpack (>= 5.1) + activesupport (>= 5.1) + haml (>= 4.0.6) + railties (>= 5.1) + hashdiff (1.1.1) + html_page (0.1.0) + http-accept (1.7.0) + http-cookie (1.0.7) + domain_name (~> 0.5) + httparty (0.22.0) + csv + mini_mime (>= 1.0.0) + multi_xml (>= 0.5.2) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + icalendar (2.10.2) + ice_cube (~> 0.16) + ice_cube (0.17.0) + image_processing (1.13.0) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) + io-console (0.7.2) + irb (1.14.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jbuilder (2.12.0) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + jmespath (1.6.2) + jquery-rails (4.6.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jsonapi-serializer (2.2.0) + activesupport (>= 4.2) + kramdown (2.4.0) + rexml + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + local_time (3.0.2) + logger (1.6.1) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + mailgun-ruby (1.2.14) + rest-client (>= 2.0.2) + marcel (1.0.4) + matrix (0.4.2) + memory_profiler (1.0.2) + meta-tags (2.22.0) + actionpack (>= 6.0.0, < 8.1) + method_source (1.1.0) + mime-types (3.5.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2024.0903) + mimemagic (0.4.3) + nokogiri (~> 1) + rake + mini_magick (4.13.2) + mini_mime (1.1.5) + mini_portile2 (2.8.7) + minitest (5.25.1) + mocha (2.4.5) + ruby2_keywords (>= 0.0.5) + msgpack (1.7.2) + multi_xml (0.7.1) + bigdecimal (~> 3.1) + mustermann (3.0.3) + ruby2_keywords (~> 0.0.1) + mutex_m (0.2.0) + net-imap (0.4.16) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-scp (4.0.0) + net-ssh (>= 2.6.5, < 8.0.0) + net-sftp (4.0.0) + net-ssh (>= 5.0.0, < 8.0.0) + net-smtp (0.5.0) + net-protocol + net-ssh (7.2.3) + netrc (0.11.0) + next_rails (1.3.0) + colorize (>= 0.8.1) + nio4r (2.7.3) + nokogiri (1.16.7) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + orm_adapter (0.5.0) + ostruct (0.6.0) + parallel (1.26.3) + pg (1.5.8) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + psych (5.1.2) + stringio + public_suffix (5.1.1) + puma (5.6.8) + nio4r (~> 2.0) + racc (1.8.1) + rack (2.2.9) + rack-accept (0.4.5) + rack (>= 0.4) + rack-cors (2.0.2) + rack (>= 2.0.0) + rack-mini-profiler (3.3.1) + rack (>= 1.2.0) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-proxy (0.7.7) + rack + rack-session (1.0.2) + rack (< 3) + rack-test (2.1.0) + rack (>= 1.3) + rack-timeout (0.7.0) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.4) + actioncable (= 7.1.4) + actionmailbox (= 7.1.4) + actionmailer (= 7.1.4) + actionpack (= 7.1.4) + actiontext (= 7.1.4) + actionview (= 7.1.4) + activejob (= 7.1.4) + activemodel (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) + bundler (>= 1.15.0) + railties (= 7.1.4) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + rails-i18n (7.0.9) + i18n (>= 0.7, < 2) + railties (>= 6.0.0, < 8) + railties (7.1.4) + actionpack (= 7.1.4) + activesupport (= 7.1.4) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.2.1) + ransack (4.2.1) + activerecord (>= 6.1.5) + activesupport (>= 6.1.5) + i18n + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rdoc (6.7.0) + psych (>= 4.0.0) + recaptcha (5.17.0) + redis (5.3.0) + redis-client (>= 0.22.0) + redis-client (0.22.2) + connection_pool + redis-namespace (1.11.0) + redis (>= 4) + regexp_parser (2.9.2) + reline (0.5.10) + io-console (~> 0.5) + responders (3.1.1) + actionpack (>= 5.2) + railties (>= 5.2) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + rexml (3.3.7) + ros-apartment (3.1.0) + activerecord (>= 6.1.0, < 7.2) + parallel (< 2.0) + public_suffix (>= 2.0.5, < 6.0) + rack (>= 1.3.6, < 4.0) + ros-apartment-sidekiq (1.2.0) + ros-apartment (>= 1.0) + sidekiq (>= 2.11) + rotp (6.3.0) + ruby-vips (2.2.2) + ffi (~> 1.12) + logger + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + safely_block (0.4.1) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.4.0) + ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt + selenium-webdriver (4.24.0) + base64 (~> 0.2) + logger (~> 1.4) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + semantic_range (3.0.0) + sidekiq (7.3.2) + concurrent-ruby (< 2) + connection_pool (>= 2.3.0) + logger + rack (>= 2.2.4) + redis-client (>= 0.22.2) + simple_calendar (3.0.4) + rails (>= 6.1) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.13.0) + simplecov_json_formatter (0.1.4) + sinatra (3.2.0) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.2.0) + tilt (~> 2.0) + sitemap_generator (6.3.0) + builder (~> 3.0) + slowpoke (0.5.0) + actionpack + rack-timeout (>= 0.6) + railties (>= 6.1) + spring (4.2.1) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + sshkit (1.23.1) + base64 + net-scp (>= 1.1.2) + net-sftp (>= 2.1.2) + net-ssh (>= 2.8.0) + ostruct + stackprof (0.2.26) + stringio (3.1.1) + stripe (12.5.0) + stripe-rails (2.6.0) + rails (>= 5.1) + responders + stripe (>= 3.15.0) + strong_migrations (2.0.0) + activerecord (>= 6.1) + temple (0.10.3) + thor (1.3.2) + tilt (2.4.0) + timeout (0.4.1) + turbo-rails (1.5.0) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) + turnout (2.5.0) + i18n (>= 0.7, < 2) + rack (>= 1.3, < 3) + rack-accept (~> 0.4) + tilt (>= 1.4, < 3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + warden (1.2.9) + rack (>= 2.0.9) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webdrivers (5.2.0) + nokogiri (~> 1.6) + rubyzip (>= 1.3.0) + selenium-webdriver (~> 4.0) + webmock (3.23.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + webpacker (5.4.4) + activesupport (>= 5.2) + rack-proxy (>= 0.6.1) + railties (>= 5.2) + semantic_range (>= 2.3.0) + webrick (1.8.1) + websocket (1.2.11) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + whenever (1.0.0) + chronic (>= 0.6.3) + wicked (2.0.0) + railties (>= 3.0.7) + will_paginate (4.0.1) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.18) + +PLATFORMS + ruby + +DEPENDENCIES + ahoy_matey + apartment-activejob + aws-sdk-s3 + bcrypt_pbkdf (>= 1.0, < 2.0) + bootsnap (>= 1.7.3) + byebug + capistrano + capistrano-local-precompile + capistrano-rails + capistrano-rbenv + capistrano3-puma + capybara (>= 3.26) + chartkick + comfortable_mexican_sofa! + comfy_blog! + devise + devise-two-factor (= 5.1.0) + devise_invitable + ed25519 (>= 1.2, < 2.0) + ember-cli-rails (= 0.10.0) + exception_notification (~> 4.5) + faker + flamegraph + friendly_id + graphiql-rails + graphql (~> 2.0) + gravatar_image_tag + groupdate + httparty + icalendar (~> 2.9) + image_processing (~> 1.12) + jbuilder (~> 2.7) + jsonapi-serializer + listen (~> 3.3) + local_time + mailgun-ruby + memory_profiler + meta-tags (= 2.22.0) + mocha + net-ssh (>= 6.0.2) + next_rails (~> 1.3) + pg (~> 1.1) + pry + puma (~> 5.6) + rack-cors + rack-mini-profiler (~> 3.0) + rails (~> 7.1) + rails-controller-testing + ransack + recaptcha + redis-namespace (~> 1.8) + ros-apartment (= 3.1.0) + ros-apartment-sidekiq + sass-rails (>= 6) + selenium-webdriver + simple_calendar (~> 3.0) + simple_discussion! + simplecov + sinatra + sitemap_generator + slowpoke + spring + stackprof + stripe-rails + strong_migrations + turbo-rails (~> 1.1) + turnout (~> 2.5) + tzinfo-data + web-console (>= 4.1.0) + webdrivers + webmock + webpacker (~> 5.0) + whenever + wicked + will_paginate + +RUBY VERSION + ruby 3.2.1p31 + +BUNDLED WITH + 2.1.4 diff --git a/bin/ci-pre-deploy b/bin/ci-pre-deploy old mode 100644 new mode 100755 diff --git a/config/application.rb b/config/application.rb index 38e6bb7cf..9dbf142ea 100644 --- a/config/application.rb +++ b/config/application.rb @@ -11,8 +11,14 @@ class Application < Rails::Application # Ensuring that ActiveStorage routes are loaded before Comfy's globbing # route. Without this file serving routes are inaccessible. config.railties_order = [ActiveStorage::Engine, :main_app, :all] - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.1 + if NextRails.next? + # Do things "the Rails 7 way" + config.load_defaults 7.1 + else + # Do things "the Rails 6.1 way" + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 6.1 + end # Configuration for the application, engines, and railties goes here. # # These settings can be overridden in specific environments using the files diff --git a/config/boot.rb b/config/boot.rb index 3cda23b4d..988a5ddc4 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,4 +1,4 @@ -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) require "bundler/setup" # Set up gems listed in the Gemfile. require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/config/environments/development.rb b/config/environments/development.rb index bf85f74a9..2e7fb486b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -6,7 +6,7 @@ # In the development environment your application's code is reloaded any time # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false @@ -14,15 +14,18 @@ # Show full error reports. config.consider_all_requests_local = true + # Enable server timing + config.server_timing = true + # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. - if Rails.root.join('tmp', 'caching-dev.txt').exist? + if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true config.cache_store = :memory_store config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.to_i}" + "Cache-Control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false @@ -53,21 +56,8 @@ # Highlight code that triggered database queries in logs. config.active_record.verbose_query_logs = true - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true - - - config.hosts = nil - - - config.action_mailer.default_url_options = { host: ENV['APP_HOST'] } - config.action_mailer.perform_deliveries = true - config.action_mailer.delivery_method = :smtp - config.action_mailer.smtp_settings = { :address => 'mailcatcher', :port => 1025 } - config.action_mailer.raise_delivery_errors = true - config.active_job.queue_adapter = :sidekiq + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true # Suppress logger output for asset requests. config.assets.quiet = true @@ -78,17 +68,9 @@ # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = 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 - # Uncomment if you wish to allow Action Cable access from any origin. # config.action_cable.disable_request_forgery_protection = true - # Timeout long running requests - config.slowpoke.timeout = lambda do |env| - request = Rack::Request.new(env) - # disable timeout for ember routes - request.path.start_with?("/app") ? 0 : ENV['VIOLET_SERVICE_TIMEOUT'].to_i.nonzero? || 15 - end -end \ No newline at end of file + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true +end diff --git a/config/initializers/ahoy.rb b/config/initializers/ahoy.rb index 591cdeab5..ef441bbf0 100755 --- a/config/initializers/ahoy.rb +++ b/config/initializers/ahoy.rb @@ -16,7 +16,16 @@ def tracking_enabled? end end -Ahoy::Controller.prepend(AhoyControllerPatch) +if NextRails.next? + # Do things "the Rails 7 way" + Rails.application.config.to_prepare do + Ahoy::Controller.prepend(AhoyControllerPatch) + end + +else + # Do things "the Rails 6 way" + Ahoy::Controller.prepend(AhoyControllerPatch) +end # set to true for JavaScript tracking Ahoy.api = false diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 2927d1ada..2bd7ead19 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -14,25 +14,51 @@ def skip_format? end end -class RSolutionsDeviseController < ApplicationController - class Responder < ActionController::Responder - def to_turbo_stream - controller.render(options.merge(formats: :html)) - rescue ActionView::MissingTemplate => error - if get? - raise error - elsif has_errors? && default_action - render rendering_options.merge(formats: :html, status: :unprocessable_entity) - else - redirect_to navigation_location +if NextRails.next? + # Do things "the Rails 7 way" + Rails.application.config.to_prepare do + class RSolutionsDeviseController < ApplicationController + class Responder < ActionController::Responder + def to_turbo_stream + controller.render(options.merge(formats: :html)) + rescue ActionView::MissingTemplate => error + if get? + raise error + elsif has_errors? && default_action + render rendering_options.merge(formats: :html, status: :unprocessable_entity) + else + redirect_to navigation_location + end + end end + + self.responder = Responder + respond_to :html, :turbo_stream end end - - self.responder = Responder - respond_to :html, :turbo_stream +else +# Do things "the Rails 6.1 way" + class RSolutionsDeviseController < ApplicationController + class Responder < ActionController::Responder + def to_turbo_stream + controller.render(options.merge(formats: :html)) + rescue ActionView::MissingTemplate => error + if get? + raise error + elsif has_errors? && default_action + render rendering_options.merge(formats: :html, status: :unprocessable_entity) + else + redirect_to navigation_location + end + end + end + + self.responder = Responder + respond_to :html, :turbo_stream + end end + # Assuming you have not yet modified this file, each configuration option below # is set to its default value. Note that some are commented out while others # are not: uncommented lines are intended to protect your configuration from diff --git a/config/initializers/ember.rb b/config/initializers/ember.rb index 28ac73d82..e402827d8 100644 --- a/config/initializers/ember.rb +++ b/config/initializers/ember.rb @@ -1,5 +1,12 @@ if RUBY_VERSION != '3.0.0' - EmberCli.configure do |c| - c.app :client + + if NextRails.next? + # Do things "the Rails 7 way" + p "NO EMBER SUPPORT IN VIOLET RAILS 7" + else + # Do things "the Rails 6 way" + EmberCli.configure do |c| + c.app :client + end end end diff --git a/config/initializers/exception_notification.rb b/config/initializers/exception_notification.rb index 637109182..a947b5cd8 100644 --- a/config/initializers/exception_notification.rb +++ b/config/initializers/exception_notification.rb @@ -3,46 +3,99 @@ require 'exception_notification/sidekiq' +if NextRails.next? + # Do things "the Rails 7 way" + Rails.application.config.to_prepare do + + ExceptionNotification.configure do |config| + # Ignore additional exception types. + # ActiveRecord::RecordNotFound, Mongoid::Errors::DocumentNotFound, AbstractController::ActionNotFound and ActionController::RoutingError are already added. + config.ignored_exceptions += %w{ActionController::ParameterMissing ActionController::RoutingError ActionController::InvalidAuthenticityToken ActionDispatch::Http::MimeNegotiation::InvalidType ActiveRecord::RecordNotFound} + + # Adds a condition to decide when an exception must be ignored or not. + # The ignore_if method can be invoked multiple times to add extra conditions. + # config.ignore_if do |exception, options| + # not Rails.env.production? + # end + + # Ignore exceptions generated by crawlers + config.ignore_crawlers %w{Googlebot bingbot} + + # Notifiers ================================================================= + + # app/services/exception_notifier/violet_rails_error_notifier.rb + config.add_notifier :violet_rails_error, { + app: { + host: ENV["APP_HOST"] + } + } + + # Campfire notifier sends notifications to your Campfire room. Requires 'tinder' gem. + # config.add_notifier :campfire, { + # subdomain: 'my_subdomain', + # token: 'my_token', + # room_name: 'my_room' + # } + + # HipChat notifier sends notifications to your HipChat room. Requires 'hipchat' gem. + # config.add_notifier :hipchat, { + # api_token: 'my_token', + # room_name: 'my_room' + # } + + # Webhook notifier sends notifications over HTTP protocol. Requires 'httparty' gem. + # config.add_notifier :webhook, { + # url: 'http://example.com:5555/hubot/path', + # http_method: :post + # } + end + + end -ExceptionNotification.configure do |config| - # Ignore additional exception types. - # ActiveRecord::RecordNotFound, Mongoid::Errors::DocumentNotFound, AbstractController::ActionNotFound and ActionController::RoutingError are already added. - config.ignored_exceptions += %w{ActionController::ParameterMissing ActionController::RoutingError ActionController::InvalidAuthenticityToken ActionDispatch::Http::MimeNegotiation::InvalidType ActiveRecord::RecordNotFound} +else + # Do things "the Rails 6 way" - # Adds a condition to decide when an exception must be ignored or not. - # The ignore_if method can be invoked multiple times to add extra conditions. - # config.ignore_if do |exception, options| - # not Rails.env.production? - # end - - # Ignore exceptions generated by crawlers - config.ignore_crawlers %w{Googlebot bingbot} - - # Notifiers ================================================================= - - # app/services/exception_notifier/violet_rails_error_notifier.rb - config.add_notifier :violet_rails_error, { - app: { - host: ENV["APP_HOST"] + ExceptionNotification.configure do |config| + # Ignore additional exception types. + # ActiveRecord::RecordNotFound, Mongoid::Errors::DocumentNotFound, AbstractController::ActionNotFound and ActionController::RoutingError are already added. + config.ignored_exceptions += %w{ActionController::ParameterMissing ActionController::RoutingError ActionController::InvalidAuthenticityToken ActionDispatch::Http::MimeNegotiation::InvalidType ActiveRecord::RecordNotFound} + + # Adds a condition to decide when an exception must be ignored or not. + # The ignore_if method can be invoked multiple times to add extra conditions. + # config.ignore_if do |exception, options| + # not Rails.env.production? + # end + + # Ignore exceptions generated by crawlers + config.ignore_crawlers %w{Googlebot bingbot} + + # Notifiers ================================================================= + + # app/services/exception_notifier/violet_rails_error_notifier.rb + config.add_notifier :violet_rails_error, { + app: { + host: ENV["APP_HOST"] + } } - } - - # Campfire notifier sends notifications to your Campfire room. Requires 'tinder' gem. - # config.add_notifier :campfire, { - # subdomain: 'my_subdomain', - # token: 'my_token', - # room_name: 'my_room' - # } - - # HipChat notifier sends notifications to your HipChat room. Requires 'hipchat' gem. - # config.add_notifier :hipchat, { - # api_token: 'my_token', - # room_name: 'my_room' - # } + + # Campfire notifier sends notifications to your Campfire room. Requires 'tinder' gem. + # config.add_notifier :campfire, { + # subdomain: 'my_subdomain', + # token: 'my_token', + # room_name: 'my_room' + # } + + # HipChat notifier sends notifications to your HipChat room. Requires 'hipchat' gem. + # config.add_notifier :hipchat, { + # api_token: 'my_token', + # room_name: 'my_room' + # } + + # Webhook notifier sends notifications over HTTP protocol. Requires 'httparty' gem. + # config.add_notifier :webhook, { + # url: 'http://example.com:5555/hubot/path', + # http_method: :post + # } + end - # Webhook notifier sends notifications over HTTP protocol. Requires 'httparty' gem. - # config.add_notifier :webhook, { - # url: 'http://example.com:5555/hubot/path', - # http_method: :post - # } end diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb index f0411a4d3..a644338e8 100644 --- a/config/initializers/geocoder.rb +++ b/config/initializers/geocoder.rb @@ -1,6 +1,20 @@ -Geocoder.configure( - # IP address geocoding service (default :ipinfo_io) - ip_lookup: :ipapi_com, - # https://github.com/alexreisner/geocoder#caching - cache: Redis.new -) \ No newline at end of file +if NextRails.next? + # Do things "the Rails 7 way" + Rails.application.config.to_prepare do + Geocoder.configure( + # IP address geocoding service (default :ipinfo_io) + ip_lookup: :ipapi_com, + # https://github.com/alexreisner/geocoder#caching + cache: Redis.new + ) + end + +else + # Do things "the Rails 6 way" + Geocoder.configure( + # IP address geocoding service (default :ipinfo_io) + ip_lookup: :ipapi_com, + # https://github.com/alexreisner/geocoder#caching + cache: Redis.new + ) +end diff --git a/config/initializers/new_framework_defaults_7_1.rb b/config/initializers/new_framework_defaults_7_1.rb new file mode 100644 index 000000000..3dc295db6 --- /dev/null +++ b/config/initializers/new_framework_defaults_7_1.rb @@ -0,0 +1,280 @@ +# Be sure to restart your server when you modify this file. +# +# This file eases your Rails 7.1 framework defaults upgrade. +# +# Uncomment each configuration one by one to switch to the new default. +# Once your application is ready to run with all new defaults, you can remove +# this file and set the `config.load_defaults` to `7.1`. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. +# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html + +### +# No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able +# to manually require files that are managed by the autoloader, which you shouldn't do anyway. +# +# This will reduce the size of the load path, making `require` faster if you don't use bootsnap, or reduce the size +# of the bootsnap cache if you use it. +# +# To set this configuration, add the following line to `config/application.rb` (NOT this file): +# config.add_autoload_paths_to_load_path = false + +### +# Remove the default X-Download-Options headers since it is used only by Internet Explorer. +# If you need to support Internet Explorer, add back `"X-Download-Options" => "noopen"`. +#++ +# Rails.application.config.action_dispatch.default_headers = { +# "X-Frame-Options" => "SAMEORIGIN", +# "X-XSS-Protection" => "0", +# "X-Content-Type-Options" => "nosniff", +# "X-Permitted-Cross-Domain-Policies" => "none", +# "Referrer-Policy" => "strict-origin-when-cross-origin" +# } + +### +# Do not treat an `ActionController::Parameters` instance +# as equal to an equivalent `Hash` by default. +#++ +# Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false + +### +# Active Record Encryption now uses SHA-256 as its hash digest algorithm. +# +# There are 3 scenarios to consider. +# +# 1. If you have data encrypted with previous Rails versions, and you have +# +config.active_support.key_generator_hash_digest_class+ configured as SHA1 (the default +# before Rails 7.0), you need to configure SHA-1 for Active Record Encryption too: +#++ +# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA1 +# +# 2. If you have +config.active_support.key_generator_hash_digest_class+ configured as SHA256 (the new default +# in 7.0), then you need to configure SHA-256 for Active Record Encryption: +#++ +# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256 +# +# 3. If you don't currently have data encrypted with Active Record encryption, you can disable this setting to +# configure the default behavior starting 7.1+: +#++ +# Rails.application.config.active_record.encryption.support_sha1_for_non_deterministic_encryption = false + +### +# No longer run after_commit callbacks on the first of multiple Active Record +# instances to save changes to the same database row within a transaction. +# Instead, run these callbacks on the instance most likely to have internal +# state which matches what was committed to the database, typically the last +# instance to save. +#++ +# Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false + +### +# Configures SQLite with a strict strings mode, which disables double-quoted string literals. +# +# SQLite has some quirks around double-quoted string literals. +# It first tries to consider double-quoted strings as identifier names, but if they don't exist +# it then considers them as string literals. Because of this, typos can silently go unnoticed. +# For example, it is possible to create an index for a non existing column. +# See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted for more details. +#++ +# Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true + +### +# Disable deprecated singular associations names. +#++ +# Rails.application.config.active_record.allow_deprecated_singular_associations_name = false + +### +# Enable the Active Job `BigDecimal` argument serializer, which guarantees +# roundtripping. Without this serializer, some queue adapters may serialize +# `BigDecimal` arguments as simple (non-roundtrippable) strings. +# +# When deploying an application with multiple replicas, old (pre-Rails 7.1) +# replicas will not be able to deserialize `BigDecimal` arguments from this +# serializer. Therefore, this setting should only be enabled after all replicas +# have been successfully upgraded to Rails 7.1. +#++ +# Rails.application.config.active_job.use_big_decimal_serializer = true + +### +# Specify if an `ArgumentError` should be raised if `Rails.cache` `fetch` or +# `write` are given an invalid `expires_at` or `expires_in` time. +# Options are `true`, and `false`. If `false`, the exception will be reported +# as `handled` and logged instead. +#++ +# Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true + +### +# Specify whether Query Logs will format tags using the SQLCommenter format +# (https://open-telemetry.github.io/opentelemetry-sqlcommenter/), or using the legacy format. +# Options are `:legacy` and `:sqlcommenter`. +#++ +# Rails.application.config.active_record.query_log_tags_format = :sqlcommenter + +### +# Specify the default serializer used by `MessageEncryptor` and `MessageVerifier` +# instances. +# +# The legacy default is `:marshal`, which is a potential vector for +# deserialization attacks in cases where a message signing secret has been +# leaked. +# +# In Rails 7.1, the new default is `:json_allow_marshal` which serializes and +# deserializes with `ActiveSupport::JSON`, but can fall back to deserializing +# with `Marshal` so that legacy messages can still be read. +# +# In Rails 7.2, the default will become `:json` which serializes and +# deserializes with `ActiveSupport::JSON` only. +# +# Alternatively, you can choose `:message_pack` or `:message_pack_allow_marshal`, +# which serialize with `ActiveSupport::MessagePack`. `ActiveSupport::MessagePack` +# can roundtrip some Ruby types that are not supported by JSON, and may provide +# improved performance, but it requires the `msgpack` gem. +# +# For more information, see +# https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-message-serializer +# +# If you are performing a rolling deploy of a Rails 7.1 upgrade, wherein servers +# that have not yet been upgraded must be able to read messages from upgraded +# servers, first deploy without changing the serializer, then set the serializer +# in a subsequent deploy. +#++ +# Rails.application.config.active_support.message_serializer = :json_allow_marshal + +### +# Enable a performance optimization that serializes message data and metadata +# together. This changes the message format, so messages serialized this way +# cannot be read by older versions of Rails. However, messages that use the old +# format can still be read, regardless of whether this optimization is enabled. +# +# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have +# not yet been upgraded must be able to read messages from upgraded servers, +# leave this optimization off on the first deploy, then enable it on a +# subsequent deploy. +#++ +# Rails.application.config.active_support.use_message_serializer_for_metadata = true + +### +# Set the maximum size for Rails log files. +# +# `config.load_defaults 7.1` does not set this value for environments other than +# development and test. +#++ +# if Rails.env.local? +# Rails.application.config.log_file_size = 100 * 1024 * 1024 +# end + +### +# Enable raising on assignment to attr_readonly attributes. The previous +# behavior would allow assignment but silently not persist changes to the +# database. +#++ +# Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true + +### +# Enable validating only parent-related columns for presence when the parent is mandatory. +# The previous behavior was to validate the presence of the parent record, which performed an extra query +# to get the parent every time the child record was updated, even when parent has not changed. +#++ +# Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false + +### +# Enable precompilation of `config.filter_parameters`. Precompilation can +# improve filtering performance, depending on the quantity and types of filters. +#++ +# Rails.application.config.precompile_filter_parameters = true + +### +# Enable before_committed! callbacks on all enrolled records in a transaction. +# The previous behavior was to only run the callbacks on the first copy of a record +# if there were multiple copies of the same record enrolled in the transaction. +#++ +# Rails.application.config.active_record.before_committed_on_all_records = true + +### +# Disable automatic column serialization into YAML. +# To keep the historic behavior, you can set it to `YAML`, however it is +# recommended to explicitly define the serialization method for each column +# rather than to rely on a global default. +#++ +# Rails.application.config.active_record.default_column_serializer = nil + +### +# Enable a performance optimization that serializes Active Record models +# in a faster and more compact way. +# +# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have +# not yet been upgraded must be able to read caches from upgraded servers, +# leave this optimization off on the first deploy, then enable it on a +# subsequent deploy. +#++ +# Rails.application.config.active_record.marshalling_format_version = 7.1 + +### +# Run `after_commit` and `after_*_commit` callbacks in the order they are defined in a model. +# This matches the behaviour of all other callbacks. +# In previous versions of Rails, they ran in the inverse order. +#++ +# Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true + +### +# Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`. +#++ +# Rails.application.config.active_record.commit_transaction_on_non_local_return = true + +### +# Controls when to generate a value for has_secure_token declarations. +#++ +# Rails.application.config.active_record.generate_secure_token_on = :initialize + +### +# ** Please read carefully, this must be configured in config/application.rb ** +# +# Change the format of the cache entry. +# +# Changing this default means that all new cache entries added to the cache +# will have a different format that is not supported by Rails 7.0 +# applications. +# +# Only change this value after your application is fully deployed to Rails 7.1 +# and you have no plans to rollback. +# When you're ready to change format, add this to `config/application.rb` (NOT +# this file): +# config.active_support.cache_format_version = 7.1 + +### +# Configure Action View to use HTML5 standards-compliant sanitizers when they are supported on your +# platform. +# +# `Rails::HTML::Sanitizer.best_supported_vendor` will cause Action View to use HTML5-compliant +# sanitizers if they are supported, else fall back to HTML4 sanitizers. +# +# In previous versions of Rails, Action View always used `Rails::HTML4::Sanitizer` as its vendor. +#++ +# Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor + +### +# Configure Action Text to use an HTML5 standards-compliant sanitizer when it is supported on your +# platform. +# +# `Rails::HTML::Sanitizer.best_supported_vendor` will cause Action Text to use HTML5-compliant +# sanitizers if they are supported, else fall back to HTML4 sanitizers. +# +# In previous versions of Rails, Action Text always used `Rails::HTML4::Sanitizer` as its vendor. +#++ +# Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor + +### +# Configure the log level used by the DebugExceptions middleware when logging +# uncaught exceptions during requests. +#++ +# Rails.application.config.action_dispatch.debug_exception_log_level = :error + +### +# Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5 +# parsers. +# +# Nokogiri::HTML5 isn't supported on JRuby, so JRuby applications must set this to :html4. +# +# In previous versions of Rails, these test helpers always used an HTML4 parser. +#++ +# Rails.application.config.dom_testing_default_html_version = :html5 diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index b1976cef3..0ccbc5ec4 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,7 +1,19 @@ require "sidekiq/middleware/current_attributes" -# TODO: We need to persist the Current(user, visit) too in a similiar way. But we save user and vist's record in Current.user and Current.Visit which gets converted to string following this approach. -Sidekiq::CurrentAttributes.persist(ActiveStorage::Current) + + +if NextRails.next? + # Do things "the Rails 7 way" + Rails.application.config.to_prepare do + # TODO: We need to persist the Current(user, visit) too in a similiar way. But we save user and vist's record in Current.user and Current.Visit which gets converted to string following this approach. + Sidekiq::CurrentAttributes.persist(ActiveStorage::Current) + end + +else + # Do things "the Rails 6 way" + # TODO: We need to persist the Current(user, visit) too in a similiar way. But we save user and vist's record in Current.user and Current.Visit which gets converted to string following this approach. + Sidekiq::CurrentAttributes.persist(ActiveStorage::Current) +end Sidekiq.configure_server do |config| config.redis = { url: ENV['REDIS_URL'], namespace: "#{ENV['APP_HOST']}_#{Rails.env}" } diff --git a/docker-compose.yml b/docker-compose.yml index f8d173272..43a5a40d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,6 +78,7 @@ services: command: ['rails', 'server', '-p', '5250', '-b', '0.0.0.0'] environment: RAILS_ENV: development + # BUNDLE_GEMFILE: Gemfile.next depends_on: - solutions_db - solutions_redis diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 830b5ed7f..dfd4227c3 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,6 +7,8 @@ echo "Environment: $RAILS_ENV" # Check if we need to install new gems bundle check || bundle install --jobs 20 --retry 5 +bundle update + # Remove a potentially pre-existing server.pid for Rails. rm -f $APP_PATH/tmp/pids/server.pid