hyrax 3.0.1 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (388) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +49 -19
  3. data/.dassie/.env +1 -2
  4. data/.dassie/Gemfile +18 -9
  5. data/.dassie/app/controllers/catalog_controller.rb +6 -0
  6. data/.dassie/app/models/user.rb +0 -2
  7. data/.dassie/config/analytics.yml +12 -5
  8. data/.dassie/config/environments/development.rb +2 -0
  9. data/.dassie/config/initializers/hyrax.rb +7 -0
  10. data/.dassie/config/role_map.yml +2 -0
  11. data/.dassie/db/migrate/20210921150120_enable_uuid_extension.valkyrie_engine.rb +7 -0
  12. data/.dassie/db/migrate/20210921150121_create_orm_resources.valkyrie_engine.rb +19 -0
  13. data/.dassie/db/migrate/20210921150122_add_model_type_to_orm_resources.valkyrie_engine.rb +7 -0
  14. data/.dassie/db/migrate/20210921150123_change_model_type_to_internal_model.valkyrie_engine.rb +7 -0
  15. data/.dassie/db/migrate/20210921150124_create_path_gin_index.valkyrie_engine.rb +7 -0
  16. data/.dassie/db/migrate/20210921150125_create_internal_resource_index.valkyrie_engine.rb +7 -0
  17. data/.dassie/db/migrate/20210921150126_create_updated_at_index.valkyrie_engine.rb +7 -0
  18. data/.dassie/db/migrate/20210921150127_add_optimistic_locking_to_orm_resources.valkyrie_engine.rb +7 -0
  19. data/.dassie/db/migrate/20211130181150_create_default_administrative_set.rb +8 -0
  20. data/.dassie/db/schema.rb +20 -1
  21. data/.dassie/db/seeds.rb +1 -1
  22. data/.dockerignore +3 -0
  23. data/.env +8 -6
  24. data/.github/workflows/main.yml +17 -0
  25. data/.github/workflows/release.yml +17 -0
  26. data/.gitignore +1 -0
  27. data/.regen +1 -1
  28. data/.rubocop.yml +4 -0
  29. data/CONTAINERS.md +33 -10
  30. data/Dockerfile +14 -9
  31. data/Gemfile +21 -27
  32. data/README.md +37 -0
  33. data/app/actors/hyrax/actors/base_actor.rb +2 -2
  34. data/app/actors/hyrax/actors/collections_membership_actor.rb +3 -3
  35. data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +85 -63
  36. data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +7 -42
  37. data/app/actors/hyrax/actors/file_set_actor.rb +12 -5
  38. data/app/assets/javascripts/hyrax/admin/graphs.es6 +34 -37
  39. data/app/assets/javascripts/hyrax/analytics_events.js +69 -0
  40. data/app/assets/javascripts/hyrax/collapse.js +24 -0
  41. data/app/assets/javascripts/hyrax/collections.js +1 -2
  42. data/app/assets/javascripts/hyrax/ga_events.js +2 -8
  43. data/app/assets/javascripts/hyrax/reports-buttons.js +33 -0
  44. data/app/assets/javascripts/hyrax.js +2 -1
  45. data/app/assets/stylesheets/_bootstrap-default-overrides.scss +9 -0
  46. data/app/assets/stylesheets/hyrax/_styles.scss +5 -0
  47. data/app/authorities/qa/authorities/collections.rb +4 -5
  48. data/app/authorities/qa/authorities/find_works.rb +1 -1
  49. data/app/controllers/concerns/hyrax/breadcrumbs_for_collection_analytics.rb +26 -0
  50. data/app/controllers/concerns/hyrax/breadcrumbs_for_works_analytics.rb +26 -0
  51. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +30 -10
  52. data/app/controllers/concerns/hyrax/controller.rb +35 -2
  53. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +21 -9
  54. data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +14 -5
  55. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +22 -3
  56. data/app/controllers/hyrax/admin/admin_sets_controller.rb +2 -19
  57. data/app/controllers/hyrax/admin/analytics/analytics_controller.rb +40 -0
  58. data/app/controllers/hyrax/admin/analytics/collection_reports_controller.rb +61 -0
  59. data/app/controllers/hyrax/admin/analytics/work_reports_controller.rb +122 -0
  60. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +5 -6
  61. data/app/controllers/hyrax/admin/workflows_controller.rb +8 -2
  62. data/app/controllers/hyrax/collections_controller.rb +6 -1
  63. data/app/controllers/hyrax/dashboard/collection_members_controller.rb +24 -17
  64. data/app/controllers/hyrax/dashboard/collections_controller.rb +112 -37
  65. data/app/controllers/hyrax/dashboard/nest_collections_controller.rb +75 -39
  66. data/app/controllers/hyrax/dashboard_controller.rb +8 -0
  67. data/app/controllers/hyrax/file_sets_controller.rb +49 -13
  68. data/app/controllers/hyrax/my_controller.rb +4 -4
  69. data/app/controllers/hyrax/permissions_controller.rb +3 -4
  70. data/app/controllers/hyrax/stats_controller.rb +3 -1
  71. data/app/controllers/hyrax/workflow_actions_controller.rb +11 -6
  72. data/app/forms/hyrax/forms/administrative_set_form.rb +62 -0
  73. data/app/forms/hyrax/forms/collection_form.rb +9 -5
  74. data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +38 -6
  75. data/app/forms/hyrax/forms/file_set_form.rb +46 -0
  76. data/app/forms/hyrax/forms/pcdm_collection_form.rb +67 -0
  77. data/app/forms/hyrax/forms/permission.rb +23 -0
  78. data/app/forms/hyrax/forms/permission_template_form.rb +8 -2
  79. data/app/forms/hyrax/forms/resource_form.rb +34 -26
  80. data/app/forms/hyrax/forms/work_form.rb +5 -2
  81. data/app/forms/hyrax/forms/workflow_action_form.rb +4 -0
  82. data/app/helpers/hyrax/batch_edits_helper.rb +3 -1
  83. data/app/helpers/hyrax/collections_helper.rb +88 -2
  84. data/app/helpers/hyrax/dashboard_helper_behavior.rb +16 -5
  85. data/app/helpers/hyrax/embargo_helper.rb +4 -0
  86. data/app/helpers/hyrax/file_set_helper.rb +25 -6
  87. data/app/helpers/hyrax/hyrax_helper_behavior.rb +9 -0
  88. data/app/helpers/hyrax/lease_helper.rb +4 -0
  89. data/app/helpers/hyrax/url_helper.rb +4 -1
  90. data/app/helpers/hyrax/work_form_helper.rb +53 -0
  91. data/app/indexers/hyrax/administrative_set_indexer.rb +18 -0
  92. data/app/indexers/hyrax/pcdm_collection_indexer.rb +2 -0
  93. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +3 -1
  94. data/app/indexers/hyrax/valkyrie_indexer.rb +3 -3
  95. data/app/indexers/hyrax/valkyrie_work_indexer.rb +1 -1
  96. data/app/inputs/controlled_vocabulary_input.rb +2 -5
  97. data/app/jobs/attach_files_to_work_job.rb +19 -10
  98. data/app/jobs/attach_files_to_work_with_ordered_members_job.rb +6 -5
  99. data/app/jobs/characterize_job.rb +28 -1
  100. data/app/jobs/ingest_local_file_job.rb +18 -2
  101. data/app/jobs/inherit_permissions_job.rb +9 -5
  102. data/app/jobs/valkyrie_ingest_job.rb +56 -0
  103. data/app/models/admin_set.rb +22 -30
  104. data/app/models/collection_branding_info.rb +25 -9
  105. data/app/models/concerns/hyrax/ability/admin_set_ability.rb +31 -7
  106. data/app/models/concerns/hyrax/ability/collection_ability.rb +35 -20
  107. data/app/models/concerns/hyrax/ability/collection_type_ability.rb +1 -1
  108. data/app/models/concerns/hyrax/ability.rb +31 -8
  109. data/app/models/concerns/hyrax/collection_behavior.rb +17 -44
  110. data/app/models/concerns/hyrax/embargoable.rb +24 -0
  111. data/app/models/concerns/hyrax/file_set/characterization.rb +18 -12
  112. data/app/models/concerns/hyrax/solr_document/metadata.rb +1 -0
  113. data/app/models/concerns/hyrax/solr_document_behavior.rb +11 -54
  114. data/app/models/concerns/hyrax/suppressible.rb +5 -0
  115. data/app/models/concerns/hyrax/user.rb +9 -3
  116. data/app/models/concerns/hyrax/work_behavior.rb +1 -1
  117. data/app/models/file_download_stat.rb +4 -4
  118. data/app/models/hyrax/administrative_set.rb +7 -1
  119. data/app/models/hyrax/default_administrative_set.rb +42 -0
  120. data/app/models/hyrax/file_set.rb +6 -0
  121. data/app/models/hyrax/pcdm_collection.rb +1 -0
  122. data/app/models/hyrax/permission.rb +1 -1
  123. data/app/models/hyrax/permission_template.rb +112 -12
  124. data/app/models/hyrax/statistic.rb +31 -4
  125. data/app/models/hyrax/virus_scanner.rb +27 -18
  126. data/app/models/hyrax/work.rb +1 -0
  127. data/app/models/hyrax/workflow_action_info.rb +16 -0
  128. data/app/models/sipity/agent.rb +1 -0
  129. data/app/models/sipity/comment.rb +17 -0
  130. data/app/models/sipity/entity.rb +30 -8
  131. data/app/models/sipity/workflow.rb +1 -0
  132. data/app/models/sipity.rb +53 -2
  133. data/app/presenters/hyrax/admin/dashboard_presenter.rb +8 -6
  134. data/app/presenters/hyrax/admin/repository_growth_presenter.rb +10 -5
  135. data/app/presenters/hyrax/admin/user_activity_presenter.rb +8 -12
  136. data/app/presenters/hyrax/admin_set_options_presenter.rb +12 -8
  137. data/app/presenters/hyrax/admin_set_presenter.rb +13 -4
  138. data/app/presenters/hyrax/admin_set_selection_presenter.rb +116 -0
  139. data/app/presenters/hyrax/collection_presenter.rb +34 -9
  140. data/app/presenters/hyrax/file_set_presenter.rb +8 -1
  141. data/app/presenters/hyrax/file_usage.rb +3 -2
  142. data/app/presenters/hyrax/menu_presenter.rb +4 -0
  143. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +119 -0
  144. data/app/presenters/hyrax/stats_usage_presenter.rb +2 -1
  145. data/app/presenters/hyrax/trophy_presenter.rb +33 -4
  146. data/app/presenters/hyrax/user_profile_presenter.rb +11 -1
  147. data/app/presenters/hyrax/version_list_presenter.rb +19 -0
  148. data/app/presenters/hyrax/version_presenter.rb +3 -2
  149. data/app/presenters/hyrax/work_show_presenter.rb +37 -8
  150. data/app/presenters/hyrax/work_usage.rb +6 -3
  151. data/app/renderers/hyrax/renderers/attribute_renderer.rb +10 -2
  152. data/app/search_builders/hyrax/README.md +1 -1
  153. data/app/search_builders/hyrax/abstract_type_relation.rb +4 -2
  154. data/app/search_builders/hyrax/admin_set_search_builder.rb +1 -1
  155. data/app/search_builders/hyrax/collection_member_search_builder.rb +6 -1
  156. data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +1 -1
  157. data/app/search_builders/hyrax/exposed_models_relation.rb +1 -1
  158. data/app/search_builders/hyrax/filter_by_type.rb +1 -2
  159. data/app/search_builders/hyrax/my/collections_search_builder.rb +2 -2
  160. data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +1 -1
  161. data/app/search_builders/hyrax/single_collection_search_builder.rb +1 -1
  162. data/app/services/hyrax/admin_set_create_service.rb +199 -53
  163. data/app/services/hyrax/analytics/google/events.rb +37 -0
  164. data/app/services/hyrax/analytics/google/events_daily.rb +72 -0
  165. data/app/services/hyrax/analytics/google/visits.rb +44 -0
  166. data/app/services/hyrax/analytics/google/visits_daily.rb +49 -0
  167. data/app/services/hyrax/analytics/google.rb +204 -0
  168. data/app/services/hyrax/analytics/matomo.rb +193 -0
  169. data/app/services/hyrax/analytics/results.rb +79 -0
  170. data/app/services/hyrax/analytics.rb +12 -82
  171. data/app/services/hyrax/characterization/valkyrie_characterization_service.rb +134 -0
  172. data/app/services/hyrax/collection_types/permissions_service.rb +1 -1
  173. data/app/services/hyrax/collections/collection_member_search_service.rb +72 -0
  174. data/app/services/hyrax/collections/collection_member_service.rb +122 -27
  175. data/app/services/hyrax/collections/migration_service.rb +4 -2
  176. data/app/services/hyrax/collections/nested_collection_persistence_service.rb +12 -13
  177. data/app/services/hyrax/collections/nested_collection_query_service.rb +10 -3
  178. data/app/services/hyrax/collections/permissions_create_service.rb +82 -78
  179. data/app/services/hyrax/collections/permissions_service.rb +1 -1
  180. data/app/services/hyrax/contextual_path.rb +24 -1
  181. data/app/services/hyrax/curation_concern.rb +24 -2
  182. data/app/services/hyrax/custom_queries/find_file_metadata.rb +7 -5
  183. data/app/services/hyrax/custom_queries/navigators/parent_collections_navigator.rb +46 -0
  184. data/app/services/hyrax/default_middleware_stack.rb +11 -0
  185. data/app/services/hyrax/edit_permissions_service.rb +74 -41
  186. data/app/services/hyrax/ensure_well_formed_admin_set_service.rb +3 -3
  187. data/app/services/hyrax/find_objects_via_solr_service.rb +31 -0
  188. data/app/services/hyrax/listeners/acl_index_listener.rb +3 -1
  189. data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +4 -1
  190. data/app/services/hyrax/listeners/batch_notification_listener.rb +3 -1
  191. data/app/services/hyrax/listeners/file_metadata_listener.rb +19 -0
  192. data/app/services/hyrax/listeners/file_set_lifecycle_listener.rb +6 -2
  193. data/app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb +6 -2
  194. data/app/services/hyrax/listeners/member_cleanup_listener.rb +3 -0
  195. data/app/services/hyrax/listeners/metadata_index_listener.rb +33 -11
  196. data/app/services/hyrax/listeners/object_lifecycle_listener.rb +9 -3
  197. data/app/services/hyrax/listeners/proxy_deposit_listener.rb +3 -1
  198. data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +3 -0
  199. data/app/services/hyrax/listeners/workflow_listener.rb +3 -1
  200. data/app/services/hyrax/listeners.rb +8 -0
  201. data/app/services/hyrax/multiple_membership_checker.rb +53 -29
  202. data/app/services/hyrax/permission_manager.rb +4 -4
  203. data/app/services/hyrax/resource_status.rb +7 -0
  204. data/app/services/hyrax/restriction_service.rb +4 -0
  205. data/app/services/hyrax/search_service.rb +4 -2
  206. data/app/services/hyrax/solr_query_builder_service.rb +45 -8
  207. data/app/services/hyrax/solr_query_service.rb +224 -0
  208. data/app/services/hyrax/solr_service.rb +9 -2
  209. data/app/services/hyrax/statistics/collections/over_time.rb +2 -1
  210. data/app/services/hyrax/statistics/depositors/summary.rb +2 -1
  211. data/app/services/hyrax/statistics/users/over_time.rb +8 -5
  212. data/app/services/hyrax/statistics/works/over_time.rb +10 -0
  213. data/app/services/hyrax/visibility_intention.rb +20 -2
  214. data/app/services/hyrax/work_uploads_handler.rb +21 -3
  215. data/app/services/hyrax/workflow/abstract_notification.rb +2 -2
  216. data/app/services/hyrax/workflow/action_taken_service.rb +16 -4
  217. data/app/services/hyrax/workflow/actionable_objects.rb +70 -0
  218. data/app/services/hyrax/workflow/activate_object.rb +5 -4
  219. data/app/services/hyrax/workflow/changes_required_notification.rb +5 -4
  220. data/app/services/hyrax/workflow/deactivate_object.rb +7 -5
  221. data/app/services/hyrax/workflow/deposited_notification.rb +8 -4
  222. data/app/services/hyrax/workflow/grant_edit_to_depositor.rb +7 -3
  223. data/app/services/hyrax/workflow/grant_read_to_depositor.rb +10 -3
  224. data/app/services/hyrax/workflow/object_in_workflow_decorator.rb +31 -0
  225. data/app/services/hyrax/workflow/revoke_edit_from_depositor.rb +8 -2
  226. data/app/services/hyrax/workflow/status_list_service.rb +43 -13
  227. data/app/services/hyrax/workflow/workflow_action_service.rb +4 -1
  228. data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
  229. data/app/views/hyrax/admin/analytics/_date_range_form.html.erb +11 -0
  230. data/app/views/hyrax/admin/analytics/collection_reports/_custom_range.html.erb +39 -0
  231. data/app/views/hyrax/admin/analytics/collection_reports/_monthly_summary.html.erb +48 -0
  232. data/app/views/hyrax/admin/analytics/collection_reports/_summary.html.erb +55 -0
  233. data/app/views/hyrax/admin/analytics/collection_reports/_top_collections.html.erb +55 -0
  234. data/app/views/hyrax/admin/analytics/collection_reports/index.html.erb +70 -0
  235. data/app/views/hyrax/admin/analytics/collection_reports/show.html.erb +94 -0
  236. data/app/views/hyrax/admin/analytics/work_reports/_custom_range.html.erb +43 -0
  237. data/app/views/hyrax/admin/analytics/work_reports/_monthly_summary.html.erb +35 -0
  238. data/app/views/hyrax/admin/analytics/work_reports/_summary.html.erb +60 -0
  239. data/app/views/hyrax/admin/analytics/work_reports/_top_file_set_downloads.html.erb +33 -0
  240. data/app/views/hyrax/admin/analytics/work_reports/_top_works.html.erb +40 -0
  241. data/app/views/hyrax/admin/analytics/work_reports/_work_counts.html.erb +18 -0
  242. data/app/views/hyrax/admin/analytics/work_reports/_work_files.html.erb +41 -0
  243. data/app/views/hyrax/admin/analytics/work_reports/index.html.erb +77 -0
  244. data/app/views/hyrax/admin/analytics/work_reports/show.html.erb +90 -0
  245. data/app/views/hyrax/admin/stats/show.html.erb +1 -1
  246. data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
  247. data/app/views/hyrax/base/_form_relationships.html.erb +1 -2
  248. data/app/views/hyrax/base/_form_rendering.html.erb +1 -1
  249. data/app/views/hyrax/base/_form_representative.html.erb +1 -1
  250. data/app/views/hyrax/base/_form_thumbnail.html.erb +1 -1
  251. data/app/views/hyrax/base/_form_visibility_error.html.erb +2 -0
  252. data/app/views/hyrax/base/_guts4form.html.erb +3 -3
  253. data/app/views/hyrax/base/_relationships_parent_row.html.erb +0 -1
  254. data/app/views/hyrax/base/_representative_media.html.erb +1 -1
  255. data/app/views/hyrax/base/_show_actions.html.erb +2 -2
  256. data/app/views/hyrax/base/_work_button_row.html.erb +1 -1
  257. data/app/views/hyrax/base/show.html.erb +6 -0
  258. data/app/views/hyrax/batch_uploads/_form.html.erb +1 -1
  259. data/app/views/hyrax/collections/show.html.erb +4 -0
  260. data/app/views/hyrax/dashboard/_repository_growth.html.erb +5 -5
  261. data/app/views/hyrax/dashboard/_resource_type_graph.html.erb +41 -0
  262. data/app/views/hyrax/dashboard/_sidebar.html.erb +4 -1
  263. data/app/views/hyrax/dashboard/_tabs.html.erb +11 -0
  264. data/app/views/hyrax/dashboard/_user_activity.html.erb +17 -23
  265. data/app/views/hyrax/dashboard/_user_activity_graph.html.erb +55 -0
  266. data/app/views/hyrax/dashboard/_visibility_graph.html.erb +31 -0
  267. data/app/views/hyrax/dashboard/_work_type_graph.html.erb +41 -0
  268. data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +1 -1
  269. data/app/views/hyrax/dashboard/collections/_form.html.erb +6 -5
  270. data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +1 -1
  271. data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
  272. data/app/views/hyrax/dashboard/collections/edit.html.erb +4 -2
  273. data/app/views/hyrax/dashboard/collections/new.html.erb +4 -2
  274. data/app/views/hyrax/dashboard/collections/show.html.erb +1 -1
  275. data/app/views/hyrax/dashboard/show_admin.html.erb +24 -45
  276. data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +22 -0
  277. data/app/views/hyrax/file_sets/_actions.html.erb +4 -3
  278. data/app/views/hyrax/file_sets/edit.html.erb +1 -1
  279. data/app/views/hyrax/file_sets/media_display/_audio.html.erb +1 -1
  280. data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
  281. data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -1
  282. data/app/views/hyrax/file_sets/media_display/_office_document.html.erb +1 -1
  283. data/app/views/hyrax/file_sets/media_display/_pdf.html.erb +1 -1
  284. data/app/views/hyrax/file_sets/media_display/_video.html.erb +1 -1
  285. data/app/views/hyrax/file_sets/show.html.erb +7 -1
  286. data/app/views/hyrax/homepage/index.html.erb +1 -1
  287. data/app/views/hyrax/my/_admin_set_action_menu.html.erb +0 -11
  288. data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -2
  289. data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
  290. data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +3 -5
  291. data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +1 -1
  292. data/app/views/hyrax/my/collections/index.html.erb +1 -1
  293. data/app/views/hyrax/stats/_downloads.html.erb +18 -0
  294. data/app/views/hyrax/stats/_pageviews.html.erb +18 -0
  295. data/app/views/hyrax/stats/work.html.erb +17 -9
  296. data/app/views/layouts/_head_tag_content.html.erb +7 -2
  297. data/app/views/layouts/hyrax/dashboard.html.erb +1 -0
  298. data/app/views/layouts/hyrax.html.erb +1 -0
  299. data/app/views/{_ga.html.erb → shared/_ga.html.erb} +3 -7
  300. data/app/views/shared/_matomo.html.erb +15 -0
  301. data/app/views/shared/_read_only.html.erb +5 -0
  302. data/bin/db-migrate-seed.sh +3 -1
  303. data/bin/hyrax-entrypoint.sh +0 -14
  304. data/bin/solrcloud-assign-configset.sh +11 -3
  305. data/bin/solrcloud-upload-configset.sh +17 -6
  306. data/chart/hyrax/Chart.yaml +9 -5
  307. data/chart/hyrax/README.md +52 -5
  308. data/chart/hyrax/templates/_helpers.tpl +15 -1
  309. data/chart/hyrax/templates/branding-pvc.yaml +2 -2
  310. data/chart/hyrax/templates/configmap-env.yaml +6 -2
  311. data/chart/hyrax/templates/deployment-worker.yaml +42 -5
  312. data/chart/hyrax/templates/deployment.yaml +53 -0
  313. data/chart/hyrax/templates/derivatives-pvc.yaml +2 -2
  314. data/chart/hyrax/templates/ingress.yaml +13 -4
  315. data/chart/hyrax/templates/secrets.yaml +8 -0
  316. data/chart/hyrax/templates/uploads-pvc.yaml +2 -2
  317. data/chart/hyrax/values.yaml +84 -2
  318. data/config/brakeman.ignore +2 -2
  319. data/config/features.rb +3 -0
  320. data/config/i18n-tasks.yml +2 -2
  321. data/config/initializers/1_healthz.rb +1 -0
  322. data/config/initializers/listeners.rb +5 -4
  323. data/config/initializers/valkryrie_storage.rb +7 -0
  324. data/config/locales/hyrax.de.yml +195 -1
  325. data/config/locales/hyrax.en.yml +192 -13
  326. data/config/locales/hyrax.es.yml +195 -1
  327. data/config/locales/hyrax.fr.yml +195 -1
  328. data/config/locales/hyrax.it.yml +195 -1
  329. data/config/locales/hyrax.pt-BR.yml +195 -1
  330. data/config/locales/hyrax.zh.yml +195 -1
  331. data/config/routes.rb +4 -0
  332. data/db/seeds.rb +1 -1
  333. data/docker-compose.yml +42 -9
  334. data/documentation/developing-your-hyrax-based-app.md +4 -4
  335. data/documentation/legacyREADME.md +4 -4
  336. data/hyrax.gemspec +4 -2
  337. data/lib/generators/hyrax/templates/catalog_controller.rb +3 -1
  338. data/lib/generators/hyrax/templates/config/analytics.yml +13 -7
  339. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +15 -13
  340. data/lib/generators/hyrax/templates/db/migrate/20211130181150_create_default_administrative_set.rb.erb +8 -0
  341. data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +4 -2
  342. data/lib/generators/hyrax/work_resource/templates/indexer_spec.rb.erb +1 -0
  343. data/lib/hyrax/active_fedora_dummy_model.rb +62 -0
  344. data/lib/hyrax/collection_name.rb +6 -2
  345. data/lib/hyrax/configuration.rb +114 -4
  346. data/lib/hyrax/engine.rb +9 -6
  347. data/lib/hyrax/errors.rb +2 -0
  348. data/lib/hyrax/form_fields.rb +1 -0
  349. data/lib/hyrax/publisher.rb +16 -0
  350. data/lib/hyrax/resource_name.rb +1 -0
  351. data/lib/hyrax/resource_sync/change_list_writer.rb +2 -2
  352. data/lib/hyrax/resource_sync/resource_list_writer.rb +2 -2
  353. data/lib/hyrax/specs/capybara.rb +5 -3
  354. data/lib/hyrax/specs/shared_specs/hydra_works.rb +2 -0
  355. data/lib/hyrax/specs/shared_specs/indexers.rb +6 -0
  356. data/lib/hyrax/specs/shared_specs/valkyrie_storage_versions.rb +9 -0
  357. data/lib/hyrax/transactions/admin_set_create.rb +22 -0
  358. data/lib/hyrax/transactions/collection_create.rb +25 -0
  359. data/lib/hyrax/transactions/collection_update.rb +20 -0
  360. data/lib/hyrax/transactions/container.rb +58 -0
  361. data/lib/hyrax/transactions/file_set_destroy.rb +21 -0
  362. data/lib/hyrax/transactions/steps/add_file_sets.rb +3 -2
  363. data/lib/hyrax/transactions/steps/add_to_collections.rb +13 -1
  364. data/lib/hyrax/transactions/steps/add_to_parent.rb +36 -0
  365. data/lib/hyrax/transactions/steps/apply_collection_type_permissions.rb +29 -0
  366. data/lib/hyrax/transactions/steps/remove_file_set_from_work.rb +47 -0
  367. data/lib/hyrax/transactions/steps/save.rb +18 -6
  368. data/lib/hyrax/transactions/steps/set_collection_type_gid.rb +35 -0
  369. data/lib/hyrax/transactions/work_create.rb +2 -1
  370. data/lib/hyrax/valkyrie_can_can_adapter.rb +1 -0
  371. data/lib/hyrax/valkyrie_simple_path_generator.rb +20 -0
  372. data/lib/hyrax/version.rb +1 -1
  373. data/lib/hyrax.rb +9 -0
  374. data/lib/tasks/collection_type_global_id.rake +1 -1
  375. data/lib/tasks/default_admin_set.rake +12 -11
  376. data/lib/tasks/regenerate_derivatives.rake +12 -0
  377. data/lib/wings/active_fedora_converter/default_work.rb +15 -0
  378. data/lib/wings/model_transformer.rb +17 -1
  379. data/lib/wings/orm_converter.rb +18 -2
  380. data/lib/wings/setup.rb +17 -0
  381. data/lib/wings/valkyrie/persister.rb +16 -0
  382. data/lib/wings/valkyrie/storage.rb +56 -1
  383. data/lib/wings.rb +0 -21
  384. data/template.rb +1 -1
  385. data/vendor/assets/javascripts/morris/morris.min.js +1 -7
  386. data/vendor/assets/stylesheets/morris.js/0.5.1/morris.css +1 -1
  387. metadata +120 -17
  388. data/app/views/hyrax/dashboard/_repository_objects.html.erb +0 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '081daeb5064ca757527e98cfbbea41846b8a15440a26a2d152b1ad7a1c7f395b'
