hyrax 5.0.4 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dassie/.env +4 -0
- data/.dassie/Gemfile +15 -11
- data/.dassie/app/controllers/application_controller.rb +4 -0
- data/.dassie/app/helpers/hyrax_helper.rb +4 -0
- data/.dassie/app/models/ability.rb +4 -0
- data/.dassie/app/models/user.rb +11 -0
- data/.dassie/app/views/shared/_footer.html.erb +17 -0
- data/.dassie/bin/rails +0 -5
- data/.dassie/bin/rake +0 -5
- data/.dassie/config/application.rb +2 -1
- data/.dassie/config/database.yml +18 -0
- data/.dassie/config/environments/development.rb +1 -1
- data/.dassie/config/environments/production.rb +5 -3
- data/.dassie/config/environments/test.rb +1 -1
- data/.dassie/config/fedora.yml +6 -6
- data/.dassie/config/initializers/profiler.rb +5 -0
- data/.dassie/config/initializers/riiif.rb +20 -18
- data/.dassie/config/locales/hyrax.en.yml +1 -1
- data/.dassie/config/puma.rb +55 -5
- data/.dassie/config/routes.rb +2 -0
- data/.dassie/db/migrate/20250328100249_user_roles.rb +20 -0
- data/.dassie/db/schema.rb +122 -110
- data/.github/workflows/lint-build-test.yml +35 -6
- data/.github/workflows/main.yml +4 -4
- data/.koppie/.env +1 -1
- data/.koppie/Gemfile +13 -10
- data/.koppie/app/controllers/application_controller.rb +4 -0
- data/.koppie/app/helpers/hyrax_helper.rb +4 -0
- data/.koppie/app/models/ability.rb +4 -0
- data/.koppie/app/models/user.rb +10 -0
- data/.koppie/app/views/shared/_footer.html.erb +17 -0
- data/.koppie/bin/rails +0 -5
- data/.koppie/bin/rake +0 -5
- data/.koppie/config/application.rb +2 -1
- data/.koppie/config/database.yml +2 -9
- data/.koppie/config/environments/development.rb +10 -1
- data/.koppie/config/environments/production.rb +5 -3
- data/.koppie/config/environments/test.rb +1 -1
- data/.koppie/config/initializers/1_valkyrie.rb +5 -5
- data/.koppie/config/initializers/hyrax.rb +20 -17
- data/.koppie/config/initializers/profiler.rb +5 -0
- data/.koppie/config/initializers/riiif.rb +21 -18
- data/.koppie/config/locales/hyrax.en.yml +2 -2
- data/.koppie/config/puma.rb +26 -7
- data/.koppie/config/routes.rb +2 -0
- data/.koppie/db/schema.rb +109 -110
- data/Dockerfile +110 -51
- data/app/actors/hyrax/actors/add_to_work_actor.rb +1 -1
- data/app/actors/hyrax/actors/apply_order_actor.rb +1 -1
- data/app/assets/stylesheets/hyrax/_tinymce.scss +6 -0
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +1 -0
- data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +4 -4
- data/app/controllers/hyrax/api/zotero_controller.rb +1 -1
- data/app/controllers/hyrax/file_sets_controller.rb +11 -0
- data/app/jobs/batch_create_job.rb +2 -2
- data/app/models/admin_set.rb +2 -2
- data/app/models/concerns/hyrax/permissions/writable.rb +1 -2
- data/app/models/concerns/hyrax/valkyrie_lazy_migration.rb +1 -0
- data/app/models/hyrax/collection_type.rb +4 -4
- data/app/models/single_use_link.rb +1 -1
- data/app/services/hyrax/listeners.rb +1 -0
- data/app/services/hyrax/statistics/term_query.rb +1 -1
- data/app/services/hyrax/user_stat_importer.rb +1 -1
- data/app/services/hyrax/workflow.rb +8 -0
- data/app/validators/hyrax/has_one_title_validator.rb +1 -1
- data/app/views/hyrax/base/iiif_viewers/_universal_viewer.html.erb +1 -1
- data/bin/db-migrate-seed.sh +1 -1
- data/bin/dev-entrypoint.sh +3 -0
- data/config/initializers/1_healthz.rb +2 -1
- data/config/initializers/ar_test_fixture_monkey_patch.rb +8 -0
- data/config/initializers/arel_rails_7_2_monkey_patch.rb +6 -0
- data/config/initializers/listeners.rb +4 -2
- data/config/initializers/new_framework_defaults_7_2.rb +8 -0
- data/docker-compose-dassie.yml +2 -2
- data/docker-compose-koppie.yml +2 -2
- data/docker-compose-sirenia.yml +3 -3
- data/documentation/developing-your-hyrax-based-app.md +6 -6
- data/hyrax.gemspec +9 -9
- data/lib/generators/hyrax/config_generator.rb +0 -5
- data/lib/generators/hyrax/install_generator.rb +1 -6
- data/lib/generators/hyrax/templates/.env +1 -1
- data/lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb +21 -19
- data/lib/generators/hyrax/templates/config/initializers/riiif.rb +21 -19
- data/lib/generators/hyrax/templates/db/migrate/20170131142607_add_permission_template_to_sipity_workflow.rb.erb +1 -1
- data/lib/generators/hyrax/templates/db/migrate/20170810190549_update_collection_type_column_options.rb.erb +1 -1
- data/lib/generators/hyrax/templates/db/migrate/20230821153635_add_fields_to_counter_metric.rb.erb +1 -1
- data/lib/hyrax/configuration.rb +1 -0
- data/lib/hyrax/controlled_vocabulary/importer/language.rb +1 -1
- data/lib/hyrax/engine.rb +15 -10
- data/lib/hyrax/version.rb +1 -1
- data/lib/hyrax.rb +4 -0
- data/lib/tasks/workflow.rake +1 -2
- data/template.rb +6 -1
- metadata +49 -44
- data/.dassie/bin/spring +0 -17
- data/.dassie/config/initializers/mini_magick.rb +0 -6
- data/.dassie/config/spring.rb +0 -6
- data/.koppie/bin/spring +0 -17
- data/.koppie/config/initializers/mini_magick.rb +0 -6
- data/.koppie/config/spring.rb +0 -6
- data/config/initializers/reform_rails_6_1_monkey_patch.rb +0 -27
- data/lib/generators/hyrax/templates/config/initializers/mini_magick.rb +0 -6
data/Dockerfile
CHANGED
@@ -1,49 +1,98 @@
|
|
1
|
-
ARG
|
2
|
-
ARG RUBY_VERSION=3.
|
3
|
-
|
4
|
-
FROM ruby:$RUBY_VERSION
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
1
|
+
ARG DEBIAN_VERSION=bookworm
|
2
|
+
ARG RUBY_VERSION=3.3
|
3
|
+
|
4
|
+
FROM ruby:$RUBY_VERSION-$DEBIAN_VERSION AS hyrax-base
|
5
|
+
|
6
|
+
RUN apt-get update && \
|
7
|
+
curl -sL "https://deb.nodesource.com/setup_20.x" | bash - && \
|
8
|
+
apt-get install -y --no-install-recommends \
|
9
|
+
acl \
|
10
|
+
build-essential \
|
11
|
+
curl \
|
12
|
+
exiftool \
|
13
|
+
ffmpeg \
|
14
|
+
ghostscript \
|
15
|
+
git \
|
16
|
+
less \
|
17
|
+
libgsf-1-dev \
|
18
|
+
libimagequant-dev \
|
19
|
+
libjemalloc2 \
|
20
|
+
libjpeg62-turbo-dev \
|
21
|
+
libopenjp2-7-dev \
|
22
|
+
libopenjp2-tools \
|
23
|
+
libpng-dev \
|
24
|
+
libpoppler-cpp-dev \
|
25
|
+
libpoppler-dev \
|
26
|
+
libpoppler-glib-dev \
|
27
|
+
libpoppler-private-dev \
|
28
|
+
libpoppler-qt5-dev \
|
29
|
+
libreoffice \
|
30
|
+
libreoffice-l10n-uk \
|
31
|
+
librsvg2-dev \
|
32
|
+
libtiff-dev \
|
33
|
+
libvips-dev \
|
34
|
+
libvips-tools \
|
35
|
+
libwebp-dev \
|
36
|
+
libxml2-dev \
|
37
|
+
lsof \
|
38
|
+
mediainfo \
|
39
|
+
netcat-openbsd \
|
40
|
+
nodejs \
|
41
|
+
perl \
|
42
|
+
poppler-utils \
|
43
|
+
postgresql-client \
|
44
|
+
rsync \
|
45
|
+
ruby-grpc \
|
46
|
+
screen \
|
47
|
+
tesseract-ocr \
|
48
|
+
tzdata \
|
49
|
+
vim \
|
50
|
+
zip \
|
51
|
+
&& \
|
52
|
+
npm install --global yarn && \
|
53
|
+
apt-get clean && \
|
54
|
+
rm -rf /var/lib/apt/lists/* && \
|
55
|
+
ln -s /usr/lib/*-linux-gnu/libjemalloc.so.2 /usr/lib/libjemalloc.so.2 && \
|
56
|
+
echo "******** Packages Installed *********"
|
57
|
+
|
58
|
+
RUN bash -x -c "\
|
59
|
+
if [ $(dpkg --print-architecture) = 'amd64' ]; then \
|
60
|
+
wget https://github.com/ImageMagick/ImageMagick/releases/download/7.1.1-47/ImageMagick-82572af-gcc-x86_64.AppImage -O magick \
|
61
|
+
&& chmod a+x magick \
|
62
|
+
&& ./magick --appimage-extract \
|
63
|
+
&& mv squashfs-root/usr/etc/ImageMagick* /etc \
|
64
|
+
&& rm -rf squashfs-root/usr/share/doc \
|
65
|
+
&& cp -rv squashfs-root/usr/* /usr/local \
|
66
|
+
&& rm -rf magick squashfs-root ; \
|
67
|
+
else \
|
68
|
+
wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.1-47.tar.gz \
|
69
|
+
&& tar xf 7.1.1-47.tar.gz \
|
70
|
+
&& cd ImageMagick* \
|
71
|
+
&& ./configure \
|
72
|
+
&& make install \
|
73
|
+
&& ldconfig /usr/local/lib \
|
74
|
+
&& cd $OLDPWD \
|
75
|
+
&& rm -rf 7.1.1-47.tar.gz ImageMagick* ; \
|
76
|
+
fi \
|
77
|
+
&& identify -version"
|
31
78
|
|
32
79
|
RUN setfacl -d -m o::rwx /usr/local/bundle && \
|
33
|
-
|
80
|
+
gem update --silent --system
|
34
81
|
|
35
|
-
RUN
|
36
|
-
|
37
|
-
|
82
|
+
RUN useradd -m -u 1001 -U -s /bin/bash --home-dir /app app && \
|
83
|
+
mkdir -p /app/samvera/hyrax-webapp && \
|
84
|
+
chown -R app:app /app && \
|
85
|
+
echo "export PATH=/app/samvera/hyrax-webapp/bin:${PATH}" >> /etc/bash.bashrc
|
38
86
|
|
39
|
-
|
87
|
+
USER app
|
40
88
|
WORKDIR /app/samvera/hyrax-webapp
|
41
89
|
|
42
|
-
COPY --chown=1001
|
90
|
+
COPY --chown=1001 ./bin/*.sh /app/samvera/
|
43
91
|
ENV PATH="/app/samvera:$PATH" \
|
44
92
|
RAILS_ROOT="/app/samvera/hyrax-webapp" \
|
45
93
|
RAILS_SERVE_STATIC_FILES="1" \
|
46
|
-
LD_PRELOAD="/usr/
|
94
|
+
LD_PRELOAD="/usr/lib/libjemalloc.so.2" \
|
95
|
+
MALLOC_CONF="dirty_decay_ms:1000,narenas:2,background_thread:true"
|
47
96
|
|
48
97
|
ENTRYPOINT ["hyrax-entrypoint.sh"]
|
49
98
|
CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
|
@@ -54,22 +103,23 @@ FROM hyrax-base AS hyrax
|
|
54
103
|
ARG APP_PATH=.
|
55
104
|
ARG BUNDLE_WITHOUT="development test"
|
56
105
|
|
57
|
-
ONBUILD COPY --chown=1001
|
106
|
+
ONBUILD COPY --chown=1001 $APP_PATH /app/samvera/hyrax-webapp
|
58
107
|
ONBUILD RUN bundle install --jobs "$(nproc)"
|
59
|
-
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret`
|
108
|
+
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DATABASE_URL='nulldb://nulldb' bundle exec rake assets:precompile
|
109
|
+
ARG BUILD_GITSHA
|
110
|
+
ARG BUILD_TIMESTAMP
|
111
|
+
ENV BUILD_GITSHA=$BUILD_GITSHA \
|
112
|
+
BUILD_TIMESTAMP=$BUILD_TIMESTAMP
|
60
113
|
|
61
114
|
|
62
115
|
FROM hyrax-base AS hyrax-worker-base
|
63
|
-
|
64
116
|
USER root
|
65
|
-
RUN apk --no-cache add bash \
|
66
|
-
ffmpeg \
|
67
|
-
mediainfo \
|
68
|
-
openjdk17-jre \
|
69
|
-
perl
|
70
|
-
USER app
|
71
117
|
|
72
|
-
RUN
|
118
|
+
RUN apt update && \
|
119
|
+
apt install -y --no-install-recommends default-jre-headless && \
|
120
|
+
apt-get clean && \
|
121
|
+
rm -rf /var/lib/apt/lists/* && \
|
122
|
+
mkdir -p /app/fits && \
|
73
123
|
cd /app/fits && \
|
74
124
|
wget https://github.com/harvard-lts/fits/releases/download/1.6.0/fits-1.6.0.zip -O fits.zip && \
|
75
125
|
unzip fits.zip && \
|
@@ -88,7 +138,11 @@ ARG BUNDLE_WITHOUT="development test"
|
|
88
138
|
|
89
139
|
ONBUILD COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
|
90
140
|
ONBUILD RUN bundle install --jobs "$(nproc)"
|
91
|
-
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret`
|
141
|
+
ONBUILD RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DATABASE_URL='nulldb://nulldb' bundle exec rake assets:precompile
|
142
|
+
ARG BUILD_GITSHA
|
143
|
+
ARG BUILD_TIMESTAMP
|
144
|
+
ENV BUILD_GITSHA=$BUILD_GITSHA \
|
145
|
+
BUILD_TIMESTAMP=$BUILD_TIMESTAMP
|
92
146
|
|
93
147
|
|
94
148
|
FROM hyrax-worker-base AS hyrax-engine-dev
|
@@ -97,8 +151,9 @@ USER app
|
|
97
151
|
ARG BUNDLE_WITHOUT=
|
98
152
|
ENV HYRAX_ENGINE_PATH=/app/samvera/hyrax-engine
|
99
153
|
|
100
|
-
COPY --chown=1001
|
101
|
-
COPY --chown=1001
|
154
|
+
COPY --chown=1001 .dassie /app/samvera/hyrax-webapp
|
155
|
+
COPY --chown=1001 .koppie /app/samvera/hyrax-koppie
|
156
|
+
COPY --chown=1001 . /app/samvera/hyrax-engine
|
102
157
|
|
103
158
|
RUN bundle -v && \
|
104
159
|
BUNDLE_GEMFILE=Gemfile.dassie bundle install --jobs "$(nproc)" && yarn && \
|
@@ -106,4 +161,8 @@ RUN bundle -v && \
|
|
106
161
|
yarn cache clean
|
107
162
|
|
108
163
|
ENTRYPOINT ["dev-entrypoint.sh"]
|
109
|
-
CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
|
164
|
+
CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
|
165
|
+
ARG BUILD_GITSHA
|
166
|
+
ARG BUILD_TIMESTAMP
|
167
|
+
ENV BUILD_GITSHA=$BUILD_GITSHA \
|
168
|
+
BUILD_TIMESTAMP=$BUILD_TIMESTAMP
|
@@ -69,7 +69,7 @@ module Hyrax
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def add_permissions_error(work)
|
72
|
-
work.errors
|
72
|
+
work.errors.add(:in_works_ids, "Works can only be related to each other if user has ability to edit both.")
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -41,7 +41,7 @@ module Hyrax
|
|
41
41
|
env.curation_concern.ordered_members << work
|
42
42
|
env.curation_concern.save!
|
43
43
|
else
|
44
|
-
env.curation_concern.errors
|
44
|
+
env.curation_concern.errors.add(:ordered_member_ids, "Works can only be related to each other if user has ability to edit both.")
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -12,3 +12,9 @@
|
|
12
12
|
.home_marketing_text #content_block_external_key {
|
13
13
|
color: black;
|
14
14
|
}
|
15
|
+
|
16
|
+
// Prevents text from being clipped in Tiny MCE bottom status bar and drop-down style menu (Issue #6789)
|
17
|
+
.tox .tox-statusbar { overflow: visible !important; }
|
18
|
+
.tox .tox-tbtn--bespoke .tox-tbtn__select-label { overflow: visible !important; }
|
19
|
+
.tox .tox-tbtn { overflow: visible !important; }
|
20
|
+
.tox-tinymce { overflow: visible !important; }
|
@@ -360,6 +360,7 @@ module Hyrax
|
|
360
360
|
# that they have not removed from the upload widget.
|
361
361
|
uploaded_files = params.fetch(:uploaded_files, [])
|
362
362
|
selected_files = params.fetch(:selected_files, {}).values
|
363
|
+
.map { |f| f.permit(:expires, :file_name, :url, {}) }
|
363
364
|
browse_everything_urls = uploaded_files &
|
364
365
|
selected_files.map { |f| f[:url] }
|
365
366
|
|
@@ -21,14 +21,14 @@ module Hyrax
|
|
21
21
|
|
22
22
|
def after_destroy_error
|
23
23
|
if source.admin_set?
|
24
|
-
@permission_template_access.errors
|
25
|
-
t('hyrax.admin.admin_sets.form.permission_destroy_errors.participants')
|
24
|
+
@permission_template_access.errors.add(:base,
|
25
|
+
t('hyrax.admin.admin_sets.form.permission_destroy_errors.participants'))
|
26
26
|
redirect_to hyrax.edit_admin_admin_set_path(source_id,
|
27
27
|
anchor: 'participants'),
|
28
28
|
alert: @permission_template_access.errors.full_messages.to_sentence
|
29
29
|
else
|
30
|
-
@permission_template_access.errors
|
31
|
-
t('hyrax.dashboard.collections.form.permission_update_errors.sharing')
|
30
|
+
@permission_template_access.errors.add(:base,
|
31
|
+
t('hyrax.dashboard.collections.form.permission_update_errors.sharing'))
|
32
32
|
redirect_to hyrax.edit_dashboard_collection_path(source_id,
|
33
33
|
anchor: 'sharing'),
|
34
34
|
alert: @permission_template_access.errors.full_messages.to_sentence
|
@@ -14,7 +14,7 @@ module Hyrax
|
|
14
14
|
session[:request_token] = request_token
|
15
15
|
current_user.zotero_token = request_token
|
16
16
|
current_user.save
|
17
|
-
redirect_to request_token.authorize_url(identity: '1', oauth_callback: callback_url)
|
17
|
+
redirect_to request_token.authorize_url(identity: '1', oauth_callback: callback_url), allow_other_host: true
|
18
18
|
rescue OAuth::Unauthorized
|
19
19
|
redirect_to root_url, alert: 'Invalid Zotero client key pair'
|
20
20
|
end
|
@@ -9,6 +9,10 @@ module Hyrax
|
|
9
9
|
|
10
10
|
before_action :authenticate_user!, except: [:show, :citation, :stats]
|
11
11
|
load_and_authorize_resource class: Hyrax.config.file_set_class
|
12
|
+
# If Hyrax.config.file_set_class is set to ::FileSet, the load above will force-cast
|
13
|
+
# the instance as a ::FileSet, even if it is a Hyrax::FileSet. Re-cast it back to
|
14
|
+
# prevent method errors and nil objects later
|
15
|
+
before_action :cast_file_set
|
12
16
|
before_action :build_breadcrumbs, only: [:show, :edit, :stats]
|
13
17
|
before_action do
|
14
18
|
blacklight_config.track_search_session = false
|
@@ -159,6 +163,13 @@ module Hyrax
|
|
159
163
|
attrs
|
160
164
|
end
|
161
165
|
|
166
|
+
def cast_file_set
|
167
|
+
return unless @file_set.class == ::FileSet
|
168
|
+
# We can tell if a Hyrax::FileSet was improperly cast because this AF method will
|
169
|
+
# return nil since its parent is not a ActiveFedora work.
|
170
|
+
@file_set = @file_set.valkyrie_resource if @file_set.parent&.id.nil?
|
171
|
+
end
|
172
|
+
|
162
173
|
def parent(file_set: curation_concern)
|
163
174
|
@parent ||=
|
164
175
|
case file_set
|
@@ -32,8 +32,8 @@ class BatchCreateJob < Hyrax::ApplicationJob
|
|
32
32
|
title = [titles[upload_id]] if titles[upload_id]
|
33
33
|
resource_type = Array.wrap(resource_types[upload_id]) if resource_types[upload_id]
|
34
34
|
job_attributes = job_attributes.merge(uploaded_files: [upload_id],
|
35
|
-
|
36
|
-
|
35
|
+
title: title,
|
36
|
+
resource_type: resource_type)
|
37
37
|
child_operation = Hyrax::Operation.create!(user: user,
|
38
38
|
operation_type: "Create Work",
|
39
39
|
parent: operation)
|
data/app/models/admin_set.rb
CHANGED
@@ -105,13 +105,13 @@ class AdminSet < ActiveFedora::Base
|
|
105
105
|
|
106
106
|
def check_if_empty
|
107
107
|
return true if members.empty?
|
108
|
-
errors
|
108
|
+
errors.add(:base, I18n.t('hyrax.admin.admin_sets.delete.error_not_empty'))
|
109
109
|
throw :abort
|
110
110
|
end
|
111
111
|
|
112
112
|
def check_if_not_default_set
|
113
113
|
return true unless Hyrax::AdminSetCreateService.default_admin_set?(id: id)
|
114
|
-
errors
|
114
|
+
errors.add(:base, I18n.t('hyrax.admin.admin_sets.delete.error_default_set'))
|
115
115
|
throw :abort
|
116
116
|
end
|
117
117
|
end
|
@@ -23,8 +23,7 @@ module Hyrax
|
|
23
23
|
valid = true
|
24
24
|
paranoid_edit_permissions.each do |validation|
|
25
25
|
next unless validation[:condition].call(self)
|
26
|
-
errors
|
27
|
-
errors[validation[:key]] << validation[:message]
|
26
|
+
errors.add(validation[:key], validation[:message])
|
28
27
|
valid = false
|
29
28
|
end
|
30
29
|
valid
|
@@ -163,26 +163,26 @@ module Hyrax
|
|
163
163
|
|
164
164
|
def ensure_no_collections
|
165
165
|
return true unless collections?
|
166
|
-
errors
|
166
|
+
errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.not_empty'))
|
167
167
|
throw :abort
|
168
168
|
end
|
169
169
|
|
170
170
|
def ensure_no_settings_changes_for_admin_set_type
|
171
171
|
return true unless admin_set? && collection_type_settings_changed? && exists_for_machine_id?(ADMIN_SET_MACHINE_ID)
|
172
|
-
errors
|
172
|
+
errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_admin_sets'))
|
173
173
|
throw :abort
|
174
174
|
end
|
175
175
|
|
176
176
|
def ensure_no_settings_changes_for_user_collection_type
|
177
177
|
return true unless user_collection? && collection_type_settings_changed? && exists_for_machine_id?(USER_COLLECTION_MACHINE_ID)
|
178
|
-
errors
|
178
|
+
errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_for_user_collections'))
|
179
179
|
throw :abort
|
180
180
|
end
|
181
181
|
|
182
182
|
def ensure_no_settings_changes_if_collections_exist
|
183
183
|
return true unless collections?
|
184
184
|
return true unless collection_type_settings_changed?
|
185
|
-
errors
|
185
|
+
errors.add(:base, I18n.t('hyrax.admin.collection_types.errors.no_settings_change_if_not_empty'))
|
186
186
|
throw :abort
|
187
187
|
end
|
188
188
|
|
@@ -20,6 +20,7 @@ module Hyrax
|
|
20
20
|
autoload :ACLIndexListener
|
21
21
|
autoload :ActiveFedoraACLIndexListener
|
22
22
|
autoload :BatchNotificationListener
|
23
|
+
autoload :FileListener
|
23
24
|
autoload :FileMetadataListener
|
24
25
|
autoload :FileSetLifecycleListener
|
25
26
|
autoload :FileSetLifecycleNotificationListener
|
@@ -49,7 +49,7 @@ module Hyrax
|
|
49
49
|
|
50
50
|
def process_files(stats, user, start_date)
|
51
51
|
file_ids_for_user(user).each do |file_id|
|
52
|
-
file =
|
52
|
+
file = Hyrax.query_service.find_by(id: file_id)
|
53
53
|
view_stats = extract_stats_for(object: file, from: FileViewStat, start_date: start_date, user: user)
|
54
54
|
stats = tally_results(view_stats, :views, stats) if view_stats.present?
|
55
55
|
delay
|
@@ -4,7 +4,7 @@ module Hyrax
|
|
4
4
|
class HasOneTitleValidator < ActiveModel::Validator
|
5
5
|
def validate(record)
|
6
6
|
return unless record.title.reject(&:empty?).empty?
|
7
|
-
record.errors
|
7
|
+
record.errors.add(:title, "You must provide a title")
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="viewer-wrapper">
|
2
|
-
<iframe
|
2
|
+
<iframe title="image view"
|
3
3
|
src="<%= universal_viewer_base_url %>#?manifest=<%= main_app.polymorphic_url [main_app, :manifest, presenter], { locale: nil } %>&config=<%= universal_viewer_config_url %>"
|
4
4
|
allowfullscreen="true"
|
5
5
|
frameborder="0"
|
data/bin/db-migrate-seed.sh
CHANGED
data/bin/dev-entrypoint.sh
CHANGED
@@ -12,6 +12,9 @@ cp -Rn /usr/local/bundle/* /app/bundle/ruby/$RUBY_MAJOR.0
|
|
12
12
|
bundle install
|
13
13
|
yarn install
|
14
14
|
|
15
|
+
# Precompile assets if running in production (Nurax)
|
16
|
+
[ "$RAILS_ENV" = "production" ] && bundle exec rake assets:precompile
|
17
|
+
|
15
18
|
db-migrate-seed.sh
|
16
19
|
|
17
20
|
# Run the command
|
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraACLIndexListener.new) unless Hyrax.config.disable_wings
|
4
4
|
|
5
|
-
|
6
|
-
Hyrax.publisher.
|
5
|
+
Rails.application.reloader.to_prepare do
|
6
|
+
Hyrax.publisher.default_listeners.each do |listener|
|
7
|
+
Hyrax.publisher.subscribe(listener)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
|
9
11
|
# Publish events from old style Hyrax::Callbacks to trigger the listeners
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Any options set here are to override Rails 7.2 configuration defaults
|
4
|
+
|
5
|
+
# These fix a couple of issues arising from Rails 7.2 enforcement of HTML5 semantics
|
6
|
+
# by default when using certain Rails methods
|
7
|
+
Rails.application.config.action_view.button_to_generates_button_tag = false
|
8
|
+
Rails.application.config.action_view.sanitizer_vendor = Rails::HTML4::Sanitizer
|
data/docker-compose-dassie.yml
CHANGED
@@ -6,7 +6,7 @@ services:
|
|
6
6
|
args:
|
7
7
|
- EXTRA_APK_PACKAGES=git less
|
8
8
|
- BUNDLE_GEMFILE=Gemfile.dassie
|
9
|
-
image: samvera/hyrax-dev
|
9
|
+
image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
|
10
10
|
command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000'
|
11
11
|
stdin_open: true
|
12
12
|
tty: true
|
@@ -40,7 +40,7 @@ services:
|
|
40
40
|
- hyrax
|
41
41
|
|
42
42
|
worker:
|
43
|
-
image: samvera/hyrax-dev
|
43
|
+
image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
|
44
44
|
entrypoint: worker-entrypoint.sh
|
45
45
|
command: sh -c 'bundle exec sidekiq'
|
46
46
|
user: root
|
data/docker-compose-koppie.yml
CHANGED
@@ -8,7 +8,7 @@ services:
|
|
8
8
|
args:
|
9
9
|
- EXTRA_APK_PACKAGES=git less
|
10
10
|
- BUNDLE_GEMFILE=Gemfile.koppie
|
11
|
-
image: samvera/hyrax-dev
|
11
|
+
image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
|
12
12
|
command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000'
|
13
13
|
stdin_open: true
|
14
14
|
tty: true
|
@@ -43,7 +43,7 @@ services:
|
|
43
43
|
- koppie
|
44
44
|
|
45
45
|
worker:
|
46
|
-
image: samvera/hyrax-dev
|
46
|
+
image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
|
47
47
|
entrypoint: worker-entrypoint.sh
|
48
48
|
command: sh -c 'bundle exec sidekiq'
|
49
49
|
user: root
|
data/docker-compose-sirenia.yml
CHANGED
@@ -8,7 +8,7 @@ services:
|
|
8
8
|
args:
|
9
9
|
- EXTRA_APK_PACKAGES=git less
|
10
10
|
- BUNDLE_GEMFILE=Gemfile.koppie
|
11
|
-
image: samvera/hyrax-dev
|
11
|
+
image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
|
12
12
|
command: sh -c 'bundle exec puma -v -b tcp://0.0.0.0:3000'
|
13
13
|
stdin_open: true
|
14
14
|
tty: true
|
@@ -46,7 +46,7 @@ services:
|
|
46
46
|
- sirenia
|
47
47
|
|
48
48
|
worker:
|
49
|
-
image: samvera/hyrax-dev
|
49
|
+
image: ghcr.io/samvera/hyrax-dev:${GITHUB_SHA:-latest}
|
50
50
|
entrypoint: worker-entrypoint.sh
|
51
51
|
command: sh -c 'bundle exec sidekiq'
|
52
52
|
user: root
|
@@ -109,7 +109,7 @@ services:
|
|
109
109
|
- sirenia
|
110
110
|
|
111
111
|
fcrepo:
|
112
|
-
image: fcrepo/fcrepo:6.5.1-
|
112
|
+
image: fcrepo/fcrepo:6.5.1-tomcat9
|
113
113
|
environment:
|
114
114
|
- >-
|
115
115
|
CATALINA_OPTS=-Dfcrepo.home=/fcrepo-home -Djava.awt.headless=true -Dfile.encoding=UTF-8
|
@@ -32,7 +32,7 @@ You can also try [Running Hyrax-based application in local VM](https://github.co
|
|
32
32
|
During development, running only the dependent services in a container environment may be beneficial. This avoids potential headaches concerning file permissions and eases the use of debugging tools. The application generation instructions below use [Lando](https://lando.dev) to achieve this setup.
|
33
33
|
|
34
34
|
This document contains instructions specific to setting up an app with __Hyrax
|
35
|
-
v5.
|
35
|
+
v5.1.0__. If you are looking for instructions on installing a different
|
36
36
|
version, be sure to select the appropriate branch or tag from the drop-down
|
37
37
|
menu above.
|
38
38
|
|
@@ -46,7 +46,7 @@ Prerequisites are required for both creating a Hyrax\-based app and contributing
|
|
46
46
|
Hyrax requires the following software to work:
|
47
47
|
|
48
48
|
1. [Solr](http://lucene.apache.org/solr/) version >= 5.x (tested up to 8.11.1, which includes the log4j library update)
|
49
|
-
1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.7.6 (if
|
49
|
+
1. [Fedora Commons](http://www.fedora-commons.org/) digital repository version >= 4.7.6 && < 5 (if using legacy ActiveFedora) or >= 6.5.1 (if using the Valkyrie Fedora adapter)
|
50
50
|
1. A SQL RDBMS ([PostgreSQL](https://www.postgresql.org) recommended)
|
51
51
|
1. [Redis](http://redis.io/), a key-value store
|
52
52
|
1. [ImageMagick](http://www.imagemagick.org/) with JPEG-2000 support
|
@@ -102,7 +102,7 @@ Once ffmpeg has been installed, enable transcoding by setting `config.enable_ffm
|
|
102
102
|
|
103
103
|
First, you'll need a working Ruby installation. You can install this via your operating system's package manager -- you are likely to get farther with OSX, Linux, or UNIX than Windows but your mileage may vary -- but we recommend using a Ruby version manager such as [RVM](https://rvm.io/) or [rbenv](https://github.com/sstephenson/rbenv).
|
104
104
|
|
105
|
-
Hyrax supports Ruby 3.
|
105
|
+
Hyrax supports Ruby 3.3. When starting a new project, we recommend using the latest Ruby 3.3 version.
|
106
106
|
|
107
107
|
## Redis
|
108
108
|
|
@@ -112,11 +112,11 @@ Starting up Redis will depend on your operating system, and may in fact already
|
|
112
112
|
|
113
113
|
## Rails
|
114
114
|
|
115
|
-
Hyrax requires Rails
|
115
|
+
Hyrax requires Rails 7. We recommend the latest Rails 7.2 release.
|
116
116
|
|
117
117
|
```
|
118
118
|
# If you don't already have Rails at your disposal...
|
119
|
-
gem install rails -v
|
119
|
+
gem install rails -v 7.2.2.1
|
120
120
|
```
|
121
121
|
|
122
122
|
### JavaScript runtime
|
@@ -148,7 +148,7 @@ Generate a new Rails application using the template.
|
|
148
148
|
**NOTE:** `HYRAX_SKIP_WINGS` is needed here to avoid loading the Wings compatibility layer during the application generation process.
|
149
149
|
|
150
150
|
```shell
|
151
|
-
HYRAX_SKIP_WINGS=true rails
|
151
|
+
HYRAX_SKIP_WINGS=true rails _7.2.2.1_ new my_app --database=postgresql -m https://raw.githubusercontent.com/samvera/hyrax/hyrax-v5.1.0-beta1/template.rb
|
152
152
|
```
|
153
153
|
|
154
154
|
Generating a new Rails application using Hyrax's template above takes cares of a number of steps for you, including:
|