hyrax 5.0.4 → 5.1.0.pre.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dassie/Gemfile +11 -12
- data/.dassie/bin/rails +0 -5
- data/.dassie/bin/rake +0 -5
- data/.dassie/config/application.rb +2 -1
- data/.dassie/config/environments/development.rb +1 -1
- data/.dassie/config/environments/production.rb +4 -2
- data/.dassie/config/environments/test.rb +1 -1
- data/.dassie/config/initializers/riiif.rb +20 -18
- data/.dassie/db/schema.rb +109 -110
- data/.github/workflows/lint-build-test.yml +1 -1
- data/.koppie/Gemfile +10 -11
- data/.koppie/bin/rails +0 -5
- data/.koppie/bin/rake +0 -5
- data/.koppie/config/application.rb +2 -1
- data/.koppie/config/environments/development.rb +1 -1
- data/.koppie/config/environments/production.rb +4 -2
- data/.koppie/config/environments/test.rb +1 -1
- data/.koppie/config/initializers/hyrax.rb +20 -17
- data/.koppie/config/initializers/riiif.rb +21 -18
- data/Dockerfile +7 -6
- data/app/actors/hyrax/actors/add_to_work_actor.rb +1 -1
- data/app/actors/hyrax/actors/apply_order_actor.rb +1 -1
- data/app/assets/stylesheets/hyrax/_tinymce.scss +6 -0
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +1 -0
- data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +4 -4
- data/app/controllers/hyrax/api/zotero_controller.rb +1 -1
- data/app/jobs/batch_create_job.rb +2 -2
- data/app/models/admin_set.rb +2 -2
- data/app/models/concerns/hyrax/permissions/writable.rb +1 -2
- data/app/models/concerns/hyrax/valkyrie_lazy_migration.rb +1 -0
- data/app/models/hyrax/collection_type.rb +4 -4
- data/app/models/single_use_link.rb +1 -1
- data/app/services/hyrax/listeners.rb +1 -0
- data/app/services/hyrax/statistics/term_query.rb +1 -1
- data/app/services/hyrax/user_stat_importer.rb +1 -1
- data/app/services/hyrax/workflow.rb +8 -0
- data/app/validators/hyrax/has_one_title_validator.rb +1 -1
- data/config/initializers/1_healthz.rb +2 -1
- data/config/initializers/ar_test_fixture_monkey_patch.rb +8 -0
- data/config/initializers/arel_rails_7_2_monkey_patch.rb +6 -0
- data/config/initializers/listeners.rb +4 -2
- data/config/initializers/new_framework_defaults_7_2.rb +8 -0
- data/docker-compose-sirenia.yml +1 -1
- data/documentation/developing-your-hyrax-based-app.md +6 -6
- data/hyrax.gemspec +8 -8
- data/lib/generators/hyrax/config_generator.rb +0 -5
- data/lib/generators/hyrax/install_generator.rb +1 -1
- data/lib/generators/hyrax/templates/config/initializers/riiif.rb +21 -19
- data/lib/hyrax/configuration.rb +1 -0
- data/lib/hyrax/controlled_vocabulary/importer/language.rb +1 -1
- data/lib/hyrax/engine.rb +15 -10
- data/lib/hyrax/version.rb +1 -1
- data/lib/hyrax.rb +4 -0
- data/template.rb +6 -1
- metadata +41 -42
- data/.dassie/bin/spring +0 -17
- data/.dassie/config/initializers/mini_magick.rb +0 -6
- data/.dassie/config/spring.rb +0 -6
- data/.koppie/bin/spring +0 -17
- data/.koppie/config/initializers/mini_magick.rb +0 -6
- data/.koppie/config/spring.rb +0 -6
- data/config/initializers/reform_rails_6_1_monkey_patch.rb +0 -27
- data/lib/generators/hyrax/templates/config/initializers/mini_magick.rb +0 -6
@@ -26,8 +26,10 @@ Rails.application.configure do
|
|
26
26
|
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
27
27
|
|
28
28
|
# Compress JavaScripts and CSS.
|
29
|
-
config.assets.
|
30
|
-
|
29
|
+
config.assets.configure do |env|
|
30
|
+
env.js_compressor = :uglifier
|
31
|
+
# env.css_compressor = :sass
|
32
|
+
end
|
31
33
|
|
32
34
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
33
35
|
config.assets.compile = false
|
@@ -43,7 +43,7 @@ Rails.application.configure do
|
|
43
43
|
config.active_support.deprecation = :stderr
|
44
44
|
|
45
45
|
# Raises error for missing translations
|
46
|
-
# config.
|
46
|
+
# config.i18n.raise_on_missing_translations = true
|
47
47
|
|
48
48
|
config.log_level = :warn
|
49
49
|
end
|
@@ -317,23 +317,26 @@ Qa::Authorities::Local.register_subauthority('subjects', 'Qa::Authorities::Local
|
|
317
317
|
Qa::Authorities::Local.register_subauthority('languages', 'Qa::Authorities::Local::TableBasedAuthority')
|
318
318
|
Qa::Authorities::Local.register_subauthority('genres', 'Qa::Authorities::Local::TableBasedAuthority')
|
319
319
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
320
|
+
Rails.application.reloader.to_prepare do
|
321
|
+
custom_queries = [Hyrax::CustomQueries::Navigators::CollectionMembers,
|
322
|
+
Hyrax::CustomQueries::Navigators::ChildCollectionsNavigator,
|
323
|
+
Hyrax::CustomQueries::Navigators::ParentCollectionsNavigator,
|
324
|
+
Hyrax::CustomQueries::Navigators::ChildFileSetsNavigator,
|
325
|
+
Hyrax::CustomQueries::Navigators::ChildWorksNavigator,
|
326
|
+
Hyrax::CustomQueries::Navigators::ParentWorkNavigator,
|
327
|
+
Hyrax::CustomQueries::Navigators::FindFiles,
|
328
|
+
Hyrax::CustomQueries::FindAccessControl,
|
329
|
+
Hyrax::CustomQueries::FindCollectionsByType,
|
330
|
+
Hyrax::CustomQueries::FindFileMetadata,
|
331
|
+
Hyrax::CustomQueries::FindIdsByModel,
|
332
|
+
Hyrax::CustomQueries::FindManyByAlternateIds,
|
333
|
+
Hyrax::CustomQueries::FindModelsByAccess,
|
334
|
+
Hyrax::CustomQueries::FindCountBy,
|
335
|
+
Hyrax::CustomQueries::FindByDateRange]
|
336
|
+
custom_queries.each do |handler|
|
337
|
+
Hyrax.query_service.custom_queries.register_query_handler(handler)
|
338
|
+
end
|
337
339
|
end
|
338
340
|
|
341
|
+
|
339
342
|
ActiveFedora.init(solr_config_path: Rails.root.join('config', 'solr.yml'))
|
@@ -35,32 +35,35 @@ end
|
|
35
35
|
module Hyrax
|
36
36
|
# Adds file locking to Riiif::File
|
37
37
|
# @see RiiifFileResolver
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
Rails.application.reloader.to_prepare do
|
39
|
+
class RiiifFile < Riiif::File
|
40
|
+
include ActiveSupport::Benchmarkable
|
41
|
+
|
42
|
+
attr_reader :id
|
43
|
+
def initialize(input_path, tempfile = nil, id:)
|
44
|
+
super(input_path, tempfile)
|
45
|
+
raise(ArgumentError, "must specify id") if id.blank?
|
46
|
+
@id = id
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
# Wrap extract in a read lock and benchmark it
|
50
|
+
def extract(transformation, image_info = nil)
|
51
|
+
Riiif::Image.file_resolver.file_locks[id].with_read_lock do
|
52
|
+
benchmark "RiiifFile extracted #{path} with #{transformation.to_params}", level: :debug do
|
53
|
+
super
|
54
|
+
end
|
53
55
|
end
|
54
56
|
end
|
55
|
-
end
|
56
57
|
|
57
|
-
|
58
|
+
private
|
58
59
|
|
59
|
-
|
60
|
-
|
60
|
+
def logger
|
61
|
+
Hyrax.logger
|
62
|
+
end
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
66
|
+
|
64
67
|
class RiiifFileResolver
|
65
68
|
include ActiveSupport::Benchmarkable
|
66
69
|
|
data/Dockerfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
ARG ALPINE_VERSION=3.
|
2
|
-
ARG RUBY_VERSION=3.
|
1
|
+
ARG ALPINE_VERSION=3.21
|
2
|
+
ARG RUBY_VERSION=3.3.6
|
3
3
|
|
4
4
|
FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION AS hyrax-base
|
5
5
|
|
@@ -7,6 +7,9 @@ ARG DATABASE_APK_PACKAGE="postgresql-dev"
|
|
7
7
|
ARG EXTRA_APK_PACKAGES="git"
|
8
8
|
ARG RUBYGEMS_VERSION=""
|
9
9
|
|
10
|
+
RUN addgroup -S --gid 101 app && \
|
11
|
+
adduser -S -G app -u 1001 -s /bin/sh -h /app app
|
12
|
+
|
10
13
|
RUN apk --no-cache upgrade && \
|
11
14
|
apk --no-cache add acl \
|
12
15
|
build-base \
|
@@ -32,8 +35,6 @@ RUN apk --no-cache upgrade && \
|
|
32
35
|
RUN setfacl -d -m o::rwx /usr/local/bundle && \
|
33
36
|
gem update --silent --system $RUBYGEMS_VERSION
|
34
37
|
|
35
|
-
RUN addgroup -S --gid 101 app && \
|
36
|
-
adduser -S -G app -u 1001 -s /bin/sh -h /app app
|
37
38
|
USER app
|
38
39
|
|
39
40
|
RUN mkdir -p /app/samvera/hyrax-webapp
|
@@ -56,7 +57,7 @@ ARG BUNDLE_WITHOUT="development test"
|
|
56
57
|
|
57
58
|
ONBUILD COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
|
58
59
|
ONBUILD RUN bundle install --jobs "$(nproc)"
|
59
|
-
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret`
|
60
|
+
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DATABASE_URL='nulldb://nulldb' bundle exec rake assets:precompile
|
60
61
|
|
61
62
|
|
62
63
|
FROM hyrax-base AS hyrax-worker-base
|
@@ -88,7 +89,7 @@ ARG BUNDLE_WITHOUT="development test"
|
|
88
89
|
|
89
90
|
ONBUILD COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
|
90
91
|
ONBUILD RUN bundle install --jobs "$(nproc)"
|
91
|
-
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret`
|
92
|
+
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DATABASE_URL='nulldb://nulldb' bundle exec rake assets:precompile
|
92
93
|
|
93
94
|
|
94
95
|
FROM hyrax-worker-base AS hyrax-engine-dev
|
@@ -69,7 +69,7 @@ module Hyrax
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def add_permissions_error(work)
|
72
|
-
work.errors
|
72
|
+
work.errors.add(:in_works_ids, "Works can only be related to each other if user has ability to edit both.")
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -41,7 +41,7 @@ module Hyrax
|
|
41
41
|
env.curation_concern.ordered_members << work
|
42
42
|
env.curation_concern.save!
|
43
43
|
else
|
44
|
-
env.curation_concern.errors
|
44
|
+
env.curation_concern.errors.add(:ordered_member_ids, "Works can only be related to each other if user has ability to edit both.")
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -12,3 +12,9 @@
|
|
12
12
|
.home_marketing_text #content_block_external_key {
|
13
13
|
color: black;
|
14
14
|
}
|
15
|
+
|
16
|
+
// Prevents text from being clipped in Tiny MCE bottom status bar and drop-down style menu (Issue #6789)
|
17
|
+
.tox .tox-statusbar { overflow: visible !important; }
|
18
|
+
.tox .tox-tbtn--bespoke .tox-tbtn__select-label { overflow: visible !important; }
|
19
|
+
.tox .tox-tbtn { overflow: visible !important; }
|
20
|
+
.tox-tinymce { overflow: visible !important; }
|
@@ -360,6 +360,7 @@ module Hyrax
|
|
360
360
|
# that they have not removed from the upload widget.
|
361
361
|
uploaded_files = params.fetch(:uploaded_files, [])
|
362
362
|
selected_files = params.fetch(:selected_files, {}).values
|
363
|
+
.map { |f| f.permit(:expires, :file_name, :url, {}) }
|
363
364
|
browse_everything_urls = uploaded_files &
|
364
365
|
selected_files.map { |f| f[:url] }
|
365
366
|
|
@@ -21,14 +21,14 @@ module Hyrax
|
|
21
21
|
|
22
22
|
def after_destroy_error
|
23
23
|
if source.admin_set?
|
24
|
-
@permission_template_access.errors
|
25
|
-
t('hyrax.admin.admin_sets.form.permission_destroy_errors.participants')
|
24
|
+
@permission_template_access.errors.add(:base,
|
25
|
+
t('hyrax.admin.admin_sets.form.permission_destroy_errors.participants'))
|
26
26
|
redirect_to hyrax.edit_admin_admin_set_path(source_id,
|
27
27
|
anchor: 'participants'),
|
28
28
|
alert: @permission_template_access.errors.full_messages.to_sentence
|
29
29
|
else
|
30
|
-
@permission_template_access.errors
|
31
|
-
t('hyrax.dashboard.collections.form.permission_update_errors.sharing')
|
30
|
+
@permission_template_access.errors.add(:base,
|
31
|
+
t('hyrax.dashboard.collections.form.permission_update_errors.sharing'))
|
32
32
|
redirect_to hyrax.edit_dashboard_collection_path(source_id,
|
33
33
|
anchor: 'sharing'),
|
34
34
|
alert: @permission_template_access.errors.full_messages.to_sentence
|
@@ -14,7 +14,7 @@ module Hyrax
|
|
14
14
|
session[:request_token] = request_token
|
15
15
|
current_user.zotero_token = request_token
|
16
16
|
current_user.save
|
17
|
-
redirect_to request_token.authorize_url(identity: '1', oauth_callback: callback_url)
|
17
|
+
redirect_to request_token.authorize_url(identity: '1', oauth_callback: callback_url), allow_other_host: true
|
18
18
|
rescue OAuth::Unauthorized
|
19
19
|
redirect_to root_url, alert: 'Invalid Zotero client key pair'
|
20
20
|
end
|
@@ -32,8 +32,8 @@ class BatchCreateJob < Hyrax::ApplicationJob
|
|
32
32
|
title = [titles[upload_id]] if titles[upload_id]
|
33
33
|
resource_type = Array.wrap(resource_types[upload_id]) if resource_types[upload_id]
|
34
34
|
job_attributes = job_attributes.merge(uploaded_files: [upload_id],
|
35
|
-
|
36
|
-
|
35
|
+
title: title,
|
36
|
+
resource_type: resource_type)
|
37
37
|
child_operation = Hyrax::Operation.create!(user: user,
|
38
38
|
operation_type: "Create Work",
|
39
39
|
parent: operation)
|
data/app/models/admin_set.rb
CHANGED
@@ -105,13 +105,13 @@ class AdminSet < ActiveFedora::Base
|
|
105
105
|
|
106
106
|
def check_if_empty
|
107
107
|
return true if members.empty?
|
108
|
-
errors
|
108
|
+
errors.add(:base, I18n.t('hyrax.admin.admin_sets.delete.error_not_empty'))
|
109
109
|
throw :abort
|
110
110
|
end
|
111
111
|
|
112
112
|
def check_if_not_default_set
|
113
113
|
return true unless Hyrax::AdminSetCreateService.default_admin_set?(id: id)
|
114
|
-
errors
|
114
|
+
errors.add(:base, I18n.t('hyrax.admin.admin_sets.delete.error_default_set'))
|
115
115
|
throw :abort
|
116
116
|
end
|
117
117
|
end
|
@@ -23,8 +23,7 @@ module Hyrax
|
|
23
23
|
valid = true
|
24
24
|
paranoid_edit_permissions.each do |validation|
|
25
25
|
next unless validation[:condition].call(self)
|
26
|
-
errors
|
27
|
-
errors[validation[:key]] << validation[:message]
|
26
|
+
errors.add(validation[:key], validation[:message])
|
28
27
|
valid = false
|
29
28
|
end
|
30
29
|
valid
|
@@ -163,26 +163,26 @@ module Hyrax
|
|
163
163
|
|
164
164
|
def ensure_no_collections
|
165
165
|
return true unless collections?
|
166
|
-
errors
|
166
|
+
errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.not_empty'))
|
167
167
|
throw :abort
|
168
168
|
end
|
169
169
|
|
170
170
|
def ensure_no_settings_changes_for_admin_set_type
|
171
171
|
return true unless admin_set? && collection_type_settings_changed? && exists_for_machine_id?(ADMIN_SET_MACHINE_ID)
|
172
|
-
errors
|
172
|
+
errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_admin_sets'))
|
173
173
|
throw :abort
|
174
174
|
end
|
175
175
|
|
176
176
|
def ensure_no_settings_changes_for_user_collection_type
|
177
177
|
return true unless user_collection? && collection_type_settings_changed? && exists_for_machine_id?(USER_COLLECTION_MACHINE_ID)
|
178
|
-
errors
|
178
|
+
errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_user_collections'))
|
179
179
|
throw :abort
|
180
180
|
end
|
181
181
|
|
182
182
|
def ensure_no_settings_changes_if_collections_exist
|
183
183
|
return true unless collections?
|
184
184
|
return true unless collection_type_settings_changed?
|
185
|
-
errors
|
185
|
+
errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_if_not_empty'))
|
186
186
|
throw :abort
|
187
187
|
end
|
188
188
|
|
@@ -20,6 +20,7 @@ module Hyrax
|
|
20
20
|
autoload :ACLIndexListener
|
21
21
|
autoload :ActiveFedoraACLIndexListener
|
22
22
|
autoload :BatchNotificationListener
|
23
|
+
autoload :FileListener
|
23
24
|
autoload :FileMetadataListener
|
24
25
|
autoload :FileSetLifecycleListener
|
25
26
|
autoload :FileSetLifecycleNotificationListener
|
@@ -49,7 +49,7 @@ module Hyrax
|
|
49
49
|
|
50
50
|
def process_files(stats, user, start_date)
|
51
51
|
file_ids_for_user(user).each do |file_id|
|
52
|
-
file =
|
52
|
+
file = Hyrax.query_service.find_by(id: file_id)
|
53
53
|
view_stats = extract_stats_for(object: file, from: FileViewStat, start_date: start_date, user: user)
|
54
54
|
stats = tally_results(view_stats, :views, stats) if view_stats.present?
|
55
55
|
delay
|
@@ -4,7 +4,7 @@ module Hyrax
|
|
4
4
|
class HasOneTitleValidator < ActiveModel::Validator
|
5
5
|
def validate(record)
|
6
6
|
return unless record.title.reject(&:empty?).empty?
|
7
|
-
record.errors
|
7
|
+
record.errors.add(:title, "You must provide a title")
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraACLIndexListener.new) unless Hyrax.config.disable_wings
|
4
4
|
|
5
|
-
|
6
|
-
Hyrax.publisher.
|
5
|
+
Rails.application.reloader.to_prepare do
|
6
|
+
Hyrax.publisher.default_listeners.each do |listener|
|
7
|
+
Hyrax.publisher.subscribe(listener)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
|
9
11
|
# Publish events from old style Hyrax::Callbacks to trigger the listeners
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Any options set here are to override Rails 7.2 configuration defaults
|
4
|
+
|
5
|
+
# These fix a couple of issues arising from Rails 7.2 enforcement of HTML5 semantics
|
6
|
+
# by default when using certain Rails methods
|
7
|
+
Rails.application.config.action_view.button_to_generates_button_tag = false
|
8
|
+
Rails.application.config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer
|
data/docker-compose-sirenia.yml
CHANGED
@@ -32,7 +32,7 @@ You can also try [Running Hyrax-based application in local VM](https://github.co
|
|
32
32
|
During development, running only the dependent services in a container environment may be beneficial. This avoids potential headaches concerning file permissions and eases the use of debugging tools. The application generation instructions below use [Lando](https://lando.dev) to achieve this setup.
|
33
33
|
|
34
34
|
This document contains instructions specific to setting up an app with __Hyrax
|
35
|
-
v5.0.
|
35
|
+
v5.1.0-beta1__. If you are looking for instructions on installing a different
|
36
36
|
version, be sure to select the appropriate branch or tag from the drop-down
|
37
37
|
menu above.
|
38
38
|
|
@@ -46,7 +46,7 @@ Prerequisites are required for both creating a Hyrax\-based app and contributing
|
|
46
46
|
Hyrax requires the following software to work:
|
47
47
|
|
48
48
|
1. [Solr](http://lucene.apache.org/solr/) version >= 5.x (tested up to 8.11.1, which includes the log4j library update)
|
49
|
-
1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.7.6 (if
|
49
|
+
1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.7.6 && < 5 (if using legacy ActiveFedora) or >= 6.5.1 (if using the Valkyrie Fedora adapter)
|
50
50
|
1. A SQL RDBMS ([PostgreSQL](https://www.postgresql.org) recommended)
|
51
51
|
1. [Redis](http://redis.io/), a key-value store
|
52
52
|
1. [ImageMagick](http://www.imagemagick.org/) with JPEG-2000 support
|
@@ -102,7 +102,7 @@ Once ffmpeg has been installed, enable transcoding by setting `config.enable_ffm
|
|
102
102
|
|
103
103
|
First, you'll need a working Ruby installation. You can install this via your operating system's package manager -- you are likely to get farther with OSX, Linux, or UNIX than Windows but your mileage may vary -- but we recommend using a Ruby version manager such as [RVM](https://rvm.io/) or [rbenv](https://github.com/sstephenson/rbenv).
|
104
104
|
|
105
|
-
Hyrax supports Ruby 3.
|
105
|
+
Hyrax supports Ruby 3.3. When starting a new project, we recommend using the latest Ruby 3.3 version.
|
106
106
|
|
107
107
|
## Redis
|
108
108
|
|
@@ -112,11 +112,11 @@ Starting up Redis will depend on your operating system, and may in fact already
|
|
112
112
|
|
113
113
|
## Rails
|
114
114
|
|
115
|
-
Hyrax requires Rails
|
115
|
+
Hyrax requires Rails 7. We recommend the latest Rails 7.2 release.
|
116
116
|
|
117
117
|
```
|
118
118
|
# If you don't already have Rails at your disposal...
|
119
|
-
gem install rails -v
|
119
|
+
gem install rails -v 7.2.2.1
|
120
120
|
```
|
121
121
|
|
122
122
|
### JavaScript runtime
|
@@ -148,7 +148,7 @@ Generate a new Rails application using the template.
|
|
148
148
|
**NOTE:** `HYRAX_SKIP_WINGS` is needed here to avoid loading the Wings compatibility layer during the application generation process.
|
149
149
|
|
150
150
|
```shell
|
151
|
-
HYRAX_SKIP_WINGS=true rails
|
151
|
+
HYRAX_SKIP_WINGS=true rails _7.2.2.1_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.1.0-beta1/template.rb
|
152
152
|
```
|
153
153
|
|
154
154
|
Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
|
data/hyrax.gemspec
CHANGED
@@ -32,9 +32,9 @@ SUMMARY
|
|
32
32
|
# NOTE: rails does not follow sem-ver conventions, it's
|
33
33
|
# minor version releases can include breaking changes; see
|
34
34
|
# http://guides.rubyonrails.org/maintenance_policy.html
|
35
|
-
spec.add_dependency 'rails', '~>
|
35
|
+
spec.add_dependency 'rails', '~> 7.2', '< 8.0'
|
36
36
|
|
37
|
-
spec.add_dependency 'active-fedora', '~>
|
37
|
+
spec.add_dependency 'active-fedora', '~> 15.0'
|
38
38
|
spec.add_dependency 'almond-rails', '~> 0.1'
|
39
39
|
spec.add_dependency 'awesome_nested_set', '~> 3.1'
|
40
40
|
spec.add_dependency 'blacklight', '~> 7.29'
|
@@ -56,22 +56,22 @@ SUMMARY
|
|
56
56
|
spec.add_dependency 'flot-rails', '~> 0.0.6'
|
57
57
|
spec.add_dependency 'font-awesome-rails', '~> 4.2'
|
58
58
|
spec.add_dependency 'google-analytics-data', '~> 0.6'
|
59
|
-
spec.add_dependency 'hydra-derivatives', '~>
|
60
|
-
spec.add_dependency 'hydra-editor', '~>
|
59
|
+
spec.add_dependency 'hydra-derivatives', '~> 4.0'
|
60
|
+
spec.add_dependency 'hydra-editor', '~> 7.0'
|
61
61
|
spec.add_dependency 'hydra-file_characterization', '~> 1.1'
|
62
|
-
spec.add_dependency 'hydra-head', '~>
|
62
|
+
spec.add_dependency 'hydra-head', '~> 13.0'
|
63
63
|
spec.add_dependency 'hydra-works', '>= 0.16'
|
64
64
|
spec.add_dependency 'iiif_manifest', '>= 0.3', '< 2.0'
|
65
65
|
spec.add_dependency 'json-schema' # for Arkivo
|
66
66
|
spec.add_dependency 'legato', '~> 0.3'
|
67
67
|
spec.add_dependency 'linkeddata' # Required for getting values from geonames
|
68
|
+
spec.add_dependency 'listen', '~> 3.9'
|
68
69
|
spec.add_dependency 'mailboxer', '~> 0.12'
|
69
70
|
spec.add_dependency 'nest', '~> 3.1'
|
70
71
|
spec.add_dependency 'noid-rails', '~> 3.0'
|
71
72
|
spec.add_dependency 'oauth'
|
72
73
|
spec.add_dependency 'oauth2', '~> 1.2'
|
73
74
|
spec.add_dependency 'openseadragon', '~> 0.9'
|
74
|
-
spec.add_dependency 'posix-spawn'
|
75
75
|
spec.add_dependency 'qa', '~> 5.5', '>= 5.5.1' # questioning_authority
|
76
76
|
spec.add_dependency 'rails_autolink', '~> 1.1'
|
77
77
|
spec.add_dependency 'rdf-rdfxml' # controlled vocabulary importer
|
@@ -92,7 +92,7 @@ SUMMARY
|
|
92
92
|
|
93
93
|
spec.add_development_dependency "capybara", '~> 3.29'
|
94
94
|
spec.add_development_dependency 'capybara-screenshot', '~> 1.0'
|
95
|
-
spec.add_development_dependency 'database_cleaner', '
|
95
|
+
spec.add_development_dependency 'database_cleaner', '>= 1.3'
|
96
96
|
spec.add_development_dependency "equivalent-xml", '~> 0.5'
|
97
97
|
spec.add_development_dependency "factory_bot", '~> 4.4'
|
98
98
|
spec.add_development_dependency 'mida', '~> 0.3'
|
@@ -100,7 +100,7 @@ SUMMARY
|
|
100
100
|
spec.add_development_dependency 'pg', '~> 1.2'
|
101
101
|
spec.add_development_dependency 'rspec-activemodel-mocks', '~> 1.0'
|
102
102
|
spec.add_development_dependency 'rspec-its', '~> 1.1'
|
103
|
-
spec.add_development_dependency 'rspec-rails', '~>
|
103
|
+
spec.add_development_dependency 'rspec-rails', '~> 7.0'
|
104
104
|
spec.add_development_dependency 'rspec_junit_formatter'
|
105
105
|
spec.add_development_dependency "selenium-webdriver", '~> 4.4'
|
106
106
|
spec.add_development_dependency 'i18n-debug'
|
@@ -59,11 +59,6 @@ class Hyrax::ConfigGenerator < Rails::Generators::Base
|
|
59
59
|
copy_file 'config/initializers/hyrax.rb'
|
60
60
|
end
|
61
61
|
|
62
|
-
# Add mini-magick configuration
|
63
|
-
def minimagick_config
|
64
|
-
copy_file 'config/initializers/mini_magick.rb'
|
65
|
-
end
|
66
|
-
|
67
62
|
def tinymce_config
|
68
63
|
copy_file 'config/tinymce.yml'
|
69
64
|
end
|
@@ -188,7 +188,7 @@ module Hyrax
|
|
188
188
|
generate 'hyrax:riiif' unless options[:'skip-riiif']
|
189
189
|
end
|
190
190
|
|
191
|
-
def
|
191
|
+
def insert_application_config
|
192
192
|
insert_into_file 'config/application.rb', after: /config\.load_defaults [0-9.]+$/ do
|
193
193
|
"\n config.active_job.queue_adapter = ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE') { 'async' }.to_sym\n"
|
194
194
|
end
|
@@ -29,35 +29,37 @@ Rails.application.reloader.to_prepare do
|
|
29
29
|
Riiif.not_found_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
30
30
|
Riiif.unauthorized_image = Rails.root.join('app', 'assets', 'images', 'us_404.svg')
|
31
31
|
|
32
|
-
Riiif::Engine.config.cache_duration = 1.
|
32
|
+
Riiif::Engine.config.cache_duration = 1.day
|
33
33
|
end
|
34
34
|
|
35
35
|
module Hyrax
|
36
36
|
# Adds file locking to Riiif::File
|
37
37
|
# @see RiiifFileResolver
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
38
|
+
Rails.application.reloader.to_prepare do
|
39
|
+
class RiiifFile < Riiif::File
|
40
|
+
include ActiveSupport::Benchmarkable
|
41
|
+
|
42
|
+
attr_reader :id
|
43
|
+
def initialize(input_path, tempfile = nil, id:)
|
44
|
+
super(input_path, tempfile)
|
45
|
+
raise(ArgumentError, "must specify id") if id.blank?
|
46
|
+
@id = id
|
47
|
+
end
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
# Wrap extract in a read lock and benchmark it
|
50
|
+
def extract(transformation, image_info = nil)
|
51
|
+
Riiif::Image.file_resolver.file_locks[id].with_read_lock do
|
52
|
+
benchmark "RiiifFile extracted #{path} with #{transformation.to_params}", level: :debug do
|
53
|
+
super
|
54
|
+
end
|
53
55
|
end
|
54
56
|
end
|
55
|
-
end
|
56
57
|
|
57
|
-
|
58
|
+
private
|
58
59
|
|
59
|
-
|
60
|
-
|
60
|
+
def logger
|
61
|
+
Hyrax.logger
|
62
|
+
end
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|