4
- data.tar.gz: 70e52823ff8ef7546510db08f28c22207488952f146be3bb63b9ecba440ebb81
3
+ metadata.gz: 95d9c34fb76fd8e3ac06d6605962c16bbdad32ffa2c1f5ab24958740fc175507
4
+ data.tar.gz: 8be6a02dc887f93076d84a5dc47b8e4cc7ecf916415e23fd00df24078f20ebbf
5
5
  SHA512:
6
- metadata.gz: a36054d54da990c0ea0ab03ce538a903ceed121026e1ac160b1dc2226a21fc12a8b8d422d99b71e545048af33318ab86ae90e8e3a906b6bcb1061983059ac4d4
7
- data.tar.gz: 5b8b6759915c77982125b0c33b6f8681dd7ea61c0cce63b0665567fd00e47be468d097e6653cdfd65df5db35ff1ac4f01c98cb39b12d774c741b8cd6ff086e1a
6
+ metadata.gz: b6e519190cda4bdcdb4a68577b682ad6fd138756da25ce69228429755e3ee3a2fb3ac95d9140831d623f75e0aa8a9115d378abafe8f301850c200fb8080b9942
7
+ data.tar.gz: 90610095bd1b82e79bc7ebaa8de11a2f3c8452803a15d60a4595308b67ab85724b118c7343b2a46fb2bafb3a138365fdb94540e948965cc1a96d4259fd8b07d6
data/.circleci/config.yml CHANGED
@@ -12,7 +12,7 @@ jobs:
12
12
  default: 1.17.3
