diff --git a/.gitignore b/.gitignore index fd5fb22..db0e05c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ .DS_Store .env .ruby-gemset -.byebug_history \ No newline at end of file +.byebug_history +/vendor \ No newline at end of file diff --git a/Gemfile b/Gemfile index 7772687..74bf373 100644 --- a/Gemfile +++ b/Gemfile @@ -2,9 +2,9 @@ source "https://rubygems.org" ruby File.read(File.join(File.dirname(__FILE__), ".ruby-version")).strip -gem "rails", "~> 5.0.0" +gem "rails", "~> 6.1.0" -gem "attr_encrypted" +gem "attr_encrypted", "~> 3.1.0" gem "bootstrap-sass", "~> 3.3.4" gem "bootstrap-scss" gem "carrierwave" @@ -46,7 +46,7 @@ group :test do gem "database_cleaner" gem "faker" gem "launchy" - gem "show_me_the_cookies", '~> 5.0.1' + gem "show_me_the_cookies", '~> 6.0.0' gem "timecop" end @@ -57,3 +57,5 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] + +gem 'unicorn' diff --git a/Gemfile.lock b/Gemfile.lock index bed085a..24ed5a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,65 +1,87 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.0.7.2) - actionpack (= 5.0.7.2) - nio4r (>= 1.2, < 3.0) - websocket-driver (~> 0.6.1) - actionmailer (5.0.7.2) - actionpack (= 5.0.7.2) - actionview (= 5.0.7.2) - activejob (= 5.0.7.2) + actioncable (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) + mail (>= 2.7.1) + actionmailer (6.1.7.6) + actionpack (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activesupport (= 6.1.7.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.0.7.2) - actionview (= 5.0.7.2) - activesupport (= 5.0.7.2) - rack (~> 2.0) - rack-test (~> 0.6.3) + actionpack (6.1.7.6) + actionview (= 6.1.7.6) + activesupport (= 6.1.7.6) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.7.2) - activesupport (= 5.0.7.2) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.7.6) + actionpack (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) + nokogiri (>= 1.8.5) + actionview (6.1.7.6) + activesupport (= 6.1.7.6) builder (~> 3.1) - erubis (~> 2.7.0) + erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.7.2) - activesupport (= 5.0.7.2) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.1.7.6) + activesupport (= 6.1.7.6) globalid (>= 0.3.6) - activemodel (5.0.7.2) - activesupport (= 5.0.7.2) - activerecord (5.0.7.2) - activemodel (= 5.0.7.2) - activesupport (= 5.0.7.2) - arel (~> 7.0) - activesupport (5.0.7.2) + activemodel (6.1.7.6) + activesupport (= 6.1.7.6) + activerecord (6.1.7.6) + activemodel (= 6.1.7.6) + activesupport (= 6.1.7.6) + activestorage (6.1.7.6) + actionpack (= 6.1.7.6) + activejob (= 6.1.7.6) + activerecord (= 6.1.7.6) + activesupport (= 6.1.7.6) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.7.6) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.8.1) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) - arel (7.1.4) ast (2.4.2) attr_encrypted (3.1.0) encryptor (~> 3.0.0) - autoprefixer-rails (10.4.7.0) + autoprefixer-rails (10.4.16.0) execjs (~> 2) - better_errors (2.9.1) - coderay (>= 1.0.0) + base64 (0.2.0) + better_errors (2.10.1) erubi (>= 1.0.0) rack (>= 0.9.0) + rouge (>= 1.0.0) bindex (0.8.1) bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) bootstrap-scss (0.0.3) - bugsnag (6.25.1) + bugsnag (6.26.0) concurrent-ruby (~> 1.0) builder (3.2.4) byebug (11.1.3) - capybara (3.38.0) + capybara (3.39.2) addressable matrix mini_mime (>= 0.1.3) @@ -71,24 +93,22 @@ GEM capybara-selenium (0.0.6) capybara selenium-webdriver - carrierwave (2.2.3) - activemodel (>= 5.0.0) - activesupport (>= 5.0.0) + carrierwave (3.0.5) + activemodel (>= 6.0.0) + activesupport (>= 6.0.0) addressable (~> 2.6) image_processing (~> 1.1) marcel (~> 1.0.0) - mini_mime (>= 0.1.3) ssrf_filter (~> 1.0) - coderay (1.1.3) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) crass (1.0.6) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.1) + database_cleaner (2.0.2) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.1.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.3.3) + date (3.3.4) diff-lcs (1.5.0) dotenv (2.8.1) dotenv-rails (2.8.1) @@ -98,24 +118,24 @@ GEM activemodel encryptor (3.0.0) erubi (1.12.0) - erubis (2.7.0) - execjs (2.8.1) + execjs (2.9.1) factory_girl (4.9.0) activesupport (>= 3.0.0) factory_girl_rails (4.9.0) factory_girl (~> 4.9.0) railties (>= 3.0.0) - faker (3.1.0) + faker (3.2.2) i18n (>= 1.8.11, < 2) - faraday (2.7.3) + faraday (2.7.12) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) - ffi (1.15.5) - globalid (1.0.1) - activesupport (>= 5.0) + ffi (1.16.3) + globalid (1.2.1) + activesupport (>= 6.1) hashie (5.0.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) @@ -123,12 +143,13 @@ GEM jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) - jquery-rails (4.5.1) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.6) - jwt (2.6.0) + jwt (2.7.1) + kgio (2.11.4) launchy (2.5.2) addressable (~> 2.8) listen (3.0.8) @@ -138,10 +159,10 @@ GEM logstasher (0.6.5) logstash-event (~> 1.2.0) request_store - loofah (2.19.1) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.8.0.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop @@ -150,22 +171,24 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_magick (4.12.0) - mini_mime (1.1.2) - mini_portile2 (2.8.1) - minitest (5.17.0) + mini_mime (1.1.5) + minitest (5.20.0) multi_xml (0.6.0) - net-imap (0.3.4) + net-imap (0.4.7) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol - nio4r (2.5.8) - nokogiri (1.14.0) - mini_portile2 (~> 2.8.0) + nio4r (2.7.0) + nokogiri (1.15.5-arm64-darwin) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) oauth2 (2.0.9) faraday (>= 0.17.3, < 3.0) @@ -174,8 +197,8 @@ GEM rack (>= 1.2, < 4) snaky_hash (~> 2.0) version_gem (~> 1.1) - okcomputer (1.18.4) - omniauth (2.1.0) + okcomputer (1.18.5) + omniauth (2.1.1) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection @@ -187,77 +210,84 @@ GEM omniauth-oauth2 (1.8.0) oauth2 (>= 1.4, < 3) omniauth (~> 2.0) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.4) ast (~> 2.4.1) - pg (1.4.5) + racc + pg (1.5.4) pickadate-rails (3.5.6.0) railties (>= 3.1.0) - public_suffix (5.0.1) + public_suffix (5.0.4) puma (3.12.6) - racc (1.6.2) - rack (2.2.6.2) - rack-protection (3.0.5) - rack - rack-test (0.6.3) - rack (>= 1.0) - rails (5.0.7.2) - actioncable (= 5.0.7.2) - actionmailer (= 5.0.7.2) - actionpack (= 5.0.7.2) - actionview (= 5.0.7.2) - activejob (= 5.0.7.2) - activemodel (= 5.0.7.2) - activerecord (= 5.0.7.2) - activesupport (= 5.0.7.2) - bundler (>= 1.3.0) - railties (= 5.0.7.2) + racc (1.7.3) + rack (2.2.8) + rack-protection (3.1.0) + rack (~> 2.2, >= 2.2.4) + rack-test (2.1.0) + rack (>= 1.3) + rails (6.1.7.6) + actioncable (= 6.1.7.6) + actionmailbox (= 6.1.7.6) + actionmailer (= 6.1.7.6) + actionpack (= 6.1.7.6) + actiontext (= 6.1.7.6) + actionview (= 6.1.7.6) + activejob (= 6.1.7.6) + activemodel (= 6.1.7.6) + activerecord (= 6.1.7.6) + activestorage (= 6.1.7.6) + activesupport (= 6.1.7.6) + bundler (>= 1.15.0) + railties (= 6.1.7.6) sprockets-rails (>= 2.0.0) - 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.4) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (5.0.7.2) - actionpack (= 5.0.7.2) - activesupport (= 5.0.7.2) + railties (6.1.7.6) + actionpack (= 6.1.7.6) + activesupport (= 6.1.7.6) method_source - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) + rake (>= 12.2) + thor (~> 1.0) rainbow (3.1.1) - rake (13.0.6) + raindrops (0.20.1) + rake (13.1.0) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rdoc (4.3.0) - recaptcha (5.12.3) - json - regexp_parser (2.6.2) + recaptcha (5.16.0) + regexp_parser (2.8.3) request_store (1.5.1) rack (>= 1.4) - rexml (3.2.5) - rspec-core (3.12.0) + rexml (3.2.6) + rouge (4.2.0) + rspec-core (3.12.2) rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.3) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-rails (4.1.2) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.12.0) + rspec-rails (6.1.0) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.12) + rspec-expectations (~> 3.12) + rspec-mocks (~> 3.12) + rspec-support (~> 3.12) + rspec-support (3.12.1) rubocop (1.31.0) parallel (~> 1.10) parser (>= 3.1.0.0) @@ -267,10 +297,10 @@ GEM rubocop-ast (>= 1.18.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - ruby-progressbar (1.11.0) - ruby-vips (2.1.4) + rubocop-ast (1.30.0) + parser (>= 3.2.1.0) + ruby-progressbar (1.13.0) + ruby-vips (2.2.0) ffi (~> 1.12) ruby2_keywords (0.0.5) rubyzip (2.3.2) @@ -290,19 +320,17 @@ GEM sdoc (0.4.2) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - selenium-webdriver (4.7.1) + selenium-webdriver (4.9.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - show_me_the_cookies (5.0.1) + show_me_the_cookies (6.0.0) capybara (>= 2, < 4) - simple_form (5.0.3) - actionpack (>= 5.0) - activemodel (>= 5.0) - skylight (4.3.2) - skylight-core (= 4.3.2) - skylight-core (4.3.2) - activesupport (>= 4.2.0) + simple_form (5.3.0) + actionpack (>= 5.2) + activemodel (>= 5.2) + skylight (6.0.1) + activesupport (>= 5.2.0) snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) @@ -310,44 +338,47 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - 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) - ssrf_filter (1.1.1) - thor (1.2.1) - thread_safe (0.3.6) - tilt (2.0.11) - timecop (0.9.6) - timeout (0.3.1) - tzinfo (1.2.10) - thread_safe (~> 0.1) + ssrf_filter (1.1.2) + thor (1.3.0) + tilt (2.3.0) + timecop (0.9.8) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unicode-display_width (2.4.2) - version_gem (1.1.1) - web-console (3.7.0) - actionview (>= 5.0) - activemodel (>= 5.0) + unicode-display_width (2.5.0) + unicorn (6.1.0) + kgio (~> 2.6) + raindrops (~> 0.7) + version_gem (1.1.3) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) bindex (>= 0.4.0) - railties (>= 5.0) - websocket (1.2.9) - websocket-driver (0.6.5) + railties (>= 6.0.0) + websocket (1.2.10) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) + zeitwerk (2.6.12) PLATFORMS - ruby + arm64-darwin-22 x86_64-darwin x86_64-linux DEPENDENCIES - attr_encrypted + attr_encrypted (~> 3.1.0) better_errors bootstrap-sass (~> 3.3.4) bootstrap-scss @@ -372,24 +403,25 @@ DEPENDENCIES pg pickadate-rails puma (~> 3.0) - rails (~> 5.0.0) + rails (~> 6.1.0) rails_12factor recaptcha rspec-rails rubocop sassc-rails sdoc (~> 0.4.0) - show_me_the_cookies (~> 5.0.1) + show_me_the_cookies (~> 6.0.0) simple_form skylight spring-watcher-listen (~> 2.0.0) timecop tzinfo-data uglifier (>= 1.3.0) + unicorn web-console RUBY VERSION ruby 2.7.7p221 BUNDLED WITH - 2.4.4 + 2.4.22 diff --git a/app/controllers/decrypted_secrets_controller.rb b/app/controllers/decrypted_secrets_controller.rb index d462886..a94a790 100644 --- a/app/controllers/decrypted_secrets_controller.rb +++ b/app/controllers/decrypted_secrets_controller.rb @@ -1,7 +1,7 @@ class DecryptedSecretsController < ApplicationController include RetrieveSecret - before_filter :retrieve_secret - before_filter :require_validated_email + before_action :retrieve_secret + before_action :require_validated_email def create begin diff --git a/app/controllers/secrets_controller.rb b/app/controllers/secrets_controller.rb index 91fe1b3..940e20a 100644 --- a/app/controllers/secrets_controller.rb +++ b/app/controllers/secrets_controller.rb @@ -1,7 +1,7 @@ class SecretsController < ApplicationController include RetrieveSecret - before_filter :retrieve_secret, only: :show - before_filter :require_validated_email, only: [:new, :create] + before_action :retrieve_secret, only: :show + before_action :require_validated_email, only: [:new, :create] def show # As the receipient has now clicked a link, we know their email address is also diff --git a/app/models/user.rb b/app/models/user.rb index 23ab7ae..cfd6be9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,11 +3,11 @@ class User < ApplicationRecord # :lockable, :timeoutable and :omniauthable after_create :create_settings - devise :registerable, :confirmable, - :recoverable, :rememberable, :trackable, :validatable + # devise :registerable, :confirmable, + # :recoverable, :rememberable, :trackable, :validatable - devise :two_factor_authenticatable, - otp_secret_encryption_key: Rails.configuration.topsekrit_2fa_key + # devise :two_factor_authenticatable, + # otp_secret_encryption_key: Rails.configuration.topsekrit_2fa_key validate :email_authorised?, on: :create diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f8dea37..b58ecbc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -17,5 +17,11 @@ <%= render partial: 'shared/footer' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> + <% unless ENV['DEFAULT_HOST'] == 'secretlink.org' %> +
+ Rails version <%= Rails::VERSION::STRING %> | + Ruby version <%= RUBY_VERSION %> +
+ <% end %>