hyrax 4.0.0 → 5.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +116 -231
  3. data/.dassie/.env +3 -1
  4. data/.dassie/config/environments/test.rb +1 -0
  5. data/.dassie/config/initializers/hyrax.rb +3 -1
  6. data/.dassie/config/initializers/riiif.rb +13 -3
  7. data/.dassie/db/schema.rb +2 -2
  8. data/.dockerignore +6 -0
  9. data/.github/PULL_REQUEST_TEMPLATE.md +10 -7
  10. data/.github/release.yml +5 -2
  11. data/.koppie/.env +3 -0
  12. data/.koppie/app/forms/collection_resource_form.rb +1 -0
  13. data/.koppie/app/indexers/collection_resource_indexer.rb +1 -0
  14. data/.koppie/app/models/collection_resource.rb +1 -0
  15. data/.koppie/config/environments/test.rb +1 -0
  16. data/.koppie/config/initializers/hyrax.rb +8 -2
  17. data/.koppie/config/initializers/riiif.rb +13 -4
  18. data/.koppie/config/metadata/collection_resource.yaml +1 -128
  19. data/.koppie/yarn.lock +23 -23
  20. data/.regen +1 -1
  21. data/CONTAINERS.md +1 -1
  22. data/Dockerfile +6 -11
  23. data/app/actors/hyrax/actors/base_actor.rb +4 -3
  24. data/app/actors/hyrax/actors/embargo_actor.rb +5 -2
  25. data/app/actors/hyrax/actors/lease_actor.rb +5 -2
  26. data/app/assets/javascripts/hyrax/file_manager/sorting.es6 +3 -2
  27. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +1 -1
  28. data/app/controllers/concerns/hyrax/valkyrie_downloads_controller_behavior.rb +74 -0
  29. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +14 -5
  30. data/app/controllers/hyrax/admin/workflows_controller.rb +48 -3
  31. data/app/controllers/hyrax/batch_edits_controller.rb +33 -4
  32. data/app/controllers/hyrax/downloads_controller.rb +8 -1
  33. data/app/controllers/hyrax/file_sets_controller.rb +1 -0
  34. data/app/forms/hyrax/forms/file_set_edit_form.rb +1 -1
  35. data/app/forms/hyrax/forms/permission_template_form.rb +2 -0
  36. data/app/forms/hyrax/forms/resource_batch_edit_form.rb +90 -0
  37. data/app/forms/hyrax/forms/work_embargo_form.rb +1 -0
  38. data/app/forms/hyrax/forms/work_form.rb +1 -1
  39. data/app/forms/hyrax/forms/work_lease_form.rb +1 -0
  40. data/app/helpers/hyrax/dashboard_helper_behavior.rb +17 -9
  41. data/app/helpers/hyrax/membership_helper.rb +13 -1
  42. data/app/helpers/hyrax/work_form_helper.rb +0 -107
  43. data/app/indexers/hyrax/file_set_indexer.rb +6 -0
  44. data/app/indexers/hyrax/pcdm_collection_indexer.rb +8 -0
  45. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +41 -5
  46. data/app/indexers/hyrax/valkyrie_work_indexer.rb +8 -2
  47. data/app/jobs/valkyrie_create_derivatives_job.rb +8 -7
  48. data/app/jobs/valkyrie_ingest_job.rb +0 -1
  49. data/app/models/admin_set.rb +1 -31
  50. data/app/models/concerns/hyrax/file_set/derivatives.rb +3 -2
  51. data/app/models/concerns/hyrax/solr_document_behavior.rb +1 -1
  52. data/app/models/hyrax/collection_type.rb +5 -14
  53. data/app/models/hyrax/file_metadata.rb +6 -7
  54. data/app/models/hyrax/file_set.rb +8 -0
  55. data/app/models/hyrax/resource.rb +30 -2
  56. data/app/presenters/hyrax/file_set_presenter.rb +6 -0
  57. data/app/presenters/hyrax/iiif_manifest_presenter.rb +3 -7
  58. data/app/presenters/hyrax/presenter_renderer.rb +0 -7
  59. data/app/presenters/hyrax/work_show_presenter.rb +6 -11
  60. data/app/search_builders/hyrax/file_set_search_builder.rb +1 -1
  61. data/app/search_builders/hyrax/valkyrie_abstract_type_relation.rb +37 -0
  62. data/app/search_builders/hyrax/valkyrie_work_relation.rb +9 -0
  63. data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +11 -9
  64. data/app/services/hyrax/custom_queries/find_by_date_range.rb +55 -0
  65. data/app/services/hyrax/custom_queries/find_count_by.rb +62 -0
  66. data/app/services/hyrax/custom_queries/find_file_metadata.rb +1 -1
  67. data/app/services/hyrax/custom_queries/find_models_by_access.rb +59 -0
  68. data/app/services/hyrax/derivative_bucketed_storage.rb +25 -0
  69. data/app/services/hyrax/derivative_path.rb +14 -4
  70. data/app/services/hyrax/embargo_manager.rb +76 -10
  71. data/app/services/hyrax/file_set_derivatives_service.rb +3 -2
  72. data/app/services/hyrax/lease_manager.rb +88 -8
  73. data/app/services/hyrax/listeners/file_metadata_listener.rb +2 -2
  74. data/app/services/hyrax/listeners/workflow_listener.rb +8 -11
  75. data/app/services/hyrax/persist_directly_contained_output_file_service.rb +24 -2
  76. data/app/services/hyrax/solr_query_service.rb +7 -6
  77. data/app/services/hyrax/statistics/depositors/summary.rb +1 -1
  78. data/app/services/hyrax/statistics/over_time.rb +1 -1
  79. data/app/services/hyrax/statistics/users/over_time.rb +3 -1
  80. data/app/services/hyrax/statistics/valkyrie_query_service.rb +49 -0
  81. data/app/services/hyrax/statistics/works/count.rb +1 -1
  82. data/app/services/hyrax/thumbnail_path_service.rb +5 -0
  83. data/app/services/hyrax/valkyrie_persist_derivatives.rb +16 -11
  84. data/app/services/hyrax/valkyrie_upload.rb +5 -3
  85. data/app/services/hyrax/versioning_service.rb +1 -0
  86. data/app/services/hyrax/visibility_intention.rb +1 -4
  87. data/app/services/hyrax/visibility_propagator.rb +1 -1
  88. data/app/services/hyrax/workflow/actionable_objects.rb +28 -3
  89. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +1 -1
  90. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +1 -1
  91. data/app/services/hyrax/workflow/permission_query.rb +23 -2
  92. data/app/views/hyrax/admin/workflows/_tabs.html.erb +9 -0
  93. data/app/views/hyrax/admin/workflows/index.html.erb +53 -76
  94. data/app/views/hyrax/base/_file_manager_members.html.erb +2 -2
  95. data/app/views/hyrax/base/_form.html.erb +0 -10
  96. data/app/views/hyrax/base/_form_permission_embargo.html.erb +1 -1
  97. data/app/views/hyrax/base/_form_permission_lease.html.erb +1 -1
  98. data/app/views/hyrax/base/_form_visibility_component.html.erb +2 -2
  99. data/app/views/hyrax/base/_items.html.erb +1 -1
  100. data/app/views/hyrax/base/file_manager.html.erb +1 -1
  101. data/app/views/hyrax/base/show.json.jbuilder +2 -2
  102. data/app/views/hyrax/file_sets/show.html.erb +5 -3
  103. data/app/views/hyrax/homepage/_explore_collections.html.erb +1 -1
  104. data/chart/hyrax/Chart.yaml +18 -14
  105. data/chart/hyrax/README.md +34 -21
  106. data/chart/hyrax/templates/_helpers.tpl +26 -1
  107. data/chart/hyrax/templates/configmap-env.yaml +12 -2
  108. data/chart/hyrax/templates/secrets.yaml +1 -1
  109. data/chart/hyrax/values.yaml +36 -14
  110. data/config/initializers/listeners.rb +4 -10
  111. data/config/initializers/storage_adapter_initializer.rb +1 -1
  112. data/config/locales/hyrax.en.yml +8 -0
  113. data/config/metadata/file_set_metadata.yaml +1 -1
  114. data/docker-compose-koppie.yml +17 -4
  115. data/docker-compose.yml +19 -6
  116. data/documentation/developing-your-hyrax-based-app.md +6 -14
  117. data/documentation/legacyREADME.md +3 -1
  118. data/hyrax.gemspec +2 -2
  119. data/karma.conf.js +8 -9
  120. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +1 -1
  121. data/lib/generators/hyrax/templates/config/initializers/riiif.rb +15 -5
  122. data/lib/hyrax/active_fedora_dummy_model.rb +6 -1
  123. data/lib/hyrax/configuration.rb +6 -0
  124. data/lib/hyrax/engine.rb +2 -0
  125. data/lib/hyrax/publisher.rb +19 -3
  126. data/lib/hyrax/specs/capybara.rb +9 -4
  127. data/lib/hyrax/transactions/container.rb +5 -0
  128. data/lib/hyrax/transactions/steps/add_file_sets.rb +6 -0
  129. data/lib/hyrax/transactions/steps/apply_permission_template.rb +40 -0
  130. data/lib/hyrax/transactions/steps/save.rb +21 -0
  131. data/lib/hyrax/transactions/work_create.rb +1 -0
  132. data/lib/hyrax/version.rb +1 -1
  133. data/lib/hyrax.rb +1 -0
  134. data/lib/wings/active_fedora_converter/default_work.rb +7 -2
  135. data/lib/wings/active_fedora_converter/file_metadata_node.rb +1 -1
  136. data/lib/wings/active_fedora_converter.rb +47 -11
  137. data/lib/wings/model_transformer.rb +23 -4
  138. data/lib/wings/setup.rb +21 -1
  139. data/lib/wings/valkyrie/persister.rb +4 -2
  140. data/package.json +3 -1
  141. data/template.rb +1 -1
  142. metadata +17 -12
  143. data/app/forms/hyrax/forms/file_manager_form.rb +0 -35
  144. data/app/services/hyrax/collections/migration_service.rb +0 -113
  145. data/app/views/hyrax/base/_form_collections_error.html.erb +0 -1
  146. data/app/views/hyrax/base/_form_in_works_error.html.erb +0 -3
  147. data/app/views/hyrax/base/_form_ordered_members_error.html.erb +0 -3
  148. data/app/views/hyrax/base/_form_visibility_error.html.erb +0 -19