13
13
  rails_version:
14
14
  type: string
15
- default: '5.2.2'
15
+ default: '5.2.6'
16
16
  executor:
17
17
  name: 'samvera/ruby'
18
18
  ruby_version: << parameters.ruby_version >>
@@ -22,10 +22,20 @@ jobs:
22
22
  NOKOGIRI_USE_SYSTEM_LIBRARIES: true
23
23
  steps:
24
24
  - samvera/cached_checkout
25
- - samvera/bundle_for_gem:
25
+
26
+ - run:
27
+ name: Check for a branch named 'master'
28
+ command: |
29
+ git fetch --all --quiet --prune --prune-tags
30
+ if [[ -n "$(git branch --all --list master */master)" ]]; then
31
+ echo "A branch named 'master' was found. Please remove it."
32
+ echo "$(git branch --all --list master */master)"
33
+ fi
34
+ [[ -z "$(git branch --all --list master */master)" ]]
35
+
36
+ - samvera/bundle:
26
37
  ruby_version: << parameters.ruby_version >>
27
38
  bundler_version: << parameters.bundler_version >>
28
- project: hyrax
29
39
 
30
40
  # Run rubocop in parallel with caching
31
41
  # This should get added to the orb once proven here
@@ -63,7 +73,7 @@ jobs:
63
73
  default: 1.17.3
