diff --git a/.circleci/config.yml b/.circleci/config.yml index 38d5f0c20..777e797a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -135,8 +135,8 @@ jobs: name: Compile imagemagick with jp2 support command: | mkdir -p /tmp/im && \ - curl -sL https://www.imagemagick.org/archive/releases/ImageMagick-7.1.0-27.tar.xz \ - | tar -xJvf - -C /tmp/im && cd /tmp/im/ImageMagick-7.1.0-27 && \ + curl -sL https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.0-62.tar.gz \ + | tar -xz -C /tmp/im && cd /tmp/im/ImageMagick-7.1.0-62 && \ ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -232,7 +232,7 @@ jobs: export APP_VERSION=$(cat lib/oregon_digital/version.rb | grep VERSION | cut -d "=" -f 2 | sed "s/['\" ]//g") export GIT_SHORT_HASH=$(git rev-parse --short HEAD) export DATETIME=$(date "+%Y%m%d%H%M") - export TAG="$DATETIME-$GIT_SHORT_HASH" + export TAG="$DATETIME-$GIT_SHORT_HASH-v5" export DEPLOYED_VERSION="$DATETIME-$GIT_SHORT_HASH" echo export RAILS_ENV="$RAILS_ENV" >> $BASH_ENV echo export TAG="$TAG" >> $BASH_ENV @@ -276,23 +276,24 @@ workflows: - lint: requires: - bundle - - test: - requires: - - lint - filters: - branches: - ignore: - - master + # - test: + # requires: + # - lint + # filters: + # branches: + # ignore: + # - master - build_and_push_beavernetes: name: Build and push application image to Beavernetes image repository requires: - lint - - test + # - test filters: branches: only: - master - /infra\/.*/ - /staging\/.*/ + - /update\/.*/ repo: od2_web environment: production diff --git a/.irbrc b/.irbrc new file mode 100644 index 000000000..f850f01ac --- /dev/null +++ b/.irbrc @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +IRB.conf[:USE_AUTOCOMPLETE] = false diff --git a/Dockerfile b/Dockerfile index c29e850a3..681da1293 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ FROM bundler AS dependencies RUN apt update && apt -y upgrade && \ apt -y install nodejs unzip ghostscript vim less tmux yarnpkg curl wget openssl \ git sqlite3 postgresql-client libpq-dev libjpeg62-turbo-dev libpng-dev libtool libgomp1 \ - build-essential zip xz-utils autoconf automake libtool texinfo libltdl7 \ + build-essential gcc zip xz-utils autoconf automake libtool texinfo libltdl7 \ bash bash-completion java-common openjdk-17-jre-headless graphicsmagick ffmpeg \ poppler-utils tesseract-ocr libopenjp2-7-dev libopenjp2-tools libopenjp2-7 \ libffi-dev tini libxslt1-dev libxml2-dev tzdata lsb-release cmake mediainfo libmediainfo-dev @@ -26,8 +26,8 @@ RUN ln -s /usr/bin/python3 /usr/bin/python # Install ImageMagick with jp2/tiff support # Install ImageMagick with full support RUN mkdir -p /tmp/im && \ - curl -sL https://www.imagemagick.org/archive/releases/ImageMagick-7.1.0-27.tar.xz \ - | tar -xJvf - -C /tmp/im && cd /tmp/im/ImageMagick-7.1.0-27 && \ + curl -sL https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.0-62.tar.gz \ + | tar -xz -C /tmp/im && cd /tmp/im/ImageMagick-7.1.0-62 && \ ./configure \ --build=$CBUILD \ --host=$CHOST \ diff --git a/Gemfile b/Gemfile index ad9911d5e..f01ad75fb 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem 'dalli', '~> 3.2.3' gem 'devise' gem "edtf", "~> 3.0" gem 'hydra-role-management' -gem 'hyrax', '~> 4.0' +gem 'hyrax', '~> 5.2' # gem 'hyrax-migrator', github: 'OregonDigital/hyrax-migrator', branch: 'master' gem 'jquery-rails' gem 'sassc-rails' @@ -77,7 +77,7 @@ gem 'blacklight_oai_provider' group :development do # listen is a requirement of puma but isn't part of its gemspec - gem 'listen', '>= 3.0.5', '< 3.2' + gem 'listen' gem 'web-console', '>= 3.3.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 2149216b3..83ba36f12 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,50 +35,53 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (6.0.6.1) - actionpack (= 6.0.6.1) + actioncable (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.6.1) - actionpack (= 6.0.6.1) - activejob (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) + actionmailbox (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) mail (>= 2.7.1) - actionmailer (6.0.6.1) - actionpack (= 6.0.6.1) - actionview (= 6.0.6.1) - activejob (= 6.0.6.1) + actionmailer (6.1.7.10) + actionpack (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activesupport (= 6.1.7.10) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.6.1) - actionview (= 6.0.6.1) - activesupport (= 6.0.6.1) - rack (~> 2.0, >= 2.0.8) + actionpack (6.1.7.10) + actionview (= 6.1.7.10) + activesupport (= 6.1.7.10) + 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.0.6.1) - actionpack (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) + actiontext (6.1.7.10) + actionpack (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) nokogiri (>= 1.8.5) - actionview (6.0.6.1) - activesupport (= 6.0.6.1) + actionview (6.1.7.10) + activesupport (= 6.1.7.10) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - active-fedora (14.0.1) + active-fedora (15.0.1) active-triples (>= 0.11.0, < 2.0.0) - activemodel (>= 5.1) - activesupport (>= 5.1) + activemodel (>= 6.1) + activesupport (>= 6.1) deprecation faraday (>= 1.0) faraday-encoding (>= 0.0.5) ldp (>= 0.7.0, < 2) + mutex_m rsolr (>= 1.1.2, < 3) ruby-progressbar (~> 1.0) active-triples (1.2.0) @@ -86,34 +89,36 @@ GEM activesupport (>= 3.0.0) rdf (>= 2.0.2, < 4.0) rdf-vocab (>= 2.0, < 4.0) - active_encode (0.8.2) + active_encode (1.3.0) + addressable (~> 2.8) rails - sprockets (< 4) - activejob (6.0.6.1) - activesupport (= 6.0.6.1) + activejob (6.1.7.10) + activesupport (= 6.1.7.10) globalid (>= 0.3.6) - activemodel (6.0.6.1) - activesupport (= 6.0.6.1) + activemodel (6.1.7.10) + activesupport (= 6.1.7.10) activemodel-serializers-xml (1.0.3) activemodel (>= 5.0.0.a) activesupport (>= 5.0.0.a) builder (~> 3.1) - activerecord (6.0.6.1) - activemodel (= 6.0.6.1) - activesupport (= 6.0.6.1) + activerecord (6.1.7.10) + activemodel (= 6.1.7.10) + activesupport (= 6.1.7.10) activerecord-import (2.0.0) activerecord (>= 4.2) - activestorage (6.0.6.1) - actionpack (= 6.0.6.1) - activejob (= 6.0.6.1) - activerecord (= 6.0.6.1) + activestorage (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activesupport (= 6.1.7.10) marcel (~> 1.0) - activesupport (6.0.6.1) + mini_mime (>= 1.1.0) + activesupport (6.1.7.10) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) almond-rails (0.3.0) @@ -174,9 +179,9 @@ GEM blacklight (> 6.0, < 8) cancancan (>= 1.8) deprecation (~> 1.0) - blacklight-gallery (4.0.2) - blacklight (~> 7.17) - rails (>= 5.1, < 8) + blacklight-gallery (4.6.4) + blacklight (>= 7.17, < 9) + rails (>= 6.1, < 9) blacklight-oembed (1.4.2) blacklight (>= 7.25, < 9) rails @@ -295,55 +300,54 @@ GEM dropbox_api (0.1.21) faraday (< 3.0) oauth2 (~> 1.1) - dry-configurable (0.16.1) - dry-core (~> 0.6) + dry-configurable (1.3.0) + dry-core (~> 1.1) zeitwerk (~> 2.6) dry-container (0.11.0) concurrent-ruby (~> 1.0) - dry-core (0.9.1) + dry-core (1.2.0) concurrent-ruby (~> 1.0) + logger zeitwerk (~> 2.6) - dry-equalizer (0.3.0) - dry-events (0.2.0) + dry-events (1.1.0) concurrent-ruby (~> 1.0) - dry-core (~> 0.4) - dry-equalizer (~> 0.2) - dry-inflector (0.3.0) + dry-core (~> 1.1) + dry-inflector (1.3.1) dry-initializer (3.2.0) - dry-logic (1.3.0) + dry-logic (1.6.0) + bigdecimal concurrent-ruby (~> 1.0) - dry-core (~> 0.9, >= 0.9) + dry-core (~> 1.1) zeitwerk (~> 2.6) - dry-monads (1.5.0) + dry-monads (1.10.0) concurrent-ruby (~> 1.0) - dry-core (~> 0.9, >= 0.9) + dry-core (~> 1.1) zeitwerk (~> 2.6) - dry-schema (1.11.3) + dry-schema (1.16.0) concurrent-ruby (~> 1.0) - dry-configurable (~> 0.16, >= 0.16) - dry-core (~> 0.9, >= 0.9) - dry-initializer (~> 3.0) - dry-logic (~> 1.3) - dry-types (~> 1.6) + dry-configurable (~> 1.0, >= 1.0.1) + dry-core (~> 1.1) + dry-initializer (~> 3.2) + dry-logic (~> 1.6) + dry-types (~> 1.9, >= 1.9.1) zeitwerk (~> 2.6) - dry-struct (1.5.2) - dry-core (~> 0.9, >= 0.9) - dry-types (~> 1.6) + dry-struct (1.8.1) + dry-core (~> 1.1) + dry-types (~> 1.8, >= 1.8.2) ice_nine (~> 0.11) zeitwerk (~> 2.6) - dry-types (1.6.1) + dry-types (1.9.1) + bigdecimal (>= 3.0) concurrent-ruby (~> 1.0) - dry-container (~> 0.3) - dry-core (~> 0.9, >= 0.9) - dry-inflector (~> 0.1, >= 0.1.2) - dry-logic (~> 1.3, >= 1.3) + dry-core (~> 1.0) + dry-inflector (~> 1.0) + dry-logic (~> 1.4) zeitwerk (~> 2.6) - dry-validation (1.9.0) + dry-validation (1.11.1) concurrent-ruby (~> 1.0) - dry-container (~> 0.7, >= 0.7.1) - dry-core (~> 0.9, >= 0.9) - dry-initializer (~> 3.0) - dry-schema (~> 1.11, >= 1.11.0) + dry-core (~> 1.1) + dry-initializer (~> 3.2) + dry-schema (~> 1.14) zeitwerk (~> 2.6) dumb_delegator (0.8.1) ebnf (2.4.0) @@ -409,11 +413,27 @@ GEM railties (>= 3.2, < 9.0) font-awesome-sass (6.7.2) sassc (~> 2.0) + gapic-common (1.3.0) + faraday (>= 1.9, < 3.a) + faraday-retry (>= 1.0, < 3.a) + google-cloud-env (~> 2.2) + google-logging-utils (~> 0.1) + google-protobuf (~> 4.26) + googleapis-common-protos (~> 1.6) + googleapis-common-protos-types (~> 1.15) + googleauth (~> 1.12) + grpc (~> 1.66) geocoder (1.8.5) base64 (>= 0.1.0) csv (>= 3.0.0) globalid (1.1.0) activesupport (>= 5.0) + google-analytics-data (0.8.0) + google-analytics-data-v1beta (>= 0.11, < 2.a) + google-cloud-core (~> 1.6) + google-analytics-data-v1beta (0.21.0) + gapic-common (~> 1.2) + google-cloud-errors (~> 1.0) google-apis-core (0.16.0) addressable (~> 2.5, >= 2.5.1) googleauth (~> 1.9) @@ -424,9 +444,25 @@ GEM retriable (>= 2.0, < 4.a) google-apis-drive_v3 (0.61.0) google-apis-core (>= 0.15.0, < 2.a) + google-cloud-core (1.8.0) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) google-cloud-env (2.2.1) faraday (>= 1.0, < 3.a) + google-cloud-errors (1.6.0) google-logging-utils (0.1.0) + google-protobuf (4.34.1-aarch64-linux-gnu) + bigdecimal + rake (~> 13.3) + google-protobuf (4.34.1-x86_64-linux-gnu) + bigdecimal + rake (~> 13.3) + googleapis-common-protos (1.9.0) + google-protobuf (~> 4.26) + googleapis-common-protos-types (~> 1.21) + grpc (~> 1.41) + googleapis-common-protos-types (1.22.0) + google-protobuf (~> 4.26) googleauth (1.13.0) faraday (>= 1.0, < 3.a) google-cloud-env (~> 2.2) @@ -435,6 +471,12 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) + grpc (1.80.0-aarch64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + grpc (1.80.0-x86_64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) haml (6.3.0) temple (>= 0.8.2) thor @@ -458,40 +500,42 @@ GEM http-form_data (2.3.0) http_logger (0.7.0) httpclient (2.8.3) - hydra-access-controls (12.1.0) + hydra-access-controls (13.2.0) active-fedora (>= 10.0.0) - activesupport (>= 5.2, < 7.1) + activesupport (>= 6.1, < 9) blacklight-access_controls (~> 6.0) cancancan (>= 1.8, < 4) deprecation (~> 1.0) - hydra-core (12.1.0) - hydra-access-controls (= 12.1.0) - railties (>= 5.2, < 7.1) - hydra-derivatives (3.8.0) + hydra-core (13.2.0) + hydra-access-controls (= 13.2.0) + railties (>= 6.1, < 9) + hydra-derivatives (4.1.0) active-fedora (>= 14.0) active-triples (>= 1.2) - active_encode (~> 0.1) - activesupport (>= 4.0, < 7.1) + active_encode (~> 1.2) + activesupport (>= 4.0, < 9.0) addressable (~> 2.5) deprecation mime-types (> 2.0, < 4.0) mini_magick (>= 3.2, < 5) - hydra-editor (6.3.0) + ruby-vips + hydra-editor (7.1.0) active-fedora (>= 9.0.0) - activerecord (>= 5.2, < 8.0) + activerecord (>= 5.2, < 8.1) almond-rails (~> 0.1) cancancan + concurrent-ruby (= 1.3.4) psych (~> 3.3, < 4) - rails (>= 5.2, < 8.0) + rails (>= 5.2, < 8.1) simple_form (>= 4.1.0, < 5.2) - sprockets (>= 3.7) + sprockets (~> 3.7) sprockets-es6 hydra-file_characterization (1.2.0) activesupport (>= 3.0.0) - hydra-head (12.1.0) - hydra-access-controls (= 12.1.0) - hydra-core (= 12.1.0) - rails (>= 5.2, < 7.1) + hydra-head (13.2.0) + hydra-access-controls (= 13.2.0) + hydra-core (= 13.2.0) + rails (>= 6.1, < 9) hydra-pcdm (1.4.0) active-fedora (>= 10) mime-types (>= 1) @@ -508,44 +552,46 @@ GEM hydra-derivatives (>= 3.6) hydra-file_characterization (~> 1.0) hydra-pcdm (>= 0.9) - hyrax (4.0.0) - active-fedora (~> 14.0) + hyrax (5.2.0) + active-fedora (~> 15.0) almond-rails (~> 0.1) awesome_nested_set (~> 3.1) blacklight (~> 7.29) - blacklight-gallery (~> 4.0) + blacklight-gallery (~> 4.6.4) breadcrumbs_on_rails (~> 3.0) browse-everything (>= 0.16, < 2.0) carrierwave (~> 1.0) clipboard-rails (~> 1.5) + concurrent-ruby (= 1.3.4) connection_pool (~> 2.4) draper (~> 4.0) - dry-equalizer (~> 0.2) - dry-events (~> 0.2.0) - dry-monads (~> 1.5) - dry-struct (~> 1.0) - dry-validation (~> 1.3) + dry-container (~> 0.11) + dry-events (~> 1.0, >= 1.0.1) + dry-logic (~> 1.5) + dry-monads (~> 1.6) + dry-validation (~> 1.10) flipflop (~> 2.3) flot-rails (~> 0.0.6) font-awesome-rails (~> 4.2) - hydra-derivatives (~> 3.3) - hydra-editor (~> 6.0) + google-analytics-data (~> 0.6) + hydra-derivatives (~> 4.0) + hydra-editor (~> 7.0) hydra-file_characterization (~> 1.1) - hydra-head (~> 12.0) + hydra-head (~> 13.0) hydra-works (>= 0.16) iiif_manifest (>= 0.3, < 2.0) json-schema legato (~> 0.3) linkeddata + listen (~> 3.9) mailboxer (~> 0.12) nest (~> 3.1) noid-rails (~> 3.0) oauth oauth2 (~> 1.2) - openseadragon - posix-spawn + openseadragon (~> 0.9) qa (~> 5.5, >= 5.5.1) - rails (~> 6.0) + rails (> 6.1, < 8.0) rails_autolink (~> 1.1) rdf-rdfxml rdf-vocab (~> 3.0) @@ -558,9 +604,9 @@ GEM sass-rails (~> 6.0) select2-rails (~> 3.5) signet - sprockets (~> 3.7) + sprockets (= 3.7.2) tinymce-rails (~> 5.10) - valkyrie (~> 3.0.1) + valkyrie (~> 3.5) view_component (~> 2.74.1) i18n (1.14.7) concurrent-ruby (~> 1.0) @@ -674,9 +720,10 @@ GEM sparql (~> 3.3) sparql-client (~> 3.3) yaml-ld (~> 0.0) - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) + listen (3.10.0) + logger + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) llhttp-ffi (0.5.0) ffi-compiler (~> 1.0) rake (~> 13.0) @@ -761,8 +808,8 @@ GEM omniauth-saml (2.2.1) omniauth (~> 2.1) ruby-saml (~> 1.17) - openseadragon (0.6.0) - rails (> 3.2.0) + openseadragon (0.9.0) + rails (> 6.1.0) orm_adapter (0.5.0) os (1.1.4) ostruct (0.6.1) @@ -814,20 +861,20 @@ GEM rdf (~> 3.3) rack-test (2.2.0) rack (>= 1.3) - rails (6.0.6.1) - actioncable (= 6.0.6.1) - actionmailbox (= 6.0.6.1) - actionmailer (= 6.0.6.1) - actionpack (= 6.0.6.1) - actiontext (= 6.0.6.1) - actionview (= 6.0.6.1) - activejob (= 6.0.6.1) - activemodel (= 6.0.6.1) - activerecord (= 6.0.6.1) - activestorage (= 6.0.6.1) - activesupport (= 6.0.6.1) - bundler (>= 1.3.0) - railties (= 6.0.6.1) + rails (6.1.7.10) + actioncable (= 6.1.7.10) + actionmailbox (= 6.1.7.10) + actionmailer (= 6.1.7.10) + actionpack (= 6.1.7.10) + actiontext (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activemodel (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) + bundler (>= 1.15.0) + railties (= 6.1.7.10) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -844,14 +891,14 @@ GEM actionview (> 3.1) activesupport (> 3.1) railties (> 3.1) - railties (6.0.6.1) - actionpack (= 6.0.6.1) - activesupport (= 6.0.6.1) + railties (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) method_source - rake (>= 0.8.7) - thor (>= 0.20.3, < 2.0) + rake (>= 12.2) + thor (~> 1.0) rainbow (3.1.1) - rake (13.2.1) + rake (13.4.2) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) @@ -1012,6 +1059,9 @@ GEM ruby-saml (1.17.0) nokogiri (>= 1.13.10) rexml + ruby-vips (2.3.0) + ffi (~> 1.12) + logger ruby2_keywords (0.0.5) rubyzip (2.4.1) sass-rails (6.0.0) @@ -1129,8 +1179,8 @@ GEM railties (>= 3.1) typhoeus (1.4.1) ethon (>= 0.9.0) - tzinfo (1.2.11) - thread_safe (~> 0.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) tzinfo-data (1.2025.1) tzinfo (>= 1.0.0) uber (0.1.0) @@ -1139,7 +1189,7 @@ GEM unicode-display_width (1.8.0) unicode-types (1.10.0) validatable (1.6.7) - valkyrie (3.0.3) + valkyrie (3.5.1) activemodel activesupport dry-struct @@ -1149,7 +1199,7 @@ GEM json json-ld railties - rdf (~> 3.0, >= 3.0.10) + rdf (~> 3.0, >= 3.3.2) rdf-vocab reform (~> 2.2) reform-rails @@ -1246,11 +1296,11 @@ DEPENDENCIES font-awesome-sass (~> 6.4, >= 6.4.2) honeycomb-beeline (>= 2.10.0) hydra-role-management - hyrax (~> 4.0) + hyrax (~> 5.2) jquery-datatables-rails jquery-rails libhoney (>= 2.1.0) - listen (>= 3.0.5, < 3.2) + listen loofah (>= 2.2.3) omniauth omniauth-cas @@ -1262,7 +1312,7 @@ DEPENDENCIES pry-byebug pry-rails puma (~> 4.3.8) - rails (~> 6.0.6) + rails (~> 6.1) rails-controller-testing recaptcha rsolr (>= 1.0, < 3) diff --git a/app/actors/oregon_digital/actors/create_with_oembed_url_actor.rb b/app/actors/oregon_digital/actors/create_with_oembed_url_actor.rb index 3060630e0..bab913f5e 100644 --- a/app/actors/oregon_digital/actors/create_with_oembed_url_actor.rb +++ b/app/actors/oregon_digital/actors/create_with_oembed_url_actor.rb @@ -42,7 +42,6 @@ def attach_files(env, oembed_urls) # rubocop:disable Metrics/MethodLength def create_file_from_url(env, uri) oembed_url = URI.decode_www_form_component(uri.to_s) - use_valkyrie = false fs_class = env.curation_concern.is_a?(Valkyrie::Resource) ? Hyrax::FileSet : ::FileSet file_set = fs_class.new(oembed_url: oembed_url) do |fs| @@ -60,12 +59,9 @@ def create_file_from_url(env, uri) fs.title = Array(title) end - if env.curation_concern.is_a? Valkyrie::Resource - file_set = Hyrax.persister.save(resource: file_set) - use_valkyrie = true - end + file_set = Hyrax.persister.save(resource: file_set) if env.curation_concern.is_a? Valkyrie::Resource - actor = Hyrax::Actors::FileSetActor.new(file_set, env.user, use_valkyrie: use_valkyrie) + actor = Hyrax::Actors::FileSetActor.new(file_set, env.user) actor.create_metadata(visibility: env.curation_concern.visibility) actor.attach_to_work(env.curation_concern) file_set.save! if file_set.respond_to?(:save!) diff --git a/app/assets/stylesheets/oregon_digital/_header.scss b/app/assets/stylesheets/oregon_digital/_header.scss index b139dc090..c6d781719 100644 --- a/app/assets/stylesheets/oregon_digital/_header.scss +++ b/app/assets/stylesheets/oregon_digital/_header.scss @@ -152,6 +152,7 @@ header { } #masthead { + z-index: 1001; box-shadow: 0 0 10px $dark-grey; border-width: 0 0 5px 0; padding: 1em 2em; @@ -170,8 +171,7 @@ header { #top-navbar-collapse { letter-spacing: 2px; - - @media (max-width: breakpoint-max(lg)) { + @media (max-width: breakpoint-max(md)) { justify-content: flex-start !important; } @@ -194,10 +194,16 @@ header { a { color: #333; - } - & > a:hover{ - text-decoration: none; + &:active{ + background-color: #f5f5f5; + outline: 2px auto Highlight !important; + outline: 2px auto -webkit-focus-ring-color !important; + } + + &:hover{ + text-decoration: none; + } } } diff --git a/app/assets/stylesheets/oregon_digital/_home-page.scss b/app/assets/stylesheets/oregon_digital/_home-page.scss index e8a199ac8..3dae0a908 100644 --- a/app/assets/stylesheets/oregon_digital/_home-page.scss +++ b/app/assets/stylesheets/oregon_digital/_home-page.scss @@ -38,8 +38,10 @@ td.toggle .input-group-btn:last-child > input[type=submit]:not(:last-child) { text-align: center; } - .background-container img { - width: 100%; + @media (min-width: breakpoint-max(lg)) { + .background-container img { + width: 100%; + } } } #masthead { diff --git a/app/assets/stylesheets/oregon_digital/_sidebar.scss b/app/assets/stylesheets/oregon_digital/_sidebar.scss index 7b8e5e711..22409adc7 100644 --- a/app/assets/stylesheets/oregon_digital/_sidebar.scss +++ b/app/assets/stylesheets/oregon_digital/_sidebar.scss @@ -10,7 +10,7 @@ } } -.profile-data-name .h3 { +.profile-data-name .h3, .card-user .card-header h3{ margin-top: 20px; margin-bottom: 10px; } diff --git a/app/assets/stylesheets/oregon_digital/_sign_up.scss b/app/assets/stylesheets/oregon_digital/_sign_up.scss index becc797b5..541debec2 100644 --- a/app/assets/stylesheets/oregon_digital/_sign_up.scss +++ b/app/assets/stylesheets/oregon_digital/_sign_up.scss @@ -2,6 +2,10 @@ max-width: map-get($container-max-widths, "md");; margin: auto; + h1 { + margin-top: 20px; + } + .login-footer, .new_user { padding: 2em 0; diff --git a/app/assets/stylesheets/oregon_digital/dashboard/_dashboard.scss b/app/assets/stylesheets/oregon_digital/dashboard/_dashboard.scss index 051a2f144..152e86f19 100644 --- a/app/assets/stylesheets/oregon_digital/dashboard/_dashboard.scss +++ b/app/assets/stylesheets/oregon_digital/dashboard/_dashboard.scss @@ -129,4 +129,10 @@ table.dataTable td.dataTables_empty { .list-group-item > .badge, td.status .list-group-item > span { float: right; +} + +#myTab { + .nav-link.active { + border-top: inherit !important; + } } \ No newline at end of file diff --git a/app/controllers/concerns/oregon_digital/iiif_manifest_controller_behavior.rb b/app/controllers/concerns/oregon_digital/iiif_manifest_controller_behavior.rb index 27a144a1f..b3dafefac 100644 --- a/app/controllers/concerns/oregon_digital/iiif_manifest_controller_behavior.rb +++ b/app/controllers/concerns/oregon_digital/iiif_manifest_controller_behavior.rb @@ -66,7 +66,13 @@ def jp2_work_presenter solrdoc = SolrDocument.find(params['id']) @jp2_work_presenter = OregonDigital::IIIFPresenter.new(solrdoc, current_ability, request) - @jp2_work_presenter.file_sets = solrdoc.file_sets + + # Filter out restricted filesets non-editors can't access + accessible_file_sets = solrdoc.file_sets.select do |fs| + fs['visibility_ssi'] == 'open' || (current_ability.can?(:edit, fs) && fs['visibility_ssi'] == 'restricted') + end + + @jp2_work_presenter.file_sets = accessible_file_sets @jp2_work_presenter end @@ -81,7 +87,11 @@ def jp2_work_presenter # @return [String] def manifest_cache_key solrdoc = SolrDocument.find(params['id']) - "#{KEY_PREFIX}_#{solrdoc.id}/#{version_for(solrdoc)}" + + # Add in a prefix to determine which cache to render + current_role = current_ability.can?(:edit, solrdoc) ? 'editor' : 'public' + + "#{KEY_PREFIX}_#{solrdoc.id}/#{version_for(solrdoc)}/#{current_role}" end ## diff --git a/app/controllers/concerns/oregon_digital/importer_controller_behavior.rb b/app/controllers/concerns/oregon_digital/importer_controller_behavior.rb index bf7c32704..14fab1f2d 100644 --- a/app/controllers/concerns/oregon_digital/importer_controller_behavior.rb +++ b/app/controllers/concerns/oregon_digital/importer_controller_behavior.rb @@ -24,7 +24,10 @@ def report_path # rubocop:disable Metrics/AbcSize def verify @importer = Bulkrax::Importer.find(params[:importer_id]) - Redis.current.del("verify_count:#{@importer.id}") + + Hyrax.config.redis_connection.with do |conn| + conn.del("verify_count:#{@importer.id}") + end ids = work_ids.map { |x| x[:work_id] }.reject(&:nil?) redirect_to(importer_path(@importer.id), notice: 'Unable to find any items to verify.') and return if ids.empty? diff --git a/app/indexers/generic_indexer.rb b/app/indexers/generic_indexer.rb index 942b7af43..083d30d0f 100644 --- a/app/indexers/generic_indexer.rb +++ b/app/indexers/generic_indexer.rb @@ -43,7 +43,7 @@ def generate_solr_document solr_doc['user_collections_ssim'] = [] solr_doc['oai_collections_ssim'] = [] object.member_of_collections.each do |collection| - collection_index_key = collection_indexing_key(collection.collection_type.machine_id) + collection_index_key = collection_indexing_key(Hyrax::CollectionType.for(collection: collection).machine_id) solr_doc[collection_index_key] << collection.id solr_doc[collection_index_key.gsub('_ssim', '_tesim')] = collection.title solr_doc['non_user_collections_label_ssim'] << collection.title.first if collection_index_key == 'non_user_collections_ssim' diff --git a/app/indexers/oregon_digital/deep_indexing_service.rb b/app/indexers/oregon_digital/deep_indexing_service.rb index 5c40dab23..7518939ab 100644 --- a/app/indexers/oregon_digital/deep_indexing_service.rb +++ b/app/indexers/oregon_digital/deep_indexing_service.rb @@ -61,6 +61,9 @@ def fetch_value(value) rescue IOError, SocketError, TriplestoreAdapter::TriplestoreException => e # IOError could result from a 500 error on the remote server # SocketError results if there is no server to connect to + # Add in the fail fetch attempt to store the info what is being fail + OregonDigital::Triplestore.create_and_check_directory + OregonDigital::Triplestore.store_failed_fetch(@object.id, [{ uri: value.rdf_subject.to_s, error: e.message }]) Rails.logger.error "Unable to fetch #{value.rdf_subject}.\n#{e.message}" end diff --git a/app/jobs/oregon_digital/verify_work_job.rb b/app/jobs/oregon_digital/verify_work_job.rb index aad5f408d..be9b96cad 100644 --- a/app/jobs/oregon_digital/verify_work_job.rb +++ b/app/jobs/oregon_digital/verify_work_job.rb @@ -9,10 +9,15 @@ class VerifyWorkJob < ApplicationJob # rubocop:disable Style/GuardClause after_perform do |job| args = job.arguments.first - count = Redis.current.incr("verify_count:#{args[:batch_id]}") + count = -1 + Hyrax.config.redis_connection.with do |conn| + count = conn.incr("verify_count:#{args[:batch_id]}") + end if count >= args[:size] follow_up(args) - Redis.current.expire("verify_count:#{args[:batch_id]}", 5) + Hyrax.config.redis_connection.with do |conn| + conn.expire("verify_count:#{args[:batch_id]}", 5) + end end end diff --git a/app/mailers/oregon_digital/failed_fetch_mailer.rb b/app/mailers/oregon_digital/failed_fetch_mailer.rb index 6c900efff..d86bada2a 100644 --- a/app/mailers/oregon_digital/failed_fetch_mailer.rb +++ b/app/mailers/oregon_digital/failed_fetch_mailer.rb @@ -10,7 +10,7 @@ def failed_fetch_email file_path = "#{Rails.root.join('tmp')}/#{params[:filename]}" attachments[params[:filename]] = File.read(file_path) if File.exist?(file_path) else - file_text = "#{Rails.root.join('tmp', 'failed_fetch')}/#{params[:filename]}" + file_text = "#{Rails.root.join('tmp', 'shared', 'failed_fetch')}/#{params[:filename]}" attachments[params[:filename]] = File.read(file_text) if File.exist?(file_text) end diff --git a/app/models/collection.rb b/app/models/collection.rb index 187dad520..15afb5130 100644 --- a/app/models/collection.rb +++ b/app/models/collection.rb @@ -13,8 +13,6 @@ class Collection < ActiveFedora::Base include OregonDigital::AccessControls::Visibility self.indexer = OregonDigital::CollectionIndexer - delegate :facet_configurable?, to: :collection_type - # Identify facets available to configure def available_facets generate_default_facets @@ -22,6 +20,11 @@ def available_facets facets.sort_by(&:order) end + # Expand on Hyrax::CollectionsHelper for facet configurability + def facet_configurable? + Hyrax::CollectionType.for(collection: self).facet_configurable? + end + def insitution_restricted?(current_ability) return false if current_ability.can?(:read, self) diff --git a/app/models/concerns/oregon_digital/ability/collection_ability.rb b/app/models/concerns/oregon_digital/ability/collection_ability.rb index 7513d3ed2..1af85843f 100644 --- a/app/models/concerns/oregon_digital/ability/collection_ability.rb +++ b/app/models/concerns/oregon_digital/ability/collection_ability.rb @@ -20,7 +20,7 @@ def collection_ability admin_or_in_depositor?(collection) end can(%i[download], Collection) do |collection| - collection.collection_type.machine_id == 'user_collection' + Hyrax::CollectionType.for(collection: collection).machine_id == 'user_collection' end # TODO: SHOW AND SEARCH FOR UO AND OSU end diff --git a/app/models/concerns/oregon_digital/errors.rb b/app/models/concerns/oregon_digital/errors.rb index 3b1a83150..0a1fa4103 100644 --- a/app/models/concerns/oregon_digital/errors.rb +++ b/app/models/concerns/oregon_digital/errors.rb @@ -4,24 +4,32 @@ module OregonDigital # adds error support using Redis module Errors def add_error(desc_key, message) - Redis.current.sadd(redis_key(desc_key), message) + Hyrax.config.redis_connection.with do |conn| + conn.sadd(redis_key(desc_key), message) + end end def error_keys - Redis.current.keys("#{base_error_key}:*") + Hyrax.config.redis_connection.with do |conn| + conn.keys("#{base_error_key}:*") + end end def all_errors errors = {} error_keys.each do |r_key| - errors[shorten(r_key)] = Redis.current.smembers(r_key) + Hyrax.config.redis_connection.with do |conn| + errors[shorten(r_key)] = conn.smembers(r_key) + end end errors end def remove_errors(desc_key) - Redis.current.smembers(redis_key(desc_key)).each do |message| - Redis.current.srem(redis_key(desc_key), message) + Hyrax.config.redis_connection.with do |conn| + conn.smembers(redis_key(desc_key)).each do |message| + conn.srem(redis_key(desc_key), message) + end end end diff --git a/app/models/file_set.rb b/app/models/file_set.rb index 81e469819..59c59f767 100644 --- a/app/models/file_set.rb +++ b/app/models/file_set.rb @@ -34,18 +34,10 @@ def oembed? !oembed_url.nil? && !oembed_url.empty? end - def self.characterization_terms - %i[ - format_label file_size well_formed valid date_created fits_version - exif_version original_checksum byte_order compression height width color_space - profile_name profile_version orientation color_map image_producer capture_device - scanning_software gps_timestamp latitude longitude file_title creator page_count - language word_count character_count line_count character_set markup_basis markup_language - paragraph_count table_count graphics_count bit_depth channels data_format frame_rate - bit_rate duration sample_rate offset aspect_ratio - ] - end + self.characterization_terms = Hyrax::FileSetPresenter.characterization_terms - %i[filename] delegate(*characterization_terms, to: :characterization_proxy) + alias filename file_name + alias last_modified date_modified def hocr_text # Use hocr derivative if available diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index 7785c6961..1cf56664a 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -168,6 +168,10 @@ def oai_collections self['oai_collections_ssim'] end + def oembed_url + self['oembed_url_sim'] + end + # METHOD: Fetch the ssim for 'label$uri' def label_uri_helpers(attribute_name) OregonDigital::LabelParserService.parse_label_uris(self["#{attribute_name}_parsable_label_ssim"]) @@ -184,6 +188,6 @@ def resource solrized_methods Generic.controlled_properties solrized_methods Generic.controlled_property_labels solrized_methods FileSet.characterization_terms - solrized_methods %w[resource_type_label language_label rights_statement_label oembed_url] + solrized_methods %w[resource_type_label language_label rights_statement_label] end # rubocop:enable Metrics/ClassLength diff --git a/app/presenters/hyrax/file_set_presenter.rb b/app/presenters/hyrax/file_set_presenter.rb index f22544774..b1e47f9ed 100644 --- a/app/presenters/hyrax/file_set_presenter.rb +++ b/app/presenters/hyrax/file_set_presenter.rb @@ -22,7 +22,8 @@ def initialize(solr_document, current_ability, request = nil) # CurationConcern methods delegate :stringify_keys, :human_readable_type, :collection?, :image?, :video?, - :audio?, :pdf?, :office_document?, :representative_id, :to_s, to: :solr_document + :audio?, :pdf?, :office_document?, :representative_id, :to_s, + :extensions_and_mime_types, to: :solr_document # Methods used by blacklight helpers delegate :has?, :first, :fetch, to: :solr_document @@ -37,16 +38,20 @@ def initialize(solr_document, current_ability, request = nil) :accessibility_feature, :alt_text, to: :solr_document + delegate :member_of_collection_ids, to: :parent + def self.characterization_terms %i[ - format_label file_size well_formed valid date_created fits_version - exif_version original_checksum byte_order compression height width color_space + file_name filename mime_type alpha_channels + last_modified date_created valid + format_label file_size well_formed + original_checksum byte_order compression height width color_space profile_name profile_version orientation color_map image_producer capture_device scanning_software gps_timestamp latitude longitude file_title creator page_count language word_count character_count line_count character_set markup_basis markup_language paragraph_count table_count graphics_count bit_depth channels data_format frame_rate bit_rate duration sample_rate offset aspect_ratio - ] + ].sort end delegate(*characterization_terms, to: :solr_document) @@ -73,6 +78,11 @@ def link_name current_ability.can?(:read, id) ? first_title : 'File' end + ## + # @deprecated use `::Ability.can?(:edit, presenter)`. Hyrax views calling + # presenter {#editor} methods will continue to call them until Hyrax + # 4.0.0. The deprecation time horizon for the presenter methods themselves + # is 5.0.0. def editor? current_ability.can?(:edit, solr_document) end @@ -115,6 +125,12 @@ def user_can_perform_any_action? current_ability.can?(:edit, id) || current_ability.can?(:destroy, id) || current_ability.can?(:download, id) end + ## + # @return [Array] + def show_partials + ['show_details'] + end + private def link_presenter_class diff --git a/app/presenters/hyrax/generic_presenter.rb b/app/presenters/hyrax/generic_presenter.rb index 6809586af..0d1aa0035 100644 --- a/app/presenters/hyrax/generic_presenter.rb +++ b/app/presenters/hyrax/generic_presenter.rb @@ -28,10 +28,15 @@ def iiif_viewer? fileset_viewable || work_viewable end + # Look for any direct filesets for oembed or any child works with oembed filesets def oembed_viewer? - file_set_presenters.any? do |presenter| + fileset_viewable = file_set_presenters.any? do |presenter| + oembed?(presenter) + end + work_viewable = work_presenters.any? do |presenter| oembed?(presenter) end + fileset_viewable || work_viewable end def page_title @@ -86,9 +91,17 @@ def presentable?(presenter) (presenter.image? || presenter.pdf? || presenter.video? || presenter.audio?) && current_ability.can?(:read, presenter.id) end + # if the given presenter is an oEmbed the user is allowed to see def oembed?(presenter) curation_concern = Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: presenter.id, use_valkyrie: false) - !curation_concern.oembed_url.nil? && !curation_concern.oembed_url.empty? && current_ability.can?(:read, presenter.id) + + if curation_concern.respond_to?(:oembed_url) + # You're a fileset + !curation_concern.oembed_url.blank? && current_ability.can?(:read, presenter.id) + else + # Or you're a work with filesets + curation_concern.file_sets.any?(&:oembed_url) && current_ability.can?(:read, presenter.id) + end end end end diff --git a/app/presenters/oregon_digital/iiif_presenter.rb b/app/presenters/oregon_digital/iiif_presenter.rb index eda60960c..ab8f2f5cf 100644 --- a/app/presenters/oregon_digital/iiif_presenter.rb +++ b/app/presenters/oregon_digital/iiif_presenter.rb @@ -70,12 +70,16 @@ def work_presenters presenters = work_ids.map do |id| doc = SolrDocument.new(document_hash[id]) + # We don't want the works that contain oembed to be put into the IIIF manifest + # They don't have a canvas and breaks the viewer + next unless doc.file_sets.map(&:oembed_url).flatten.compact.blank? + presenter = IIIFPresenter.new(doc, current_ability, request) presenter.file_sets = doc.file_sets presenter.collections = cached_collections presenter end - presenters + presenters.compact end # rubocop:enable Metrics/AbcSize # rubocop:enable Metrics/MethodLength diff --git a/app/services/hyrax/derivative_path.rb b/app/services/hyrax/derivative_path.rb deleted file mode 100644 index 5a6432b1a..000000000 --- a/app/services/hyrax/derivative_path.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -module Hyrax - # OVERRIDDEN: we need to customize how derivative paths are generated for - # PDFs which can have dozens of derivatives (one JP2 per page) - class DerivativePath - attr_reader :id, :destination_name - - class << self - # Path on file system where derivative file is stored - # @param [ActiveFedora::Base or String] object either the AF object or its id - # @param [String] destination_name - def derivative_path_for_reference(object, destination_name) - new(object, destination_name).derivative_path - end - - # @param [ActiveFedora::Base or String] object either the AF object or its id - # @return [Array] Array of paths to derivatives for this object. - def derivatives_for_reference(object) - new(object).all_paths - end - end - - # @param [ActiveFedora::Base, String] object either the AF object or its id - # @param [String] destination_name - def initialize(object, destination_name = nil) - @id = object.is_a?(String) ? object : object.id.to_s - @destination_name = destination_name.gsub(/^original_file_/, '') if destination_name - end - - def derivative_path - "#{path_prefix}-#{file_name}" - end - - def all_paths - Dir.glob(root_path.join('*')).select do |path| - path.start_with?(path_prefix.to_s) - end - end - - private - - # @return [String] Returns the root path where derivatives will be generated into. - def root_path - Pathname.new(derivative_path).dirname - end - - # @return Full prefix of the path for object. - def path_prefix - Pathname.new(Hyrax.config.derivatives_path).join(pair_path) - end - - def pair_path - id.split('').each_slice(2).map(&:join).join('/') - end - - def file_name - return unless destination_name - - destination_name + extension - end - - def extension - case destination_name - when 'thumbnail' - ".#{MIME::Types.type_for('jpg').first.extensions.first}" - else - ".#{destination_name}" - end - end - end -end diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index eb902a9f0..6c74f5c4c 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -3,7 +3,7 @@