Skip to content

Commit

Permalink
T99 t313 merge (#401)
Browse files Browse the repository at this point in the history
* Docker containers for Solr, Fedora, and PG

* Hyrax image in progress

* Dockerfile & init scripts

* Adding docker-compose

* Moving scholarspace user setup to container init

* Added Redis

* Sidekiq container added

* Fixed sitemap generation task for Dockerized environment

* Added config files

* Updating README

* Updated documentation

* Updated README

* Fixed issue with log permissions & directory creation

* Changed DB to HYRAX_DB_PROD in docker-compose; moved calling hyrax-config.sh from Dockerfile to scholarspace-setup.sh

* Update hyrax gem to 3.0.0

* Add psych gem <4.0.0

* Run db migrations to update schema

* Add univeral viewer folder to gitignore

* Add tinymce-rails version gem

* Replace solrizer methods with activefedora

* Bump hyrax version to 3.0.2

* Bump hyrax to v3.5.0

* Add db migration files

* Updated schema

* Change /ga to shared/ga

* Add updated helper modules

* Add iiif config to hyrax initializer

* Add univeral viewer files

* Fixes #379 by installing Imagemagick 7 when building the sidekiq container image

* Updated URL for ImageMagick source download to more persistent URL

* Fix app-init.sh command option

* Added {} due to change in yaml parsing; Ref UNC-Libraries/hy-c#918

* Add back action buttons

* Listed prerequisites for Docker setup. Ref #99.

* T99 t313 redesign merge (#398)

* Comment out instructions

* Delete duplicated solr_wrapper file

* Seed file with admin role, admin user, workflows, default admin set

* Copy config files to conf, delete redundant config folder

* Add ETD collection creation to seed

* Add solr_wrapper configs for local deployment

* Add placeholder value to analytics.yml

* Add dev environment settings

* Refactor seed file into scholarspace_seeder file

* Update solr instructions to use conf instead of config

* header restructuring and styling progress

* Fix default admin set permission template creation

* footer positioning fixed

* Development and test file processing settings

* Lock redlock gem to < 2.0

* Set fedora to not persist

* header styles cleanup and template changes

* homepage and general styles

* dashboard styling and misc template edits

* footer formatting

* search bar border edit

* responsive footer and responsive header progress

* menu, header, footer translations

* Add default setup seed

* Add additional logs to gitignore

* Turn off persistence in fcrepo_wrapper

* Revert "Turn off persistence in fcrepo_wrapper"

This reverts commit 50881fe.

* Revert "Revert "Turn off persistence in fcrepo_wrapper""

This reverts commit b730de2.

* Add faker and factory_bot to development gems

* Delete commented out gems

* Add Gemfile.lock

* Add example files for testing

* WIP on seed file

* mobile accordion menu implemented

* Add content-admin role and user

* Remove scholarspace_seeder util

* Add thumbnail_label_for method

* Add journal creation and branding to seed

* Add featured work to seed

* further homepage and header styling

* Add styling and contentblocks to seed

* collections page styles and structure

* misc search page changes, commit for pull from local_setup

* misc search page styling

* search widgets restyled and misc homepage edits

* slight locale edit

* mobile menu styled

* admin style and template improvements

* Change solr/config to solr/conf

* Add aarch64-linux and x86_64-linux to bundle platforms

* Add default dev admin settings to env template

* Comment out pry gem

* Remove ImageMagick zip after install

* Add test/dev/prod solr core creation

* Add development.rb.template

* Add test.rb.template

* Add environment templates to docker

* Add solr core creation env variables

* language selector commented out for this milestone

* Turn off inline job queuing

* Modify blacklight.yml template for docker

* Modify fedora.yml.template for docker

* Modify solr.yml.template for docker

* Updated gemfile

* single item page styles and search style tweaks

* table styles for collections and single items

* search styling edits for collections

* mobile compatibility single item page fixes

* share your work logic progress

* logic progress

* header styles adjustment

* Adjust indentation for consistency

* Workaround for share work button functionality

* Add create work presenter to _masthead

* Refactor into stand_work_types_presenter

* Add update method in strategies_controller for fixing flipflop redirect error

* Redesign 2023 (#400)

* dashboard style fixes and contact dropdown fix

* share your work mobile usability

* removed duplicate share your work modal html

* Add error_controller, routes, erb for custom error pages

* 404 page template and styles

* header style customization

---------

Co-authored-by: Max Turer <[email protected]>
Co-authored-by: Alex Boyd <[email protected]>

* Added support for SSL

* Adding ssl conf

* Updated solrconfig to remove suggester

* accessibility fixes and style convention adherence

* placeholder thumbnail alt text

* Pinned postgres version

* fixed bug of scss loading twice

* descriptive thumbnail alt text added to search, featured, work page

* Updates to README

* alt text added and buttons standardized in single work pages

* README updates

* Script cleanup

---------

Co-authored-by: Max Turer <[email protected]>
Co-authored-by: Dolsy Smith <[email protected]>
Co-authored-by: Dolsy Smith <[email protected]>

---------
Resolves: #395, #394, #393, #390, #380, #379, #378, #313, #99

---------

Co-authored-by: dolsysmith <[email protected]>
Co-authored-by: Dan Kerchner <[email protected]>
Co-authored-by: Alex Boyd <[email protected]>
Co-authored-by: Alex Boyd <[email protected]>
Co-authored-by: Max Turer <[email protected]>
Co-authored-by: Dolsy Smith <[email protected]>
  • Loading branch information
7 people authored Oct 2, 2023
1 parent 75181e3 commit 93b144e
Show file tree
Hide file tree
Showing 144 changed files with 18,279 additions and 3,401 deletions.
35 changes: 35 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

docker-compose.yml
Dockerfile*
.env.example
.env
.travis.yml
method_tracer.rb
nohup.out
.gitignore
.bundle
.git
.cache
.byebug_history
fits.log
bin/importer
db/*.sqlite3
db/*.sqlite3-journal
public/assets
public/sitemap.xml
log/*.*
config/environments/*.rb
config/initializers/bulkrax.rb.backup
config/initializers/bulkrax.rb.backup2
config/initializers/hyrax.rb
config/initializers/hyrax.rb.backup
config/database.yml
config/fedora.yml
config/solr.yml
config/blacklight.yml
config/secrets.yml
vendor
sidekiq_conf
tomcat_conf
apache_conf
tmp
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ RECAPTCHA_SECRET_KEY_V3='your_recaptcha_v3_secret_key'
# where 1.0 is very likely a good interaction, 0.0 is very likely a bot;
# If the initial request fails to pass, our code (currently) falls back to a v2 reCAPTCHA challenge.
# See https://developers.google.com/recaptcha/docs/v3
RECAPTCHA_MINIMUM_SCORE=0.8
RECAPTCHA_MINIMUM_SCORE=0.8

# Dev environment admin
DEV_ADMIN_USER_EMAIL="[email protected]"
DEV_ADMIN_USER_PASSWORD="password"
1 change: 1 addition & 0 deletions .fcrepo_wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
port: 8984
enable_jms: false
fcrepo_home_dir: tmp/fcrepo4-development-data
persist: false
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@
/tmp/*
!/log/.keep
!/tmp/.keep
dump.rdb
fits.log

# Ignore local config files
config/database.yml
config/fedora.yml
config/solr.yml
config/blacklight.yml
config/secrets.yml
.env

# Ignore Byebug command history file.
.byebug_history

# Ignore universal viewer folder
/public/uv

# VScode settings
/.vscode
10 changes: 5 additions & 5 deletions .solr_wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# version: 6.0.0
# port: 8983
instance_dir: tmp/solr-development
collection:
persist: true
dir: solr/config/
name: hydra-development
version: 6.6.1
persist: false
dir: solr/conf/
name: hydra-development
version: 6.4.1
verbose: true
5 changes: 0 additions & 5 deletions .solr_wrapper.yml

This file was deleted.

74 changes: 74 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
FROM phusion/passenger-ruby27:2.5.0

RUN apt update && apt install -y libpq-dev unzip clamav-daemon curl libreoffice libcurl4-openssl-dev ffmpeg gnupg2 libxml2 libxml2-dev wget

RUN apt update && apt build-dep -y imagemagick

RUN apt install -y checkinstall libwebp-dev libopenjp2-7-dev librsvg2-dev libde265-dev

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cd /opt && \
wget https://www.imagemagick.org/archive/releases/ImageMagick-7.1.1-12.tar.gz && \
tar xzvf ImageMagick-7.1.1-12.tar.gz && \
cd ImageMagick-7.1.1-12 && \
./configure --enable-shared --with-modules --with-gslib && \
make && \
make install && \
ldconfig /usr/local/lib && \
identify -version && \
rm /opt/ImageMagick-7.1.1-12.tar.gz

# FITS install
WORKDIR /usr/local/bin

RUN wget https://github.com/harvard-lts/fits/releases/download/1.5.0/fits-1.5.0.zip \
&& unzip fits-1.5.0.zip -d fits-1.5.0 \
&& rm fits-1.5.0.zip \
&& chmod a+x fits-1.5.0/fits*.sh

# Uninstall Ruby version from image and install our version
# bash -lc is necessary per the configuration of the base image
RUN bash -lc "rvm remove ruby-2.7.7 && rvm install ruby-2.7.3 && gem install rails -v 5.2.7 -N"

# Hyrax directories
RUN mkdir -p /opt/scholarspace/scholarspace-hyrax \
&& mkdir -p /opt/scholarspace/certs \
&& mkdir -p /opt/scholarspace/scholarspace-tmp \
&& mkdir -p /opt/scholarspace/scholarspace-minter \
&& mkdir -p /opt/scholarspace/scholarspace-derivatives \
&& chmod 775 -R /opt/scholarspace/scholarspace-derivatives

WORKDIR /opt/scholarspace/scholarspace-hyrax

# Default ImageMagick configuration (to allow PDF's)
COPY ./docker/imagemagick/policy.xml /etc/ImageMagick-6/policy.xml

# Switch to bash shell so that we can use the source command
SHELL ["/bin/bash", "-c"]

COPY ./docker/scripts/rvm-wrapper.sh ./docker/scripts/rvm-wrapper.sh
# Replace the existing ruby2.7 wrapper with one that points to our version of Ruby
RUN source ./docker/scripts/rvm-wrapper.sh && rm /usr/bin/ruby2.7 \
&& create_rvm_wrapper_script ruby2.7 ruby-2.7.3 ruby
# Compile it for Passenger
RUN ruby2.7 -S passenger-config build-native-support

# Copy Gemfile separately, so that we don't have to rebuild this stage every time we change another file
COPY Gemfile Gemfile.lock ./
# Used to create the correct file in config/environments
ARG RAILS_ENV
# Install dependencies and finalize Hyrax setup
# Running without development; installing as development seems to cause some issues
RUN gem install bundler \
&& bundle lock --add-platform aarch64-linux \
&& bundle lock --add-platform x86_64-linux \
&& bundle install

# Copy app files
COPY . ./
# Create config files
RUN chmod +x docker/scripts/*.sh

# Script that creates the scholarspace user
CMD ["bash", "-l", "docker/scripts/scholarspace-setup.sh"]
13 changes: 13 additions & 0 deletions Dockerfile-solr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM library/solr:6.4.2-alpine

# Add Log4J security patch
RUN echo 'SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"' >> /opt/solr/bin/solr.in.sh

# Copy app configs to image
COPY --chown=solr:solr ./solr/conf /opt/scholarspace/solr/conf
# Copy init script to resident scripts folder
COPY --chown=solr:solr ./docker/scripts/scholarspace-solr-init.sh /opt/docker-solr/scripts/
# Make executable
RUN chmod +x /opt/docker-solr/scripts/scholarspace-solr-init.sh

ENTRYPOINT ["/opt/docker-solr/scripts/scholarspace-solr-init.sh" ]
10 changes: 7 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ gem 'bootsnap', '>= 1.1.0', require: false
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'hyrax', '2.9.6'
gem 'hyrax', '3.5.0'

gem 'hydra-role-management'

Expand Down Expand Up @@ -81,9 +81,10 @@ gem 'recaptcha'

gem 'invisible_captcha'

gem 'redlock', '>= 0.1.2', '< 2.0' # redis/sidekiq fix per https://github.com/samvera/hyrax/pull/5961

group :development, :test do
gem 'pry'
# gem 'pry' # temporily removing, seems to break something with sidekiq in development mode
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'solr_wrapper', '>= 0.3'
gem 'launchy'
Expand All @@ -98,6 +99,8 @@ group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'factory_bot_rails'
gem 'faker'
end

group :test do
Expand All @@ -106,4 +109,5 @@ group :test do
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
end
gem "ffi", "~> 1.15"
Loading

0 comments on commit 93b144e

Please sign in to comment.