hyrax 5.1.0.pre.beta1 → 5.2.0
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/.env +4 -0
- data/.dassie/Gemfile +12 -7
- data/.dassie/app/controllers/application_controller.rb +4 -0
- data/.dassie/app/helpers/hyrax_helper.rb +4 -0
- data/.dassie/app/models/ability.rb +4 -0
- data/.dassie/app/models/user.rb +11 -0
- data/.dassie/app/views/shared/_footer.html.erb +17 -0
- data/.dassie/config/application.rb +1 -1
- data/.dassie/config/database.yml +18 -0
- data/.dassie/config/environments/production.rb +1 -1
- data/.dassie/config/fedora.yml +6 -6
- data/.dassie/config/initializers/devise.rb +1 -0
- data/.dassie/config/initializers/profiler.rb +5 -0
- data/.dassie/config/locales/hyrax.en.yml +1 -1
- data/.dassie/config/puma.rb +55 -5
- data/.dassie/config/routes.rb +2 -0
- data/.dassie/db/migrate/20250328100249_user_roles.rb +20 -0
- data/.dassie/db/schema.rb +123 -109
- data/.github/workflows/lint-build-test.yml +34 -5
- data/.koppie/.env +1 -1
- data/.koppie/Gemfile +10 -6
- data/.koppie/app/controllers/application_controller.rb +4 -0
- data/.koppie/app/helpers/hyrax_helper.rb +4 -0
- data/.koppie/app/models/ability.rb +4 -0
- data/.koppie/app/models/user.rb +10 -0
- data/.koppie/app/views/shared/_footer.html.erb +17 -0
- data/.koppie/config/database.yml +2 -9
- data/.koppie/config/environments/development.rb +9 -0
- data/.koppie/config/environments/production.rb +1 -1
- data/.koppie/config/initializers/1_valkyrie.rb +5 -5
- data/.koppie/config/initializers/devise.rb +1 -1
- data/.koppie/config/initializers/profiler.rb +5 -0
- data/.koppie/config/locales/hyrax.en.yml +2 -2
- data/.koppie/config/puma.rb +26 -7
- data/.koppie/config/routes.rb +2 -0
- data/.koppie/db/schema.rb +109 -110
- data/CONTAINERS.md +10 -10
- data/Dockerfile +108 -50
- data/Gemfile +2 -1
- data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +1 -0
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +2 -1
- data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +4 -4
- data/app/controllers/hyrax/file_sets_controller.rb +11 -0
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +2 -2
- data/app/helpers/hyrax/trophy_helper.rb +1 -1
- data/app/jobs/concerns/hyrax/queued_job_behavior.rb +22 -0
- data/app/jobs/hyrax/propagate_change_depositor_job.rb +1 -1
- data/app/jobs/hyrax/queued_delete_job.rb +11 -0
- data/app/jobs/hyrax/queued_indexing_job.rb +11 -0
- data/app/jobs/migrate_files_to_valkyrie_job.rb +33 -21
- data/app/jobs/migrate_sipity_entity_job.rb +21 -0
- data/app/models/concerns/hyrax/ability.rb +4 -2
- data/app/models/concerns/hyrax/solr_document_behavior.rb +5 -2
- data/app/models/hyrax/file_metadata.rb +22 -7
- data/app/services/hyrax/analytics/ga4/base.rb +1 -1
- data/app/services/hyrax/analytics/ga4.rb +5 -1
- data/app/services/hyrax/change_depositor_service.rb +1 -1
- data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +21 -13
- data/app/services/hyrax/custom_queries/find_ids_by_model.rb +31 -6
- data/app/services/hyrax/edit_permissions_service.rb +9 -8
- data/app/services/hyrax/workflow/workflow_factory.rb +3 -3
- data/app/services/migrate_resource_service.rb +1 -1
- data/app/views/_user_util_links.html.erb +2 -1
- data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +3 -7
- data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +3 -6
- data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +2 -3
- data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +1 -6
- data/app/views/hyrax/base/_social_media.html.erb +2 -0
- data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_document_list_menu.html.erb +13 -12
- data/app/views/hyrax/my/_admin_set_action_menu.html.erb +31 -27
- data/app/views/hyrax/my/_collection_action_menu.html.erb +40 -35
- data/app/views/hyrax/my/_work_action_menu.html.erb +23 -22
- data/bin/db-migrate-seed.sh +1 -1
- data/bin/dev-entrypoint.sh +3 -0
- data/config/features.rb +50 -40
- data/config/initializers/indexing_adapter_initializer.rb +4 -0
- data/config/initializers/new_framework_defaults_7_2.rb +6 -4
- data/config/initializers/reform_rails_6_1_monkey_patch.rb +29 -0
- data/config/metadata/core_metadata.yaml +1 -0
- data/docker-compose-dassie.yml +6 -6
- data/docker-compose-koppie.yml +2 -2
- data/docker-compose-sirenia.yml +2 -2
- data/documentation/developing-your-hyrax-based-app.md +2 -2
- data/hyrax.gemspec +3 -3
- data/lib/freyja/persister.rb +11 -4
- data/lib/generators/hyrax/install_generator.rb +0 -5
- data/lib/generators/hyrax/templates/.env +1 -1
- data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +21 -19
- data/lib/generators/hyrax/templates/db/migrate/20170131142607_add_permission_template_to_sipity_workflow.rb.erb +1 -1
- data/lib/generators/hyrax/templates/db/migrate/20170810190549_update_collection_type_column_options.rb.erb +1 -1
- data/lib/generators/hyrax/templates/db/migrate/20230821153635_add_fields_to_counter_metric.rb.erb +1 -1
- data/lib/hyrax/configuration.rb +22 -7
- data/lib/hyrax/controlled_vocabulary/importer/language.rb +5 -1
- data/lib/hyrax/transactions/steps/add_file_sets.rb +2 -1
- data/lib/hyrax/version.rb +1 -1
- data/lib/hyrax.rb +1 -0
- data/lib/tasks/workflow.rake +1 -2
- data/lib/valkyrie/indexing/redis_queue/indexing_adapter.rb +144 -0
- data/lib/wings/valkyrie/query_service.rb +3 -4
- data/template.rb +1 -1
- metadata +28 -14
- data/.github/workflows/main.yml +0 -17
data/.koppie/Gemfile
CHANGED
@@ -19,24 +19,28 @@ gem 'devise-guests', '~> 0.8'
|
|
19
19
|
# To install the package in Alpine: `apk add ruby-grpc`
|
20
20
|
# The pinned versions should match the version provided by the Alpine packages.
|
21
21
|
|
22
|
-
|
23
|
-
#
|
22
|
+
if RUBY_PLATFORM =~ /musl/
|
23
|
+
# Disabled due to dependency mismatches in Alpine packages (grpc 1.62.1 needs protobuf ~> 3.25)
|
24
24
|
# path '/usr/lib/ruby/gems/3.3.0' do
|
25
|
-
|
26
|
-
|
25
|
+
gem 'google-protobuf', force_ruby_platform: true
|
26
|
+
gem 'grpc', force_ruby_platform: true
|
27
27
|
# end
|
28
|
-
|
28
|
+
end
|
29
29
|
|
30
|
+
gem 'hydra-role-management'
|
30
31
|
gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
|
31
32
|
gem 'jbuilder', '~> 2.5'
|
32
33
|
gem 'jquery-rails'
|
34
|
+
gem 'okcomputer'
|
33
35
|
gem 'pg', '~> 1.3'
|
34
36
|
gem 'puma'
|
37
|
+
gem 'rack-mini-profiler', require: ['prepend_net_http_patch']
|
35
38
|
gem 'rails', '~> 7.2', '< 8.0'
|
36
39
|
gem 'riiif', '~> 2.1'
|
37
40
|
gem 'rsolr', '>= 1.0', '< 3'
|
38
41
|
gem 'sass-rails', '~> 6.0'
|
39
|
-
gem 'sidekiq', '~>
|
42
|
+
gem 'sidekiq', '~> 7.0'
|
43
|
+
gem 'stackprof', require: false
|
40
44
|
gem 'turbolinks', '~> 5'
|
41
45
|
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
|
42
46
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
data/.koppie/app/models/user.rb
CHANGED
@@ -2,6 +2,9 @@ class User < ApplicationRecord
|
|
2
2
|
# Connects this user object to Hydra behaviors.
|
3
3
|
include Hydra::User
|
4
4
|
|
5
|
+
# Connects this user object to Role-management behaviors.
|
6
|
+
include Hydra::RoleManagement::UserRoles
|
7
|
+
|
5
8
|
# Connects this user object to Hyrax behaviors.
|
6
9
|
include Hyrax::User
|
7
10
|
include Hyrax::UserUsageStats
|
@@ -19,4 +22,11 @@ class User < ApplicationRecord
|
|
19
22
|
def to_s
|
20
23
|
email
|
21
24
|
end
|
25
|
+
|
26
|
+
# Groups include roles and those set by #groups= (especially in specs)
|
27
|
+
def groups
|
28
|
+
g = roles.map(&:name)
|
29
|
+
g += group_service.fetch_groups(user: self)
|
30
|
+
g
|
31
|
+
end
|
22
32
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<footer class="navbar navbar-dark bg-dark site-footer">
|
2
|
+
<div class="container-fluid">
|
3
|
+
<div class="navbar-text text-left">
|
4
|
+
<p><%= t('hyrax.footer.service_html') %> <%= t('hyrax.product_name') %> v<%= Hyrax::VERSION %></p>
|
5
|
+
<p>Commit <%= link_to ENV.fetch('BUILD_GITSHA', "Unknown")[0..6],
|
6
|
+
"https://github.com/samvera/hyrax/commit/#{ENV.fetch('BUILD_GITSHA', 'main')}" %>
|
7
|
+
Built at <%= ENV.fetch('BUILD_TIMESTAMP', 'Unknown') %>
|
8
|
+
</p>
|
9
|
+
</div>
|
10
|
+
<div class="navbar-right">
|
11
|
+
<div class="navbar-text text-right">
|
12
|
+
<p><%= t('hyrax.footer.copyright_html', current_year: Time.current.year) %></p>
|
13
|
+
<p><%= t('hyrax.background_attribution_html') %></p>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</footer>
|
data/.koppie/config/database.yml
CHANGED
@@ -1,23 +1,16 @@
|
|
1
1
|
default: &default
|
2
2
|
adapter: postgresql
|
3
|
-
|
4
|
-
timeout: <%= ENV.fetch('DB_TIMEOUT') { 5000 } %>
|
5
|
-
database: <%= ENV['APP_DB_NAME'] %>
|
6
|
-
username: <%= ENV['DB_USERNAME'] %>
|
7
|
-
password: <%= ENV['DB_PASSWORD'] %>
|
8
|
-
host: <%= ENV['DB_HOST'] %>
|
9
|
-
port: <%= ENV['DB_PORT'] %>
|
3
|
+
url: <%= ENV.fetch('DATABASE_URL') %>
|
10
4
|
|
11
5
|
development:
|
12
6
|
<<: *default
|
13
|
-
database: <%= ENV.fetch('APP_DB_NAME', 'nurax_pg_development') %>
|
14
7
|
|
15
8
|
# Warning: The database defined as "test" will be erased and
|
16
9
|
# re-generated from your development database when you run "rake".
|
17
10
|
# Do not set this db to the same as development or production.
|
18
11
|
test:
|
19
12
|
<<: *default
|
20
|
-
|
13
|
+
url: <%= ENV.fetch('DATABASE_TEST_URL') { ENV.fetch('DATABASE_URL') } %>
|
21
14
|
|
22
15
|
production:
|
23
16
|
<<: *default
|
@@ -29,6 +29,15 @@ Rails.application.configure do
|
|
29
29
|
config.cache_store = :null_store
|
30
30
|
end
|
31
31
|
|
32
|
+
# Logging
|
33
|
+
#
|
34
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", 'debug')
|
35
|
+
config.log_formatter = ::Logger::Formatter.new
|
36
|
+
# log to stdout
|
37
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
38
|
+
logger.formatter = config.log_formatter
|
39
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
40
|
+
|
32
41
|
# Store uploaded files on the local file system (see config/storage.yml for options)
|
33
42
|
config.active_storage.service = :local
|
34
43
|
|
@@ -56,7 +56,7 @@ Rails.application.configure do
|
|
56
56
|
|
57
57
|
# Use the lowest log level to ensure availability of diagnostic information
|
58
58
|
# when problems arise.
|
59
|
-
config.log_level = :debug
|
59
|
+
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :debug).to_sym
|
60
60
|
|
61
61
|
# Prepend all log lines with the following tags.
|
62
62
|
config.log_tags = [ :request_id ]
|
@@ -31,8 +31,8 @@ Valkyrie::MetadataAdapter.register(
|
|
31
31
|
Valkyrie::MetadataAdapter.register(
|
32
32
|
Valkyrie::Persistence::Fedora::MetadataAdapter.new(
|
33
33
|
connection: ::Ldp::Client.new(Hyrax.config.fedora_connection_builder.call(
|
34
|
-
ENV.fetch('
|
35
|
-
base_path: Rails.env,
|
34
|
+
ENV.fetch('FEDORA6_URL') { ENV.fetch('FEDORA_URL') { "http://localhost:8080/fcrepo/rest" } })),
|
35
|
+
base_path: ENV.fetch('FEDORA_BASE_PATH', Rails.env).gsub(/^\/|\/$/, ''),
|
36
36
|
schema: Valkyrie::Persistence::Fedora::PermissiveSchema.new(Hyrax::SimpleSchemaLoader.new.permissive_schema_for_valkrie_adapter),
|
37
37
|
fedora_version: 6.5,
|
38
38
|
fedora_pairtree_count: 4,
|
@@ -64,8 +64,8 @@ Valkyrie.config.metadata_adapter = ENV.fetch('VALKYRIE_METADATA_ADAPTER') { :pg_
|
|
64
64
|
Valkyrie::StorageAdapter.register(
|
65
65
|
Valkyrie::Storage::Fedora.new(
|
66
66
|
connection: ::Ldp::Client.new(Hyrax.config.fedora_connection_builder.call(
|
67
|
-
ENV.fetch('
|
68
|
-
base_path: Rails.env,
|
67
|
+
ENV.fetch('FEDORA6_URL') { ENV.fetch('FEDORA_URL') { "http://localhost:8080/fcrepo/rest" } })),
|
68
|
+
base_path: ENV.fetch('FEDORA_BASE_PATH', Rails.env).gsub(/^\/|\/$/, ''),
|
69
69
|
fedora_version: 6.5,
|
70
70
|
fedora_pairtree_count: 4,
|
71
71
|
fedora_pairtree_length: 2
|
@@ -73,7 +73,7 @@ Valkyrie::StorageAdapter.register(
|
|
73
73
|
)
|
74
74
|
|
75
75
|
Valkyrie::StorageAdapter.register(
|
76
|
-
Valkyrie::Storage::VersionedDisk.new(base_path: Rails.root.join("storage", "files"),
|
76
|
+
Valkyrie::Storage::VersionedDisk.new(base_path: ENV.fetch('HYRAX_STORAGE_PATH') { Rails.root.join("storage", "files") },
|
77
77
|
file_mover: FileUtils.method(:cp)),
|
78
78
|
:versioned_disk_storage
|
79
79
|
)
|
@@ -266,7 +266,7 @@ Devise.setup do |config|
|
|
266
266
|
# config.navigational_formats = ['*/*', :html]
|
267
267
|
|
268
268
|
# The default HTTP method used to sign out a resource. Default is :delete.
|
269
|
-
config.sign_out_via = :
|
269
|
+
config.sign_out_via = :delete
|
270
270
|
|
271
271
|
# ==> OmniAuth
|
272
272
|
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
@@ -50,9 +50,9 @@ en:
|
|
50
50
|
directory:
|
51
51
|
suffix: "@example.org"
|
52
52
|
footer:
|
53
|
-
copyright_html: "<strong>Copyright ©
|
53
|
+
copyright_html: "<strong>Copyright © %{current_year} Samvera</strong> Licensed under the Apache License, Version 2.0"
|
54
54
|
service_html: A service of <a href="http://samvera.org/" class="navbar-link" target="_blank">Samvera</a>.
|
55
55
|
institution_name: Institution
|
56
56
|
institution_name_full: The Institution Name
|
57
|
-
product_name:
|
57
|
+
product_name: Hyrax
|
58
58
|
product_twitter_handle: "@SamveraRepo"
|
data/.koppie/config/puma.rb
CHANGED
@@ -4,19 +4,20 @@
|
|
4
4
|
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
5
|
# and maximum; this matches the default thread size of Active Record.
|
6
6
|
#
|
7
|
-
threads_count = ENV.fetch("RAILS_MAX_THREADS"
|
8
|
-
threads
|
7
|
+
threads_count = ENV.fetch("RAILS_MAX_THREADS", 5).to_i
|
8
|
+
threads 1, threads_count - 2
|
9
9
|
|
10
10
|
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
11
11
|
#
|
12
|
-
port ENV.fetch("PORT"
|
12
|
+
port ENV.fetch("PORT", 3000)
|
13
13
|
|
14
14
|
# Specifies the `environment` that Puma will run in.
|
15
15
|
#
|
16
|
-
|
16
|
+
rails_env = ENV.fetch("RAILS_ENV", 'development')
|
17
|
+
environment rails_env
|
17
18
|
|
18
19
|
# Specifies the `pidfile` that Puma will use.
|
19
|
-
pidfile ENV.fetch("PIDFILE"
|
20
|
+
pidfile ENV.fetch("PIDFILE", 'tmp/pids/server.pid')
|
20
21
|
|
21
22
|
# Specifies the number of `workers` to boot in clustered mode.
|
22
23
|
# Workers are forked webserver processes. If using threads and workers together
|
@@ -24,14 +25,32 @@ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
|
24
25
|
# Workers do not work on JRuby or Windows (both of which do not support
|
25
26
|
# processes).
|
26
27
|
#
|
27
|
-
|
28
|
+
workers ENV.fetch('WEB_CONCURRENCY', 1)
|
28
29
|
|
29
30
|
# Use the `preload_app!` method when specifying a `workers` number.
|
30
31
|
# This directive tells Puma to first boot the application and load code
|
31
32
|
# before forking the application. This takes advantage of Copy On Write
|
32
33
|
# process behavior so workers use less memory.
|
33
34
|
#
|
34
|
-
|
35
|
+
preload_app!
|
35
36
|
|
36
37
|
# Allow puma to be restarted by `rails restart` command.
|
37
38
|
plugin :tmp_restart
|
39
|
+
|
40
|
+
# Embedded Sidekiq https://github.com/sidekiq/sidekiq/wiki/Embedding
|
41
|
+
if ENV.fetch('SIDEKIQ_MODE', false) == 'embed'
|
42
|
+
embedded_sidekiq = nil
|
43
|
+
|
44
|
+
on_worker_boot do
|
45
|
+
embedded_sidekiq = Sidekiq.configure_embed do |config|
|
46
|
+
config.logger.level = ENV.fetch("RAILS_LOG_LEVEL", 'debug')
|
47
|
+
config.queues = %w[ingest batch default]
|
48
|
+
config.concurrency = ENV.fetch('SIDEKIQ_WORKERS', 2) # Adjust max `threads` above accordingly
|
49
|
+
end
|
50
|
+
embedded_sidekiq.run
|
51
|
+
end
|
52
|
+
|
53
|
+
on_worker_shutdown do
|
54
|
+
embedded_sidekiq&.stop
|
55
|
+
end
|
56
|
+
end
|
data/.koppie/config/routes.rb
CHANGED