@@ -5,7 +5,7 @@
5
5
  replicaCount: 1
6
6
 
7
7
  image:
8
- repository: samveralabs/dassie
8
+ repository: ghcr.io/samvera/hyrax/dassie
9
9
  pullPolicy: IfNotPresent
10
10
  # Overrides the image tag whose default is the chart appVersion.
11
11
  tag: ""
@@ -193,7 +193,7 @@ worker:
193
193
  enabled: true
194
194
  replicaCount: 3
195
195
  image:
196
- repository: samveralabs/dassie-worker
196
+ repository: ghcr.io/samvera/hyrax/dassie-worker
197
197
  pullPolicy: IfNotPresent
198
198
  tag: ""
199
199
  extraInitContainers: []
@@ -220,19 +220,35 @@ worker:
220
220
 
221
221
  fcrepo:
222
222
  enabled: true
223
- externalDatabaseUsername: "hyrax"
224
223
  servicePort: 8080
225
224
  postgresql:
226
225
  enabled: false
227
226
  image:
228
227
  repository: bitnami/postgresql
229
- tag: 12.3.0
228
+ tag: 12.11.0-debian-11-r12
229
+
230
+ # configuration for an external/existing fits service;
231
+ # ignored if `fits.enabled` is true
232
+ externalFits:
233
+ enabled: false
234
+ url: "" # existing FITS servlet endpoint
235
+
236
+ fits:
237
+ enabled: true
238
+ servicePort: 8080
239
+ subPath: /fits
230
240
 
