hyrax 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +19 -8
  3. data/.dassie/config/role_map.yml +2 -0
  4. data/.dassie/db/seeds.rb +1 -1
  5. data/.env +1 -1
  6. data/CONTAINERS.md +20 -0
  7. data/app/actors/hyrax/actors/file_set_actor.rb +10 -5
  8. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +0 -4
  9. data/app/forms/hyrax/forms/resource_form.rb +11 -1
  10. data/app/helpers/hyrax/dashboard_helper_behavior.rb +20 -5
  11. data/app/helpers/hyrax/embargo_helper.rb +4 -0
  12. data/app/helpers/hyrax/lease_helper.rb +4 -0
  13. data/app/helpers/hyrax/url_helper.rb +4 -1
  14. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +2 -0
  15. data/app/indexers/hyrax/valkyrie_work_indexer.rb +1 -1
  16. data/app/jobs/ingest_local_file_job.rb +18 -2
  17. data/app/models/collection_branding_info.rb +25 -9
  18. data/app/models/concerns/hyrax/embargoable.rb +24 -0
  19. data/app/models/concerns/hyrax/work_behavior.rb +1 -1
  20. data/app/presenters/hyrax/admin_set_options_presenter.rb +13 -1
  21. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +119 -0
  22. data/app/presenters/hyrax/work_show_presenter.rb +5 -1
  23. data/app/search_builders/hyrax/collection_member_search_builder.rb +6 -1
  24. data/app/search_builders/hyrax/my/collections_search_builder.rb +1 -1
  25. data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +1 -1
  26. data/app/search_builders/hyrax/single_collection_search_builder.rb +1 -1
  27. data/app/services/hyrax/contextual_path.rb +1 -1
  28. data/app/services/hyrax/edit_permissions_service.rb +47 -21
  29. data/app/services/hyrax/find_objects_via_solr_service.rb +27 -0
  30. data/app/services/hyrax/multiple_membership_checker.rb +6 -2
  31. data/app/services/hyrax/solr_query_builder_service.rb +17 -3
  32. data/app/services/hyrax/visibility_intention.rb +20 -2
  33. data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
  34. data/app/views/hyrax/base/_form_visibility_error.html.erb +2 -0
  35. data/app/views/hyrax/base/_guts4form.html.erb +1 -1
  36. data/app/views/hyrax/base/_show_actions.html.erb +1 -1
  37. data/app/views/hyrax/base/_work_button_row.html.erb +1 -1
  38. data/app/views/hyrax/batch_uploads/_form.html.erb +1 -1
  39. data/bin/db-migrate-seed.sh +3 -1
  40. data/bin/hyrax-entrypoint.sh +0 -14
  41. data/bin/solrcloud-assign-configset.sh +5 -0
  42. data/bin/solrcloud-upload-configset.sh +14 -5
  43. data/chart/hyrax/Chart.yaml +8 -4
  44. data/chart/hyrax/README.md +5 -4
  45. data/chart/hyrax/templates/_helpers.tpl +14 -0
  46. data/chart/hyrax/templates/branding-pvc.yaml +2 -2
  47. data/chart/hyrax/templates/configmap-env.yaml +7 -1
  48. data/chart/hyrax/templates/deployment-worker.yaml +39 -5
  49. data/chart/hyrax/templates/deployment.yaml +42 -0
  50. data/chart/hyrax/templates/derivatives-pvc.yaml +2 -2
  51. data/chart/hyrax/templates/ingress.yaml +13 -4
  52. data/chart/hyrax/templates/secrets.yaml +8 -0
  53. data/chart/hyrax/templates/uploads-pvc.yaml +2 -2
  54. data/chart/hyrax/values.yaml +71 -1
  55. data/config/initializers/valkryrie_storage.rb +7 -0
  56. data/docker-compose.yml +38 -8
  57. data/documentation/developing-your-hyrax-based-app.md +3 -3
  58. data/documentation/legacyREADME.md +4 -4
  59. data/lib/hyrax/configuration.rb +12 -0
  60. data/lib/hyrax/engine.rb +1 -0
  61. data/lib/hyrax/resource_name.rb +1 -0
  62. data/lib/hyrax/specs/capybara.rb +2 -2
  63. data/lib/hyrax/valkyrie_simple_path_generator.rb +20 -0
  64. data/lib/hyrax/version.rb +1 -1
  65. data/lib/wings.rb +0 -21
  66. data/lib/wings/active_fedora_converter/default_work.rb +15 -0
  67. data/lib/wings/model_transformer.rb +17 -1
  68. data/lib/wings/setup.rb +1 -0
  69. data/template.rb +1 -1
  70. metadata +8 -3
