diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e856a1d9c..1089e6787 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ['3.0'] + ruby: ['3.0', '3.1', '3.2', '3.3'] + rails_version: [7.0.8] services: postgres: @@ -44,7 +45,7 @@ jobs: - name: Bundler - Install dependencies run: bundle _2.3.5_ install env: - rails_version: 6.1.5 + RAILS_VERSION: ${{ matrix.rails_version }} - name: Node - v14 uses: actions/setup-node@v2 @@ -64,6 +65,11 @@ jobs: - name: Rails - Database setup env: RAILS_ENV: test + POSTGRES_HOST: 127.0.0.1 + POSTGRES_PORT: 5432 + POSTGRES_DB: geoblacklight_test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres run: | bundle exec rails db:schema:load bin/rails db:migrate RAILS_ENV=test @@ -71,11 +77,18 @@ jobs: - name: Rails - Run tests env: RAILS_ENV: test - rails_version: 6.1.5 - ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test' + RAILS_VERSION: ${{ matrix.rails_version }} + RUBYOPT: W0 SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core FARADAY_VERSION: ${{ matrix.faraday_version }} - run: bundle exec rake geoportal:ci --trace + POSTGRES_HOST: 127.0.0.1 + POSTGRES_PORT: 5432 + POSTGRES_DB: geoblacklight_test + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + BLAZER_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/geoblacklight_test + run: | + bundle exec rake geoportal:ci --trace - name: Artifacts - Upload coverage uses: actions/upload-artifact@v2 diff --git a/Gemfile b/Gemfile index be29819e0..eeff0b925 100644 --- a/Gemfile +++ b/Gemfile @@ -2,26 +2,26 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 6.1.0' +gem 'rails', '~> 7.0.0' gem 'bootsnap', '~> 1.9.3', require: false gem 'listen', '~> 3.0' gem 'rack-cors', :require => 'rack/cors' -gem "puma", "~> 5.1" +gem "puma", "~> 5.6" # Run puma with systemd integration gem 'sd_notify', '>= 0.1.0' # Webpacker -gem 'webpacker', '~> 4.x' +gem 'webpacker', '~> 5.x' gem 'sqlite3', '~> 1.4' #gem 'mysql2', '~> 0.5.0' gem 'pg' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' -# Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 1.3.0' +# Use Terser as compressor for JavaScript assets +gem 'terser' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks @@ -81,6 +81,7 @@ gem 'popper_js' gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript' gem 'geoblacklight', '~> 4.1' gem 'geoblacklight_admin', "~> 0.4.0" +gem 'git', ">= 1.13" gem "rubyzip", ">= 1.3.0" gem "awesome_print" @@ -97,7 +98,6 @@ gem 'paper_trail' # Image migration gem 'geoblacklight_sidecar_images', git: "https://github.com/geoblacklight/geoblacklight_sidecar_images.git", branch: "feature/statesman-update" -gem 'carrierwave', '~> 1.2' gem 'mini_magick', '~> 4.9.4' gem "image_processing", ">= 1.2" @@ -105,7 +105,7 @@ gem 'statesman', '~> 10.0' gem 'sidekiq', '~> 6.4' gem 'sidekiq-failures', '~> 1.0.0' gem 'down', '~> 5.0' -gem 'addressable', '~> 2.5.0' +gem 'addressable', '~> 2.0' gem 'handlebars_assets', '~> 0.23.0' gem 'geoblacklight-icons', git: 'https://github.com/geoblacklight/geoblacklight-icons.git', :ref => '84da81140e7ef93e7241b7753c01d7f709216f2b' gem 'solr_wrapper', git: 'https://github.com/cbeer/solr_wrapper.git', branch: 'master' @@ -114,7 +114,7 @@ gem 'rsolr', '>= 1.0' gem 'jquery-rails' # Auth -gem "devise", "4.7.3" +gem "devise", "~> 4.0" gem 'devise-bootstrap-views', '~> 1.0' gem 'devise-guests', '~> 0.6' gem 'devise_invitable', '~> 2.0.0' @@ -132,7 +132,6 @@ gem 'dotenv-rails' gem 'pointless_feedback' gem 'whenever', '~> 1.0.0', require: false gem 'sitemap_generator', '~> 6.0.2' -gem 'exception_notification', '~> 4.4.0' # Appsignal gem 'appsignal' @@ -144,4 +143,5 @@ group :test do gem 'minitest-reporters' end +gem 'net-ftp' gem 'rexml' diff --git a/Gemfile.lock b/Gemfile.lock index 898b55316..0637f7d9b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,76 +43,82 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actioncable (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) 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) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) 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) + net-imap + net-pop + net-smtp + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp rails-dom-testing (~> 2.0) - actionpack (6.1.7.6) - actionview (= 6.1.7.6) - activesupport (= 6.1.7.6) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) 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) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.7.6) - activesupport (= 6.1.7.6) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) active_record_query_trace (1.8.2) activerecord (>= 6.0.0) - active_storage_validations (1.1.3) + active_storage_validations (1.1.4) activejob (>= 5.2.0) activemodel (>= 5.2.0) activestorage (>= 5.2.0) activesupport (>= 5.2.0) - activejob (6.1.7.6) - activesupport (= 6.1.7.6) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - 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) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) activerecord-import (1.5.1) activerecord (>= 4.2) - 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) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (6.1.7.6) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) afm (0.2.2) airrecord (1.0.12) faraday (>= 1.0, < 3.0) @@ -120,23 +126,23 @@ GEM net-http-persistent amazing_print (1.5.0) ansi (1.5.0) - appsignal (3.4.12) + appsignal (3.5.3) rack attr_json (2.3.0) activerecord (>= 6.0.0, < 7.2) autoprefixer-rails (10.4.16.0) execjs (~> 2) awesome_print (1.9.2) - axe-core-api (4.7.0) + axe-core-api (4.8.0) dumb_delegator virtus axiom-types (0.1.1) descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) - base64 (0.2.0) bcp47_spec (0.2.1) bcrypt (3.1.20) + bigdecimal (3.1.5) bindex (0.8.1) blacklight (7.33.1) deprecation @@ -153,11 +159,12 @@ GEM jquery-rails rails (>= 3.0) tether-rails - blazer (2.6.5) - activerecord (>= 5) - chartkick (>= 3.2) - railties (>= 5) - safely_block (>= 0.1.1) + blazer (3.0.3) + activerecord (>= 6.1) + chartkick (>= 5) + csv + railties (>= 6.1) + safely_block (>= 0.4) bootsnap (1.9.4) msgpack (~> 1.0) bootstrap (4.6.2) @@ -181,12 +188,7 @@ GEM capybara-selenium (0.0.6) capybara selenium-webdriver - carrierwave (1.3.3) - activemodel (>= 4.0.0) - activesupport (>= 4.0.0) - mime-types (>= 1.16) - ssrf_filter (~> 1.0, < 1.1.0) - chartkick (5.0.4) + chartkick (5.0.5) chosen-rails (1.10.0) coffee-rails (>= 3.2) railties (>= 3.0) @@ -210,6 +212,7 @@ GEM connection_pool (2.4.1) content_disposition (1.0.0) crass (1.0.6) + csv (3.2.8) database_cleaner (2.0.2) database_cleaner-active_record (>= 2, < 3) database_cleaner-active_record (2.1.0) @@ -222,28 +225,28 @@ GEM activesupport descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (4.7.3) + devise (4.9.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) devise-bootstrap-views (1.1.0) - devise-guests (0.8.1) + devise-guests (0.8.2) devise devise_invitable (2.0.9) actionmailer (>= 5.0) devise (>= 4.6) diff-lcs (1.5.0) - domain_name (0.6.20231109) + domain_name (0.6.20240107) dot-properties (0.1.4) bundler (>= 2.2.33) dotenv (2.8.1) dotenv-rails (2.8.1) dotenv (= 2.8.1) railties (>= 3.2) - down (5.2.2) - addressable (~> 2.5) + down (5.4.1) + addressable (~> 2.8) dry-configurable (1.1.0) dry-core (~> 1.0, < 2) zeitwerk (~> 2.6) @@ -264,7 +267,8 @@ GEM dry-logic (>= 1.4, < 2) dry-types (>= 1.7, < 2) zeitwerk (~> 2.6) - dry-types (1.7.1) + dry-types (1.7.2) + bigdecimal (~> 3.0) concurrent-ruby (~> 1.0) dry-core (~> 1.0) dry-inflector (~> 1.0) @@ -280,24 +284,20 @@ GEM erubi (1.12.0) ethon (0.16.0) ffi (>= 1.15.0) - exception_notification (4.4.3) - actionmailer (>= 4.0, < 7) - activesupport (>= 4.0, < 7) execjs (2.9.1) - factory_bot (6.2.1) + factory_bot (6.4.5) activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (2.7.12) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http faraday-net_http_persistent (2.1.0) faraday (~> 2.5) net-http-persistent (~> 4.0) - fastimage (2.2.7) + fastimage (2.3.0) ffi (1.16.3) ffi-compiler (1.0.1) ffi (>= 1.0.0) @@ -358,7 +358,8 @@ GEM sprockets (< 4) statesman (~> 10.0) geocoder (1.8.2) - git (1.11.0) + git (1.19.0) + addressable (~> 2.8) rchardet (~> 1.8) globalid (1.2.1) activesupport (>= 6.1) @@ -369,14 +370,14 @@ GEM execjs (~> 2.0) sprockets (>= 2.0.0) tilt (>= 1.2) - hashdiff (1.0.1) + hashdiff (1.1.0) hashery (2.1.2) hashie (5.0.0) - http (5.0.1) - addressable (~> 2.3) + http (5.1.1) + addressable (~> 2.8) http-cookie (~> 1.0) http-form_data (~> 2.2) - llhttp-ffi (~> 0.3.0) + llhttp-ffi (~> 0.4.0) http-cookie (1.0.5) domain_name (~> 0.5) http-form_data (2.3.0) @@ -400,8 +401,8 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json-schema (2.8.1) - addressable (>= 2.4) + json-schema (4.1.1) + addressable (>= 2.8) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -429,8 +430,8 @@ GEM simple_form (>= 4.0, < 6.0) traject (~> 3.0, >= 3.1.0.rc1) tty-command (>= 0.8.2, < 2) - launchy (2.4.3) - addressable (~> 2.3) + launchy (2.5.2) + addressable (~> 2.8) ldpath (1.2.0) nokogiri (~> 1.8) parslet @@ -442,7 +443,7 @@ GEM listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - llhttp-ffi (0.3.1) + llhttp-ffi (0.4.0) ffi-compiler (~> 1.0) rake (~> 13.0) loofah (2.22.0) @@ -466,7 +467,7 @@ GEM matrix (0.4.2) memory_profiler (0.9.14) method_source (1.0.0) - mime-types (3.5.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) mime-types-data (3.2023.1205) mimemagic (0.4.3) @@ -486,19 +487,24 @@ GEM ruby-progressbar msgpack (1.7.2) multi_xml (0.6.0) + net-ftp (0.3.4) + net-protocol + time + net-http (0.4.1) + uri net-http-persistent (4.0.2) connection_pool (~> 2.2) - net-imap (0.4.7) + net-imap (0.4.9.1) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.4.0.1) net-protocol nio4r (2.7.0) - nokogiri (1.15.5) + nokogiri (1.16.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) noticed (1.6.3) @@ -506,14 +512,14 @@ GEM rails (>= 5.2.0) orm_adapter (0.5.0) ostruct (0.6.0) - pagy (6.2.0) + pagy (6.3.0) paper_trail (14.0.0) activerecord (>= 6.0) request_store (~> 1.4) parslet (2.0.0) pastel (0.8.0) tty-color (~> 0.5) - pdf-reader (2.11.0) + pdf-reader (2.12.0) Ascii85 (~> 1.0) afm (~> 0.2.1) hashery (~> 2.0) @@ -526,8 +532,8 @@ GEM rails (>= 4.0) typhoeus (~> 0.7, >= 0.7.3) popper_js (1.16.1) - public_suffix (3.1.1) - puma (5.6.7) + public_suffix (5.0.4) + puma (5.6.8) nio4r (~> 2.0) qa (5.11.0) activerecord-import @@ -548,21 +554,20 @@ GEM rack 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) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 6.1.7.6) - sprockets-rails (>= 2.0.0) + railties (= 7.0.8) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -570,12 +575,13 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (6.1.7.6) - actionpack (= 6.1.7.6) - activesupport (= 6.1.7.6) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rake (13.1.0) rb-fsevent (0.11.2) rb-inotify (0.10.1) @@ -587,7 +593,7 @@ GEM rdf-vocab (3.3.0) rdf (~> 3.3) redis (4.8.1) - regexp_parser (2.8.1) + regexp_parser (2.9.0) request_store (1.5.1) rack (>= 1.4) responders (3.1.1) @@ -622,7 +628,6 @@ GEM ruby-rc4 (0.1.5) ruby-vips (2.2.0) ffi (~> 1.12) - ruby2_keywords (0.0.5) rubyzip (2.3.2) safely_block (0.4.0) sanitize (6.1.0) @@ -649,10 +654,11 @@ GEM tilt scrub_rb (1.0.1) sd_notify (0.1.1) - selenium-webdriver (4.12.0) + selenium-webdriver (4.16.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) + semantic_range (3.0.0) shrine (3.5.0) content_disposition (~> 1.0) down (~> 5.1) @@ -660,7 +666,7 @@ GEM down (~> 5.0) http (>= 3.2, < 6) shrine (>= 3.0.0.rc, < 4) - sidekiq (6.5.9) + sidekiq (6.5.12) connection_pool (>= 2.2.5, < 3) rack (~> 2.0) redis (>= 4.5.0, < 5) @@ -672,7 +678,7 @@ GEM sitemap_generator (6.0.2) builder (~> 3.0) slop (4.10.1) - spring (4.1.1) + spring (4.1.3) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -680,17 +686,20 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.6.4) + sqlite3 (1.7.0) mini_portile2 (~> 2.8.0) - ssrf_filter (1.0.8) stackprof (0.2.25) statesman (10.0.0) temple (0.10.3) + terser (1.1.20) + execjs (>= 0.3.0, < 3) tether-rails (1.4.0) rails (>= 3.1) thor (1.3.0) thread_safe (0.3.6) tilt (2.3.0) + time (0.3.0) + date timeout (0.4.1) traject (3.8.1) concurrent-ruby (>= 0.8.0) @@ -718,12 +727,11 @@ GEM ethon (>= 0.8.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext unf_ext (0.0.9.1) - view_component (2.82.0) + uri (0.13.0) + view_component (2.83.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) @@ -738,11 +746,12 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webpacker (4.3.0) - activesupport (>= 4.2) + webpacker (5.4.4) + activesupport (>= 5.2) rack-proxy (>= 0.6.1) - railties (>= 4.2) - websocket (1.2.9) + railties (>= 5.2) + semantic_range (>= 2.3.0) + websocket (1.2.10) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -759,7 +768,7 @@ PLATFORMS DEPENDENCIES active_record_query_trace active_storage_validations - addressable (~> 2.5.0) + addressable (~> 2.0) appsignal awesome_print axe-core-api @@ -773,18 +782,16 @@ DEPENDENCIES capybara capybara-screenshot capybara-selenium - carrierwave (~> 1.2) chosen-rails (~> 1.10) chronic coffee-rails (~> 4.2) database_cleaner - devise (= 4.7.3) + devise (~> 4.0) devise-bootstrap-views (~> 1.0) devise-guests (~> 0.6) devise_invitable (~> 2.0.0) dotenv-rails down (~> 5.0) - exception_notification (~> 4.4.0) factory_bot_rails flamegraph (~> 0.9.5) foreman @@ -792,6 +799,7 @@ DEPENDENCIES geoblacklight-icons! geoblacklight_admin (~> 0.4.0) geoblacklight_sidecar_images! + git (>= 1.13) haml handlebars_assets (~> 0.23.0) image_processing (>= 1.2) @@ -807,15 +815,16 @@ DEPENDENCIES minitest minitest-ci (~> 3.4.0) minitest-reporters + net-ftp noticed paper_trail pg pointless_feedback popper_js - puma (~> 5.1) + puma (~> 5.6) rack-cors rack-mini-profiler (~> 2.3.1) - rails (~> 6.1.0) + rails (~> 7.0.0) rexml rsolr (>= 1.0) rspec-rails (~> 3.5) @@ -831,11 +840,11 @@ DEPENDENCIES sqlite3 (~> 1.4) stackprof (~> 0.2.12) statesman (~> 10.0) + terser turbolinks twitter-typeahead-rails (= 0.11.1.pre.corejavascript) - uglifier (>= 1.3.0) web-console - webpacker (~> 4.x) + webpacker (~> 5.x) whenever (~> 1.0.0) BUNDLED WITH diff --git a/README.md b/README.md index bf8bb577c..29519d32e 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,4 @@ Visit the [project wiki](https://github.com/BTAA-Geospatial-Data-Project/geoport #### Release Version -B1G Geoportal Version v5.3.1 / GeoBlacklight v4.1.0 / GeoBlacklight Admin v0.4.0 +B1G Geoportal Version v5.4.0 / GeoBlacklight v4.1.0 / GeoBlacklight Admin v0.4.0 diff --git a/app/assets/favicon.ico b/app/assets/favicon.ico new file mode 100644 index 000000000..d5388b43c Binary files /dev/null and b/app/assets/favicon.ico differ diff --git a/app/assets/images/aerial_photo_dark.jpg b/app/assets/images/aerial_photo_dark-orig.jpg similarity index 100% rename from app/assets/images/aerial_photo_dark.jpg rename to app/assets/images/aerial_photo_dark-orig.jpg diff --git a/app/assets/images/aerial_photo_dark.jpeg b/app/assets/images/aerial_photo_dark.jpeg index 05f2553f8..1ce8540fd 100644 Binary files a/app/assets/images/aerial_photo_dark.jpeg and b/app/assets/images/aerial_photo_dark.jpeg differ diff --git a/app/assets/images/btaa-logo-white-orig.png b/app/assets/images/btaa-logo-white-orig.png new file mode 100644 index 000000000..e31bf9cb4 Binary files /dev/null and b/app/assets/images/btaa-logo-white-orig.png differ diff --git a/app/assets/images/btaa-logo-white.png b/app/assets/images/btaa-logo-white.png index e31bf9cb4..063df81aa 100644 Binary files a/app/assets/images/btaa-logo-white.png and b/app/assets/images/btaa-logo-white.png differ diff --git a/app/assets/images/homepage/aerial_imagery.png b/app/assets/images/homepage/aerial_imagery.png index 796151519..2c8a8ad67 100644 Binary files a/app/assets/images/homepage/aerial_imagery.png and b/app/assets/images/homepage/aerial_imagery.png differ diff --git a/app/assets/images/homepage/aerial_imagery_orig.png b/app/assets/images/homepage/aerial_imagery_orig.png new file mode 100644 index 000000000..796151519 Binary files /dev/null and b/app/assets/images/homepage/aerial_imagery_orig.png differ diff --git a/app/assets/images/homepage/geospatial_data.png b/app/assets/images/homepage/geospatial_data.png index 7e1ac10b2..4b9f5f764 100644 Binary files a/app/assets/images/homepage/geospatial_data.png and b/app/assets/images/homepage/geospatial_data.png differ diff --git a/app/assets/images/homepage/geospatial_data_orig.png b/app/assets/images/homepage/geospatial_data_orig.png new file mode 100644 index 000000000..7e1ac10b2 Binary files /dev/null and b/app/assets/images/homepage/geospatial_data_orig.png differ diff --git a/app/assets/images/homepage/maps.png b/app/assets/images/homepage/maps.png index 4a8fb4816..6789e1773 100644 Binary files a/app/assets/images/homepage/maps.png and b/app/assets/images/homepage/maps.png differ diff --git a/app/assets/images/homepage/maps_orig.png b/app/assets/images/homepage/maps_orig.png new file mode 100644 index 000000000..4a8fb4816 Binary files /dev/null and b/app/assets/images/homepage/maps_orig.png differ diff --git a/app/assets/javascripts/analytics.js b/app/assets/javascripts/analytics.js deleted file mode 100644 index 879e645a5..000000000 --- a/app/assets/javascripts/analytics.js +++ /dev/null @@ -1,101 +0,0 @@ -// Inspired by and modified from http://railsapps.github.io/rails-google-analytics.html - -GoogleAnalytics = (function() { - function GoogleAnalytics() {} - - GoogleAnalytics.load = function() { - var firstScript, ga; - window._gaq = []; - GoogleAnalytics.analyticsId = GoogleAnalytics.getAnalyticsId(); - window._gaq.push(['_setAccount', GoogleAnalytics.analyticsId]); - ga = document.createElement('script'); - ga.type = 'text/javascript'; - ga.async = true; - ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - firstScript = document.getElementsByTagName('script')[0]; - firstScript.parentNode.insertBefore(ga, firstScript); - }; - - GoogleAnalytics.trackPageview = function(url) { - if (!GoogleAnalytics.isLocalRequest()) { - if (url) { - window._gaq.push(['_trackPageview', url]); - } else { - window._gaq.push(['_trackPageview']); - } - return window._gaq.push(['_trackPageLoadTime']); - } - }; - - GoogleAnalytics.isLocalRequest = function() { - return GoogleAnalytics.documentDomainIncludes('local'); - }; - - GoogleAnalytics.documentDomainIncludes = function(str) { - return document.domain.indexOf(str) !== -1; - }; - - GoogleAnalytics.getAnalyticsId = function() { - return $('[data-analytics-id]').data('analytics-id'); - }; - - return GoogleAnalytics; - -})(); - -Blacklight.onLoad(function() { - GoogleAnalytics.load(); - if (GoogleAnalytics.analyticsId) { - GoogleAnalytics.trackPageview(); - } - - // Log spatial search events - - // Map Moved - History.Adapter.bind(window, 'statechange', function(e) { - var state = History.getState(); - window._gaq.push(['_trackEvent', 'Spatial Search', 'Map Moved', state.url]); - }); - - // Initiate search in an area - $('.leaflet-control.search-control a.btn-primary').on('click', function(e) { - window._gaq.push(['_trackEvent', 'Spatial Search', 'Search Here', e.currentTarget.baseURI]); - }); - - // Log download clicks - $(document).on('click', '[data-download="trigger"]', function(e) { - var data = $(e.target).data(); - window._gaq.push(['_trackEvent', 'Download', data.downloadId, data.downloadType]); - }); - - // Log failed download - $(document).on('DOMNodeInserted', '[data-download="error"]', function(e) { - var data = $(e.target).data(); - window._gaq.push(['_trackEvent', 'Failed Download', data.downloadId, data.downloadType]); - }); - - // Log all show page tool clicks - $(document).on('click', 'div.show-tools li a', function() { - var data = $(this); - window._gaq.push(['_trackEvent', $.trim(data[0].innerText), window.location.href.split("/").pop()]); - }); - - // Log all facet expand/collapse clicks - $('#facets h3').on('click', function(){ - var label = $(this).text(); - var heading_values = ['Facets', 'collapse_expand', label]; - _gaq.push(['_trackEvent'].concat(heading_values)); - }); - - // Log all facet more link clicks - $('#facets li.more_facets a').on('click', function(){ - var label = $(this).find("span").text(); - var heading_values = ['Facets', 'more_link', label]; - _gaq.push(['_trackEvent'].concat(heading_values)); - }); - - // Log all item viewer definition rollovers - $('#viewer-container a[data-toggle="popover"]').hover(function(){ - window._gaq.push(['_trackEvent', 'Item Viewer Popover', window.location.href.split("/").pop()]); - }); -}); diff --git a/app/assets/javascripts/geoportal/viewers/iiif_manifest.js b/app/assets/javascripts/geoportal/viewers/iiif_manifest.js index 59c616b56..6ba55d21a 100644 --- a/app/assets/javascripts/geoportal/viewers/iiif_manifest.js +++ b/app/assets/javascripts/geoportal/viewers/iiif_manifest.js @@ -39,7 +39,6 @@ GeoBlacklight.Viewer.IiifManifest = GeoBlacklight.Viewer.extend({ enabled: false, } }, [ - OSDReferencesPlugin, miradorDownloadDialogPlugin, miradorDownloadPlugin, customIconPlugin diff --git a/app/assets/stylesheets/geoportal/_mirador.scss b/app/assets/stylesheets/geoportal/_mirador.scss index b10cea878..48d565200 100644 --- a/app/assets/stylesheets/geoportal/_mirador.scss +++ b/app/assets/stylesheets/geoportal/_mirador.scss @@ -1,3 +1,4 @@ main.mirador-viewer { margin-top:2rem; + background: none; } diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 3f53a7e0f..e8adab844 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -63,7 +63,9 @@ class CatalogController < ApplicationController 'bf' => ["if(exists(#{Settings.FIELDS.B1G_CHILD_RECORD}),0,100)^0.5"] } - config.default_per_page = 10 # Works! + config.per_page = [10, 20, 50] + config.max_per_page = 50 + config.default_per_page = 10 ## Default parameters to send on single-document requests to Solr. These settings are the Blackligt defaults (see SolrHelper#solr_doc_params) or ## parameters included in the Blacklight-jetty document requestHandler. @@ -346,7 +348,6 @@ class CatalogController < ApplicationController # 'positron' http://cartodb.com/basemaps/ # 'darkMatter' http://cartodb.com/basemaps/ config.basemap_provider = 'esri' - config.max_per_page = 10000 # Configuration for autocomplete suggestor config.autocomplete_enabled = true diff --git a/app/javascript/m3/index.js b/app/javascript/m3/index.js index 4c8fa1465..88391a088 100644 --- a/app/javascript/m3/index.js +++ b/app/javascript/m3/index.js @@ -3,11 +3,9 @@ import Mirador from 'mirador/dist/es/src/index.js'; import miradorDownloadPlugin from 'mirador-dl-plugin/es/miradorDownloadPlugin.js'; import miradorDownloadDialogPlugin from 'mirador-dl-plugin/es/MiradorDownloadDialog.js'; -import OSDReferencesPlugin from 'mirador/dist/es/src/plugins/OSDReferences'; import customIconPlugin from 'm3/plugins/customIconPlugin'; window.Mirador = Mirador; window.miradorDownloadPlugin = miradorDownloadPlugin; window.miradorDownloadDialogPlugin = miradorDownloadDialogPlugin; -window.OSDReferencesPlugin = OSDReferencesPlugin; -window.customIconPlugin = customIconPlugin; +window.customIconPlugin = customIconPlugin; \ No newline at end of file diff --git a/app/models/solr_document_sidecar.rb b/app/models/solr_document_sidecar.rb index 9fb198a01..d511ff2d1 100644 --- a/app/models/solr_document_sidecar.rb +++ b/app/models/solr_document_sidecar.rb @@ -13,9 +13,6 @@ class SolrDocumentSidecar < ApplicationRecord initial_state: :initialized ] - # Deprecated - Carrierwave - mount_uploader :cw_image, ImageUploader - # ActiveStorage has_one_attached :image diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb deleted file mode 100644 index 5888cd8c7..000000000 --- a/app/uploaders/image_uploader.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -class ImageUploader < CarrierWave::Uploader::Base - # Include RMagick or MiniMagick support: - # include CarrierWave::RMagick - include CarrierWave::MiniMagick - - # Choose what kind of storage to use for this uploader: - storage :file - # storage :fog - - # Override the directory where uploaded files will be stored. - # This is a sensible default for uploaders that are meant to be mounted: - def store_dir - "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" - end - - # Provide a default URL as a default if there hasn't been a file uploaded: - # def default_url(*args) - # # For Rails 3.1+ asset pipeline compatibility: - # # ActionController::Base.helpers.asset_path( - # "fallback/" + [version_name, "default.png"].compact.join('_') - # # ) - # - # "/images/fallback/" + [version_name, "default.png"].compact.join('_') - # end - - # Process files as they are uploaded: - # process scale: [200, 300] - # - # def scale(width, height) - # # do something - # end - - # Create different versions of your uploaded files: - version :thumb do - process resize_to_fill: [300, 300] - end - - version :square, from_version: :thumb do - process resize_to_fill: [100, 100] - end - - # Add a white list of extensions which are allowed to be uploaded. - # For images you might use something like this: - def extension_whitelist - %w[jpg jpeg gif png] - end - - # Override the filename of the uploaded files: - # Avoid using model.id or version_name here, see uploader/store.rb for details. - # def filename - # "something.jpg" if original_filename - # end -end diff --git a/app/uploaders/localize_uploader.rb b/app/uploaders/localize_uploader.rb deleted file mode 100644 index 4c15b51f3..000000000 --- a/app/uploaders/localize_uploader.rb +++ /dev/null @@ -1,47 +0,0 @@ -class LocalizeUploader < CarrierWave::Uploader::Base - # Include RMagick or MiniMagick support: - # include CarrierWave::RMagick - # include CarrierWave::MiniMagick - - # Choose what kind of storage to use for this uploader: - storage :file - # storage :fog - - # Override the directory where uploaded files will be stored. - # This is a sensible default for uploaders that are meant to be mounted: - def store_dir - "uploads/localized" - end - - # Provide a default URL as a default if there hasn't been a file uploaded: - # def default_url(*args) - # # For Rails 3.1+ asset pipeline compatibility: - # # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_')) - # - # "/images/fallback/" + [version_name, "default.png"].compact.join('_') - # end - - # Process files as they are uploaded: - # process scale: [200, 300] - # - # def scale(width, height) - # # do something - # end - - # Create different versions of your uploaded files: - # version :thumb do - # process resize_to_fit: [50, 50] - # end - - # Add a white list of extensions which are allowed to be uploaded. - # For images you might use something like this: - # def extension_whitelist - # %w(jpg jpeg gif png) - # end - - # Override the filename of the uploaded files: - # Avoid using model.id or version_name here, see uploader/store.rb for details. - # def filename - # "something.jpg" if original_filename - # end -end diff --git a/app/views/catalog/_home_text.html.erb b/app/views/catalog/_home_text.html.erb index 6d8597f02..c138488ad 100644 --- a/app/views/catalog/_home_text.html.erb +++ b/app/views/catalog/_home_text.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/layouts/blacklight/base.html.erb b/app/views/layouts/blacklight/base.html.erb index c133e7e15..35117cfeb 100644 --- a/app/views/layouts/blacklight/base.html.erb +++ b/app/views/layouts/blacklight/base.html.erb @@ -11,7 +11,16 @@ <%= render_page_title %> <%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %> - <%= favicon_link_tag %> + + + + + + + + + + <%= stylesheet_link_tag "application", media: "all" %> <% if layout_type == "item" && @document && @document.viewer_protocol == 'iiif_manifest' %> @@ -19,7 +28,6 @@ <% end %> <%= javascript_include_tag "application" %> - <%= javascript_include_tag "analytics" %> @@ -43,7 +51,7 @@ <%= render :partial=>'shared/flash_msg', layout: 'shared/flash_messages' %> <%= render 'home' %> <% else %> -
+
<%= content_for(:container_header) %> <%= render partial: 'shared/flash_msg', layout: 'shared/flash_messages' %> diff --git a/app/views/layouts/blazer/application.html.erb b/app/views/layouts/blazer/application.html.erb index cf8466b0f..609bd0cd6 100644 --- a/app/views/layouts/blazer/application.html.erb +++ b/app/views/layouts/blazer/application.html.erb @@ -11,10 +11,6 @@ - <% if blazer_maps? %> - <%= stylesheet_link_tag "https://api.mapbox.com/mapbox.js/v3.3.1/mapbox.css", integrity: "sha384-vxzdEt+wZRPNQbhChjmiaFMLWg86IGuq1NGDehJHsD2mphYkxXll/eSs16WWi6Dq", crossorigin: "anonymous" %> - <%= javascript_include_tag "https://api.mapbox.com/mapbox.js/v3.3.1/mapbox.js", integrity: "sha384-CTBEiDLiZJ8gkAQ3fYGoeiRp81/ecNiBkGz11jXFALOZ6++rbnqmdo6OImkmr1MO", crossorigin: "anonymous" %> - <% end %> <%= csrf_meta_tags %> diff --git a/app/views/robots/robots.text.erb b/app/views/robots/robots.text.erb index 62df1dc03..18bafc477 100644 --- a/app/views/robots/robots.text.erb +++ b/app/views/robots/robots.text.erb @@ -1,6 +1,6 @@ # GeoPortal robots.txt -<%- if File.exists? "#{Rails.root}/public/sitemap.xml.gz" -%> +<%- if File.exist? "#{Rails.root}/public/sitemap.xml.gz" -%> Sitemap: <%= "#{root_url}sitemap.xml.gz" %> <%- end -%> diff --git a/bin/rails b/bin/rails index 21d3e02d8..efc037749 100755 --- a/bin/rails +++ b/bin/rails @@ -1,5 +1,4 @@ #!/usr/bin/env ruby -load File.expand_path("spring", __dir__) -APP_PATH = File.expand_path('../config/application', __dir__) +APP_PATH = File.expand_path("../config/application", __dir__) require_relative "../config/boot" require "rails/commands" diff --git a/bin/rake b/bin/rake index 7327f471e..4fbf10b96 100755 --- a/bin/rake +++ b/bin/rake @@ -1,5 +1,4 @@ #!/usr/bin/env ruby -load File.expand_path("spring", __dir__) require_relative "../config/boot" require "rake" Rake.application.run diff --git a/bin/setup b/bin/setup index 90700ac4f..ec47b79b3 100755 --- a/bin/setup +++ b/bin/setup @@ -2,7 +2,7 @@ require "fileutils" # path to your application root. -APP_ROOT = File.expand_path('..', __dir__) +APP_ROOT = File.expand_path("..", __dir__) def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") @@ -13,24 +13,21 @@ FileUtils.chdir APP_ROOT do # This script is idempotent, so that you can run it at any time and get an expectable outcome. # Add necessary setup steps to this file. - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - # Install JavaScript dependencies - system! 'bin/yarn' + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" # end puts "\n== Preparing database ==" - system! 'bin/rails db:prepare' + system! "bin/rails db:prepare" puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' + system! "bin/rails log:clear tmp:clear" puts "\n== Restarting application server ==" - system! 'bin/rails restart' + system! "bin/rails restart" end diff --git a/config/application.rb b/config/application.rb index a8ea03827..718f56fe3 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,7 +9,7 @@ module Geoblacklight class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.1 + config.load_defaults 7.0 # Configuration for the application, engines, and railties goes here. # diff --git a/config/appsignal.yml b/config/appsignal.yml index 7023c9b1d..8c940f9a9 100644 --- a/config/appsignal.yml +++ b/config/appsignal.yml @@ -40,3 +40,7 @@ development: production: <<: *defaults active: true + <% revision = if (defined?(Rails)); Rails.root.join('REVISION'); end %> + <% if revision&.exist? %> + revision: "<%= revision.read.strip[0, 7] %>" + <% end %> 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/database.yml b/config/database.yml index 41b0e9f11..6af9a2b1f 100644 --- a/config/database.yml +++ b/config/database.yml @@ -23,10 +23,11 @@ development: # Do not set this db to the same as development or production. test: <<: *default - host: <%= ENV['POSTGRES_HOST'] || '127.0.0.1' %> - port: <%= ENV['POSTGRES_PORT'] || '5432' %> - username: <%= ENV['POSTGRES_USER'] || 'postgres' %> - password: <%= ENV['POSTGRES_PASSWORD'] || 'postgres' %> + host: "<%= ENV['POSTGRES_HOST'] %>" + port: "<%= ENV['POSTGRES_PORT'] %>" + database: "<%= ENV['POSTGRES_DB'] %>" + username: "<%= ENV['POSTGRES_USER'] %>" + password: "<%= ENV['POSTGRES_PASSWORD'] %>" production: # Puma is given a lot of threads diff --git a/config/environments/development.rb b/config/environments/development.rb index f72343189..b88a25dfd 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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 @@ -37,11 +40,9 @@ config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true config.action_mailer.default_options = {from: 'no-reply@geo.btaa.org'} - config.action_mailer.perform_caching = false config.action_mailer.default_url_options = { :host => 'localhost:3000' } - # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log @@ -57,29 +58,17 @@ # 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 - # Suppress logger output for asset requests. config.assets.quiet = true # Raises error for missing translations. # config.i18n.raise_on_missing_translations = true - # Google Analytics - Dev - config.google_analytics = 'UA-82483267-2' - config.active_job.queue_adapter = :sidekiq # 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 end diff --git a/config/environments/production.rb b/config/environments/production.rb index 9ed7179bb..baa1884db 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,28 +22,31 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? - # Compress JavaScripts and CSS. - config.assets.js_compressor = Uglifier.new(harmony: true) + # Compress JavaScript. + config.assets.js_compressor = :terser + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.asset_host = 'http://assets.example.com' + # config.asset_host = "http://assets.example.com" # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + # 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). config.active_storage.service = :local # 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.*/ ] + # 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 @@ -78,21 +81,15 @@ # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify - - # Log disallowed deprecations. - config.active_support.disallowed_deprecation = :log - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] + # Don't log any deprecations. + config.active_support.report_deprecations = false # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. # require "syslog/logger" - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT) @@ -103,43 +100,6 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - # Google Analytics - Prod - config.google_analytics = 'UA-82483267-1' - # Background jobs config.active_job.queue_adapter = :sidekiq - - # Exception email notification - Rails.application.config.middleware.use ExceptionNotification::Rack, - # Blacklight uses its own 404 extension we need to ignore separately - :ignore_exceptions => ['Blacklight::Exceptions::RecordNotFound'] + ExceptionNotifier.ignored_exceptions, - # Ignore exception notification from IPs defined in environment variable as comma-separated - :ignore_if => ->(env, exception) { ENV['EXCEPTION_NOTIFIER_EXCLUDE_IPS'].to_s.split(/[, ]+/).include?(env['REMOTE_ADDR']) }, - :email => { - :email_prefix => "[Geoblacklight Error] ", - # Google Groups won't accept messages unless the sender host resolves! - :sender_address => %{"Geoblacklight" }, - :exception_recipients => %w{mjb+alert@umn.edu majew030@umn.edu} - } - - # 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 c710daaca..502f27afd 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -8,18 +8,18 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - config.cache_classes = false - config.action_view.cache_template_loading = true + # Turn false under Spring and add config.action_view.cache_template_loading = true. + config.cache_classes = true - # 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 - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false + # Eager loading loads your whole application. When running a single test locally, + # this probably isn't necessary. It's a good idea to do in a continuous integration + # system, or in some way before deploying your code. + config.eager_load = ENV["CI"].present? # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + "Cache-Control" => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. @@ -51,12 +51,6 @@ # Raise exceptions for disallowed deprecations. config.active_support.disallowed_deprecation = :raise - # Google Analytics - TEST - config.google_analytics = 'UA-BANANAS-1' - - # Background jobs - config.active_job.queue_adapter = :inline - # Tell Active Support which deprecation messages to disallow. config.active_support.disallowed_deprecation_warnings = [] @@ -65,4 +59,7 @@ # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true + + # Background jobs + config.active_job.queue_adapter = :inline end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index bead91b74..6d33e6fe1 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,10 +1,11 @@ # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' +Rails.application.config.assets.version = "1.0" # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path + # Add Yarn node_modules folder to the asset load path. Rails.application.config.assets.paths << Rails.root.join('node_modules') @@ -13,10 +14,8 @@ # folder are already added. # Rails.application.config.assets.precompile += %w( admin.js admin.css ) -Rails.application.config.assets.precompile += %w( analytics.js ) Rails.application.config.assets.precompile += %w( favicon.ico ) # GBL ADMIN -# Rails.application.config.assets.paths << Rails.root.join('node_modules') Rails.application.config.assets.precompile += %w( geoblacklight_admin.js ) -Rails.application.config.assets.precompile += %w[application.js] \ No newline at end of file +Rails.application.config.assets.precompile += %w[application.js] diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 35d0f26fc..54f47cf15 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,30 +1,25 @@ # Be sure to restart your server when you modify this file. -# Define an application-wide content security policy -# For further information see the following documentation -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header -# Rails.application.config.content_security_policy do |policy| -# policy.default_src :self, :https -# policy.font_src :self, :https, :data -# policy.img_src :self, :https, :data -# policy.object_src :none -# policy.script_src :self, :https -# policy.style_src :self, :https -# # If you are using webpack-dev-server then specify webpack-dev-server host -# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? - -# # Specify URI for violation reports -# # policy.report_uri "/csp-violation-report-endpoint" +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap and inline scripts +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true # end - -# If you are using UJS then enable automatic nonce generation -# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } - -# Set the nonce only to specific directives -# Rails.application.config.content_security_policy_nonce_directives = %w(script-src) - -# Report CSP violations to a specified URI -# For further information see the following documentation: -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only -# Rails.application.config.content_security_policy_report_only = true diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 2899da4ec..a9a173b9f 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,6 +1,8 @@ # Be sure to restart your server when you modify this file. -# Configure sensitive parameters which will be filtered from the log file. +# Configure parameters to be filtered from the log file. Use this to limit dissemination of +# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported +# notations and behaviors. Rails.application.config.filter_parameters += [ :password, :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn ] diff --git a/config/initializers/geoblacklight_helper_overrides.rb b/config/initializers/geoblacklight_helper_overrides.rb deleted file mode 100644 index b6b5f1c24..000000000 --- a/config/initializers/geoblacklight_helper_overrides.rb +++ /dev/null @@ -1,17 +0,0 @@ -GeoblacklightHelper.module_eval do - ## - # Render help text popover for a given feature and translation key - # @return [HTML tag] - def render_help_text_entry(feature, key) - if I18n.exists?("geoblacklight.help_text.#{feature}.#{key}", locale) - help_text = I18n.t("geoblacklight.help_text.#{feature}.#{key}") - content_tag :h3, class: 'help-text viewer_protocol h6' do - content_tag :a, 'data': { toggle: 'popover', title: help_text[:title], content: help_text[:content] } do - "#{help_text[:title]} #{geoblacklight_icon('info-circle-solid')}".html_safe - end - end - else - tag.span class: 'help-text translation-missing' - end - end -end diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index ac033bf9d..3860f659e 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -4,13 +4,13 @@ # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" # inflect.uncountable %w( fish sheep ) # end # These inflection rules are supported but not enabled by default: # ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' +# inflect.acronym "RESTful" # end diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb new file mode 100644 index 000000000..b13ef5ed1 --- /dev/null +++ b/config/initializers/new_framework_defaults_7_0.rb @@ -0,0 +1,143 @@ +# Be sure to restart your server when you modify this file. +# +# This file eases your Rails 7.0 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.0`. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. +# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html + +# `button_to` view helper will render `