231
241
  memcached:
232
242
  enabled: false
243
+ image:
244
+ repository: bitnami/memcached
245
+ tag: 1.6.15-debian-11-r12
233
246
 
234
247
  minio:
235
248
  enabled: false
249
+ image:
250
+ repository: bitnami/minio
251
+ tag: 2022.7.4-debian-11-r0
236
252
  auth:
237
253
  rootUser: hyrax-access-key
238
254
  rootPassword: hyrax-secret-key
@@ -244,7 +260,7 @@ postgresql:
244
260
  enabled: true
245
261
  image:
246
262
  repository: bitnami/postgresql
247
- tag: 12.3.0
263
+ tag: 12.11.0-debian-11-r12
248
264
  auth:
249
265
  database: hyrax
250
266
  password: hyrax_pass
@@ -262,12 +278,11 @@ postgresql:
262
278
  ## and to act as an auth proxy for Cantelope
263
279
  nginx:
264
280
  enabled: false
281
+ image:
282
+ repository: bitnami/nginx
283
+ tag: 1.23.0-debian-11-r1
265
284
  # The set up below does malicious bot / ip blocking and mounts
266
- # vaolumes to allow nginx to server assets and other public directory items
267
- # image:
268
- # registry: registry.gitlab.com
269
- # repository: notch8/scripts/bitnami-nginx
270
- # tag: 1.21.5-debian-10-r4
285
+ # volumes to allow nginx to server assets and other public directory items
271
286
  # extraVolumes:
272
287
  # - name: "uploads"
273
288
  # persistentVolumeClaim:
@@ -397,6 +412,9 @@ nginx:
397
412
 
398
413
  redis:
399
414
  enabled: true
415
+ image:
416
+ repository: bitnami/redis
417
+ tag: 7.0.2-debian-11-r7
400
418
  auth:
401
419
  password: mysecret
402
420
 
@@ -404,12 +422,14 @@ solr:
404
422
  enabled: true
405
423
  image:
406
424
  repository: bitnami/solr
407
- tag: 8.11.1
425
+ tag: 8.11.2-debian-11-r4
426
+ containerPorts:
427
+ http: 8983
408
428
  auth:
409
429
  enabled: true
410
430
  adminUsername: admin
411
431
  adminPassword: admin
412
- coreName: hyrax
432
+ coreNames: hyrax
413
433
  collection: hyrax
414
434
  cloudBootstrap: true
415
435
  cloudEnabled: true
@@ -428,9 +448,11 @@ autoscaling:
428
448
  # targetMemoryUtilizationPercentage: 80
429
449
 
430
450
  global:
451
+ # These global postgresql values are used by the fcrepo chart
431
452
  postgresql:
432
- postgresqlUsername: hyrax
433
- postgresqlPassword: hyrax_pass
453
+ auth:
454
+ username: hyrax
455
+ password: hyrax_pass
434
456
  # This is th name of the running rails server pod
435
457
  hyraxHostName: hyrax
436
458
 
@@ -1,16 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Hyrax.publisher.subscribe(Hyrax::Listeners::AclIndexListener.new)
4
3
  Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraAclIndexListener.new) unless Hyrax.config.disable_wings
5
- Hyrax.publisher.subscribe(Hyrax::Listeners::BatchNotificationListener.new)
6
- Hyrax.publisher.subscribe(Hyrax::Listeners::FileMetadataListener.new)
7
- Hyrax.publisher.subscribe(Hyrax::Listeners::FileSetLifecycleListener.new)
8
- Hyrax.publisher.subscribe(Hyrax::Listeners::FileSetLifecycleNotificationListener.new)
9
- Hyrax.publisher.subscribe(Hyrax::Listeners::MemberCleanupListener.new)
10
- Hyrax.publisher.subscribe(Hyrax::Listeners::MetadataIndexListener.new)
11
- Hyrax.publisher.subscribe(Hyrax::Listeners::ObjectLifecycleListener.new)
12
- Hyrax.publisher.subscribe(Hyrax::Listeners::TrophyCleanupListener.new)
13
- Hyrax.publisher.subscribe(Hyrax::Listeners::WorkflowListener.new)
4
+
5
+ Hyrax.publisher.default_listeners.each do |listener|
6
+ Hyrax.publisher.subscribe(listener)
7
+ end
14
8
 
15
9
  # Publish events from old style Hyrax::Callbacks to trigger the listeners
16
10
  # When callbacks are removed and replaced with direct event publication, drop these blocks
@@ -7,6 +7,6 @@ Valkyrie::StorageAdapter.register(
7
7
  )
8
8
 
9
9
  Valkyrie::StorageAdapter.register(
10
- Valkyrie::Storage::Disk.new(base_path: Hyrax.config.derivatives_path),
10
+ Valkyrie::Storage::Disk.new(base_path: Hyrax.config.derivatives_path, path_generator: Hyrax::DerivativeBucketedStorage),
11
11
  :derivatives_disk
12
12
  )
@@ -459,6 +459,14 @@ en:
459
459
  workflows:
460
460
  index:
461
461
  header: Review Submissions
462
+ heading:
463
+ work: Work
464
+ depositor: Depositor
465
+ submission_date: Submission Date
466
+ status: status
467
+ works_published: "<strong>%{total_count} works</strong> published"
468
+ works_under_review: "<strong>%{total_count} works</strong> under review"
469
+ works_listing: Works listing
462
470
  tabs:
463
471
  published: Published
464
472
  under_review: Under Review
@@ -16,7 +16,7 @@ attributes:
16
16
  type: string
17
17
  multiple: true
18
18
  form:
19
- required: true
19
+ required: false
20
20
  primary: true
21
21
 
22
22
  # Other attributes:
@@ -9,7 +9,7 @@ services:
9
9
  - EXTRA_APK_PACKAGES=git less chromium
10
10
  - APP_PATH=.koppie
11
11
  image: ghcr.io/samvera/koppie
12
- command: sh -l -c 'bundle && yarn && bundle exec puma -v -b tcp://0.0.0.0:3000'
12
+ command: sh -c 'bundle && yarn && bundle exec puma -v -b tcp://0.0.0.0:3000'
13
13
  stdin_open: true
14
14
  tty: true
15
15
  user: root
@@ -46,7 +46,7 @@ services:
46
46
  args:
47
47
  - APP_PATH=.koppie
48
48
  image: ghcr.io/samvera/koppie-worker
49
- command: sh -l -c 'bundle && bundle exec sidekiq'
49
+ command: sh -c 'bundle && bundle exec sidekiq'
50
50
  user: root
51
51
  env_file:
52
52
  - .koppie/.env
@@ -78,7 +78,7 @@ services:
78
78
  user: root
79
79
  env_file:
80
80
  - .koppie/.env
81
- command: sh -l -c 'bundle && db-migrate-seed.sh'
81
+ command: sh -c 'bundle && db-migrate-seed.sh'
82
82
  depends_on:
83
83
  - postgres
84
84
  volumes:
@@ -90,7 +90,9 @@ services:
90
90
  - koppie
91
91
 
92
92
  chrome:
93
- image: selenium/standalone-chrome:3.141
93
+ image: seleniarm/standalone-chromium:114.0
94
+ environment:
95
+ - START_XVFB=false
94
96
  logging:
95
97
  driver: none
96
98
  volumes:
@@ -113,6 +115,13 @@ services:
113
115
  networks:
114
116
  - koppie
115
117
 
118
+ fits:
119
+ image: harvardlts/fitsservlet_container:1.5.0
120
+ ports:
121
+ - 8080
122
+ networks:
123
+ - koppie
124
+
116
125
  memcached:
117
126
  image: bitnami/memcached
118
127
  ports:
@@ -140,6 +149,10 @@ services:
140
149
  volumes:
141
150
  - solr_home:/var/solr/data:cached
142
151
  - .koppie/solr/conf:/opt/solr/server/configsets/hyraxconf
152
+ ulimits:
153
+ nofile:
154
+ soft: 65536
155
+ hard: 524288
143
156
  networks:
144
157
  - koppie
145
158
 
data/docker-compose.yml CHANGED
@@ -8,7 +8,7 @@ services:
8
8
  args:
9
9
  - EXTRA_APK_PACKAGES=git less chromium
10
10
  image: ghcr.io/samvera/dassie
11
- command: sh -l -c 'bundle && bundle exec puma -v -b tcp://0.0.0.0:3000'
11
+ command: sh -c 'bundle && bundle exec puma -v -b tcp://0.0.0.0:3000'
12
12
  stdin_open: true
13
13
  tty: true
14
14
  user: root
@@ -42,7 +42,7 @@ services:
42
42
  context: .
43
43
  target: hyrax-engine-dev-worker
44
44
  image: ghcr.io/samvera/dassie-worker
45
- command: sh -l -c 'bundle && bundle exec sidekiq'
45
+ command: sh -c 'bundle && bundle exec sidekiq'
46
46
  user: root
47
47
  env_file:
48
48
  - .dassie/.env
@@ -73,7 +73,7 @@ services:
73
73
  user: root
74
74
  env_file:
75
75
  - .dassie/.env
76
- command: sh -l -c 'bundle && db-migrate-seed.sh'
76
+ command: sh -c 'bundle && db-migrate-seed.sh'
77
77
  depends_on:
78
78
  - postgres
79
79
  volumes:
@@ -85,15 +85,17 @@ services:
85
85
  - hyrax
86
86
 
87
87
  chrome:
88
- image: selenium/standalone-chrome:3.141
88
+ image: seleniarm/standalone-chromium:114.0
89
+ environment:
90
+ - START_XVFB=false
89
91
  logging:
90
92
  driver: none
91
93
  volumes:
92
94
  - /dev/shm:/dev/shm
93
95
  shm_size: 2G
94
96
  ports:
95
- - "4444:4444"
96
- - "5959:5900"
97
+ - "4445:4444"
98
+ - "5960:5900"
97
99
  networks:
98
100
  - hyrax
99
101
 
@@ -120,6 +122,13 @@ services:
120
122
  networks:
121
123
  - hyrax
122
124
 
125
+ fits:
126
+ image: harvardlts/fitsservlet_container:1.5.0
127
+ ports:
128
+ - 8080
129
+ networks:
130
+ - hyrax
131
+
123
132
  memcached:
124
133
  image: bitnami/memcached
125
134
  ports:
@@ -145,6 +154,10 @@ services:
145
154
  volumes:
146
155
  - solr_home:/var/solr/data:cached
147
156
  - .dassie/solr/conf:/opt/solr/server/configsets/hyraxconf
157
+ ulimits:
158
+ nofile:
159
+ soft: 65536
160
+ hard: 524288
148
161
  networks:
149
162
  - hyrax
150
163
 
