Skip to content

Commit

Permalink
Merge branch 'main' into hyrax_dois_urls_should_use_account_cname
Browse files Browse the repository at this point in the history
  • Loading branch information
cziaarm committed Feb 7, 2024
2 parents 82cf24b + f12b25c commit ba3dae6
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 54 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ USER root
RUN apk --no-cache upgrade && \
apk --no-cache add \
bash \
clamav \
clamav-daemon \
cmake \
exiftool \
ffmpeg \
Expand Down Expand Up @@ -35,6 +37,11 @@ RUN apk --no-cache upgrade && \
# cargo install rbspy && \
echo "******** Packages Installed *********"

RUN sed -i 's/User clamav/User app/g' /etc/clamav/clamd.conf
RUN mkdir -p /var/run/clamav && chown -R app:app /var/run/clamav
RUN mkdir -p /var/log/clamav && chown -R app:app /var/log/clamav
RUN chown -R app:app /var/lib/clamav

RUN wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.0-57.tar.gz \
&& tar xf 7.1.0-57.tar.gz \
&& apk --no-cache add \
Expand Down Expand Up @@ -98,5 +105,6 @@ RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DAT
CMD ./bin/web

FROM hyku-web as hyku-worker
RUN freshclam
ENV MALLOC_ARENA_MAX=2
CMD ./bin/worker
100 changes: 51 additions & 49 deletions app/views/shared/ubiquity/search_display/_show_array_hash.html.erb
Original file line number Diff line number Diff line change
@@ -1,59 +1,61 @@
<% array_size = (array_of_hash.size <= 5 ? array_of_hash.size - 1 : 4) %>
<% array_of_hash.each_with_index do |hash, index| %>
<% if index <= 4 %>
<span itemprop='<%= "#{attr_name}" %>'>
<% last_name = hash["#{attr_name}_family_name"] || '' %>
<% first_name = hash["#{attr_name}_given_name"] || '' %>
<% organizational_creator = hash["#{attr_name}_organization_name"] %>
<% last_name << ',' if last_name && display_comma?(hash.keys, ["#{attr_name}_family_name", "#{attr_name}_given_name"]) %>
<% document.creator_search.each do |creator| %>
<span>
<% if creator == organizational_creator %>
<%= link_to main_app.search_catalog_path(f: { creator_search_sim: Array(organizational_creator)}), class: 'creator-search-results' do %>
<%= organizational_creator %>
<%= remove_last_semicolon(array_size, index) %>
<% if index != array_size %>
&nbsp;
<% end %>
<%= '…' if index == array_size && array_of_hash.size > 5 %>
<% end %>
<% end %>
<% if last_name %>
<% if creator == "#{last_name} " + first_name ||
creator + first_name == "#{last_name} " + first_name %>
<%= link_to main_app.search_catalog_path(f: { creator_search_sim: Array(last_name + (" #{first_name}" if first_name)) }), class: 'creator-search-results' do %>
<%= last_name %>
<%= first_name if first_name %>
<% if array_of_hash.present? %>
<% array_size = (array_of_hash&.size <= 5 ? array_of_hash.size - 1 : 4) %>
<% array_of_hash.each_with_index do |hash, index| %>
<% if index <= 4 %>
<span itemprop='<%= "#{attr_name}" %>'>
<% last_name = hash["#{attr_name}_family_name"] || '' %>
<% first_name = hash["#{attr_name}_given_name"] || '' %>
<% organizational_creator = hash["#{attr_name}_organization_name"] %>
<% last_name << ',' if last_name && display_comma?(hash.keys, ["#{attr_name}_family_name", "#{attr_name}_given_name"]) %>
<% document.creator_search.each do |creator| %>
<span>
<% if creator == organizational_creator %>
<%= link_to main_app.search_catalog_path(f: { creator_search_sim: Array(organizational_creator)}), class: 'creator-search-results' do %>
<%= organizational_creator %>
<%= remove_last_semicolon(array_size, index) %>
<% if index != array_size %>
&nbsp;
<% end %>
<%= '…' if index == array_size && array_of_hash.size > 5 %>
<% end %>
<% end %>
<% if creator == last_name %>
<%= link_to main_app.search_catalog_path(f: { creator_search_sim: Array(last_name) }), class: 'creator-search-results' do %>
<%= last_name %>
<%= remove_last_semicolon(array_size, index) %>
<% if index != array_size %>
&nbsp;
<% end %>
<%= '…' if index == array_size && array_of_hash.size > 5 %>
<% if last_name %>
<% if creator == "#{last_name} " + first_name ||
creator + first_name == "#{last_name} " + first_name %>
<%= link_to main_app.search_catalog_path(f: { creator_search_sim: Array(last_name + (" #{first_name}" if first_name)) }), class: 'creator-search-results' do %>
<%= last_name %>
<%= first_name if first_name %>
<%= remove_last_semicolon(array_size, index) %>
<% if index != array_size %>
&nbsp;
<% end %>
<%= '…' if index == array_size && array_of_hash.size > 5 %>
<% end %>
<% end %>
<% end %>
<% if creator == first_name %>
<%= link_to main_app.search_catalog_path(f: { creator_search_sim: Array(first_name) }), class: 'creator-search-results' do %>
<%= first_name %>
<%= remove_last_semicolon(array_size, index) %>
<% if index != array_size %>
&nbsp;
<% end %>
<%= '…' if index == array_size && array_of_hash.size > 5 %>
<% if creator == last_name %>
<%= link_to main_app.search_catalog_path(f: { creator_search_sim: Array(last_name) }), class: 'creator-search-results' do %>
<%= last_name %>
<%= remove_last_semicolon(array_size, index) %>
<% if index != array_size %>
&nbsp;
<% end %>
<%= '…' if index == array_size && array_of_hash.size > 5 %>
<% end %>
<% end %>
<% end %>
<% end %>
</span>
<% end %>
</span>
<% if creator == first_name %>
<%= link_to main_app.search_catalog_path(f: { creator_search_sim: Array(first_name) }), class: 'creator-search-results' do %>
<%= first_name %>
<%= remove_last_semicolon(array_size, index) %>
<% if index != array_size %>
&nbsp;
<% end %>
<%= '…' if index == array_size && array_of_hash.size > 5 %>
<% end %>
<% end %>
<% end %>
</span>
<% end %>
</span>
<% end %>
<% end %>
<% end %>
<% end %>
2 changes: 1 addition & 1 deletion bin/worker
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ else
puts 'DATABASE_URL not set, no pool change needed'
end