@@ -1,10 +1,11 @@
1
1
  {{- if .Values.ingress.enabled -}}
2
2
  {{- $fullName := include "hyrax.fullname" . -}}
3
3
  {{- $svcPort := .Values.service.port -}}
4
- {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
4
+ {{- $beta := semverCompare "<1.19-0" (default .Capabilities.KubeVersion.Version .Values.kubeVersion) -}}
5
+ {{- if $beta }}
5
6
  apiVersion: networking.k8s.io/v1beta1
6
- {{- else -}}
7
- apiVersion: extensions/v1beta1
7
+ {{- else }}
8
+ apiVersion: networking.k8s.io/v1
8
9
  {{- end }}
9
10
  kind: Ingress
10
11
  metadata:
@@ -32,10 +33,18 @@ spec:
32
33
  http:
33
34
  paths:
34
35
  {{- range .paths }}
35
- - path: {{ . }}
36
+ - path: {{ .path }}
37
+ pathType: {{ .pathType | default "ImplementationSpecific" }}
36
38
  backend:
39
+ {{- if $beta }}
37
40
  serviceName: {{ $fullName }}
38
41
  servicePort: {{ $svcPort }}
42
+ {{- else }}
43
+ service:
44
+ name: {{ $fullName }}
45
+ port:
46
+ number: {{ $svcPort }}
47
+ {{- end }}
39
48
  {{- end }}
40
49
  {{- end }}
41
50
  {{- end }}
@@ -7,7 +7,15 @@ metadata:
7
7
  type: Opaque
8
8
  data:
9
9
  SECRET_KEY_BASE: {{ randAlphaNum 20 | b64enc | quote }}
10
+ DB_PASSWORD: {{ include "hyrax.postgresql.password" . | b64enc }}
10
11
  DATABASE_URL: {{ printf "postgresql://%s:%s@%s/%s?pool=5" ( include "hyrax.postgresql.username" . ) ( include "hyrax.postgresql.password" . ) ( include "hyrax.postgresql.host" . ) ( include "hyrax.postgresql.database" . ) | b64enc }}
12
+ {{- if .Values.minio.enabled }}
13
+ MINIO_ACCESS_KEY: {{ .Values.minio.accessKey.password | b64enc}}
14
+ MINIO_SECRET_KEY: {{ .Values.minio.secretKey.password | b64enc}}
15
+ {{- end }}
16
+ {{- if not .Values.solrExistingSecret }}
17
+ SOLR_ADMIN_PASSWORD: {{ include "hyrax.solr.password" . | b64enc }}
18
+ {{- end }}
11
19
  {{- if .Values.redis.enabled }}
12
20
  REDIS_PASSWORD: {{ .Values.redis.password | b64enc}}
13
21
  SIDEKIQ_REDIS_URL: {{ include "hyrax.redis.url" . | b64enc }}
@@ -6,9 +6,9 @@ metadata:
6
6
  labels:
7
7
  {{- include "hyrax.labels" . | nindent 4 }}
8
8
  spec:
9
- accessModes:
10
- - ReadWriteMany
9
+ {{ include "hyrax.sharedPvcAccessModes" . | nindent 2 }}
11
10
  resources:
12
11
  requests:
13
12
  storage: {{ .Values.uploadsVolume.size }}
13
+ storageClassName: {{ .Values.uploadsVolume.storageClass }}
14
14
  {{- end }}
@@ -10,33 +10,87 @@ image:
10
10
  # Overrides the image tag whose default is the chart appVersion.
11
11
  tag: ""
12
12
 
13
+ # use true to skip loading Hyrax engine database seed file
14
+ skipHyraxEngineSeed: false
15
+
13
16
  # use false to skip the configset management init container
14
17
  loadSolrConfigSet: true
15
18
  # the host and auth details for an external solr service;
16
19
  # ignored if `solr.enabled` is true
20
+ solrExistingSecret: ""
17
21
  externalSolrHost: ""
18
22
  externalSolrUser: ""
19
23
  externalSolrPassword: ""
20
24
  externalSolrCollection: "hyrax"
21
25
 
26
+ # additional environment variables, evaluated as a template. e.g.
27
+ #
28
+ # extraEnvVars:
29
+ # - name: RAILS_SERVE_STATIC_FILES
30
+ # value: "1"
31
+ # - name: GOOGLE_OAUTH_APP_NAME
32
+ # value: "my_hyrax_app"
33
+ extraEnvVars: []
34
+
35
+ ## Extra init containers
36
+ ## Example
37
+ ##
38
+ ## extraInitContainers:
39
+ ## - name: do-something
40
+ ## image: busybox
41
+ ## command: ['echo', 'Hello, Hyrax.']
42
+ ##
43
+ extraInitContainers: []
44
+
45
+ # Extra envFrom (secrets/configmaps)
46
+ # Example
47
+ #
48
+ # extraEnvFrom:
49
+ # - configMapRef:
50
+ # name: existingConfigMap
51
+ # - secretRef:
52
+ # name: existingSecret
53
+ #
54
+ extraEnvFrom: []
55
+
56
+ # an existing volume containing a Hyrax-based application
57
+ # must be a ReadWriteMany volume if worker is enabled
58
+ applicationExistingClaim: ""
59
+
22
60
  brandingVolume:
23
61
  enabled: true
62
+ # the name of an existing volume claim; must be an ReadWriteMany volume
24
63
  existingClaim: ""
25
64
  size: 2Gi
26
65
  storageClass: ""
27
66
 
28
67
  derivativesVolume:
29
68
  enabled: true
69
+ # the name of an existing volume claim; must be an ReadWriteMany volume
30
70
  existingClaim: ""
31
71
  size: 10Gi
32
72
  storageClass: ""
33
73
 
34
74
  uploadsVolume:
35
75
  enabled: true
76
+ # the name of an existing volume claim; must be an ReadWriteMany volume
36
77
  existingClaim: ""
37
78
  size: 20Gi
38
79
  storageClass: ""
39
80
 
81
+ # additional volumes and volume mounts, evaluated as a template, e.g.
82
+ #
83
+ # extraVolumeMounts
84
+ # - name: local-app
85
+ # mountPath: /app/samvera/hyrax-webapp
86
+ # extraVolumes:
87
+ # - name: local-app
88
+ # hostPath:
89
+ # path: /src
90
+ # type: DirectoryOrCreate
91
+ extraVolumeMounts: []
92
+ extraVolumes: []
93
+
40
94
  # configuration for an external/existing fcrepo service;
41
95
  # ignored if `fcrepo.enabled` is true
42
96
  externalFcrepoHost: ""
@@ -93,7 +147,9 @@ ingress:
93
147
  # kubernetes.io/tls-acme: "true"
94
148
  hosts:
95
149
  - host: hyrax.local
96
- paths: []
150
+ paths:
151
+ - path: /
152
+ pathType: ImplementationSpecific
97
153
  tls: []
98
154
 
99
155
  livenessProbe:
@@ -117,11 +173,15 @@ readinessProbe:
117
173
  resources: {}
118
174
 
119
175
  worker:
176
+ enabled: true
120
177
  replicaCount: 3
121
178
  image:
122
179
  repository: samveralabs/dassie-worker
123
180
  pullPolicy: IfNotPresent
124
181
  tag: ""
182
+ extraInitContainers: []
183
+ extraVolumeMounts: []
184
+ extraVolumes: []
125
185
  imagePullSecrets: []
126
186
  podSecurityContext: {}
127
187
  nodeSelector: {}
@@ -142,6 +202,16 @@ fcrepo:
142
202
  memcached:
143
203
  enabled: false
144
204
 
205
+ minio:
206
+ enabled: false
207
+ accessKey:
208
+ password: hyrax-access-key
209
+ secretKey:
210
+ password: hyrax-secret-key
211
+ persistence:
212
+ enabled: false
213
+ # defaultBuckets: bucketOne;bucketTwo
214
+
145
215
  postgresql:
146
216
  enabled: true
147
217
  image:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ Valkyrie::StorageAdapter.register(
4
+ Valkyrie::Storage::Disk.new(base_path: Hyrax.config.branding_path,
5
+ path_generator: Hyrax::ValkyrieSimplePathGenerator),
6
+ :branding_disk
7
+ )
data/docker-compose.yml CHANGED
@@ -7,7 +7,7 @@ services:
7
7
  target: hyrax-engine-dev
8
8
  args:
9
9
  - EXTRA_APK_PACKAGES=git less
10
- image: hyrax-engine-dev
10
+ image: ghcr.io/samvera/dassie
11
11
  stdin_open: true
12
12
  tty: true
13
13
  user: root
@@ -33,6 +33,8 @@ services:
33
33
  - hyrax-uploads:/app/samvera/hyrax-webapp/uploads
34
34
  - rails-public:/app/samvera/hyrax-webapp/public
35
35
  - rails-tmp:/app/samvera/hyrax-webapp/tmp
36
+ networks:
37
+ - hyrax
36
38
 
37
39
  chrome:
38
40
  image: selenium/standalone-chrome:3.141
@@ -44,9 +46,11 @@ services:
44
46
  ports:
45
47
  - "4444:4444"
46
48
  - "5959:5900"
49
+ networks:
50
+ - hyrax
47
51
 
48
52
  db_migrate:
49
- image: hyrax-engine-dev
53
+ image: ghcr.io/samvera/dassie
50
54
  user: root
51
55
  env_file:
52
56
  - .env
@@ -59,6 +63,8 @@ services:
59
63
  - .:/app/samvera/hyrax-engine:cached
60
64
  - rails-public:/app/samvera/hyrax-webapp/public
61
65
  - rails-tmp:/app/samvera/hyrax-webapp/tmp
66
+ networks:
67
+ - hyrax
62
68
 
63
69
  postgres:
64
70
  image: postgres:latest
@@ -72,33 +78,47 @@ services:
72
78
  - "5432:5432"
73
79
  volumes:
74
80
  - db:/var/lib/postgresql/data
81
+ networks:
82
+ - hyrax
75
83
 
76
84
  fcrepo:
77
- image: cbeer/fcrepo4:4.7
85
+ image: ghcr.io/samvera/fcrepo4:4.7.5
78
86
  volumes:
79
- - fcrepo:/data
87
+ - fcrepo:/data:cached
80
88
  ports:
81
89
  - 8080:8080
82
- environment:
83
- - JAVA_OPTS=${JAVA_OPTS} -Dfcrepo.modeshape.configuration="classpath:/config/file-simple/repository.json" -Dfcrepo.object.directory="/data/objects" -Dfcrepo.binary.directory="/data/binaries"
90
+ networks:
91
+ - hyrax
84
92
 
85
93
  memcached:
86
94
  image: bitnami/memcached
87
95
  ports:
88
96
  - '11211:11211'
97
+ networks:
98
+ - hyrax
89
99
 
90
100
  redis:
91
101
  image: redis:5-alpine
92
102
  volumes:
93
103
  - redis:/data
104
+ networks:
105
+ - hyrax
94
106
 
95
107
  sidekiq:
96
108
  build:
97
109
  context: .
98
110
  target: hyrax-engine-dev-worker
111
+ image: ghcr.io/samvera/dassie-worker
99
112
  env_file:
100
113
  - .env
101
114
  - .dassie/.env
115
+ depends_on:
116
+ - db_migrate
117
+ - fcrepo
118
+ - memcached
119
+ - postgres
120
+ - redis
121
+ - solr
102
122
  volumes:
103
123
  - .dassie:/app/samvera/hyrax-webapp:cached
104
124
  - .:/app/samvera/hyrax-engine:cached
@@ -106,6 +126,8 @@ services:
106
126
  - hyrax-uploads:/app/samvera/hyrax-webapp/uploads
107
127
  - sidekiq-public:/app/samvera/hyrax-webapp/public
108
128
  - sidekiq-tmp:/app/samvera/hyrax-webapp/tmp
129
+ networks:
130
+ - hyrax
109
131
 
110
132
  solr:
111
133
  image: solr:8.7
@@ -114,10 +136,12 @@ services:
114
136
  command:
115
137
  - sh
116
138
  - "-c"
117
- - "precreate-core hyrax_test /opt/solr/server/configsets/hyraxconf; precreate-core hyrax-valkyrie-test /opt/solr/server/configsets/hyraxconf; solr-precreate hyrax /opt/solr/server/configsets/hyraxconf"
139
+ - "precreate-core hyrax_test /opt/solr/server/configsets/hyraxconf; precreate-core hyrax-valkyrie-test /opt/solr/server/configsets/hyraxconf; precreate-core hyrax-valkyrie-dev /opt/solr/server/configsets/hyraxconf; solr-precreate hyrax /opt/solr/server/configsets/hyraxconf"
118
140
  volumes:
119
- - solr_home:/opt/solr/server/solr
141
+ - solr_home:/var/solr/data:cached
120
142
  - .dassie/solr/conf:/opt/solr/server/configsets/hyraxconf
143
+ networks:
144
+ - hyrax
121
145
 
122
146
  volumes:
123
147
  db:
@@ -130,3 +154,9 @@ volumes:
130
154
  sidekiq-public:
131
155
  sidekiq-tmp:
132
156
  solr_home:
157
+
158
+ networks:
159
+ hyrax:
160
+ driver: bridge
161
+ driver_opts:
162
+ com.docker.network.bridge.name: br-hyrax
@@ -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.5 release.
108
+ Hyrax requires Rails 5. We recommend the latest Rails 5.2 release.
109
109
 
110
110
  ```
111
111
  # If you don't already have Rails at your disposal...
112
- gem install rails -v 5.2.5
112
+ gem install rails -v 5.2.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 _5.2.5_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.0.1/template.rb
128
+ rails _5.2.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.0.2/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:
@@ -50,7 +50,7 @@ The Samvera community is here to help. Please see our [support guide](./.github/
50
50
  # Getting started
51
51
 
52
52
  This document contains instructions specific to setting up an app with __Hyrax
53
- v3.0.1__. If you are looking for instructions on installing a different
53
+ v3.0.2__. If you are looking for instructions on installing a different
54
54
  version, be sure to select the appropriate branch or tag from the drop-down
55
55
  menu above.
56
56
 
@@ -139,11 +139,11 @@ Starting up Redis will depend on your operating system, and may in fact already
139
139
 
140
140
  ## Rails
141
141
 
142
- Hyrax requires Rails 5. We recommend the latest Rails 5.2.5 release.
142
+ Hyrax requires Rails 5. We recommend the latest Rails 5.2 release.
143
143
 
144
144
  ```
145
145
  # If you don't already have Rails at your disposal...
146
- gem install rails -v 5.2.5
146
+ gem install rails -v 5.2.6
147
147
  ```
148
148
 
149
149
  ### JavaScript runtime
@@ -159,7 +159,7 @@ NOTE: The steps need to be done in order to create a new Hyrax based app.
159
159
  Generate a new Rails application using the template.
160
160
 
161
161
  ```
162
- rails _5.2.5_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.0.1/template.rb
162
+ rails _5.2.6_ new my_app -m https://raw.githubusercontent.com/samvera/hyrax/v3.0.2/template.rb
163
163
  ```
164
164
 
165
165
  Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
@@ -385,6 +385,18 @@ module Hyrax
385
385
  # @!endgroup
386
386
  # @!group Valkyrie
387
387
 
388
+ ##
389
+ # @return [Valkyrie::StorageAdapter]
390
+ def branding_storage_adapter
391
+ @branding_storage_adapter ||= Valkyrie::StorageAdapter.find(:branding_disk)
392
+ end
393
+
394
+ ##
395
+ # @param [#to_sym] adapter
396
+ def branding_storage_adapter=(adapter)
397
+ @branding_storage_adapter = Valkyrie::StorageAdapter.find(adapter.to_sym)
398
+ end
399
+
388
400
  ##
389
401
  # @return [#save, #save_all, #delete, #wipe!] an indexing adapter
390
402
  def index_adapter
data/lib/hyrax/engine.rb CHANGED
@@ -31,6 +31,7 @@ module Hyrax
31
31
  require 'hyrax/search_state'
32
32
  require 'hyrax/transactions'
33
33
  require 'hyrax/errors'
34
+ require 'hyrax/valkyrie_simple_path_generator'
34
35
 
35
36
  # Force these models to be added to Legato's registry in development mode
36
37
  config.eager_load_paths += %W[
@@ -7,6 +7,7 @@ module Hyrax
7
7
  class ResourceName < Name
8
8
  def initialize(klass, namespace = nil, name = nil)
9
9
  super
10
+ return unless defined?(Wings::ModelRegistry)
10
11
 
11
12
  legacy_model = Wings::ModelRegistry.lookup(klass)
12
13
  return unless legacy_model
@@ -15,9 +15,9 @@ require 'capybara/rspec'
15
15
  require 'capybara/rails'
16
16
  require 'capybara-screenshot/rspec'
17
17
  require 'selenium-webdriver'
18
- require 'webdrivers'
18
+ require 'webdrivers' unless ENV['IN_DOCKER'].present? || ENV['HUB_URL'].present?
19
19
 
20
- if ENV['IN_DOCKER'].present?
20
+ if ENV['IN_DOCKER'].present? || ENV['HUB_URL'].present?
21
21
  args = %w[disable-gpu no-sandbox whitelisted-ips window-size=1400,1400]
22
22
  args.push('headless') if ActiveModel::Type::Boolean.new.cast(ENV['CHROME_HEADLESS_MODE'])
23
23
 
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+ module Hyrax
3
+ ##
4
+ # Provide "simple", paths for the valkyrie disk storage adapter.
5
+ #
6
+ # By default, Valkyrie does bucketed/pairtree style paths. Since some of our
7
+ # older on-disk file storage does not do this, we need this to provide
8
+ # backward compatibility.
9
+ class ValkyrieSimplePathGenerator
10
+ attr_reader :base_path
11
+
12
+ def initialize(base_path:)
13
+ @base_path = base_path
14
+ end
15
+
16
+ def generate(resource:, file:, original_filename:) # rubocop:disable Lint/UnusedMethodArgument
17
+ Pathname.new(base_path).join(resource.id, original_filename)
18
+ end
19
+ end
20
+ end