64
74
  rails_version:
65
75
  type: string
66
- default: '5.2.2'
76
+ default: '5.2.6'
67
77
  executor:
68
78
  name: 'samvera/ruby_fcrepo_solr_redis_postgres'
69
79
  ruby_version: << parameters.ruby_version >>
@@ -78,10 +88,9 @@ jobs:
78
88
  at: ~/
79
89
  - samvera/engine_cart_generate:
80
90
  cache_key: v1-internal-test-app-{{ checksum "hyrax.gemspec" }}-{{ checksum ".regen" }}-{{ checksum ".circleci/config.yml" }}-<< parameters.rails_version >>-<< parameters.ruby_version >>
81
- - samvera/bundle_for_gem:
91
+ - samvera/bundle:
82
92
  ruby_version: << parameters.ruby_version >>
83
93
  bundler_version: << parameters.bundler_version >>
84
- project: hyrax
85
94
  - persist_to_workspace:
86
95
  root: ~/
87
96
  paths:
@@ -117,24 +126,38 @@ jobs:
117
126
  solr_config_path: .internal_test_app/solr/conf
118
127
  core_name: hyrax-valkyrie-test
119
128
  # Rerun bundler in case this is a different ruby version than bundle and build steps
120
- - samvera/bundle_for_gem:
129
+ - samvera/bundle:
121
130
  ruby_version: << parameters.ruby_version >>