exec "echo $DATABASE_URL && bundle exec sidekiq"
exec "echo $DATABASE_URL && clamd && bundle exec sidekiq"
4 changes: 2 additions & 2 deletions config/initializers/file_set_derivatives_overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def create_video_derivatives(filename)
Hydra::Derivatives::VideoDerivatives.create(filename,
outputs: [{ label: :thumbnail, format: 'jpg',
url: derivative_url('thumbnail') },
{ label: 'webm', format: 'webm',
url: derivative_url('webm') },
# { label: 'webm', format: 'webm',
# url: derivative_url('webm') },
{ label: 'mp4', format: 'mp4',
url: derivative_url('mp4') }])
end
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ services:
target: hyku-worker
args:
- HYKU_BULKRAX_ENABLED=true
command: bundle exec sidekiq
command: clamd && bundle exec sidekiq
depends_on:
- check_volumes
- db
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ services:
##
## With the following line, uncommented during active development, we'll
## run bundle then run sidekiq.
# command: sh -l -c "bundle && bundle exec sidekiq"
command: sh -l -c "clamd && bundle && bundle exec sidekiq"
##
## Similar to the above, except we will bundle and then tell the container
## to wait. You'll then need to bash into the worker container and start
Expand Down

0 comments on commit ba3dae6

Please sign in to comment.