@@ -30,7 +30,7 @@ A Hyrax-based application includes lots of dependencies. We provide a [Docker im
30
30
  You can also try [Running Hyrax-based application in local VM](https://github.com/samvera/hyrax/wiki/Hyrax-Development-Guide#running-hyrax-based-application-in-local-vm) which uses Ubuntu.
31
31
 
32
32
  This document contains instructions specific to setting up an app with __Hyrax
33
- v4.0.0.rc1__. If you are looking for instructions on installing a different
33
+ v5.0.0.rc1__. If you are looking for instructions on installing a different
34
34
  version, be sure to select the appropriate branch or tag from the drop-down
35
35
  menu above.
36
36
 
@@ -95,7 +95,7 @@ Note here that the following commands assume you're setting up Hyrax in a develo
95
95
 
96
96
  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).
97
97
 
98
- Hyrax supports Ruby 2.5, 2.6, and 2.7. When starting a new project, we recommend using the latest Ruby 2.7 version.
98
+ Hyrax supports Ruby 3.2. When starting a new project, we recommend using the latest Ruby 3.2 version.
99
99
 
100
100
  ## Redis
101
101
 
@@ -105,11 +105,11 @@ Starting up Redis will depend on your operating system, and may in fact already
105
105
 
106
106
  ## Rails
107
107
 
108
- Hyrax requires Rails 5. We recommend the latest Rails 5.2 release.
108
+ Hyrax requires Rails 6. We recommend the latest Rails 6.1 release.
109
109
 
110
110
  ```
111
111
  # If you don't already have Rails at your disposal...
112
- gem install rails -v 5.2.6
112
+ gem install rails -v 6.1.7.6
113
113
  ```
114
114
 
115
115
  ### JavaScript runtime
@@ -125,7 +125,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
125
125
  Generate a new Rails application using the template.
126
126
 
127
127
  ```
128
- rails _6.1.7.3_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v4.0.0.rc1/template.rb
128
+ rails _6.1.7.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.0.0.rc1/template.rb
129
129
  ```
130
130
 
131
131
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
@@ -223,7 +223,7 @@ You may wish to [customize your work type](https://github.com/samvera/hyrax/wiki
223
223
 
224
224
  ### Enable notifications
225
225
 
226
- Hyrax 2 uses a WebSocket-based user notifications system, which requires Redis. To enable user notifications, make sure that you have configured ActionCable to use Redis as the adapter in your application's `config/cable.yml`. E.g., for the `development` Rails environment:
226
+ Hyrax 2+ uses a WebSocket-based user notifications system, which requires Redis. To enable user notifications, make sure that you have configured ActionCable to use Redis as the adapter in your application's `config/cable.yml`. E.g., for the `development` Rails environment:
227
227
 
228
228
  ```yaml
229
229
  development:
@@ -231,14 +231,6 @@ development:
231
231
  url: redis://localhost:6379
232
232
  ```
233
233
 
234
- Using Rails up to version 5.1.4, ActionCable will not work with the 4.x series of the `redis` gem, so you will also need to pin your application to a 3.x release by adding this to your `Gemfile`:
235
-
236
- ```ruby
237
- gem 'redis', '~> 3.0'
238
- ```
239
-
240
- And then run `bundle update redis`.
241
-
242
234
  Note that the Hyrax Management Guide contains additional information on [how to configure ActionCable in production environments](https://github.com/samvera/hyrax/wiki/Hyrax-Management-Guide#notifications).
243
235
 
244
236
  ## Managing a Hyrax-based app
@@ -1,6 +1,8 @@
1
1
  # Legacy README
2
2
 
3
- This is a deprecated document that might have some useful information.
3
+ ## Deprecated Document
4
+
5
+ This is a deprecated document that might have some useful information. **It is no longer being updated.**
4
6
 
5
7
  # Table of Contents
6
8
 
data/hyrax.gemspec CHANGED
@@ -17,7 +17,7 @@ SUMMARY
17
17
 
18
18
  spec.homepage = "http://github.com/samvera/hyrax"
19
19
 
20
- spec.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR).select { |f| File.dirname(f) !~ %r{\A"?spec\/?} }
20
+ spec.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR).select { |f| File.dirname(f) !~ %r{\A"?spec\/?} && f != 'bin/rails' }
21
21
  spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
22
22
  spec.name = "hyrax"
23
23
  spec.require_paths = ["lib"]
@@ -25,7 +25,7 @@ SUMMARY
25
25
  spec.license = 'Apache-2.0'
26
26
  spec.metadata = { "rubygems_mfa_required" => "true" }
27
27
 
28
- spec.required_ruby_version = '>= 2.7'
28
+ spec.required_ruby_version = '>= 3.2'
29
29
 
30
30
  # NOTE: rails does not follow sem-ver conventions, it's
31
31
  # minor version releases can include breaking changes; see
data/karma.conf.js CHANGED
@@ -66,6 +66,7 @@ module.exports = function(config) {
66
66
  },
67
67
 
68
68
  // web server port
69
+ hostname: process.env.KARMA_HOSTNAME || 'localhost', // This is the host the remote browser connects to
69
70
  port: 9876,
70
71
 
71
72
  // enable / disable colors in the output (reporters and logs)
@@ -80,16 +81,14 @@ module.exports = function(config) {
80
81
 
81
82
  // start these browsers
82
83
  // available browser launchers: https://www.npmjs.com/search?q=keywords:karma-launcher
83
- browsers: [process.env.KARMA_BROWSER],
84
+ browsers: [process.env.KARMA_BROWSER || 'ChromiumHeadless'],
84
85
 
85
86
  customLaunchers: {
86
- ChromiumHeadlessCustom: {
87
- base: 'ChromiumHeadless',
88
- flags: ['--no-sandbox']
89
- },
90
- ChromeHeadlessCustom: {
91
- base: 'ChromeHeadless',
92
- flags: ['--no-sandbox']
87
+ 'remote-chromium': {
88
+ base: 'SeleniumGrid',
89
+ gridUrl: process.env.HUB_URL || 'http://localhost:4444/wd/hub',
90
+ browserName: 'chrome',
91
+ arguments: [ '--headless=new']
93
92
  }
94
93
  },
95
94
 
@@ -99,6 +98,6 @@ module.exports = function(config) {
99
98
 
100
99
  // Concurrency level
101
100
  // how many browser instances should be started simultaneously
102
- concurrency: 4
101
+ concurrency: 1
103
102
  })
104
103
  }
@@ -95,7 +95,7 @@ Hyrax.config do |config|
95
95
 
96
96
  # Location autocomplete uses geonames to search for named regions
97
97
  # Username for connecting to geonames
98
- # config.geonames_username = ''
98
+ config.geonames_username = ENV['GEONAMES_USERNAME'] || ''
99
99
 
100
100
  # Should the acceptance of the licence agreement be active (checkbox), or
101
101
  # implied when the save button is pressed? Set to true for active
@@ -14,11 +14,21 @@ ActiveSupport::Reloader.to_prepare do
14
14
  { height: doc['height_is'], width: doc['width_is'], format: doc['mime_type_ssi'], channels: doc['alpha_channels_ssi'] }
15
15
  end
16
16
 
17
- Riiif::Image.file_resolver.id_to_uri = lambda do |id|
18
- Hyrax::Base.id_to_uri(CGI.unescape(id)).tap do |url|
19
- Hyrax.logger.info "Riiif resolved #{id} to #{url}"
20
- end
21
- end
17
+ Riiif::Image.file_resolver.id_to_uri = if Hyrax.config.use_valkyrie?
18
+ # Use Valkyrie adapter to make sure file is available locally. Riiif will just open it then
19
+ # id comes in with the format "FILE_SET_ID/files/FILE_ID"
20
+ lambda do |id|
21
+ file_metadata = Hyrax.query_service.find_by(id: id.split('/').last)
22
+ file = Hyrax.storage_adapter.find_by(id: file_metadata.file_identifier)
23
+ file.disk_path.to_s
24
+ end
25
+ else
26
+ lambda do |id|
27
+ Hyrax::Base.id_to_uri(CGI.unescape(id)).tap do |url|
28
+ Rails.logger.info "Riiif resolved #{id} to #{url}"
29
+ end
30
+ end
31
+ end
22
32
 
23
33
  Riiif::Image.authorization_service = Hyrax::IiifAuthorizationService
24
34
 
@@ -69,7 +69,12 @@ module Hyrax
69
69
  ##
70
70
  # @api public
71
71
  def to_global_id
72
- URI::GID.build app: GlobalID.app, model_name: model_name.name, model_id: @id
72
+ # this covers the use case of creating a non Valkyrie::Resource, while using Valkyrie
73
+ if model_name.name.constantize <= Valkyrie::Resource
74
+ URI::GID.build app: GlobalID.app, model_name: Hyrax::ValkyrieGlobalIdProxy.to_s, model_id: @id
75
+ else
76
+ URI::GID.build app: GlobalID.app, model_name: model_name.name, model_id: @id
77
+ end
73
78
  end
74
79
  end
75
80
  end
@@ -518,6 +518,12 @@ module Hyrax
518
518
  @characterization_proxy ||= :original_file
519
519
  end
520
520
 
521
+ ##
522
+ # Options to pass to the characterization service
523
+ # @!attribute [rw] characterization_options
524
+ # @return [Hash] of options like {ch12n_tool: :fits_servlet}
525
+ attr_accessor :characterization_options
526
+
521
527
  # Attributes for the lock manager which ensures a single process/thread is mutating a ore:Aggregation at once.
522
528
  # @!attribute [w] lock_retry_count
523
529
  # How many times to retry to acquire the lock before raising UnableToAcquireLockError
data/lib/hyrax/engine.rb CHANGED
@@ -20,6 +20,8 @@ module Hyrax
20
20
  require 'qa'
21
21
  require 'tinymce-rails'
22
22
  require 'valkyrie'
23
+ require 'cancancan'
24
+ require 'blacklight'
23
25
 
24
26
  require 'hydra/derivatives'
25
27
  require 'hyrax/active_fedora_dummy_model'
@@ -137,6 +137,10 @@ module Hyrax
137
137
  # a system user.
138
138
  register_event('file.metadata.updated')
139
139
 
140
+ # @since 5.0.0
141
+ # @macro a_registered_event
142
+ register_event('file.uploaded')
143
+
140
144
  # @since 3.0.0
141
145
  # @macro a_registered_event
142
146
  register_event('file.set.audited')
@@ -191,8 +195,20 @@ module Hyrax
191
195
  # `#member_ids`)
192
196
  register_event('object.metadata.updated')
193
197
 
194
- # @since 3.2.0
195
- # @macro a_registered_event
196
- register_event('object.file.uploaded')
198
+ ##
199
+ # @return Array[Object] the listeners Hyrax subscribes by default.
200
+ def default_listeners
201
+ @default_listeners ||=
202
+ [Hyrax::Listeners::AclIndexListener.new,
203
+ Hyrax::Listeners::BatchNotificationListener.new,
204
+ Hyrax::Listeners::FileMetadataListener.new,
205
+ Hyrax::Listeners::FileSetLifecycleListener.new,
206
+ Hyrax::Listeners::FileSetLifecycleNotificationListener.new,
207
+ Hyrax::Listeners::MemberCleanupListener.new,
208
+ Hyrax::Listeners::MetadataIndexListener.new,
209
+ Hyrax::Listeners::ObjectLifecycleListener.new,
210
+ Hyrax::Listeners::TrophyCleanupListener.new,
211
+ Hyrax::Listeners::WorkflowListener.new].freeze
212
+ end
197
213
  end
198
214
  end
@@ -20,10 +20,15 @@ require 'webdrivers' unless ENV['IN_DOCKER'].present? || ENV['HUB_URL'].present?
20
20
  Capybara.save_path = ENV['CI'] ? "/tmp/test-results" : Rails.root.join('tmp', 'capybara')
21
21
 
22
22
  if ENV['IN_DOCKER'].present? || ENV['HUB_URL'].present?
23
- args = %w[disable-gpu no-sandbox whitelisted-ips window-size=1400,1400]
24
- args.push('headless') if ActiveModel::Type::Boolean.new.cast(ENV['CHROME_HEADLESS_MODE'])
25
-
26
- options = Selenium::WebDriver::Options.chrome("goog:chromeOptions" => { args: args })
23
+ options = Selenium::WebDriver::Chrome::Options.new.tap do |opts|
24
+ opts.add_argument("--headless") if ENV["CHROME_HEADLESS_MODE"]
25
+ opts.add_argument("--disable-gpu") if Gem.win_platform?
26
+ # Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary
27
+ opts.add_argument("--disable-site-isolation-trials")
28
+ opts.add_argument("--window-size=1440,1440")
29
+ opts.add_argument("--enable-features=NetworkService,NetworkServiceInProcess")
30
+ opts.add_argument("--disable-features=VizDisplayCompositor")
31
+ end
27
32
 
28
33
  Capybara.register_driver :selenium_chrome_headless_sandboxless do |app|
29
34
  driver = Capybara::Selenium::Driver.new(app,
@@ -31,6 +31,7 @@ module Hyrax
31
31
  require 'hyrax/transactions/steps/add_to_collections'
32
32
  require 'hyrax/transactions/steps/add_to_parent'
33
33
  require 'hyrax/transactions/steps/apply_collection_type_permissions'
34
+ require 'hyrax/transactions/steps/apply_permission_template'
34
35
  require 'hyrax/transactions/steps/change_depositor'
35
36
  require 'hyrax/transactions/steps/check_for_empty_admin_set'
36
37
  require 'hyrax/transactions/steps/delete_access_control'
@@ -203,6 +204,10 @@ module Hyrax
203
204
  Steps::AddToParent.new
204
205
  end
205
206
 
207
+ ops.register 'apply_permission_template' do
208
+ Steps::ApplyPermissionTemplate.new
209
+ end
210
+
206
211
  ops.register 'change_depositor' do
207
212
  Steps::ChangeDepositor.new
208
213
  end
@@ -25,6 +25,12 @@ module Hyrax
25
25
  # @return [Dry::Monads::Result]
26
26
  def call(obj, uploaded_files: [], file_set_params: [])
27
27
  if @handler.new(work: obj).add(files: uploaded_files, file_set_params: file_set_params).attach
28
+ file_sets = obj.member_ids.map do |member|
29
+ Hyrax.query_service.find_by(id: member) if Hyrax.query_service.find_by(id: member).is_a? Hyrax::FileSet
30
+ end
31
+
32
+ Hyrax::LeaseManager.create_or_update_lease_on_members(file_sets, obj) if obj.lease
33
+ Hyrax::EmbargoManager.create_or_update_embargo_on_members(file_sets, obj) if obj.embargo
28
34
  Success(obj)
29
35
  else
30
36
  Failure[:failed_to_attach_file_sets, uploaded_files]
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+ module Hyrax
3
+ module Transactions
4
+ module Steps
5
+ ##
6
+ # A `dry-transcation` step that applies a permission template
7
+ # to a saved object.
8
+ #
9
+ # @note by design, this step should succeed even if for some reason a
10
+ # permission template could not be applied. it's better to complete the
11
+ # rest of the creation process with missing ACL grants than to crash and
12
+ # miss other crucial steps.
13
+ #
14
+ # @since 4.1.0
15
+ class ApplyPermissionTemplate
16
+ include Dry::Monads[:result]
17
+
18
+ ##
19
+ # @param [Hyrax::Work] object
20
+ #
21
+ # @return [Dry::Monads::Result]
22
+ def call(object)
23
+ template = Hyrax::PermissionTemplate.find_by(source_id: object&.admin_set_id)
24
+
25
+ if template.blank?
26
+ Hyrax.logger.info("At create time, #{object} doesn't have a " \
27
+ "PermissionTemplate, which it should have via " \
28
+ "AdministrativeSet #{object&.admin_set_id}). " \
29
+ "Continuing to create this object anyway.")
30
+
31
+ return Success(object)
32
+ end
33
+
34
+ Hyrax::PermissionTemplateApplicator.apply(template).to(model: object) &&
35
+ Success(object)
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end