122
131
  bundler_version: << parameters.bundler_version >>
123
- project: hyrax
124
132
  - run:
125
133
  command: bundle exec rake app:db:migrate
126
134
  - samvera/parallel_rspec
127
135
 
136
+ # Trigger a workflow on the nurax repository that will deploy the most recent hyrax gem code to https://nurax-dev.curationexperts.com/
137
+ deploy:
138
+ docker:
139
+ - image: ubuntu
140
+ steps:
141
+ - run:
142
+ name: Install curl
143
+ command: apt-get update && apt-get install -y curl
144
+ - run:
145
+ name: "Trigger Nurax deploy"
146
+ command: |
147
+ curl -X POST https://circleci.com/api/v2/project/gh/curationexperts/nurax/pipeline \
148
+ --header "Circle-Token: $NURAX_CIRCLECI_TOKEN" \
149
+ --header 'Accept: text/plain' \
150
+ --header 'Content-Type: application/json'
128
151
  workflows:
129
152
  version: 2
130
153
  ruby2-5-8:
131
154
  jobs:
132
155
  - bundle:
133
156
  ruby_version: "2.5.8"
134
- rails_version: "5.2.4.3"
157
+ rails_version: "5.2.6"
135
158
  - build:
136
159
  ruby_version: "2.5.8"
137
- rails_version: "5.2.4.3"
160
+ rails_version: "5.2.6"
138
161
  requires:
139
162
  - bundle
140
163
  - test:
@@ -146,10 +169,10 @@ workflows:
146
169
  jobs:
147
170
  - bundle:
148
171
  ruby_version: "2.6.6"
149
- rails_version: "5.2.4.3"
172
+ rails_version: "5.2.6"
150
173
  - build:
151
174
  ruby_version: "2.6.6"
152
- rails_version: "5.2.4.3"
175
+ rails_version: "5.2.6"
153
176
  requires:
154
177
  - bundle
155
178
  - test:
@@ -163,21 +186,28 @@ workflows:
163
186
  hyrax_valkyrie: "true"
164
187
  requires:
165
188
  - build
166
- ruby2-7-2:
189
+ ruby2-7-4:
167
190
  jobs:
168
191
  - bundle:
169
- ruby_version: "2.7.2"
170
- rails_version: "5.2.4.3"
192
+ ruby_version: "2.7.4"
193
+ rails_version: "5.2.6"
171
194
  bundler_version: "2.1.4"
172
195
  - build:
173
- ruby_version: "2.7.2"
174
- rails_version: "5.2.4.3"
196
+ ruby_version: "2.7.4"
197
+ rails_version: "5.2.6"
175
198
  bundler_version: "2.1.4"
176
199
  requires:
177
200
  - bundle
178
201
  - test:
179
- name: "ruby2-7-2"
180
- ruby_version: "2.7.2"
202
+ name: "ruby2-7-4"
203
+ ruby_version: "2.7.4"
181
204
  bundler_version: "2.1.4"
182
205
  requires:
183
206
  - build
207
+ nurax-dev_deploy:
208
+ jobs:
209
+ - deploy:
210
+ filters:
211
+ branches:
212
+ only:
213
+ - main
data/.dassie/.env CHANGED
@@ -1,4 +1,3 @@
1
1
  MEMCACHED_HOST=memcached
2
- HYRAX_ANALYTICS=1
3
2
  REDIS_PROVIDER=SIDEKIQ_REDIS_URL
4
- SIDEKIQ_REDIS_URL=redis://redis:6379/0
3
+ SIDEKIQ_REDIS_URL=redis://redis:6379/0
data/.dassie/Gemfile CHANGED
@@ -1,14 +1,21 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+ # Attempts to determine if a global gem source has ready been added by another Gemfile
3
+ if @sources.global_rubygems_source == Bundler::SourceList.new.global_rubygems_source
4
+ Bundler.ui.info '[Dassie] Adding global rubygems source.'
5
+ source 'https://rubygems.org'
6
+ else
7
+ Bundler.ui.info "[Dassie] Global rubygems source already set: #{@sources.global_rubygems_source.inspect}"
8
+ end
2
9
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
10
 
4
- ruby '2.7.2'
11
+ ruby '2.7.4'
5
12
 
6
13
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7
14
  gem 'rails', '~> 5.2.4', '>= 5.2.4.4'
8
15
  # Use postgresql as the database for Active Record
9
16
  gem 'pg', '>= 0.18', '< 2.0'
10
17
  # Use Puma as the app server
11
- gem 'puma', '~> 3.11'
18
+ gem 'puma', '~> 4.3.8'
12
19
  # Use SCSS for stylesheets
13
20
  gem 'sass-rails', '~> 5.0'
14
21
  # Use Uglifier as compressor for JavaScript assets
@@ -43,15 +50,17 @@ end
43
50
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
44
51
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
45
52
 
46
- begin # this is a hack to allow `eval_gemfile` to work correctly
47
- gem 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
48
- rescue; end
53
+ gemspec name: 'hyrax', path: ENV.fetch('HYRAX_ENGINE_PATH', '..')
49
54
 
50
- gem 'rsolr', '>= 1.0', '< 3'
51
55
  gem 'bootstrap-sass', '~> 3.0'
52
- gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
53
- gem 'jquery-rails'
54
56
  gem 'devise'
55
57
  gem 'devise-guests', '~> 0.6'
58
+ gem 'jquery-rails'
59
+ gem 'pry-byebug'
60
+ gem 'pry-doc'
61
+ gem 'pry-rails'
62
+ gem 'pry-rescue'
56
63
  gem 'riiif', '~> 2.1'
64
+ gem 'rsolr', '>= 1.0', '< 3'
57
65
  gem 'sidekiq', '~> 6.0'
66
+ gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
@@ -5,6 +5,8 @@ class CatalogController < ApplicationController
5
5
 
6
6
  # This filter applies the hydra access controls
7
7
  before_action :enforce_show_permissions, only: :show
8
+ # Allow all search options when in read-only mode
9
+ skip_before_action :check_read_only
8
10
 
9
11
  def self.uploaded_field
10
12
  "system_create_dtsi"
@@ -28,6 +30,10 @@ class CatalogController < ApplicationController
28
30
  config.view.gallery.partials = [:index_header, :index]
29
31
  config.view.slideshow.partials = [:index]
30
32
 
33
+ # Because too many times on Samvera tech people raise a problem regarding a failed query to SOLR.
34
+ # Often, it's because they inadvertently exceeded the character limit of a GET request.
35
+ config.http_method = :post
36
+
31
37
  ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
32
38
  config.default_solr_params = {
33
39
  qt: "search",
@@ -5,8 +5,6 @@ class User < ApplicationRecord
5
5
  include Hyrax::User
6
6
  include Hyrax::UserUsageStats
7
7
 
8
-
9
-
10
8
  if Blacklight::Utils.needs_attr_accessible?
11
9
  attr_accessible :email, :password, :password_confirmation
12
10
  end
@@ -1,6 +1,13 @@
1
1
  analytics:
2
- app_name: My App Name
3
- app_version: 0.0.1
4
- privkey_path: /tmp/privkey.p12
5
- privkey_secret: s00pers3kr1t
6
- client_email: oauth@example.org
2
+ google:
3
+ analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
4
+ app_name: <%= ENV['GOOGLE_OAUTH_APP_NAME'] %>
5
+ app_version: <%= ENV['GOOGLE_OAUTH_APP_VERSION'] %>
6
+ privkey_path: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_PATH'] %>
7
+ privkey_secret: <%= ENV['GOOGLE_OAUTH_PRIVATE_KEY_SECRET'] %>
8
+ client_email: <%= ENV['GOOGLE_OAUTH_CLIENT_EMAIL'] %>
9
+ matomo:
10
+ base_url: <%= ENV['MATOMO_BASE_URL'] %>
11
+ site_id: <%= ENV['MATOMO_SITE_ID'] %>
12
+ auth_token: <%= ENV['MATOMO_AUTH_TOKEN'] %>
13
+
@@ -29,6 +29,8 @@ Rails.application.configure do
29
29
  config.cache_store = :null_store
30
30
  end
31
31
 
32
+ config.web_console.whitelisted_ips = ['172.18.0.0/16', '172.27.0.0/16', '0.0.0.0/0']
33
+
32
34
  # Store uploaded files on the local file system (see config/storage.yml for options)
33
35
  config.active_storage.service = :local
34
36
 
@@ -5,6 +5,8 @@ Hyrax.config do |config|
5
5
  # Defaults to false. See README for more info
6
6
  config.arkivo_api = true
7
7
 
8
+ config.analytics = ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_ANALYTICS', 'false'))
9
+ config.analytics_provider = ENV.fetch('HYRAX_ANALYTICS_PROVIDER', 'google')
8
10
  # Injected via `rails g hyrax:work GenericWork`
9
11
  config.register_curation_concern :generic_work
10
12
  # Injected via `rails g hyrax:work NamespacedWorks::NestedWork`
@@ -39,6 +41,11 @@ Hyrax.config do |config|
39
41
  ##
40
42
  # Set the system-wide virus scanner
41
43
  config.virus_scanner = Hyrax::VirusScanner
44
+
45
+ ##
46
+ # To index to the Valkyrie core, uncomment the following two lines.
47
+ # config.query_index_from_valkyrie = true
48
+ # config.index_adapter = :solr_index
42
49
  end
43
50
 
44
51
  Date::DATE_FORMATS[:standard] = "%m/%d/%Y"
@@ -1,4 +1,6 @@
1
1
  development:
2
+ admin:
3
+ - admin@example.com
2
4
  archivist:
3
5
  - archivist1@example.com
4
6
 
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20160111215816)
3
+ class EnableUuidExtension < ActiveRecord::Migration[5.0]
4
+ def change
5
+ enable_extension 'uuid-ossp'
6
+ end
7
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20161007101725)
3
+ class CreateOrmResources < ActiveRecord::Migration[5.0]
4
+ def options
5
+ if ENV["VALKYRIE_ID_TYPE"] == "string"
6
+ { id: :text, default: -> { '(uuid_generate_v4())::text' } }
7
+ else
8
+ { id: :uuid }
9
+ end
10
+ end
11
+
12
+ def change
13
+ create_table :orm_resources, **options do |t|
14
+ t.jsonb :metadata, null: false, default: {}
15
+ t.timestamps
16
+ end
17
+ add_index :orm_resources, :metadata, using: :gin
18
+ end
19
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20170124135846)
3
+ class AddModelTypeToOrmResources < ActiveRecord::Migration[5.0]
4
+ def change
5
+ add_column :orm_resources, :resource_type, :string
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20170531004548)
3
+ class ChangeModelTypeToInternalModel < ActiveRecord::Migration[5.1]
4
+ def change
5
+ rename_column :orm_resources, :resource_type, :internal_resource
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20171011224121)
3
+ class CreatePathGinIndex < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_index :orm_resources, 'metadata jsonb_path_ops', using: :gin
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20171204224121)
3
+ class CreateInternalResourceIndex < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_index :orm_resources, :internal_resource
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20180212092225)
3
+ class CreateUpdatedAtIndex < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_index :orm_resources, :updated_at
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+ # This migration comes from valkyrie_engine (originally 20180802220739)
3
+ class AddOptimisticLockingToOrmResources < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_column :orm_resources, :lock_version, :integer
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ class CreateDefaultAdministrativeSet < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :hyrax_default_administrative_set do |t|
4
+ t.string :default_admin_set_id, null: false
5
+ t.timestamps null: false
6
+ end
7
+ end
8
+ end
data/.dassie/db/schema.rb CHANGED
@@ -10,10 +10,11 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2020_08_21_212903) do
13
+ ActiveRecord::Schema.define(version: 2021_11_30_181150) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
17
+ enable_extension "uuid-ossp"
17
18
 
