diff --git a/Dockerfile b/Dockerfile index b9b3a828a..8b4cef213 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ USER root RUN apk --no-cache upgrade && \ apk --no-cache add \ bash \ + clamav \ + clamav-daemon \ cmake \ exiftool \ ffmpeg \ @@ -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 \ @@ -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 diff --git a/app/assets/images/splash-logos/MolaLogo.png b/app/assets/images/splash-logos/MolaLogo.png index 0104fa7e4..20955a5d4 100644 Binary files a/app/assets/images/splash-logos/MolaLogo.png and b/app/assets/images/splash-logos/MolaLogo.png differ diff --git a/app/views/shared/ubiquity/search_display/_show_array_hash.html.erb b/app/views/shared/ubiquity/search_display/_show_array_hash.html.erb index dfae83f74..c117c4928 100644 --- a/app/views/shared/ubiquity/search_display/_show_array_hash.html.erb +++ b/app/views/shared/ubiquity/search_display/_show_array_hash.html.erb @@ -1,29 +1,17 @@ -<% 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 %> - - <% 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| %> - - <% 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 %> -   - <% 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 %> + + <% 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| %> + + <% 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 %>   @@ -31,29 +19,43 @@ <%= '…' 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 %> -   - <% 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 %> +   + <% 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 %> -   - <% 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 %> +   + <% end %> + <%= '…' if index == array_size && array_of_hash.size > 5 %> + <% end %> <% end %> - <% 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 %> +   + <% end %> + <%= '…' if index == array_size && array_of_hash.size > 5 %> + <% end %> + <% end %> + <% end %> + + <% end %> + + <% end %> <% end %> -<% end %> \ No newline at end of file +<% end %> diff --git a/bin/worker b/bin/worker index b7605486b..2d33ecb79 100755 --- a/bin/worker +++ b/bin/worker @@ -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" diff --git a/config/initializers/file_set_derivatives_overrides.rb b/config/initializers/file_set_derivatives_overrides.rb index 35a33c14d..baa9ad47f 100644 --- a/config/initializers/file_set_derivatives_overrides.rb +++ b/config/initializers/file_set_derivatives_overrides.rb @@ -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 diff --git a/config/initializers/hyrax-doi.rb b/config/initializers/hyrax-doi.rb index 40b257656..123039c56 100644 --- a/config/initializers/hyrax-doi.rb +++ b/config/initializers/hyrax-doi.rb @@ -188,6 +188,12 @@ def initialize(builder: nil) def client Hyrax::DOI::DataCiteClient.new(username: self.username, password: self.password, prefix: self.prefix, mode: self.mode) end + + # Override Hyrax::DOI::DataCiteRegister.work_url to ensure that the url registered uses the tenant host + def work_url(work) + account_cname = Account.find_by(tenant: Apartment::Tenant.current)&.cname + Rails.application.routes.url_helpers.polymorphic_url(work, host: account_cname) + end end diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 49ea47332..3ec7ab3b8 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 9221cb824..046eafafa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/ops/production-deploy.tmpl.yaml b/ops/production-deploy.tmpl.yaml index c7cbe415d..73e212b94 100644 --- a/ops/production-deploy.tmpl.yaml +++ b/ops/production-deploy.tmpl.yaml @@ -40,6 +40,9 @@ extraVolumeMounts: &volMounts - name: uploads mountPath: /app/samvera/hyrax-webapp/tmp/shared subPath: shared + - name: uploads + mountPath: /app/samvera/hyrax-webapp/public/branding + subPath: public-branding ingress: enabled: true @@ -246,7 +249,7 @@ nginx: image: registry: registry.gitlab.com repository: notch8/scripts/bitnami-nginx - tag: 1.21.5-debian-10-r4 + tag: 1.21.5-debian-10-r7 serverBlock: |- upstream rails_app { server {{ .Values.global.hyraxName }}; diff --git a/ops/staging-deploy.tmpl.yaml b/ops/staging-deploy.tmpl.yaml index a78f26999..5bf9c96da 100644 --- a/ops/staging-deploy.tmpl.yaml +++ b/ops/staging-deploy.tmpl.yaml @@ -40,6 +40,10 @@ extraVolumeMounts: &volMounts - name: uploads mountPath: /app/samvera/hyrax-webapp/tmp/shared subPath: shared + - name: uploads + mountPath: /app/samvera/hyrax-webapp/public/branding + subPath: public-branding + ingress: enabled: true @@ -241,7 +245,7 @@ nginx: image: registry: registry.gitlab.com repository: notch8/scripts/bitnami-nginx - tag: 1.21.5-debian-10-r4 + tag: 1.21.5-debian-10-r7 serverBlock: |- upstream rails_app { server {{ .Values.global.hyraxName }};