18
19
  create_table "bookmarks", id: :serial, force: :cascade do |t|
19
20
  t.integer "user_id", null: false
@@ -139,6 +140,12 @@ ActiveRecord::Schema.define(version: 2020_08_21_212903) do
139
140
  t.index ["machine_id"], name: "index_hyrax_collection_types_on_machine_id", unique: true
140
141
  end
141
142
 
143
+ create_table "hyrax_default_administrative_set", force: :cascade do |t|
144
+ t.string "default_admin_set_id", null: false
145
+ t.datetime "created_at", null: false
146
+ t.datetime "updated_at", null: false
147
+ end
148
+
142
149
  create_table "hyrax_features", force: :cascade do |t|
143
150
  t.string "key", null: false
144
151
  t.boolean "enabled", default: false, null: false
@@ -225,6 +232,18 @@ ActiveRecord::Schema.define(version: 2020_08_21_212903) do
225
232
  t.index ["namespace"], name: "index_minter_states_on_namespace", unique: true
226
233
  end
227
234
 
235
+ create_table "orm_resources", id: :uuid, default: -> { "uuid_generate_v4()" }, force: :cascade do |t|
236
+ t.jsonb "metadata", default: {}, null: false
237
+ t.datetime "created_at", null: false
238
+ t.datetime "updated_at", null: false
239
+ t.string "internal_resource"
240
+ t.integer "lock_version"
241
+ t.index ["internal_resource"], name: "index_orm_resources_on_internal_resource"
242
+ t.index ["metadata"], name: "index_orm_resources_on_metadata", using: :gin
243
+ t.index ["metadata"], name: "index_orm_resources_on_metadata_jsonb_path_ops", opclass: :jsonb_path_ops, using: :gin
244
+ t.index ["updated_at"], name: "index_orm_resources_on_updated_at"
245
+ end
246
+
228
247
  create_table "permission_template_accesses", force: :cascade do |t|
229
248
  t.bigint "permission_template_id"
230
249
  t.string "agent_type"
data/.dassie/db/seeds.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
7
7
  # Character.create(name: 'Luke', movie: movies.first)
8
8
 
9
- Hyrax::Engine.load_seed
9
+ Hyrax::Engine.load_seed unless ActiveModel::Type::Boolean.new.cast(ENV["SKIP_HYRAX_ENGINE_SEED"])
10
10
 
11
11
  puts "\n== Loading users"
12
12
  User.where(email: 'admin@example.com').first_or_create do |f|
data/.dockerignore CHANGED
@@ -10,3 +10,6 @@ Dockerfile
10
10
  artifacts/*
11
11
  coverage/*
12
12
  chart/*
13
+
14
+ Gemfile.lock
15
+ .dassie/Gemfile.lock
data/.env CHANGED
@@ -1,15 +1,17 @@
1
- CAPYBARA_SERVER=http://app:3010
1
+ ANALYTICS_START_DATE=2021-08-21
2
2
  CHROME_HEADLESS_MODE=false
3
3
  DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
4
4
  DATABASE_TEST_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax_test?pool=5
5
5
  DATABASE_URL=postgresql://hyrax_user:hyrax_password@postgres/hyrax?pool=5
6
- DB_PORT=5432
7
6
  DB_HOST=postgres
8
- FCREPO_PORT=8080
7
+ DB_PORT=5432
9
8
  FCREPO_HOST=fcrepo
10
- FCREPO_REST_PATH=fcrepo/rest
9
+ FCREPO_PORT=8080
10
+ FCREPO_REST_PATH=rest
11
11
  FCREPO_TEST_BASE_PATH=/test
12
12
  HUB_URL=http://chrome:4444/wd/hub
13
+ HYRAX_ANALYTICS=false
14
+ HYRAX_ANALYTICS_PROVIDER=google
13
15
  HYRAX_DERIVATIVES_PATH=/app/samvera/hyrax-webapp/derivatives/
14
16
  HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
15
17
  HYRAX_UPLOAD_PATH=/app/samvera/hyrax-webapp/uploads/
@@ -18,9 +20,9 @@ RACK_ENV=development
18
20
  RAILS_ENV=development
19
21
  RAILS_ROOT=.dassie
20
22
  REDIS_HOST=redis
21
- SOLR_PORT=8983
22
23
  SOLR_HOST=solr
24
+ SOLR_PORT=8983
23
25
  SOLR_TEST_URL=http://solr:8983/solr/hyrax_test
24
26
  SOLR_URL=http://solr:8983/solr/hyrax
25
- VALKYRIE_SOLR_PORT=8983
26
27
  VALKYRIE_SOLR_HOST=solr
28
+ VALKYRIE_SOLR_PORT=8983
@@ -0,0 +1,17 @@
1
+ name: Trigger Nurax build
2
+ on:
3
+ workflow_dispatch:
4
+ push:
5
+
6
+ jobs:
7
+ trigger:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: peter-evans/repository-dispatch@v1
11
+ with:
12
+ token: ${{ secrets.NURAX_ACCESS_TOKEN }}
13
+ event-type: push
14
+ repository: curationexperts/nurax
15
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
16
+
17
+
@@ -0,0 +1,17 @@
1
+ name: Trigger Nurax build
2
+ on:
3
+ workflow_dispatch:
4
+ release:
5
+
6
+ jobs:
7
+ trigger:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: peter-evans/repository-dispatch@v1
11
+ with:
12
+ token: ${{ secrets.NURAX_ACCESS_TOKEN }}
13
+ event-type: release
14
+ repository: curationexperts/nurax
15
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
16
+
17
+
data/.gitignore CHANGED
@@ -82,3 +82,4 @@ lib/bundler/man
82
82
  spec/reports
83
83
  /spec/examples.txt
84
84
  node_modules
85
+ .env.*
data/.regen CHANGED
@@ -1 +1 @@
1
- 36
1
+ 40
data/.rubocop.yml CHANGED
@@ -41,6 +41,10 @@ Metrics/BlockLength:
41
41
  Style/AsciiComments:
42
42
  Enabled: false
43
43
 
44
+ # rubocop suggests !thing.nil? instead, but that is NOT equivalent
45
+ Style/DoubleNegation:
46
+ Enabled: false
47
+
44
48
  Style/CollectionMethods:
45
49
  PreferredMethods:
46
50
  collect: 'map'
data/CONTAINERS.md CHANGED
@@ -1,14 +1,11 @@
1
1
  Hyrax-in-a-Container
2
2
  ====================
3
3
 
4
- Our goal is to provide a practical, reusable "reference environment for applications. The first step is providing
5
- on on-ramp for Hyrax engine development. Then providing help with Hyrax-based application development. Finally,
6
- providing better guidance around deployment.
4
+ Our goal is to provide a practical, reusable reference environment for applications. The first step is providing an on-ramp for Hyrax engine development. Then providing help with Hyrax-based application development. Finally, providing better guidance around deployment.
7
5
 
8
- Where are we at? It's complicated. What we have below is experimental support, but one that we want to push
9
- towards. We need your help to keep pushing in this direction. So dig in and prepare to get your hands dirty.
6
+ The [Hyrax Engine Development](#hyrax-engine-development) is further along than the [Docker Image for Hyrax-based Applications](#docker-image-for-hyrax-based-applications) which is further along than [Deploying to Production](#deploying-to-production).
10
7
 
11
- The [Hyrax Engine Development](#hyrax-engine-development) is further along than the [Docker Image for Hyrax-based Applications](docker-image-for-hyrax-based-applications) which is further along than [Deploying to Production](#deploying-to-production).
8
+ See the [Troubleshooting](#troubleshooting) section if you encounter any issues.
12
9
 
13
10
  <!-- NOTE: This title is referenced in the top-level README.md. Keep that in mind if you change it. -->
14
11
  ## Hyrax Engine Development
@@ -42,8 +39,6 @@ To stop the containers for the Hyrax-based application, type <kbd>Ctrl</kbd>+<kb
42
39
 
43
40
  _**Note:** Starting and stopping Docker in this way will preserve your data between restarts._
44
41
 
45
- _**Note:** I (Jeremy) encountered a problem using `docker-compose build`. I ran `bundle update` in `./hyrax` as well as within `./hyrax/.dassie`. That appeared to clear up the problem of a failure to build a gem._
46
-
47
42
  ### Code Changes and Testing
48
43
 
49
44
  With `docker-compose up` running, any changes you make to your cloned Hyrax code-base should show up in `http://localhost:3000`; There may be cases where you need to restart your test application (e.g. stop the containers and start them up again).
@@ -99,7 +94,7 @@ In the two examples, note the difference in the `-w` switch. In the first case,
99
94
 
100
95
  ### Debugging
101
96
 
102
- I (Jeremy) find myself wanting to debug the application. This requires a somewhat different approach than running Hyrax bare-metal. You need to use `docker attach` to debug the running docker instance.
97
+ If you are interested in running Hyrax in debug mode, this requires a somewhat different approach than running Hyrax bare-metal. You need to use `docker attach` to debug the running docker instance.
103
98
 
104
99
  1. With `docker-compose up` running open a new Terminal session.
105
100
  2. In that new Terminal session, using `docker container ls` find the "CONTAINER ID" for the `hyrax-engine-dev`.
@@ -107,6 +102,34 @@ I (Jeremy) find myself wanting to debug the application. This requires a somewh
107
102
 
108
103
  This advice comes from [Debugging Rails App With Docker Compose: How to use Byebug in a dockerized rails app](https://medium.com/gogox-technology/debugging-rails-app-with-docker-compose-39a3767962f4).
109
104
 
105
+ ### Troubleshooting
106
+
107
+ #### Bad Address SOLR
108
+
109
+ With `docker-compose up` running, if you see the following, then there may be issues with file permissions:
110
+
111
+ ```
112
+ db_migrate_1 | waiting for solr:8983
113
+ db_migrate_1 | nc: bad address 'solr'
114
+ ```
115
+
116
+ Check the Docker application logs and look for permission errors:
117
+
118
+ ```
119
+ Executing /opt/docker-solr/scripts/precreate-core hyrax_test /opt/solr/server/configsets/hyraxconf
120
+ cp: cannot create directory '/var/solr/data/hyrax_test': Permission denied
121
+ ```
122
+
123
+ The solution that appears to work is to `docker-compose down --volumes`; This will tear down the docker instance, and remove the volumes. You can then run `docker-compose up` to get back to work. _**Note:** the `--volumes` switch will remove all custom data._
124
+
125
+ #### Errors building the Docker image
126
+
127
+ If you encounter errors running `docker-compose build`, try running `bundle update` in `./hyrax` as well as within `./hyrax/.dassie`. That can help clear up the problem of a failure to build a particular gem.
128
+
129
+ #### Containers do not all start
130
+
131
+ If any of the services fail to start on `docker-compose up`, try clearing out any `Gemfile.lock` files that might exist in `./hyrax` or `./hyrax/.dassie` and run `docker-compose build` again, then `docker-compose up` again.
132
+
110
133
  <!-- NOTE: This title is referenced in the top-level documentation/developing-your-hyrax-based-app.md. Keep that in mind if you change it. -->
111
134
  ## Docker Image for Hyrax-based Applications
112
135
 
@@ -157,4 +180,4 @@ helm dependency update chart/hyrax
157
180
  helm install -n hyrax --set image.tag=(git rev-parse HEAD) dassie chart/hyrax
158
181
  ```
159
182
 
160
- [dockerhub-samveralabs]: https://hub.docker.com/r/samveralabs
183
+ [dockerhub-samveralabs]: https://hub.docker.com/r/samveralabs