From 59842334d19fcfa5f86909049d8e8f046963d690 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Tue, 8 Dec 2020 11:30:02 -0400 Subject: [PATCH 01/20] Sandbox, Import/Export tool, and Syn toggling --- .../rootfs/etc/cont-init.d/00-load-secrets.sh | 0 demo/Dockerfile | 48 ++-------- demo/rootfs/etc/cont-init.d/04-demo-setup.sh | 88 ------------------- .../confd/templates/setup-environment.sh.tmpl | 4 +- drupal/rootfs/etc/islandora/utilities.sh | 2 - fcrepo/Dockerfile | 6 ++ .../rootfs/etc/confd/conf.d/context.xml.toml | 1 + fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml | 2 +- .../etc/confd/templates/context.xml.tmpl | 2 + .../rootfs/etc/confd/templates/setenv.sh.tmpl | 4 + 10 files changed, 23 insertions(+), 134 deletions(-) mode change 100644 => 100755 base/rootfs/etc/cont-init.d/00-load-secrets.sh delete mode 100755 demo/rootfs/etc/cont-init.d/04-demo-setup.sh diff --git a/base/rootfs/etc/cont-init.d/00-load-secrets.sh b/base/rootfs/etc/cont-init.d/00-load-secrets.sh old mode 100644 new mode 100755 diff --git a/demo/Dockerfile b/demo/Dockerfile index 70f36f6d..c477a5d4 100644 --- a/demo/Dockerfile +++ b/demo/Dockerfile @@ -5,41 +5,14 @@ FROM local/nginx:latest as composer RUN --mount=type=cache,target=/root/.composer/cache \ --mount=id=downloads,type=cache,target=/opt/downloads \ DOWNLOAD_CACHE_DIRECTORY="/opt/downloads" && \ - composer create-project drupal/recommended-project:^8.9 \ - --prefer-dist \ - --no-interaction \ - --stability stable \ - --no-dev \ - --no-install \ - /var/www/drupal \ - && \ + # Get the Drupal codebase + git clone https://github.com/dannylamb/islandora-sandbox && \ + mv islandora-sandbox /var/www/drupal && \ cd /var/www/drupal && \ - composer require --update-no-dev -- \ - drupal/admin_toolbar:^2.0 \ - drupal/content_browser:^1.0@alpha \ - drupal/devel:^2.0 \ - drupal/facets:^1.3 \ - drupal/matomo:^1.7 \ - drupal/pdf:1.x-dev \ - drupal/rdfui:^1.0-beta1 \ - drupal/rest_oai_pmh:^1.0 \ - drupal/restui:^1.16 \ - drupal/search_api_solr:^3.8 \ - drupal/transliterate_filenames:^1.3 \ - drush/drush:^10.3 \ - islandora-rdm/islandora_fits:dev-8.x-1.x \ - islandora/carapace:dev-8.x-3.x \ - islandora/islandora_defaults:dev-8.x-1.x \ - zaporylie/composer-drupal-optimizations:^1.1 \ - && \ + composer install && \ + # Set up libraries mkdir -p /var/www/drupal/web/libraries && \ - MASONRY_VERSION="3.3.2" && \ - MASONRY_FILE="v${MASONRY_VERSION}.zip" && \ - MASONRY_URL="https://github.com/desandro/masonry/archive/${MASONRY_FILE}" && \ - MASONRY_SHA256="85dc8b2cdf789693a14022dadc3e573a87d625da5da1cf83e1ef1e5af22af496" && \ - download.sh --url "${MASONRY_URL}" --sha256 "${MASONRY_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ - unzip "${DOWNLOAD_CACHE_DIRECTORY}/${MASONRY_FILE}" -d /var/www/drupal/web/libraries && \ - mv /var/www/drupal/web/libraries/masonry-${MASONRY_VERSION} /var/www/drupal/web/libraries/masonry && \ + # PDF.js PDFJS_VERSION="2.0.943" && \ PDFJS_FILE="pdfjs-${PDFJS_VERSION}-dist.zip" && \ PDFJS_URL="https://github.com/mozilla/pdf.js/releases/download/v${PDFJS_VERSION}/${PDFJS_FILE}" && \ @@ -47,14 +20,7 @@ RUN --mount=type=cache,target=/root/.composer/cache \ download.sh --url "${PDFJS_URL}" --sha256 "${PDFJS_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ mkdir -p /var/www/drupal/web/libraries/pdf.js && \ unzip "${DOWNLOAD_CACHE_DIRECTORY}/${PDFJS_FILE}" -d /var/www/drupal/web/libraries/pdf.js && \ - OPENSEADRAGON_VERSION="2.4.2" && \ - OPENSEADRAGON_FILE="openseadragon-bin-${OPENSEADRAGON_VERSION}.zip" && \ - OPENSEADRAGON_URL="https://github.com/openseadragon/openseadragon/releases/download/v${OPENSEADRAGON_VERSION}/${OPENSEADRAGON_FILE}" && \ - OPENSEADRAGON_SHA256="8e32d808b80206d5f5aadcfc51ffecf2ecc89e5fb6876c51f409940cf4b1087e" && \ - download.sh --url "${OPENSEADRAGON_URL}" --sha256 "${OPENSEADRAGON_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ - mkdir -p /var/www/drupal/web/sites/all/assets/vendor && \ - unzip "${DOWNLOAD_CACHE_DIRECTORY}/${OPENSEADRAGON_FILE}" -d /var/www/drupal/web/sites/all/assets/vendor && \ - mv "/var/www/drupal/web/sites/all/assets/vendor/${OPENSEADRAGON_FILE%.zip}" /var/www/drupal/web/sites/all/assets/vendor/openseadragon && \ + # Openseadragon mkdir -p /var/www/drupal/web/sites/default/files/library-definitions && \ cp /var/www/drupal/web/modules/contrib/openseadragon/openseadragon.json /var/www/drupal/web/sites/default/files/library-definitions && \ chown -R nginx:nginx /var/www/drupal && \ diff --git a/demo/rootfs/etc/cont-init.d/04-demo-setup.sh b/demo/rootfs/etc/cont-init.d/04-demo-setup.sh deleted file mode 100755 index da61f29d..00000000 --- a/demo/rootfs/etc/cont-init.d/04-demo-setup.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/with-contenv bash -set -e - -# Does not run in the context of a login shell so we must explicitly include utilities.sh -source /etc/islandora/utilities.sh - -function main { - local modules=( - admin_toolbar - basic_auth - content_browser - controlled_access_terms_defaults - devel - facets - islandora_breadcrumbs - islandora_defaults - islandora_fits - islandora_iiif - islandora_oaipmh - islandora_search - matomo - pdf - rdf - responsive_image - rest - restui - search_api_solr - search_api_solr_defaults - serialization - simpletest - syslog - transliterate_filenames - ) - local features=( - islandora_core_feature - islandora_defaults - islandora_search - ) - - # We do all sites in a stepwise fashion as it turns out to be faster than - # configuring one site completely at a time as they get blocked waiting on - # other services like Fedora to start. - for_all_sites create_database - for_all_sites install_site - for_all_sites update_settings_php - - # Uses the same public/private key for all sub-sites. - # Required if they share the same backend microservices, etc. - for_all_sites configure_jwt_module - - # Enable islandora before all other modules so services that require direct - # communication like ActiveMQ etc have the appropriate settings. - for_all_sites configure_islandora_module - - # The following commands require several services - # to be up and running before they can complete. - for_all_sites wait_for_required_services - - # Create namespace assumed one per site. - for_all_sites create_blazegraph_namespace_with_default_properties - - # Theme must be enabled before importing features. - for_all_sites set_carapace_default_theme - - # All subsites are assumed to use the same modules and features. - for_all_sites enable_modules ${modules[@]} - for_all_sites import_features ${features[@]} - - # Features overrides some settings for services, so we need to explicitly - # set them again. - for_all_sites configure_islandora_module - for_all_sites configure_matomo_module - for_all_sites configure_search_api_solr_module - for_all_sites configure_openseadragon - for_all_sites configure_islandora_default_module - - # Export configuration now that features have been imported. - for_all_sites create_solr_core_with_default_config - - # Run migrations. - for_all_sites import_islandora_migrations - - s6-setuidgid nginx mkdir -p /var/www/drupal/web/simpletest /var/www/drupal/web/sites/simpletest - s6-setuidgid nginx mkdir -p config/sync - - for_all_sites cache_rebuild -} -main diff --git a/drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl b/drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl index 48f3aab7..4bc99445 100644 --- a/drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl +++ b/drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl @@ -22,7 +22,7 @@ multisubstitute define ACCOUNT_EMAIL "webmaster@localhost.com" define ACCOUNT_NAME "admin" define ACCOUNT_PASSWORD "password" - define CONFIGDIR "" + define CONFIGDIR "/var/www/drupal/config/sync" define DB_DRIVER "mysql" define DB_HOST "mariadb" define DB_NAME "drupal_default" @@ -33,7 +33,7 @@ multisubstitute define DB_USER "drupal_default" define EMAIL "webmaster@localhost.com" define INSTALL "true" - define INSTALL_EXISTING_CONFIG "false" + define INSTALL_EXISTING_CONFIG "true" define LOCALE "en" define NAME "Default" define PROFILE "standard" diff --git a/drupal/rootfs/etc/islandora/utilities.sh b/drupal/rootfs/etc/islandora/utilities.sh index 9cde5e31..87412102 100755 --- a/drupal/rootfs/etc/islandora/utilities.sh +++ b/drupal/rootfs/etc/islandora/utilities.sh @@ -364,7 +364,6 @@ function configure_islandora_module { local gemini_port=$(drupal_site_env "${site}" "GEMINI_PORT") local gemini_url="http://${gemini_host}:${gemini_port}" - drush -l "${site_url}" -y pm:enable islandora drush -l "${site_url}" -y config:set --input-format=yaml jsonld.settings remove_jsonld_format true drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings broker_url "${broker_url}" drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_url "${gemini_url}" @@ -458,7 +457,6 @@ function configure_matomo_module { local matomo_url=$(drupal_site_env "${site}" "MATOMO_URL") local matomo_http_url="http${matomo_url#https}" - drush -l "${site_url}" -y pm:enable matomo drush -l "${site_url}" -y config-set matomo.settings site_id "${site_id}" drush -l "${site_url}" -y config-set matomo.settings url_http "${matomo_http_url}" drush -l "${site_url}" -y config-set matomo.settings url_https "${matomo_url}" diff --git a/fcrepo/Dockerfile b/fcrepo/Dockerfile index 4257ed25..3e8fef21 100644 --- a/fcrepo/Dockerfile +++ b/fcrepo/Dockerfile @@ -15,6 +15,12 @@ RUN --mount=id=downloads,type=cache,target=/opt/downloads \ SYN_SHA256="bcad5f872930b1bcc9ea4a176c60e22683297121357336769a21ead9fadcbbd5" && \ download.sh --url "${SYN_URL}" --sha256 "${SYN_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ cp "${DOWNLOAD_CACHE_DIRECTORY}/${SYN_FILE}" /opt/tomcat/lib && \ + IMPORT_EXPORT_VERSION="1.0.0" && \ + IMPORT_EXPORT_FILE="fcrepo-import-export-${IMPORT_EXPORT_VERSION}.jar" && \ + IMPORT_EXPORT_URL="https://github.com/fcrepo-exts/fcrepo-import-export/releases/download/fcrepo-import-export-${IMPORT_EXPORT_VERSION}/${IMPORT_EXPORT_FILE}" && \ + IMPORT_EXPORT_SHA256="f3103ce03b9ee9e38cf0a762d7b4194fd6c20fa72e19ed7e811ac5de4b890062" && \ + download.sh --url "${IMPORT_EXPORT_URL}" --sha256 "${IMPORT_EXPORT_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ + cp "${DOWNLOAD_CACHE_DIRECTORY}/${IMPORT_EXPORT_FILE}" /opt/tomcat && \ mkdir -p /opt/keys/jwt && \ chown tomcat:tomcat /opt/keys/jwt && \ mkdir /data && \ diff --git a/fcrepo/rootfs/etc/confd/conf.d/context.xml.toml b/fcrepo/rootfs/etc/confd/conf.d/context.xml.toml index 16c8f081..746afa81 100644 --- a/fcrepo/rootfs/etc/confd/conf.d/context.xml.toml +++ b/fcrepo/rootfs/etc/confd/conf.d/context.xml.toml @@ -4,3 +4,4 @@ dest = "/opt/tomcat/conf/context.xml" uid = 100 gid = 1000 mode = "0640" +keys = [ "/" ] diff --git a/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml b/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml index 45d63894..d27eb375 100644 --- a/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml +++ b/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml @@ -4,4 +4,4 @@ dest = "/opt/tomcat/bin/setenv.sh" uid = 100 gid = 1000 mode = "0655" -keys = [ "/modeshape/configuration" ] +keys = [ "/" ] diff --git a/fcrepo/rootfs/etc/confd/templates/context.xml.tmpl b/fcrepo/rootfs/etc/confd/templates/context.xml.tmpl index 40ad286d..f7f2171a 100644 --- a/fcrepo/rootfs/etc/confd/templates/context.xml.tmpl +++ b/fcrepo/rootfs/etc/confd/templates/context.xml.tmpl @@ -4,5 +4,7 @@ WEB-INF/web.xml ${catalina.base}/conf/web.xml +{{ if eq (getv "/disable/syn" "false") "false" }} +{{ end }} diff --git a/fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl b/fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl index 0f190348..cfff400a 100644 --- a/fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl +++ b/fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl @@ -4,3 +4,7 @@ export CATALINA_OPTS="{{ getv "/catalina/opts" "" }}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.home=/data/home" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.modeshape.configuration={{ getv "/modeshape/configuration" "classpath:/config/repository.json" }} -Dfcrepo.jms.baseUrl=http://{{ index (lookupIP (getenv "HOSTNAME")) 0 }}/fcrepo/rest" + +{{ if eq (getv "/disable/syn" "false") "true" }} +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" +{{ end }} From 15a1dd1a99b7a1bff4cf73cf8e567a9e5907ecbe Mon Sep 17 00:00:00 2001 From: dannylamb Date: Wed, 6 Jan 2021 13:06:45 -0400 Subject: [PATCH 02/20] Changes for reindexing and no gemini --- alpaca/Dockerfile | 2 +- ....islandora.alpaca.indexing.fcrepo.cfg.tmpl | 1 + crayfish/Dockerfile | 2 +- demo/Dockerfile | 9 +- drupal/rootfs/etc/nginx/conf.d/default.conf | 7 +- gemini/.dockerignore | 1 - gemini/Dockerfile | 11 -- gemini/README.md | 26 ----- .../rootfs/etc/confd/conf.d/config.yaml.toml | 7 -- .../confd/conf.d/setup-environment.sh.toml | 7 -- gemini/rootfs/etc/confd/confd.toml | 6 - .../etc/confd/templates/config.yaml.tmpl | 24 ---- .../confd/templates/setup-environment.sh.tmpl | 21 ---- .../rootfs/etc/cont-init.d/03-gemini-setup.sh | 103 ------------------ nginx/Dockerfile | 1 + 15 files changed, 17 insertions(+), 211 deletions(-) delete mode 100644 gemini/.dockerignore delete mode 100644 gemini/Dockerfile delete mode 100644 gemini/README.md delete mode 100644 gemini/rootfs/etc/confd/conf.d/config.yaml.toml delete mode 100644 gemini/rootfs/etc/confd/conf.d/setup-environment.sh.toml delete mode 100644 gemini/rootfs/etc/confd/confd.toml delete mode 100644 gemini/rootfs/etc/confd/templates/config.yaml.tmpl delete mode 100644 gemini/rootfs/etc/confd/templates/setup-environment.sh.tmpl delete mode 100755 gemini/rootfs/etc/cont-init.d/03-gemini-setup.sh diff --git a/alpaca/Dockerfile b/alpaca/Dockerfile index ab4655cd..c1d3710c 100644 --- a/alpaca/Dockerfile +++ b/alpaca/Dockerfile @@ -3,7 +3,7 @@ FROM local/karaf:latest # Install common features and repos RUN bin/start && \ - ALPACA_VERSION=1.0.3 && \ + ALPACA_VERSION=1.0.4 && \ ACTIVEMQ_VERSION=5.15.0 && \ CAMEL_VERSION=2.20.4 && \ bin/client -r 10 -d 5 "feature:repo-add mvn:ca.islandora.alpaca/islandora-karaf/${ALPACA_VERSION}/xml/features" && \ diff --git a/alpaca/rootfs/etc/confd/templates/ca.islandora.alpaca.indexing.fcrepo.cfg.tmpl b/alpaca/rootfs/etc/confd/templates/ca.islandora.alpaca.indexing.fcrepo.cfg.tmpl index 49a7e682..5e1903ac 100644 --- a/alpaca/rootfs/etc/confd/templates/ca.islandora.alpaca.indexing.fcrepo.cfg.tmpl +++ b/alpaca/rootfs/etc/confd/templates/ca.islandora.alpaca.indexing.fcrepo.cfg.tmpl @@ -1,4 +1,5 @@ error.maxRedeliveries={{ getv "/indexing/redeliveries" "10" }} +file.external.stream={{ getv "/indexing/stream/file/external" "broker:queue:islandora-indexing-fcrepo-file-external" }} file.delete.stream={{ getv "/indexing/stream/file/delete" "broker:queue:islandora-indexing-fcrepo-file-delete" }} file.stream={{ getv "/indexing/stream/file/index" "broker:queue:islandora-indexing-fcrepo-file" }} gemini.baseUrl={{ getv "/indexing/gemini/url" "http://gemini:8000" }} diff --git a/crayfish/Dockerfile b/crayfish/Dockerfile index b568b30c..9b325eb1 100644 --- a/crayfish/Dockerfile +++ b/crayfish/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:experimental FROM local/nginx:latest -ARG COMMIT=85a8206a9ed1db302fdeb123f9d5391ef8aae001 +ARG COMMIT=4d13cae3e370cd82fa998fb3be9c3914bd5081e0 RUN --mount=id=downloads,type=cache,target=/opt/downloads \ DOWNLOAD_CACHE_DIRECTORY="/opt/downloads" && \ diff --git a/demo/Dockerfile b/demo/Dockerfile index c477a5d4..d29b6bd7 100644 --- a/demo/Dockerfile +++ b/demo/Dockerfile @@ -1,13 +1,18 @@ # syntax=docker/dockerfile:experimental FROM local/nginx:latest as composer +ARG COMMIT=4460371c93d0dea87211d965b23242f412369ac3 + # Islandora based Drupal install. RUN --mount=type=cache,target=/root/.composer/cache \ --mount=id=downloads,type=cache,target=/opt/downloads \ DOWNLOAD_CACHE_DIRECTORY="/opt/downloads" && \ # Get the Drupal codebase - git clone https://github.com/dannylamb/islandora-sandbox && \ - mv islandora-sandbox /var/www/drupal && \ + git-clone-cached.sh \ + --url https://github.com/dannylamb/islandora-sandbox.git \ + --cache-dir "${DOWNLOAD_CACHE_DIRECTORY}" \ + --commit "${COMMIT}" \ + --worktree /var/www/drupal && \ cd /var/www/drupal && \ composer install && \ # Set up libraries diff --git a/drupal/rootfs/etc/nginx/conf.d/default.conf b/drupal/rootfs/etc/nginx/conf.d/default.conf index c2d97745..78706baa 100644 --- a/drupal/rootfs/etc/nginx/conf.d/default.conf +++ b/drupal/rootfs/etc/nginx/conf.d/default.conf @@ -33,6 +33,11 @@ server { deny all; } + # Allow access to .txt files in site files directory + location ~ ^/sites/[^/]+/files/.*\.txt$ { + allow all; + } + # Allow "Well-Known URIs" as per RFC 5785 location ~* ^/.well-known/ { allow all; @@ -125,4 +130,4 @@ server { if ($request_uri ~* "^(.*/)index\.php(.*)") { return 307 $1$2; } -} \ No newline at end of file +} diff --git a/gemini/.dockerignore b/gemini/.dockerignore deleted file mode 100644 index b43bf86b..00000000 --- a/gemini/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -README.md diff --git a/gemini/Dockerfile b/gemini/Dockerfile deleted file mode 100644 index b2fb897a..00000000 --- a/gemini/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# syntax=docker/dockerfile:experimental -FROM local/crayfish:latest - -RUN --mount=type=cache,target=/root/.composer/cache \ - composer install -d /var/www/crayfish/Gemini && \ - ln -s /var/www/crayfish/Gemini/src /var/www/html && \ - cleanup.sh - -COPY /rootfs / - -WORKDIR /var/www/crayfish/Gemini/ diff --git a/gemini/README.md b/gemini/README.md deleted file mode 100644 index 9d8213c3..00000000 --- a/gemini/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Gemini - -Docker image for [Gemini]. - -## Dependencies - -Requires `islandora/crayfish` docker image to build. Please refer to the -[Crayfish Image README](../crayfish/README.md) for additional information including -additional settings, volumes, ports, etc. - -## Settings - -| Environment Variable | Etcd Key | Default | Description | -| :---------------------- | :----------------------- | :----------------- | :------------------------------------------------------------------------------------------------ | -| GEMINI_DB_DRIVER | /gemini/db/driver | pdo_mysql | The database driver to use | -| GEMINI_DB_HOST | /gemini/db/host | database | The database host | -| GEMINI_DB_NAME | /gemini/db/name | gemini | The database name | -| GEMINI_DB_PASSWORD | /gemini/db/password | password | The database user password | -| GEMINI_DB_PORT | /gemini/db/port | 3306 | The database port | -| GEMINI_DB_ROOT_PASSWORD | /gemini/db/root/password | password | The root user password (used to create the database / user) | -| GEMINI_DB_ROOT_USER | /gemini/db/root/user | root | The root user (used to create the database / user) | -| GEMINI_DB_USER | /gemini/db/user | gemini | The user to create / use when interacting with the database | -| GEMINI_FCREPO_URL | /gemini/fcrepo/url | fcrepo/fcrepo/rest | Fcrepo Rest API URL | -| GEMINI_LOG_LEVEL | /gemini/log/level | debug | Log level. Possible Values: debug, info, notice, warning, error, critical, alert, emergency, none | - -[Gemini]: https://github.com/Islandora/Crayfish/tree/main/Gemini diff --git a/gemini/rootfs/etc/confd/conf.d/config.yaml.toml b/gemini/rootfs/etc/confd/conf.d/config.yaml.toml deleted file mode 100644 index d6d186a0..00000000 --- a/gemini/rootfs/etc/confd/conf.d/config.yaml.toml +++ /dev/null @@ -1,7 +0,0 @@ -[template] -src = "config.yaml.tmpl" -dest = "/var/www/crayfish/Gemini/cfg/config.yaml" -uid = 100 -gid = 101 -mode = "0644" -keys = [ "/log/level", "/db", "/fcrepo" ] diff --git a/gemini/rootfs/etc/confd/conf.d/setup-environment.sh.toml b/gemini/rootfs/etc/confd/conf.d/setup-environment.sh.toml deleted file mode 100644 index d7fc515b..00000000 --- a/gemini/rootfs/etc/confd/conf.d/setup-environment.sh.toml +++ /dev/null @@ -1,7 +0,0 @@ -[template] -src = "setup-environment.sh.tmpl" -dest = "/var/run/islandora/setup-environment.sh" -uid = 0 -gid = 0 -mode = "0700" -keys = [ "/" ] diff --git a/gemini/rootfs/etc/confd/confd.toml b/gemini/rootfs/etc/confd/confd.toml deleted file mode 100644 index fa30a27d..00000000 --- a/gemini/rootfs/etc/confd/confd.toml +++ /dev/null @@ -1,6 +0,0 @@ -backend = "env" -confdir = "/etc/confd" -log-level = "debug" -interval = 600 -noop = false -prefix = "/gemini" diff --git a/gemini/rootfs/etc/confd/templates/config.yaml.tmpl b/gemini/rootfs/etc/confd/templates/config.yaml.tmpl deleted file mode 100644 index c04a6917..00000000 --- a/gemini/rootfs/etc/confd/templates/config.yaml.tmpl +++ /dev/null @@ -1,24 +0,0 @@ ---- -debug: True -fedora_resource: - base_url: {{ getv "/fcrepo/url" "http://fcrepo/fcrepo/rest" }} -log: - # Valid log levels are: - # debug, info, notice, warning, error, critical, alert, emergency, none - type: stream - file: "php://stderr" - level: {{ getv "/log/level" "debug" }} -syn: - # toggles JWT security for service - enable: true - # Path to the syn config file for authentication. - # example can be found here: - # https://github.com/Islandora/Syn/blob/main/conf/syn-settings.example.xml - config: /var/www/crayfish/syn-settings.xml -db.options: - driver: {{ getv "/db/driver" "pdo_mysql" }} - host: {{ getv "/db/host" "mariadb" }} - port: {{ getv "/db/port" "3306" }} - dbname: {{ getv "/db/name" "gemini" }} - user: {{ getv "/db/user" "gemini" }} - password: {{ getv "/db/password" "password" }} diff --git a/gemini/rootfs/etc/confd/templates/setup-environment.sh.tmpl b/gemini/rootfs/etc/confd/templates/setup-environment.sh.tmpl deleted file mode 100644 index dc85e1b8..00000000 --- a/gemini/rootfs/etc/confd/templates/setup-environment.sh.tmpl +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/execlineb -P -# -*- mode: sh -*- -# vi: set ft=sh: -with-contenv -foreground { - # We add / update the environment defined for the container, - # this allows our other initialization and service scripts - # use these settings; but does not change the existing - # environment as seen by linked containers. - # Variables can only be seen when using '#!/usr/bin/with-contenv' - s6-env -i - GEMINI_DB_DRIVER="{{ getv "/db/driver" "pdo_mysql" }}" - GEMINI_DB_HOST="{{ getv "/db/host" "mariadb" }}" - GEMINI_DB_NAME="{{ getv "/db/name" "gemini" }}" - GEMINI_DB_PASSWORD="{{ getv "/db/password" "password" }}" - GEMINI_DB_PORT="{{ getv "/db/port" "3306" }}" - GEMINI_DB_ROOT_PASSWORD="{{ getv "/db/root/password" "password" }}" - GEMINI_DB_ROOT_USER="{{ getv "/db/root/user" "root" }}" - GEMINI_DB_USER="{{ getv "/db/user" "gemini" }}" - s6-dumpenv -- /var/run/s6/container_environment -} diff --git a/gemini/rootfs/etc/cont-init.d/03-gemini-setup.sh b/gemini/rootfs/etc/cont-init.d/03-gemini-setup.sh deleted file mode 100755 index 60d5897d..00000000 --- a/gemini/rootfs/etc/cont-init.d/03-gemini-setup.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/with-contenv bash -set -e - -function execute_sql_file { - execute-sql-file.sh \ - --driver "${GEMINI_DB_DRIVER}" \ - --host "${GEMINI_DB_HOST}" \ - --port "${GEMINI_DB_PORT}" \ - --user "${GEMINI_DB_ROOT_USER}" \ - --password "${GEMINI_DB_ROOT_PASSWORD}" \ - "${@}" -} - -function mysql_query { - cat <<- EOF --- Create gemini database in mariadb or mysql. -CREATE DATABASE IF NOT EXISTS ${GEMINI_DB_NAME} CHARACTER SET utf8 COLLATE utf8_general_ci; - -CREATE TABLE IF NOT EXISTS ${GEMINI_DB_NAME}.Gemini ( - id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, - drupal VARCHAR(2048) NOT NULL UNIQUE, - fedora VARCHAR(2048) NOT NULL UNIQUE -) ENGINE=InnoDB; - --- Create gemini user and grant rights. -CREATE USER IF NOT EXISTS '${GEMINI_DB_USER}'@'%' IDENTIFIED BY '${GEMINI_DB_PASSWORD}'; -GRANT ALL PRIVILEGES ON ${GEMINI_DB_NAME}.* to '${GEMINI_DB_USER}'@'%'; -FLUSH PRIVILEGES; - --- Update gemini user password if changed. -SET PASSWORD FOR ${GEMINI_DB_USER}@'%' = PASSWORD('${GEMINI_DB_PASSWORD}') -EOF -} - -function mysql_create_database { - execute_sql_file <(mysql_query) -} - -function postgres_query { - cat <<- EOF -BEGIN; - -DO \$\$ -BEGIN - IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '${GEMINI_DB_USER}') THEN - CREATE ROLE ${GEMINI_DB_USER}; - END IF; -END -\$\$; - -ALTER ROLE ${GEMINI_DB_USER} WITH LOGIN; -ALTER USER ${GEMINI_DB_USER} PASSWORD '${GEMINI_DB_PASSWORD}'; - -ALTER DATABASE ${GEMINI_DB_NAME} OWNER TO ${GEMINI_DB_USER}; -GRANT ALL PRIVILEGES ON DATABASE ${GEMINI_DB_NAME} TO ${GEMINI_DB_USER}; - -CREATE TABLE IF NOT EXISTS -Gemini ( - id SERIAL PRIMARY KEY, - drupal VARCHAR(2048) NOT NULL UNIQUE, - fedora VARCHAR(2048) NOT NULL UNIQUE -); -ALTER TABLE Gemini OWNER TO ${GEMINI_DB_USER}; - -COMMIT; -EOF -} - -function postgresql_database_exists { - execute_sql_file --database "${GEMINI_DB_NAME}" <(echo 'select 1') -} - -function postgresql_create_database { - # Postgres does not support CREATE DATABASE IF NOT EXISTS so split our logic across multiple queries. - if ! postgresql_database_exists; then - execute_sql_file <(echo "CREATE DATABASE ${GEMINI_DB_NAME}") - fi - execute_sql_file --database "${GEMINI_DB_NAME}" <(postgres_query) -} - -function create_database { - case "${GEMINI_DB_DRIVER}" in - mysql|pdo_mysql) - mysql_create_database - ;; - pgsql|postgresql|pdo_pgsql) - postgresql_create_database - ;; - *) - echo "Only MySQL/PostgresSQL databases are supported for now." >&2 - exit 1 - esac -} - -function run_migrations { - php bin/console --no-interaction migrations:migrate -} - -function main { - create_database - run_migrations -} -main diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 8759e599..736d1363 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -27,6 +27,7 @@ RUN --mount=type=cache,target=/var/cache/apk \ php7-tokenizer \ php7-xml \ php7-xmlwriter \ + php7-xmlreader \ php7-xsl \ && \ cleanup.sh From d0624e8dcdadcc4f0a37d1d19ec44dbbf2f62c8e Mon Sep 17 00:00:00 2001 From: dannylamb Date: Thu, 14 Jan 2021 14:46:31 -0400 Subject: [PATCH 03/20] Undoing some wrong things i did --- drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl | 4 ++-- drupal/rootfs/etc/islandora/utilities.sh | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl b/drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl index 4bc99445..48f3aab7 100644 --- a/drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl +++ b/drupal/rootfs/etc/confd/templates/setup-environment.sh.tmpl @@ -22,7 +22,7 @@ multisubstitute define ACCOUNT_EMAIL "webmaster@localhost.com" define ACCOUNT_NAME "admin" define ACCOUNT_PASSWORD "password" - define CONFIGDIR "/var/www/drupal/config/sync" + define CONFIGDIR "" define DB_DRIVER "mysql" define DB_HOST "mariadb" define DB_NAME "drupal_default" @@ -33,7 +33,7 @@ multisubstitute define DB_USER "drupal_default" define EMAIL "webmaster@localhost.com" define INSTALL "true" - define INSTALL_EXISTING_CONFIG "true" + define INSTALL_EXISTING_CONFIG "false" define LOCALE "en" define NAME "Default" define PROFILE "standard" diff --git a/drupal/rootfs/etc/islandora/utilities.sh b/drupal/rootfs/etc/islandora/utilities.sh index 87412102..eee47dc6 100755 --- a/drupal/rootfs/etc/islandora/utilities.sh +++ b/drupal/rootfs/etc/islandora/utilities.sh @@ -360,13 +360,10 @@ function configure_islandora_module { local broker_host=$(drupal_site_env "${site}" "BROKER_HOST") local broker_port=$(drupal_site_env "${site}" "BROKER_PORT") local broker_url="tcp://${broker_host}:${broker_port}" - local gemini_host=$(drupal_site_env "${site}" "GEMINI_HOST") - local gemini_port=$(drupal_site_env "${site}" "GEMINI_PORT") - local gemini_url="http://${gemini_host}:${gemini_port}" + drush -l "${site_url}" -y pm:enable islandora drush -l "${site_url}" -y config:set --input-format=yaml jsonld.settings remove_jsonld_format true drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings broker_url "${broker_url}" - drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_url "${gemini_url}" drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_pseudo_bundles.0 "islandora_object:node" drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_pseudo_bundles.1 "image:media" drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_pseudo_bundles.2 "file:media" @@ -457,6 +454,7 @@ function configure_matomo_module { local matomo_url=$(drupal_site_env "${site}" "MATOMO_URL") local matomo_http_url="http${matomo_url#https}" + drush -l "${site_url}" -y pm:enable matomo drush -l "${site_url}" -y config-set matomo.settings site_id "${site_id}" drush -l "${site_url}" -y config-set matomo.settings url_http "${matomo_http_url}" drush -l "${site_url}" -y config-set matomo.settings url_https "${matomo_url}" From d82cb7e350a7d5c34d9d64bfce2650add71edd50 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Thu, 14 Jan 2021 15:14:14 -0400 Subject: [PATCH 04/20] Facepalming on no /rootfs --- demo/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/demo/Dockerfile b/demo/Dockerfile index d29b6bd7..cb3d4929 100644 --- a/demo/Dockerfile +++ b/demo/Dockerfile @@ -34,5 +34,3 @@ RUN --mount=type=cache,target=/root/.composer/cache \ FROM local/drupal:latest COPY --chown=nginx:nginx --from=composer /var/www/drupal /var/www/drupal - -COPY rootfs / From bddbdd6db53f78b383ef363b67df7f4e8cd76aba Mon Sep 17 00:00:00 2001 From: dannylamb Date: Tue, 19 Jan 2021 10:27:38 -0400 Subject: [PATCH 05/20] Updating islandora-sandbox --- demo/Dockerfile | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/demo/Dockerfile b/demo/Dockerfile index cb3d4929..93ad9b10 100644 --- a/demo/Dockerfile +++ b/demo/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:experimental FROM local/nginx:latest as composer -ARG COMMIT=4460371c93d0dea87211d965b23242f412369ac3 +ARG COMMIT=689a70347a1f7cc442a3aa211c5c9272c3db0750 # Islandora based Drupal install. RUN --mount=type=cache,target=/root/.composer/cache \ @@ -25,6 +25,34 @@ RUN --mount=type=cache,target=/root/.composer/cache \ download.sh --url "${PDFJS_URL}" --sha256 "${PDFJS_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ mkdir -p /var/www/drupal/web/libraries/pdf.js && \ unzip "${DOWNLOAD_CACHE_DIRECTORY}/${PDFJS_FILE}" -d /var/www/drupal/web/libraries/pdf.js && \ + # Views Slideshow Dependencies + ## jquery.cycle + JQUERY_CYCLE_FILE="jquery.cycle.all.js" && \ + JQUERY_CYCLE_URL="https://malsup.github.io/${JQUERY_CYCLE_FILE}" && \ + JQUERY_CYCLE_SHA256="58b44d975e1e1f0664d0fb8ab5b2918d08e9497324a021aa93de5894cdb586d4" && \ + mkdir -p /var/www/drupal/web/libraries/jquery.cycle && \ + download.sh --url "${JQUERY_CYCLE_URL}" --sha256 "${JQUERY_CYCLE_SHA256}" /var/www/drupal/web/libraries/jquery.cycle && \ + ## jquery.hoverIntent + JQUERY_HOVER_INTENT_FILE="jquery.hoverIntent.js" && \ + JQUERY_HOVER_INTENT_URL="https://github.com/raw/briancherne/jquery-hoverIntent/master/${JQUERY_HOVER_INTENT_FILE}" && \ + JQUERY_HOVER_INTENT_SHA256="65f5f7e1298fe71f10290f4068df30b38a5df0106d6feb63210ddabcc67c3e59" && \ + download.sh --url "${JQUERY_HOVER_INTENT_URL}" --sha256 "${JQUERY_HOVER_INTENT_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ + mkdir -p /var/www/drupal/web/libraries/jquery.hoverIntent && \ + cp "${DOWNLOAD_CACHE_DIRECTORY}/${JQUERY_HOVER_INTENT_FILE}" /var/www/drupal/web/libraries/jquery.hoverIntent && \ + ## jquery.pause + JQUERY_PAUSE_FILE="jquery.pause.js" && \ + JQUERY_PAUSE_URL="https://github.com/raw/tobia/Pause/master/${JQUERY_PAUSE_FILE}" && \ + JQUERY_PAUSE_SHA256="39505a2a9fe36fce5b987f6804723d323ac86d0ed7220a5c12094f1d698fce33" && \ + download.sh --url "${JQUERY_PAUSE_URL}" --sha256 "${JQUERY_PAUSE_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ + mkdir -p /var/www/drupal/web/libraries/jquery.pause && \ + cp "${DOWNLOAD_CACHE_DIRECTORY}/${JQUERY_PAUSE_FILE}" /var/www/drupal/web/libraries/jquery.pause && \ + ## json2 + JSON2_FILE="jquery.pause.js" && \ + JSON2_URL="https://github.com/raw/tobia/Pause/master/${JSON2_FILE}" && \ + JSON2_SHA256="39505a2a9fe36fce5b987f6804723d323ac86d0ed7220a5c12094f1d698fce33" && \ + download.sh --url "${JSON2_URL}" --sha256 "${JSON2_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ + mkdir -p /var/www/drupal/web/libraries/json2 && \ + cp "${DOWNLOAD_CACHE_DIRECTORY}/${JSON2_FILE}" /var/www/drupal/web/libraries/json2 && \ # Openseadragon mkdir -p /var/www/drupal/web/sites/default/files/library-definitions && \ cp /var/www/drupal/web/modules/contrib/openseadragon/openseadragon.json /var/www/drupal/web/sites/default/files/library-definitions && \ From 82557c121a0b472a9e30c715547925ac64f3cdae Mon Sep 17 00:00:00 2001 From: dannylamb Date: Tue, 19 Jan 2021 11:08:23 -0400 Subject: [PATCH 06/20] Updating islandora-sandbox --- demo/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/Dockerfile b/demo/Dockerfile index 93ad9b10..e4a82cdd 100644 --- a/demo/Dockerfile +++ b/demo/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:experimental FROM local/nginx:latest as composer -ARG COMMIT=689a70347a1f7cc442a3aa211c5c9272c3db0750 +ARG COMMIT=6e9976b156e109cd87c5398afdd9786a16b0773a # Islandora based Drupal install. RUN --mount=type=cache,target=/root/.composer/cache \ From bf3ee861b81e59904c0af8c18dd955d78f29fd58 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Thu, 28 Jan 2021 11:39:51 -0400 Subject: [PATCH 07/20] Fedora 6! --- crayfish/Dockerfile | 2 +- drupal/rootfs/etc/nginx/conf.d/default.conf | 10 +- fcrepo6/.dockerignore | 1 + fcrepo6/Dockerfile | 38 +++++++ fcrepo6/README.md | 62 +++++++++++ .../conf.d/allowed-external-content.txt.toml | 7 ++ .../rootfs/etc/confd/conf.d/context.xml.toml | 7 ++ .../rootfs/etc/confd/conf.d/public.key.toml | 7 ++ .../rootfs/etc/confd/conf.d/setenv.sh.toml | 7 ++ .../confd/conf.d/setup-environment.sh.toml | 7 ++ .../etc/confd/conf.d/syn-settings.xml.toml | 7 ++ fcrepo6/rootfs/etc/confd/confd.toml | 6 ++ .../allowed-external-content.txt.tmpl | 2 + .../etc/confd/templates/context.xml.tmpl | 10 ++ .../etc/confd/templates/public.key.tmpl | 9 ++ .../rootfs/etc/confd/templates/setenv.sh.tmpl | 15 +++ .../confd/templates/setup-environment.sh.tmpl | 25 +++++ .../etc/confd/templates/syn-settings.xml.tmpl | 6 ++ .../rootfs/etc/cont-init.d/03-fcrepo-setup.sh | 101 ++++++++++++++++++ .../etc/confd/templates/config.yaml.tmpl | 2 + 20 files changed, 325 insertions(+), 6 deletions(-) create mode 100644 fcrepo6/.dockerignore create mode 100644 fcrepo6/Dockerfile create mode 100644 fcrepo6/README.md create mode 100644 fcrepo6/rootfs/etc/confd/conf.d/allowed-external-content.txt.toml create mode 100644 fcrepo6/rootfs/etc/confd/conf.d/context.xml.toml create mode 100644 fcrepo6/rootfs/etc/confd/conf.d/public.key.toml create mode 100644 fcrepo6/rootfs/etc/confd/conf.d/setenv.sh.toml create mode 100644 fcrepo6/rootfs/etc/confd/conf.d/setup-environment.sh.toml create mode 100644 fcrepo6/rootfs/etc/confd/conf.d/syn-settings.xml.toml create mode 100644 fcrepo6/rootfs/etc/confd/confd.toml create mode 100644 fcrepo6/rootfs/etc/confd/templates/allowed-external-content.txt.tmpl create mode 100644 fcrepo6/rootfs/etc/confd/templates/context.xml.tmpl create mode 100644 fcrepo6/rootfs/etc/confd/templates/public.key.tmpl create mode 100644 fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl create mode 100644 fcrepo6/rootfs/etc/confd/templates/setup-environment.sh.tmpl create mode 100644 fcrepo6/rootfs/etc/confd/templates/syn-settings.xml.tmpl create mode 100755 fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh diff --git a/crayfish/Dockerfile b/crayfish/Dockerfile index 9b325eb1..98a57b9f 100644 --- a/crayfish/Dockerfile +++ b/crayfish/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:experimental FROM local/nginx:latest -ARG COMMIT=4d13cae3e370cd82fa998fb3be9c3914bd5081e0 +ARG COMMIT=71129982975b44f45a87995420e5a778ef403ede RUN --mount=id=downloads,type=cache,target=/opt/downloads \ DOWNLOAD_CACHE_DIRECTORY="/opt/downloads" && \ diff --git a/drupal/rootfs/etc/nginx/conf.d/default.conf b/drupal/rootfs/etc/nginx/conf.d/default.conf index 78706baa..2926e0e6 100644 --- a/drupal/rootfs/etc/nginx/conf.d/default.conf +++ b/drupal/rootfs/etc/nginx/conf.d/default.conf @@ -14,6 +14,11 @@ server { access_log off; } + # Allow access to .txt files in site files directory + location ~ ^/sites/[^/]+/files/.*\.txt$ { + allow all; + } + # Very rarely should these ever be accessed outside of your lan location ~* \.(txt|log)$ { allow 192.168.0.0/16; @@ -33,11 +38,6 @@ server { deny all; } - # Allow access to .txt files in site files directory - location ~ ^/sites/[^/]+/files/.*\.txt$ { - allow all; - } - # Allow "Well-Known URIs" as per RFC 5785 location ~* ^/.well-known/ { allow all; diff --git a/fcrepo6/.dockerignore b/fcrepo6/.dockerignore new file mode 100644 index 00000000..b43bf86b --- /dev/null +++ b/fcrepo6/.dockerignore @@ -0,0 +1 @@ +README.md diff --git a/fcrepo6/Dockerfile b/fcrepo6/Dockerfile new file mode 100644 index 00000000..2b3a55c8 --- /dev/null +++ b/fcrepo6/Dockerfile @@ -0,0 +1,38 @@ +# syntax=docker/dockerfile:experimental +FROM local/tomcat:latest + +RUN --mount=id=downloads,type=cache,target=/opt/downloads \ + apk-install.sh openjdk11 && \ + DOWNLOAD_CACHE_DIRECTORY="/opt/downloads" && \ + FCREPO_VERSION="6.0.0-alpha-2" && \ + FCREPO_FILE="fcrepo-webapp-${FCREPO_VERSION}.war" && \ + FCREPO_URL="https://github.com/fcrepo/fcrepo/releases/download/fcrepo-${FCREPO_VERSION}/${FCREPO_FILE}" && \ + FCREPO_SHA256="815415a15c607c74c47e18e83180b2a45b11fef47d59105dfabb7ef9ef1a5fbf" && \ + download.sh --url "${FCREPO_URL}" --sha256 "${FCREPO_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ + install-war-into-tomcat.sh --name "fcrepo" --file "${DOWNLOAD_CACHE_DIRECTORY}/${FCREPO_FILE}" && \ + SYN_VERSION="1.1.0" && \ + SYN_FILE="islandora-syn-${SYN_VERSION}-all.jar" && \ + SYN_URL="https://github.com/Islandora-CLAW/Syn/releases/download/v${SYN_VERSION}/${SYN_FILE}" && \ + SYN_SHA256="bcad5f872930b1bcc9ea4a176c60e22683297121357336769a21ead9fadcbbd5" && \ + download.sh --url "${SYN_URL}" --sha256 "${SYN_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ + cp "${DOWNLOAD_CACHE_DIRECTORY}/${SYN_FILE}" /opt/tomcat/lib && \ + IMPORT_EXPORT_VERSION="1.0.0" && \ + IMPORT_EXPORT_FILE="fcrepo-import-export-${IMPORT_EXPORT_VERSION}.jar" && \ + IMPORT_EXPORT_URL="https://github.com/fcrepo-exts/fcrepo-import-export/releases/download/fcrepo-import-export-${IMPORT_EXPORT_VERSION}/${IMPORT_EXPORT_FILE}" && \ + IMPORT_EXPORT_SHA256="f3103ce03b9ee9e38cf0a762d7b4194fd6c20fa72e19ed7e811ac5de4b890062" && \ + download.sh --url "${IMPORT_EXPORT_URL}" --sha256 "${IMPORT_EXPORT_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ + cp "${DOWNLOAD_CACHE_DIRECTORY}/${IMPORT_EXPORT_FILE}" /opt/tomcat && \ + UPGRADE_UTILS_VERSION="6.0.0-alpha-2" && \ + UPGRADE_UTILS_FILE="fcrepo-upgrade-utils-${UPGRADE_UTILS_VERSION}.jar" && \ + UPGRADE_UTILS_URL="https://github.com/fcrepo-exts/fcrepo-upgrade-utils/releases/download/fcrepo-upgrade-utils-${UPGRADE_UTILS_VERSION}/${UPGRADE_UTILS_FILE}" && \ + UPGRADE_UTILS_SHA256="b073779538c69e908981646c2262d8261d16ddc52e726e7475b92af02590e300" && \ + download.sh --url "${UPGRADE_UTILS_URL}" --sha256 "${UPGRADE_UTILS_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ + cp "${DOWNLOAD_CACHE_DIRECTORY}/${UPGRADE_UTILS_FILE}" /opt/tomcat && \ + mkdir -p /opt/keys/jwt && \ + chown tomcat:tomcat /opt/keys/jwt && \ + mkdir /data && \ + chown tomcat:tomcat /data && \ + chown -R tomcat:tomcat /opt/tomcat && \ + cleanup.sh + +COPY rootfs / diff --git a/fcrepo6/README.md b/fcrepo6/README.md new file mode 100644 index 00000000..8056b8a7 --- /dev/null +++ b/fcrepo6/README.md @@ -0,0 +1,62 @@ +# Fcrepo + +Docker image for [Fcrepo] version 5.1.0. + +Please refer to the [Fcrepo Documentation] for more in-depth information. + +As a quick example this will bring up an instance of [Fcrepo], and allow you +to view on . + +```bash +docker run --rm -ti -p 80:80 islandora/fcrepo +``` + +## Dependencies + +Requires `islandora/tomcat` docker image to build. Please refer to the +[Tomcat Image README](../tomcat/README.md) for additional information including +additional settings, volumes, ports, etc. + +## Volumes + +| Path | Description | +| :---- | :-------------------------------------------------------------------------------------------------- | +| /data | Fcrepo Object / Binary Store if FCREPO_BINARYSTORAGE_TYPE or FCREPO_PERSISTENCE_TYPE is set to file | + +## Settings + +| Environment Variable | Etcd Key | Default | Description | +| :----------------------------- | :------------------------------ | :-------------------------------- | :---------- | +| FCREPO_ACTIVEMQ_BROKER | /fcrepo/activemq/broker | tcp://activemq:61616 | | +| FCREPO_ACTIVEMQ_QUEUE | /fcrepo/activemq/queue | fedora | | +| FCREPO_ACTIVEMQ_TOPIC | /fcrepo/activemq/topic | fedora | | +| FCREPO_BINARYSTORAGE_TYPE | /fcrepo/binarystorage/type | file | | +| FCREPO_CATALINA_OPTS | /fcrepo/catalina/opts | | | +| FCREPO_DB_HOST | /fcrepo/db/host | mariadb | | +| FCREPO_DB_NAME | /fcrepo/db/name | fcrepo | | +| FCREPO_DB_PASSWORD | /fcrepo/db/password | password | | +| FCREPO_DB_PORT | /fcrepo/db/port | 3306 | | +| FCREPO_DB_ROOT_PASSWORD | /fcrepo/db/root/password | password | | +| FCREPO_DB_ROOT_USER | /fcrepo/db/root/user | root | | +| FCREPO_DB_USER | /fcrepo/db/user | fcrepo | | +| FCREPO_JAVA_OPTS | /fcrepo/java/opts | | | +| FCREPO_JWT_ADMIN_TOKEN | /fcrepo/jwt/admin/token | islandora | | +| FCREPO_MODESHAPE_CONFIGURATION | /fcrepo/modeshape/configuration | classpath:/config/repository.json | | +| FCREPO_PERSISTENCE_TYPE | /fcrepo/persistence/type | file | | +| FCREPO_QUEUE | /fcrepo/queue | fedora | | +| FCREPO_S3_BUCKET | /fcrepo/s3/bucket | | | +| FCREPO_S3_PASSWORD | /fcrepo/s3/password | | | +| FCREPO_S3_USER | /fcrepo/s3/user | | | +| FCREPO_TOPIC | /fcrepo/topic | fedora | | + +To allow +[external content](https://wiki.lyrasis.org/display/FEDORA51/External+Content) +provide sites as key pairs. Wherein multiple values is the url and the 'name' is +a key that replaces the '*' symbol below. + +| Environment Variable | Etcd Key | +| :---------------------- | :----------------------- | +| FCREPO_ALLOW_EXTERNAL_* | /fcrepo/allow/external/* | + +[Fcrepo Documentation]: https://wiki.lyrasis.org/display/FF +[Fcrepo]: https://github.com/fcrepo4/fcrepo4 diff --git a/fcrepo6/rootfs/etc/confd/conf.d/allowed-external-content.txt.toml b/fcrepo6/rootfs/etc/confd/conf.d/allowed-external-content.txt.toml new file mode 100644 index 00000000..0688c9f6 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/conf.d/allowed-external-content.txt.toml @@ -0,0 +1,7 @@ +[template] +src = "allowed-external-content.txt.tmpl" +dest = "/opt/tomcat/conf/allowed-external-content.txt" +uid = 100 +gid = 1000 +mode = "0640" +keys = [ "/allow/external" ] diff --git a/fcrepo6/rootfs/etc/confd/conf.d/context.xml.toml b/fcrepo6/rootfs/etc/confd/conf.d/context.xml.toml new file mode 100644 index 00000000..746afa81 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/conf.d/context.xml.toml @@ -0,0 +1,7 @@ +[template] +src = "context.xml.tmpl" +dest = "/opt/tomcat/conf/context.xml" +uid = 100 +gid = 1000 +mode = "0640" +keys = [ "/" ] diff --git a/fcrepo6/rootfs/etc/confd/conf.d/public.key.toml b/fcrepo6/rootfs/etc/confd/conf.d/public.key.toml new file mode 100644 index 00000000..ec9810ec --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/conf.d/public.key.toml @@ -0,0 +1,7 @@ +[template] +src = "public.key.tmpl" +dest = "/opt/keys/jwt/public.key" +uid = 100 +gid = 1000 +mode = "0600" +keys = [ "/jwt" ] diff --git a/fcrepo6/rootfs/etc/confd/conf.d/setenv.sh.toml b/fcrepo6/rootfs/etc/confd/conf.d/setenv.sh.toml new file mode 100644 index 00000000..d27eb375 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/conf.d/setenv.sh.toml @@ -0,0 +1,7 @@ +[template] +src = "setenv.sh.tmpl" +dest = "/opt/tomcat/bin/setenv.sh" +uid = 100 +gid = 1000 +mode = "0655" +keys = [ "/" ] diff --git a/fcrepo6/rootfs/etc/confd/conf.d/setup-environment.sh.toml b/fcrepo6/rootfs/etc/confd/conf.d/setup-environment.sh.toml new file mode 100644 index 00000000..d7fc515b --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/conf.d/setup-environment.sh.toml @@ -0,0 +1,7 @@ +[template] +src = "setup-environment.sh.tmpl" +dest = "/var/run/islandora/setup-environment.sh" +uid = 0 +gid = 0 +mode = "0700" +keys = [ "/" ] diff --git a/fcrepo6/rootfs/etc/confd/conf.d/syn-settings.xml.toml b/fcrepo6/rootfs/etc/confd/conf.d/syn-settings.xml.toml new file mode 100644 index 00000000..58529b7e --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/conf.d/syn-settings.xml.toml @@ -0,0 +1,7 @@ +[template] +src = "syn-settings.xml.tmpl" +dest = "/opt/tomcat/conf/syn-settings.xml" +uid = 100 +gid = 1000 +mode = "0655" +keys = [ "/jwt/admin/token" ] diff --git a/fcrepo6/rootfs/etc/confd/confd.toml b/fcrepo6/rootfs/etc/confd/confd.toml new file mode 100644 index 00000000..68d47055 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/confd.toml @@ -0,0 +1,6 @@ +backend = "env" +confdir = "/etc/confd" +log-level = "debug" +interval = 600 +noop = false +prefix = "/fcrepo" diff --git a/fcrepo6/rootfs/etc/confd/templates/allowed-external-content.txt.tmpl b/fcrepo6/rootfs/etc/confd/templates/allowed-external-content.txt.tmpl new file mode 100644 index 00000000..d99f9fb5 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/templates/allowed-external-content.txt.tmpl @@ -0,0 +1,2 @@ +http://drupal/ +{{ range gets "/allow/external/*" }}{{.Value}}{{ end }} diff --git a/fcrepo6/rootfs/etc/confd/templates/context.xml.tmpl b/fcrepo6/rootfs/etc/confd/templates/context.xml.tmpl new file mode 100644 index 00000000..f7f2171a --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/templates/context.xml.tmpl @@ -0,0 +1,10 @@ + + + + + WEB-INF/web.xml + ${catalina.base}/conf/web.xml +{{ if eq (getv "/disable/syn" "false") "false" }} + +{{ end }} + diff --git a/fcrepo6/rootfs/etc/confd/templates/public.key.tmpl b/fcrepo6/rootfs/etc/confd/templates/public.key.tmpl new file mode 100644 index 00000000..e0e8e191 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/templates/public.key.tmpl @@ -0,0 +1,9 @@ +{{ getv "/jwt/public/key" `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6uK3nozywVaRCAB3FHdR +ZNHunSZvN/c31QimZAqQMGxj7JrGh1LF8JRX+XAQ+CJcPD9r6xXjKSS1Gqa2Os2w +ARr/9abIwG5QeNsrJ8GMt3Z/WICnNeaFAkUVviwKWcA61iFJWvTDAuI0hCaxArRK +sk0BfFSMh+4u3JAdD9tUxUx6AAUXUCdtPyluaBd53wuB0r9xRlPnDw6I9QHfKK80 +Xrrsu1PYATgrsy69stzCln3KlO5Oxc6O8OjMdjC2D2c3HmsO4CKPvvaVuaow/a9P +a3SNje4UXN+/1xUfQskxafP8CKVSr8xxtwzSureiskb5/98moAiutpUtp15yyAm0 +rwIDAQAB +-----END PUBLIC KEY-----` }} diff --git a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl new file mode 100644 index 00000000..58517030 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl @@ -0,0 +1,15 @@ +#!/bin/sh +export JAVA_OPTS="{{ getv "/java/opts" "" }}" +export CATALINA_OPTS="{{ getv "/catalina/opts" "" }}" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.home=/data/home" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.jms.baseUrl=http://{{ index (lookupIP (getenv "HOSTNAME")) 0 }}/fcrepo/rest" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.external.content.allowed=/opt/tomcat/conf/allowed-external-content.txt" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.autoversioning.enabled=false" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:{{ getv "/persistance/type" "mariadb" }}://{{ getv "/db/host" "mariadb" }}:{{ getv "/db/port" "3306" }}/fcrepo" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.user={{ getv "/db/user" "fcrepo" }}" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password={{ getv "/db/password" "password" }}" + +{{ if eq (getv "/disable/syn" "false") "true" }} +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" +{{ end }} diff --git a/fcrepo6/rootfs/etc/confd/templates/setup-environment.sh.tmpl b/fcrepo6/rootfs/etc/confd/templates/setup-environment.sh.tmpl new file mode 100644 index 00000000..8af54b04 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/templates/setup-environment.sh.tmpl @@ -0,0 +1,25 @@ +#!/usr/bin/execlineb -P +# -*- mode: sh -*- +# vi: set ft=sh: +with-contenv +foreground { + # We add / update the environment defined for the container, + # this allows our other initialization and service scripts + # use these settings; but does not change the existing + # environment as seen by linked containers. + # Variables can only be seen when using '#!/usr/bin/with-contenv' + s6-env -i + FCREPO_BINARYSTORAGE_TYPE="{{ getv "/binarystorage/type" "file" }}" + FCREPO_DB_HOST="{{ getv "/db/host" "mariadb" }}" + FCREPO_DB_NAME="{{ getv "/db/name" "fcrepo" }}" + FCREPO_DB_PASSWORD="{{ getv "/db/password" "password" }}" + FCREPO_DB_PORT="{{ getv "/db/port" "3306" }}" + FCREPO_DB_ROOT_PASSWORD="{{ getv "/db/root/password" "password" }}" + FCREPO_DB_ROOT_USER="{{ getv "/db/root/user" "root" }}" + FCREPO_DB_USER="{{ getv "/db/user" "fcrepo" }}" + FCREPO_PERSISTENCE_TYPE="{{ getv "/persistence/type" "file" }}" + FCREPO_S3_BUCKET="{{ getv "/s3/bucket" "" }}" + FCREPO_S3_PASSWORD="{{ getv "/s3/password" "" }}" + FCREPO_S3_USER="{{ getv "/s3/user" "" }}" + s6-dumpenv -- /var/run/s6/container_environment +} diff --git a/fcrepo6/rootfs/etc/confd/templates/syn-settings.xml.tmpl b/fcrepo6/rootfs/etc/confd/templates/syn-settings.xml.tmpl new file mode 100644 index 00000000..e9c912f1 --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/templates/syn-settings.xml.tmpl @@ -0,0 +1,6 @@ + + + + {{ getv "/jwt/admin/token" "islandora" }} + + diff --git a/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh b/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh new file mode 100755 index 00000000..dc3e4ae8 --- /dev/null +++ b/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh @@ -0,0 +1,101 @@ +#!/usr/bin/with-contenv bash +set -e + +function execute_sql_file { + execute-sql-file.sh \ + --driver "${FCREPO_PERSISTENCE_TYPE}" \ + --host "${FCREPO_DB_HOST}" \ + --port "${FCREPO_DB_PORT}" \ + --user "${FCREPO_DB_ROOT_USER}" \ + --password "${FCREPO_DB_ROOT_PASSWORD}" \ + "${@}" +} + +function mysql_query { + cat <<- EOF +-- Create fcrepo database in mariadb or mysql. +CREATE DATABASE IF NOT EXISTS ${FCREPO_DB_NAME} CHARACTER SET utf8 COLLATE utf8_general_ci; + +-- Create fcrepo user and grant rights. +CREATE USER IF NOT EXISTS '${FCREPO_DB_USER}'@'%' IDENTIFIED BY '${FCREPO_DB_PASSWORD}'; +GRANT ALL PRIVILEGES ON ${FCREPO_DB_NAME}.* to '${FCREPO_DB_USER}'@'%'; +FLUSH PRIVILEGES; + +-- Update fcrepo password if changed. +SET PASSWORD FOR ${FCREPO_DB_USER}@'%' = PASSWORD('${FCREPO_DB_PASSWORD}') +EOF +} + +function mysql_create_database { + execute_sql_file <(mysql_query) +} + +function postgres_query { + cat <<- EOF +BEGIN; + +DO \$\$ +BEGIN + IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '${FCREPO_DB_USER}') THEN + CREATE ROLE ${FCREPO_DB_USER}; + END IF; +END +\$\$; + +ALTER ROLE ${FCREPO_DB_USER} WITH LOGIN; +ALTER USER ${FCREPO_DB_USER} PASSWORD '${FCREPO_DB_PASSWORD}'; + +ALTER DATABASE ${FCREPO_DB_NAME} OWNER TO ${FCREPO_DB_USER}; +GRANT ALL PRIVILEGES ON DATABASE ${FCREPO_DB_NAME} TO ${FCREPO_DB_USER}; + +COMMIT; +EOF +} + +function postgresql_database_exists { + execute_sql_file --database "${FCREPO_DB_NAME}" <(echo 'select 1') +} + +function postgresql_create_database { + # Postgres does not support CREATE DATABASE IF NOT EXISTS so split our logic across multiple queries. + if ! postgresql_database_exists; then + execute_sql_file <(echo "CREATE DATABASE ${FCREPO_DB_NAME}") + fi + execute_sql_file --database "${FCREPO_DB_NAME}" <(postgres_query) +} + +function create_database { + case "${FCREPO_PERSISTENCE_TYPE}" in + mysql|pdo_mysql) + mysql_create_database + ;; + pgsql|postgresql|pdo_pgsql) + postgresql_create_database + ;; + *) + echo "Only MySQL/PostgresSQL databases are supported for now." >&2 + exit 1 + esac +} + +# Change log files to redirect to stdout/stderr +function redirect_logs_to_stdout { + ln -sf /dev/stdout /opt/tomcat/logs/velocity.log + chown tomcat:tomcat /opt/tomcat/logs/velocity.log +} + +function requires_database { + [[ "${FCREPO_PERSISTENCE_TYPE}" = "mysql" ]] || [[ "${FCREPO_PERSISTENCE_TYPE}" = "postgresql" ]] +} + +function main { + redirect_logs_to_stdout + if requires_database; then + create_database + fi + + # When bind mounting we need to ensure that we + # actually can write to the folder. + chown tomcat:tomcat /data +} +main diff --git a/milliner/rootfs/etc/confd/templates/config.yaml.tmpl b/milliner/rootfs/etc/confd/templates/config.yaml.tmpl index 578e2e26..33ef3a4d 100644 --- a/milliner/rootfs/etc/confd/templates/config.yaml.tmpl +++ b/milliner/rootfs/etc/confd/templates/config.yaml.tmpl @@ -12,6 +12,8 @@ strip_format_jsonld: true debug: true +fedora6: {{ getv "/fedora6" "false" }} + log: # Valid log levels are: # debug, info, notice, warning, error, critical, alert, emergency, none From cb827c0dd541e75dadba1344d1fab683b0c2e9d2 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Thu, 4 Feb 2021 15:40:28 -0400 Subject: [PATCH 08/20] Updating utilities for local test case --- drupal/rootfs/etc/islandora/utilities.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drupal/rootfs/etc/islandora/utilities.sh b/drupal/rootfs/etc/islandora/utilities.sh index eee47dc6..e66cd29c 100755 --- a/drupal/rootfs/etc/islandora/utilities.sh +++ b/drupal/rootfs/etc/islandora/utilities.sh @@ -361,18 +361,19 @@ function configure_islandora_module { local broker_port=$(drupal_site_env "${site}" "BROKER_PORT") local broker_url="tcp://${broker_host}:${broker_port}" - drush -l "${site_url}" -y pm:enable islandora + drush -l "${site_url}" -y pm:enable islandora_core_feature drush -l "${site_url}" -y config:set --input-format=yaml jsonld.settings remove_jsonld_format true drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings broker_url "${broker_url}" - drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_pseudo_bundles.0 "islandora_object:node" - drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_pseudo_bundles.1 "image:media" - drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_pseudo_bundles.2 "file:media" - drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_pseudo_bundles.3 "audio:media" - drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings gemini_pseudo_bundles.4 "video:media" + + if ! drush -l "${site_url}" role:create fedoraAdmin |& grep -q 'already exists'; then + drush -l "${site_url}" user:role:add fedoraAdmin admin + fi } # After enabling and importing features a number of configurations need to be updated. function configure_islandora_default_module { + if ! drush pml | grep islandora_defaults | grep -q Enabled; then return 0; fi + local site="${1}"; shift local site_url=$(drupal_site_env "${site}" "SITE_URL") local host=$(drupal_site_env "${site}" "SOLR_HOST") @@ -399,6 +400,8 @@ function configure_search_api_solr_module { # Enables and sets carapace as the default theme. function set_carapace_default_theme { + if ! drush pml | grep -q carapace; then return 0; fi + local site="${1}"; shift local site_url=$(drupal_site_env "${site}" "SITE_URL") drush -l "${site_url}" -y theme:enable carapace @@ -448,13 +451,14 @@ function create_solr_core_with_default_config { # Install matomo and configure. function configure_matomo_module { + if ! drush pml | grep matomo | grep -q Enabled; then return 0; fi + local site="${1}"; shift local site_url=$(drupal_site_env "${site}" "SITE_URL") local site_id=$(($(site_index "${site}")+1)) local matomo_url=$(drupal_site_env "${site}" "MATOMO_URL") local matomo_http_url="http${matomo_url#https}" - drush -l "${site_url}" -y pm:enable matomo drush -l "${site_url}" -y config-set matomo.settings site_id "${site_id}" drush -l "${site_url}" -y config-set matomo.settings url_http "${matomo_http_url}" drush -l "${site_url}" -y config-set matomo.settings url_https "${matomo_url}" @@ -462,6 +466,8 @@ function configure_matomo_module { # Configure Openseadragon to point use cantaloupe. function configure_openseadragon { + if ! drush pml | grep openseadragon | grep -q Enabled; then return 0; fi + local site="${1}"; shift local site_url=$(drupal_site_env "${site}" "SITE_URL") local cantaloupe_url=$(drupal_site_env "${site}" "CANTALOUPE_URL") From 6055ade254a50f7711790b88ff6c5084a19fb765 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Tue, 9 Feb 2021 13:42:57 -0400 Subject: [PATCH 09/20] Remote activemq with fcrepo6. Reworking the fedoraAdmin permission during init scripts --- drupal/rootfs/etc/islandora/utilities.sh | 8 ++++-- .../rootfs/etc/confd/conf.d/activemq.xml.toml | 7 +++++ .../etc/confd/templates/activemq.xml.tmpl | 28 +++++++++++++++++++ .../rootfs/etc/confd/templates/setenv.sh.tmpl | 2 ++ 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 fcrepo6/rootfs/etc/confd/conf.d/activemq.xml.toml create mode 100644 fcrepo6/rootfs/etc/confd/templates/activemq.xml.tmpl diff --git a/drupal/rootfs/etc/islandora/utilities.sh b/drupal/rootfs/etc/islandora/utilities.sh index e66cd29c..90d590e8 100755 --- a/drupal/rootfs/etc/islandora/utilities.sh +++ b/drupal/rootfs/etc/islandora/utilities.sh @@ -365,9 +365,12 @@ function configure_islandora_module { drush -l "${site_url}" -y config:set --input-format=yaml jsonld.settings remove_jsonld_format true drush -l "${site_url}" -y config:set --input-format=yaml islandora.settings broker_url "${broker_url}" - if ! drush -l "${site_url}" role:create fedoraAdmin |& grep -q 'already exists'; then - drush -l "${site_url}" user:role:add fedoraAdmin admin + if drush -l "${site_url}" role:list | grep -q fedoraadmin; then + echo "Fedora Admin role already exists. No need to create it." + else + drush -l "${site_url}" role:create fedoraadmin fedoraAdmin fi + drush -l "${site_url}" -y user:role:add fedoraadmin admin } # After enabling and importing features a number of configurations need to be updated. @@ -379,7 +382,6 @@ function configure_islandora_default_module { local host=$(drupal_site_env "${site}" "SOLR_HOST") local port=$(drupal_site_env "${site}" "SOLR_PORT") - drush -l "${site_url}" -y user:role:add fedoraadmin admin drush -l "${site_url}" -y config:set search_api.server.default_solr_server backend_config.connector_config.host "${host}" drush -l "${site_url}" -y config:set search_api.server.default_solr_server backend_config.connector_config.port "${port}" } diff --git a/fcrepo6/rootfs/etc/confd/conf.d/activemq.xml.toml b/fcrepo6/rootfs/etc/confd/conf.d/activemq.xml.toml new file mode 100644 index 00000000..258a7fbe --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/conf.d/activemq.xml.toml @@ -0,0 +1,7 @@ +[template] +src = "activemq.xml.tmpl" +dest = "/opt/tomcat/conf/activemq.xml" +uid = 100 +gid = 1000 +mode = "0640" +keys = [ "/activemq" ] diff --git a/fcrepo6/rootfs/etc/confd/templates/activemq.xml.tmpl b/fcrepo6/rootfs/etc/confd/templates/activemq.xml.tmpl new file mode 100644 index 00000000..4ec3ccfc --- /dev/null +++ b/fcrepo6/rootfs/etc/confd/templates/activemq.xml.tmpl @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl index 58517030..07dcaec1 100644 --- a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl +++ b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl @@ -9,6 +9,8 @@ export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.autoversioning.enabled=false" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:{{ getv "/persistance/type" "mariadb" }}://{{ getv "/db/host" "mariadb" }}:{{ getv "/db/port" "3306" }}/fcrepo" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.user={{ getv "/db/user" "fcrepo" }}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password={{ getv "/db/password" "password" }}" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.directory=file:///data/home/data/Activemq" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.configuration=file:///opt/tomcat/conf/activemq.xml" {{ if eq (getv "/disable/syn" "false") "true" }} export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" From 298feb2368ce32ac2f1d032e668e54ea4e7b2c86 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Tue, 9 Feb 2021 15:17:03 -0400 Subject: [PATCH 10/20] Re-triggering github action to push new images --- fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl | 1 - 1 file changed, 1 deletion(-) diff --git a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl index 07dcaec1..a150807c 100644 --- a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl +++ b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl @@ -11,7 +11,6 @@ export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.user={{ getv "/db/user" "fcre export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password={{ getv "/db/password" "password" }}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.directory=file:///data/home/data/Activemq" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.configuration=file:///opt/tomcat/conf/activemq.xml" - {{ if eq (getv "/disable/syn" "false") "true" }} export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" {{ end }} From b8ad278356b326f20a623bf5b51a5490ee66c21b Mon Sep 17 00:00:00 2001 From: dannylamb Date: Tue, 16 Feb 2021 11:44:44 -0400 Subject: [PATCH 11/20] Adding in getenvs --- fcrepo/rootfs/opt/tomcat/conf/context.xml | 2 +- .../confd/conf.d/setup-environment.sh.toml | 7 ------ .../etc/confd/templates/activemq.xml.tmpl | 6 ++--- .../etc/confd/templates/public.key.tmpl | 10 +------- .../rootfs/etc/confd/templates/setenv.sh.tmpl | 10 ++++---- .../confd/templates/setup-environment.sh.tmpl | 25 ------------------- .../etc/confd/templates/syn-settings.xml.tmpl | 2 +- .../etc/confd/templates/config.yaml.tmpl | 2 +- 8 files changed, 12 insertions(+), 52 deletions(-) delete mode 100644 fcrepo6/rootfs/etc/confd/conf.d/setup-environment.sh.toml delete mode 100644 fcrepo6/rootfs/etc/confd/templates/setup-environment.sh.tmpl diff --git a/fcrepo/rootfs/opt/tomcat/conf/context.xml b/fcrepo/rootfs/opt/tomcat/conf/context.xml index f7f2171a..ac36dfa1 100644 --- a/fcrepo/rootfs/opt/tomcat/conf/context.xml +++ b/fcrepo/rootfs/opt/tomcat/conf/context.xml @@ -4,7 +4,7 @@ WEB-INF/web.xml ${catalina.base}/conf/web.xml -{{ if eq (getv "/disable/syn" "false") "false" }} +{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN)) "false" }} {{ end }} diff --git a/fcrepo6/rootfs/etc/confd/conf.d/setup-environment.sh.toml b/fcrepo6/rootfs/etc/confd/conf.d/setup-environment.sh.toml deleted file mode 100644 index d7fc515b..00000000 --- a/fcrepo6/rootfs/etc/confd/conf.d/setup-environment.sh.toml +++ /dev/null @@ -1,7 +0,0 @@ -[template] -src = "setup-environment.sh.tmpl" -dest = "/var/run/islandora/setup-environment.sh" -uid = 0 -gid = 0 -mode = "0700" -keys = [ "/" ] diff --git a/fcrepo6/rootfs/etc/confd/templates/activemq.xml.tmpl b/fcrepo6/rootfs/etc/confd/templates/activemq.xml.tmpl index 4ec3ccfc..bee294ec 100644 --- a/fcrepo6/rootfs/etc/confd/templates/activemq.xml.tmpl +++ b/fcrepo6/rootfs/etc/confd/templates/activemq.xml.tmpl @@ -17,10 +17,10 @@ - + - - + + diff --git a/fcrepo6/rootfs/etc/confd/templates/public.key.tmpl b/fcrepo6/rootfs/etc/confd/templates/public.key.tmpl index e0e8e191..5ceb91aa 100644 --- a/fcrepo6/rootfs/etc/confd/templates/public.key.tmpl +++ b/fcrepo6/rootfs/etc/confd/templates/public.key.tmpl @@ -1,9 +1 @@ -{{ getv "/jwt/public/key" `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6uK3nozywVaRCAB3FHdR -ZNHunSZvN/c31QimZAqQMGxj7JrGh1LF8JRX+XAQ+CJcPD9r6xXjKSS1Gqa2Os2w -ARr/9abIwG5QeNsrJ8GMt3Z/WICnNeaFAkUVviwKWcA61iFJWvTDAuI0hCaxArRK -sk0BfFSMh+4u3JAdD9tUxUx6AAUXUCdtPyluaBd53wuB0r9xRlPnDw6I9QHfKK80 -Xrrsu1PYATgrsy69stzCln3KlO5Oxc6O8OjMdjC2D2c3HmsO4CKPvvaVuaow/a9P -a3SNje4UXN+/1xUfQskxafP8CKVSr8xxtwzSureiskb5/98moAiutpUtp15yyAm0 -rwIDAQAB ------END PUBLIC KEY-----` }} +{{ getv "/jwt/public/key" (getenv "JWT_PUBLIC_KEY") }} diff --git a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl index a150807c..1663c354 100644 --- a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl +++ b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl @@ -1,16 +1,16 @@ #!/bin/sh export JAVA_OPTS="{{ getv "/java/opts" "" }}" -export CATALINA_OPTS="{{ getv "/catalina/opts" "" }}" +export CATALINA_OPTS="{{ getv "/catalina/opts" (getenv "FCREPO_CATALINA_OPTS") }}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.home=/data/home" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.jms.baseUrl=http://{{ index (lookupIP (getenv "HOSTNAME")) 0 }}/fcrepo/rest" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.external.content.allowed=/opt/tomcat/conf/allowed-external-content.txt" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.autoversioning.enabled=false" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:{{ getv "/persistance/type" "mariadb" }}://{{ getv "/db/host" "mariadb" }}:{{ getv "/db/port" "3306" }}/fcrepo" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.user={{ getv "/db/user" "fcrepo" }}" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password={{ getv "/db/password" "password" }}" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:{{ getv "/persistance/type" (getenv "FCREPO_PERSISTANCE_TYPE") }}://{{ getv "/db/host" (getenv "FCREPO_DB_HOST") }}:{{ getv "/db/port" (getenv "FCREPO_DB_PORT") }}/fcrepo" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.user={{ getv "/db/user" (getenv "FCREPO_DB_USER") }}" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password={{ getv "/db/password" (getenv "FCREPO_DB_PASSWORD") }}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.directory=file:///data/home/data/Activemq" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.configuration=file:///opt/tomcat/conf/activemq.xml" -{{ if eq (getv "/disable/syn" "false") "true" }} +{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN")) "true" }} export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" {{ end }} diff --git a/fcrepo6/rootfs/etc/confd/templates/setup-environment.sh.tmpl b/fcrepo6/rootfs/etc/confd/templates/setup-environment.sh.tmpl deleted file mode 100644 index 8af54b04..00000000 --- a/fcrepo6/rootfs/etc/confd/templates/setup-environment.sh.tmpl +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/execlineb -P -# -*- mode: sh -*- -# vi: set ft=sh: -with-contenv -foreground { - # We add / update the environment defined for the container, - # this allows our other initialization and service scripts - # use these settings; but does not change the existing - # environment as seen by linked containers. - # Variables can only be seen when using '#!/usr/bin/with-contenv' - s6-env -i - FCREPO_BINARYSTORAGE_TYPE="{{ getv "/binarystorage/type" "file" }}" - FCREPO_DB_HOST="{{ getv "/db/host" "mariadb" }}" - FCREPO_DB_NAME="{{ getv "/db/name" "fcrepo" }}" - FCREPO_DB_PASSWORD="{{ getv "/db/password" "password" }}" - FCREPO_DB_PORT="{{ getv "/db/port" "3306" }}" - FCREPO_DB_ROOT_PASSWORD="{{ getv "/db/root/password" "password" }}" - FCREPO_DB_ROOT_USER="{{ getv "/db/root/user" "root" }}" - FCREPO_DB_USER="{{ getv "/db/user" "fcrepo" }}" - FCREPO_PERSISTENCE_TYPE="{{ getv "/persistence/type" "file" }}" - FCREPO_S3_BUCKET="{{ getv "/s3/bucket" "" }}" - FCREPO_S3_PASSWORD="{{ getv "/s3/password" "" }}" - FCREPO_S3_USER="{{ getv "/s3/user" "" }}" - s6-dumpenv -- /var/run/s6/container_environment -} diff --git a/fcrepo6/rootfs/etc/confd/templates/syn-settings.xml.tmpl b/fcrepo6/rootfs/etc/confd/templates/syn-settings.xml.tmpl index e9c912f1..01c5f91b 100644 --- a/fcrepo6/rootfs/etc/confd/templates/syn-settings.xml.tmpl +++ b/fcrepo6/rootfs/etc/confd/templates/syn-settings.xml.tmpl @@ -1,6 +1,6 @@ - {{ getv "/jwt/admin/token" "islandora" }} + {{ getv "/jwt/admin/token" (getenv "JWT_ADMIN_TOKEN") }} diff --git a/milliner/rootfs/etc/confd/templates/config.yaml.tmpl b/milliner/rootfs/etc/confd/templates/config.yaml.tmpl index a589bd20..99c9f941 100644 --- a/milliner/rootfs/etc/confd/templates/config.yaml.tmpl +++ b/milliner/rootfs/etc/confd/templates/config.yaml.tmpl @@ -12,7 +12,7 @@ strip_format_jsonld: true debug: true -fedora6: {{ getv "/fedora6" "false" }} +fedora6: {{ getv "/fedora6" (getenv "MILLINER_FEDORA6" }} log: # Valid log levels are: From e36ddd5346f7b549cf3179ce23f0dcda90365b91 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Fri, 19 Feb 2021 16:04:48 -0400 Subject: [PATCH 12/20] Rebasing off of nigel's work --- alpaca/Dockerfile | 5 +++-- .../00-container-environment-00-init.sh | 2 +- .../usr/local/bin/.execute-sql-file.sh.swp | Bin 0 -> 16384 bytes base/rootfs/usr/local/bin/execute-sql-file.sh | 2 +- .../rootfs/usr/local/bin/wait-for-database.sh | 2 +- fcrepo/Dockerfile | 4 +++- fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml | 7 +++++++ .../confd/templates/context.xml.tmpl} | 2 +- .../confd/templates/setenv.sh.tmpl} | 5 ++++- fcrepo6/Dockerfile | 19 ++++++++++++++++++ .../rootfs/etc/confd/templates/setenv.sh.tmpl | 2 +- .../rootfs/etc/cont-init.d/03-fcrepo-setup.sh | 5 +++-- .../etc/confd/templates/config.yaml.tmpl | 2 +- 13 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 base/rootfs/usr/local/bin/.execute-sql-file.sh.swp create mode 100644 fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml rename fcrepo/rootfs/{opt/tomcat/conf/context.xml => etc/confd/templates/context.xml.tmpl} (86%) rename fcrepo/rootfs/{opt/tomcat/bin/setenv.sh => etc/confd/templates/setenv.sh.tmpl} (68%) diff --git a/alpaca/Dockerfile b/alpaca/Dockerfile index 37b9f360..ebe16510 100644 --- a/alpaca/Dockerfile +++ b/alpaca/Dockerfile @@ -29,7 +29,6 @@ RUN bin/start && \ # Triple indexing RUN bin/start && \ - bin/client -r 10 -d 5 "feature:install fcrepo-indexing-triplestore" && \ bin/client -r 10 -d 5 "feature:install islandora-indexing-triplestore" && \ bin/stop && \ rm -rf instances/* @@ -54,11 +53,11 @@ ENV \ ALPACA_HOUDINI_REDELIVERIES=10 \ ALPACA_HOUDINI_SERVICE=http://houdini:8000/convert \ ALPACA_HTTP_TOKEN=islandora \ - ALPACA_INDEXING_GEMINI_URL=http://gemini:8000 \ ALPACA_INDEXING_MILLINER_URL=http://milliner:8000 \ ALPACA_INDEXING_REDELIVERIES=10 \ ALPACA_INDEXING_STREAM_FILE_DELETE=broker:queue:islandora-indexing-fcrepo-file-delete \ ALPACA_INDEXING_STREAM_FILE_INDEX=broker:queue:islandora-indexing-fcrepo-file \ + ALPACA_INDEXING_STREAM_FILE_EXTERNAL=broker:queue:islandora-indexing-fcrepo-file-external \ ALPACA_INDEXING_STREAM_INPUT=broker:topic:fedora \ ALPACA_INDEXING_STREAM_MEDIA_INDEX=broker:queue:islandora-indexing-fcrepo-media \ ALPACA_INDEXING_STREAM_NODE_DELETE=broker:queue:islandora-indexing-fcrepo-delete \ @@ -76,3 +75,5 @@ ENV \ JAVA_OPTS="-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:MaxPermSize=128m -Xms512m -Xmx8g" COPY rootfs / + +# bin/client -r 10 -d 5 "feature:install fcrepo-indexing-triplestore" && \ diff --git a/base/rootfs/etc/cont-init.d/00-container-environment-00-init.sh b/base/rootfs/etc/cont-init.d/00-container-environment-00-init.sh index 368479e3..974c7ec6 100755 --- a/base/rootfs/etc/cont-init.d/00-container-environment-00-init.sh +++ b/base/rootfs/etc/cont-init.d/00-container-environment-00-init.sh @@ -65,4 +65,4 @@ with-contenv confd -prefix '/' -onetime -sync-only -confdir /tmp/confd -log-leve execlineb -P /tmp/confd/out/import.sh # Remove temporary files. -rm -fr /tmp/confd \ No newline at end of file +rm -fr /tmp/confd diff --git a/base/rootfs/usr/local/bin/.execute-sql-file.sh.swp b/base/rootfs/usr/local/bin/.execute-sql-file.sh.swp new file mode 100644 index 0000000000000000000000000000000000000000..77d348e5eeb15f9a16b269db4f99e2f894106d6d GIT binary patch literal 16384 zcmeI2UyK_^9ml63{HHCVNTo!S$)20L3)%BIhuX$>F1h5~^rT+w+LwZqi`?~kY_D#; z>+G&`zTRCb9(aIMRVx8~sKi4N6%8OtX==z!QQ#Q2734|JjZm zPDn@y%}O7ycjq_1o&C=LnXS)1yt>Bkoy##CA7<=_|_y5fy z?ex!;t9ouhzh~jZ`~>^U(lC44ZHVluZyQd-^^C0L+d{AREW5F31=+gci>&9mLDSFn zd@pOereSC6mXj5IVfF%{`xkA!Y1v}VZ%=rRx~&vY3XD_WX0~uVC#&a_c9`Gxk#pmW z)IFtuQa~x76i^B%1(X6x0i}Ra;Qv&CpnHHlhIcyWgyI==&Koxuj90Gs)5M#dp zFM}_D&x6OnWv~f0KpCupXI7T5)A;7;(D4>0x$cnZ|P32*?s@qWgB0A2wk&eh*`R2hV|3kOvFkIQTfY1N`INjQs?>23`W+0pA9XgDc<^I09}5 ze>#Y~0zU$;f>*%z!S}!m;42^xu3;hPr{G2KG}r|OSOR%)0^AP%iSqCc_$9asz7C!R zUj;kh5g^M9m1!Owy594JSI{y$=c>iZp2jx@g1W93P*Ay4Ssw{%yS@y1pj1tRI@|ct z10JM{rj>YV7=b}wiPQ|QRnT-jzAj{TR+iV7Pc2uAdz!Sin*98Eewgczay&N;+ECDtHXH}u+_Nr)E>|k64-W{wWmtjUbiG6yd@B>> z#S}kn*tYO|ZW<03{lGKKfW+XJ47(?I({nrW(&%T)J5 z?R*+d>(BNFBG_@ zYp6I>m!y+|wxNX`ES@5dDPBf1hm?A5uhr&;vyJ8+P2o_ZOP1)fM7`IV4WkVwQSV=u z9JCF>?#9+5=It@&aVIXL3<;n&$C$_6_84<9#+;g_35h|^KO$w=piMA0$Cy(yIKjL= z#ysr&qX@&VYFuYN#n(NNP6wZ4bEAcUj33PLnUd_R4Ld0c z1NjoWB#&_xkw?@KPWex*7S)$D;bG4n$D=dFmEAq!nXco=VWdA0LuT4&j3oUOI$$g_ zaH27V4j4x{nVJtN6NZN7(Ks^7u44ERI<<9Z`7!)KmfngBVIea^6C?*?J)W7z zh)oV%1e-c6KdF}=(>s?qY}$IZK!JuUm&5SzyK_Dq3VN(K`RyHYQ-%GNyMePxv$$izkRa z79p^7*6Y$l5o^yhEp^m(p$c<#KIGWH@TJnon(UkW5$qUg&8QrG^ zvdj+6LWefza4*)AcE*On!etklX3{$2gl#Pf+V7U1Ovfc&I$JANDy2%Tx?U<5a?#FJ z`Ao7@O)k@2w(dUn3F|VYgByX29{8W{64K^l=rqoJEzO1a)|iqroFPl8?lL`;CcNNa hCJpSPBIE}7fi1hhHC?+9nB9R$>AH=~ja0e~_AmYBKW+d3 literal 0 HcmV?d00001 diff --git a/base/rootfs/usr/local/bin/execute-sql-file.sh b/base/rootfs/usr/local/bin/execute-sql-file.sh index 31e9ee21..33c11643 100755 --- a/base/rootfs/usr/local/bin/execute-sql-file.sh +++ b/base/rootfs/usr/local/bin/execute-sql-file.sh @@ -162,7 +162,7 @@ function postgresql_execute_sql_file { function execute_sql_file { case "${DRIVER}" in - mysql|pdo_mysql) + mysql|pdo_mysql|mariadb) mysql_execute_sql_file ;; pgsql|postgresql|pdo_pgsql) diff --git a/base/rootfs/usr/local/bin/wait-for-database.sh b/base/rootfs/usr/local/bin/wait-for-database.sh index 3467f6f9..a24a7553 100755 --- a/base/rootfs/usr/local/bin/wait-for-database.sh +++ b/base/rootfs/usr/local/bin/wait-for-database.sh @@ -123,7 +123,7 @@ function postgresql_validate_credentials { function validate_credentials { echo "Validating Database credentials" case "${DRIVER}" in - mysql|pdo_mysql) + mysql|pdo_mysql|mariadb) mysql_validate_credentials ;; pgsql|postgresql|pdo_pgsql) diff --git a/fcrepo/Dockerfile b/fcrepo/Dockerfile index de0d2724..3906d5dd 100644 --- a/fcrepo/Dockerfile +++ b/fcrepo/Dockerfile @@ -41,10 +41,12 @@ ENV \ FCREPO_DB_POSTGRESQL_PORT=5432 \ FCREPO_DB_ROOT_USER=root \ FCREPO_DB_USER=fcrepo \ + FCREPO_DISABLE_SYN=false \ FCREPO_MODESHAPE_CONFIGURATION=classpath:/config/repository.json \ FCREPO_PERSISTENCE_TYPE=file \ FCREPO_S3_BUCKET= \ FCREPO_S3_PASSWORD= \ - FCREPO_S3_USER= + FCREPO_S3_USER= \ + FCREPO_TOMCAT_ADMIN_ROLES=manager-gui,fedoraAdmin COPY rootfs / diff --git a/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml b/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml new file mode 100644 index 00000000..d27eb375 --- /dev/null +++ b/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml @@ -0,0 +1,7 @@ +[template] +src = "setenv.sh.tmpl" +dest = "/opt/tomcat/bin/setenv.sh" +uid = 100 +gid = 1000 +mode = "0655" +keys = [ "/" ] diff --git a/fcrepo/rootfs/opt/tomcat/conf/context.xml b/fcrepo/rootfs/etc/confd/templates/context.xml.tmpl similarity index 86% rename from fcrepo/rootfs/opt/tomcat/conf/context.xml rename to fcrepo/rootfs/etc/confd/templates/context.xml.tmpl index ac36dfa1..0f86689d 100644 --- a/fcrepo/rootfs/opt/tomcat/conf/context.xml +++ b/fcrepo/rootfs/etc/confd/templates/context.xml.tmpl @@ -4,7 +4,7 @@ WEB-INF/web.xml ${catalina.base}/conf/web.xml -{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN)) "false" }} +{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN")) "false" }} {{ end }} diff --git a/fcrepo/rootfs/opt/tomcat/bin/setenv.sh b/fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl similarity index 68% rename from fcrepo/rootfs/opt/tomcat/bin/setenv.sh rename to fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl index 6dda5b7a..c124f299 100755 --- a/fcrepo/rootfs/opt/tomcat/bin/setenv.sh +++ b/fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl @@ -3,4 +3,7 @@ export JAVA_OPTS="${CANTALOUPE_JAVA_OPTS}" export CATALINA_OPTS="${CANTALOUPE_CATALINA_OPTS}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.home=/data/home" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.modeshape.configuration=${FCREPO_MODESHAPE_CONFIGURATION} -Dfcrepo.jms.baseUrl=http://${HOSTNAME}/fcrepo/rest" \ No newline at end of file +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.modeshape.configuration=${FCREPO_MODESHAPE_CONFIGURATION} -Dfcrepo.jms.baseUrl=http://${HOSTNAME}/fcrepo/rest" +{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN")) "true" }} +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" +{{ end }} diff --git a/fcrepo6/Dockerfile b/fcrepo6/Dockerfile index 2b3a55c8..0468ec5a 100644 --- a/fcrepo6/Dockerfile +++ b/fcrepo6/Dockerfile @@ -35,4 +35,23 @@ RUN --mount=id=downloads,type=cache,target=/opt/downloads \ chown -R tomcat:tomcat /opt/tomcat && \ cleanup.sh +ENV \ + FCREPO_ACTIVEMQ_BROKER=tcp://activemq:61616 \ + FCREPO_ACTIVEMQ_QUEUE=fedora \ + FCREPO_ACTIVEMQ_TOPIC=fedora \ + FCREPO_BINARYSTORAGE_TYPE=file \ + FCREPO_DB_MYSQL_HOST=mariadb \ + FCREPO_DB_MYSQL_PORT=3306 \ + FCREPO_DB_NAME=fcrepo \ + FCREPO_DB_PASSWORD=password \ + FCREPO_DB_POSTGRESQL_HOST=postgresql \ + FCREPO_DB_POSTGRESQL_PORT=5432 \ + FCREPO_DB_ROOT_USER=root \ + FCREPO_DB_USER=fcrepo \ + FCREPO_DISABLE_SYN=false \ + FCREPO_PERSISTENCE_TYPE=file \ + FCREPO_S3_BUCKET= \ + FCREPO_S3_PASSWORD= \ + FCREPO_S3_USER= + COPY rootfs / diff --git a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl index 1663c354..334c2af6 100644 --- a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl +++ b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl @@ -6,7 +6,7 @@ export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.velocity.runtime.log=/opt/tomcat export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.jms.baseUrl=http://{{ index (lookupIP (getenv "HOSTNAME")) 0 }}/fcrepo/rest" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.external.content.allowed=/opt/tomcat/conf/allowed-external-content.txt" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.autoversioning.enabled=false" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:{{ getv "/persistance/type" (getenv "FCREPO_PERSISTANCE_TYPE") }}://{{ getv "/db/host" (getenv "FCREPO_DB_HOST") }}:{{ getv "/db/port" (getenv "FCREPO_DB_PORT") }}/fcrepo" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:{{ getv "/persistence/type" (getenv "FCREPO_PERSISTENCE_TYPE") }}://{{ getv "/db/host" (getenv "FCREPO_DB_HOST") }}:{{ getv "/db/port" (getenv "FCREPO_DB_PORT") }}/fcrepo" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.user={{ getv "/db/user" (getenv "FCREPO_DB_USER") }}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password={{ getv "/db/password" (getenv "FCREPO_DB_PASSWORD") }}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.directory=file:///data/home/data/Activemq" diff --git a/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh b/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh index dc3e4ae8..de8f359a 100755 --- a/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh +++ b/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh @@ -66,7 +66,8 @@ function postgresql_create_database { function create_database { case "${FCREPO_PERSISTENCE_TYPE}" in - mysql|pdo_mysql) + mysql|pdo_mysql|mariadb) + echo "Creating database in mysql/mariadb" mysql_create_database ;; pgsql|postgresql|pdo_pgsql) @@ -85,7 +86,7 @@ function redirect_logs_to_stdout { } function requires_database { - [[ "${FCREPO_PERSISTENCE_TYPE}" = "mysql" ]] || [[ "${FCREPO_PERSISTENCE_TYPE}" = "postgresql" ]] + [[ "${FCREPO_PERSISTENCE_TYPE}" = "mysql" || "${FCREPO_PERSISTENCE_TYPE}" = "mariadb" || "${FCREPO_PERSISTENCE_TYPE}" = "postgresql" ]] } function main { diff --git a/milliner/rootfs/etc/confd/templates/config.yaml.tmpl b/milliner/rootfs/etc/confd/templates/config.yaml.tmpl index 99c9f941..963539da 100644 --- a/milliner/rootfs/etc/confd/templates/config.yaml.tmpl +++ b/milliner/rootfs/etc/confd/templates/config.yaml.tmpl @@ -12,7 +12,7 @@ strip_format_jsonld: true debug: true -fedora6: {{ getv "/fedora6" (getenv "MILLINER_FEDORA6" }} +fedora6: {{ getv "/fedora6" (getenv "MILLINER_FEDORA6") }} log: # Valid log levels are: From 421eaf7debc5d295f70394de2a3eb45035d3201d Mon Sep 17 00:00:00 2001 From: "Noah W. Smith" Date: Sun, 21 Feb 2021 21:55:26 -0500 Subject: [PATCH 13/20] Remove Gemini from list of require services --- drupal/rootfs/etc/islandora/utilities.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/drupal/rootfs/etc/islandora/utilities.sh b/drupal/rootfs/etc/islandora/utilities.sh index 90d590e8..f3db0aae 100755 --- a/drupal/rootfs/etc/islandora/utilities.sh +++ b/drupal/rootfs/etc/islandora/utilities.sh @@ -77,7 +77,6 @@ function wait_for_required_services { wait_for_service "${site}" "SOLR" wait_for_service "${site}" "FCREPO" wait_for_service "${site}" "BROKER" - wait_for_service "${site}" "GEMINI" wait_for_service "${site}" "TRIPLESTORE" fi } From 116e319e88e7ba33d7d17f95a856c3a8e041ae69 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Mon, 22 Feb 2021 12:03:37 -0400 Subject: [PATCH 14/20] Missing FCREPO_DB_ROOT_PASSWORD --- .../usr/local/bin/.execute-sql-file.sh.swp | Bin 16384 -> 0 bytes fcrepo/Dockerfile | 7 +++---- fcrepo6/Dockerfile | 10 +++++----- 3 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 base/rootfs/usr/local/bin/.execute-sql-file.sh.swp diff --git a/base/rootfs/usr/local/bin/.execute-sql-file.sh.swp b/base/rootfs/usr/local/bin/.execute-sql-file.sh.swp deleted file mode 100644 index 77d348e5eeb15f9a16b269db4f99e2f894106d6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI2UyK_^9ml63{HHCVNTo!S$)20L3)%BIhuX$>F1h5~^rT+w+LwZqi`?~kY_D#; z>+G&`zTRCb9(aIMRVx8~sKi4N6%8OtX==z!QQ#Q2734|JjZm zPDn@y%}O7ycjq_1o&C=LnXS)1yt>Bkoy##CA7<=_|_y5fy z?ex!;t9ouhzh~jZ`~>^U(lC44ZHVluZyQd-^^C0L+d{AREW5F31=+gci>&9mLDSFn zd@pOereSC6mXj5IVfF%{`xkA!Y1v}VZ%=rRx~&vY3XD_WX0~uVC#&a_c9`Gxk#pmW z)IFtuQa~x76i^B%1(X6x0i}Ra;Qv&CpnHHlhIcyWgyI==&Koxuj90Gs)5M#dp zFM}_D&x6OnWv~f0KpCupXI7T5)A;7;(D4>0x$cnZ|P32*?s@qWgB0A2wk&eh*`R2hV|3kOvFkIQTfY1N`INjQs?>23`W+0pA9XgDc<^I09}5 ze>#Y~0zU$;f>*%z!S}!m;42^xu3;hPr{G2KG}r|OSOR%)0^AP%iSqCc_$9asz7C!R zUj;kh5g^M9m1!Owy594JSI{y$=c>iZp2jx@g1W93P*Ay4Ssw{%yS@y1pj1tRI@|ct z10JM{rj>YV7=b}wiPQ|QRnT-jzAj{TR+iV7Pc2uAdz!Sin*98Eewgczay&N;+ECDtHXH}u+_Nr)E>|k64-W{wWmtjUbiG6yd@B>> z#S}kn*tYO|ZW<03{lGKKfW+XJ47(?I({nrW(&%T)J5 z?R*+d>(BNFBG_@ zYp6I>m!y+|wxNX`ES@5dDPBf1hm?A5uhr&;vyJ8+P2o_ZOP1)fM7`IV4WkVwQSV=u z9JCF>?#9+5=It@&aVIXL3<;n&$C$_6_84<9#+;g_35h|^KO$w=piMA0$Cy(yIKjL= z#ysr&qX@&VYFuYN#n(NNP6wZ4bEAcUj33PLnUd_R4Ld0c z1NjoWB#&_xkw?@KPWex*7S)$D;bG4n$D=dFmEAq!nXco=VWdA0LuT4&j3oUOI$$g_ zaH27V4j4x{nVJtN6NZN7(Ks^7u44ERI<<9Z`7!)KmfngBVIea^6C?*?J)W7z zh)oV%1e-c6KdF}=(>s?qY}$IZK!JuUm&5SzyK_Dq3VN(K`RyHYQ-%GNyMePxv$$izkRa z79p^7*6Y$l5o^yhEp^m(p$c<#KIGWH@TJnon(UkW5$qUg&8QrG^ zvdj+6LWefza4*)AcE*On!etklX3{$2gl#Pf+V7U1Ovfc&I$JANDy2%Tx?U<5a?#FJ z`Ao7@O)k@2w(dUn3F|VYgByX29{8W{64K^l=rqoJEzO1a)|iqroFPl8?lL`;CcNNa hCJpSPBIE}7fi1hhHC?+9nB9R$>AH=~ja0e~_AmYBKW+d3 diff --git a/fcrepo/Dockerfile b/fcrepo/Dockerfile index 3906d5dd..5585de49 100644 --- a/fcrepo/Dockerfile +++ b/fcrepo/Dockerfile @@ -33,13 +33,12 @@ ENV \ FCREPO_ACTIVEMQ_QUEUE=fedora \ FCREPO_ACTIVEMQ_TOPIC=fedora \ FCREPO_BINARYSTORAGE_TYPE=file \ - FCREPO_DB_MYSQL_HOST=mariadb \ - FCREPO_DB_MYSQL_PORT=3306 \ + FCREPO_DB_HOST=mariadb \ + FCREPO_DB_PORT=3306 \ FCREPO_DB_NAME=fcrepo \ FCREPO_DB_PASSWORD=password \ - FCREPO_DB_POSTGRESQL_HOST=postgresql \ - FCREPO_DB_POSTGRESQL_PORT=5432 \ FCREPO_DB_ROOT_USER=root \ + FCREPO_DB_ROOT_PASSWORD=password \ FCREPO_DB_USER=fcrepo \ FCREPO_DISABLE_SYN=false \ FCREPO_MODESHAPE_CONFIGURATION=classpath:/config/repository.json \ diff --git a/fcrepo6/Dockerfile b/fcrepo6/Dockerfile index 0468ec5a..e6eb8254 100644 --- a/fcrepo6/Dockerfile +++ b/fcrepo6/Dockerfile @@ -40,18 +40,18 @@ ENV \ FCREPO_ACTIVEMQ_QUEUE=fedora \ FCREPO_ACTIVEMQ_TOPIC=fedora \ FCREPO_BINARYSTORAGE_TYPE=file \ - FCREPO_DB_MYSQL_HOST=mariadb \ - FCREPO_DB_MYSQL_PORT=3306 \ + FCREPO_DB_HOST=mariadb \ + FCREPO_DB_PORT=3306 \ FCREPO_DB_NAME=fcrepo \ FCREPO_DB_PASSWORD=password \ - FCREPO_DB_POSTGRESQL_HOST=postgresql \ - FCREPO_DB_POSTGRESQL_PORT=5432 \ FCREPO_DB_ROOT_USER=root \ + FCREPO_DB_ROOT_PASSWORD=password \ FCREPO_DB_USER=fcrepo \ FCREPO_DISABLE_SYN=false \ FCREPO_PERSISTENCE_TYPE=file \ FCREPO_S3_BUCKET= \ FCREPO_S3_PASSWORD= \ - FCREPO_S3_USER= + FCREPO_S3_USER= \ + FCREPO_TOMCAT_ADMIN_ROLES=manager-gui,fedoraAdmin COPY rootfs / From 449c34a24d198cb4be570abec5f7b142d2cc6c01 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Wed, 24 Feb 2021 11:02:06 -0400 Subject: [PATCH 15/20] Reworking how I check if modules are enabled or not --- drupal/rootfs/etc/islandora/utilities.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drupal/rootfs/etc/islandora/utilities.sh b/drupal/rootfs/etc/islandora/utilities.sh index f3db0aae..29f9cd75 100755 --- a/drupal/rootfs/etc/islandora/utilities.sh +++ b/drupal/rootfs/etc/islandora/utilities.sh @@ -374,7 +374,10 @@ function configure_islandora_module { # After enabling and importing features a number of configurations need to be updated. function configure_islandora_default_module { - if ! drush pml | grep islandora_defaults | grep -q Enabled; then return 0; fi + if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q islandora_defaults; then + echo "islandora_defaults is not installed. Skipping configuration" + return 0 + fi local site="${1}"; shift local site_url=$(drupal_site_env "${site}" "SITE_URL") @@ -401,11 +404,13 @@ function configure_search_api_solr_module { # Enables and sets carapace as the default theme. function set_carapace_default_theme { - if ! drush pml | grep -q carapace; then return 0; fi + if ! drush pm-list --pipe --type=theme --status=enabled --no-core | grep -q carapace; then + echo "carapace is not available. Skipping configuration." + return 0 + fi local site="${1}"; shift local site_url=$(drupal_site_env "${site}" "SITE_URL") - drush -l "${site_url}" -y theme:enable carapace drush -l "${site_url}" -y config:set system.theme default carapace } @@ -452,7 +457,10 @@ function create_solr_core_with_default_config { # Install matomo and configure. function configure_matomo_module { - if ! drush pml | grep matomo | grep -q Enabled; then return 0; fi + if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q matomo; then + echo "matomo is not installed. Skipping configuration" + return 0 + fi local site="${1}"; shift local site_url=$(drupal_site_env "${site}" "SITE_URL") @@ -467,7 +475,10 @@ function configure_matomo_module { # Configure Openseadragon to point use cantaloupe. function configure_openseadragon { - if ! drush pml | grep openseadragon | grep -q Enabled; then return 0; fi + if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q openseadragon; then + echo "openseadragon is not installed. Skipping configuration" + return 0 + fi local site="${1}"; shift local site_url=$(drupal_site_env "${site}" "SITE_URL") From 9da62284f8b5d97ef5b977bbe33e7d87a45de505 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Fri, 5 Mar 2021 16:51:29 -0400 Subject: [PATCH 16/20] Updating to use newest code. Touching up recast --- crayfish/Dockerfile | 2 +- fcrepo6/Dockerfile | 12 ++++++------ recast/Dockerfile | 5 ++--- recast/rootfs/etc/confd/templates/config.yaml.tmpl | 5 +++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crayfish/Dockerfile b/crayfish/Dockerfile index 3fdde31b..c8e3e803 100644 --- a/crayfish/Dockerfile +++ b/crayfish/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1.2.1 FROM local/nginx:latest -ARG COMMIT=71129982975b44f45a87995420e5a778ef403ede +ARG COMMIT=e2fa1df060af23f454c9cc9e84e07177a0183da6 RUN --mount=id=downloads,type=cache,target=/opt/downloads \ DOWNLOAD_CACHE_DIRECTORY="/opt/downloads" && \ diff --git a/fcrepo6/Dockerfile b/fcrepo6/Dockerfile index e6eb8254..ce716b4b 100644 --- a/fcrepo6/Dockerfile +++ b/fcrepo6/Dockerfile @@ -4,10 +4,10 @@ FROM local/tomcat:latest RUN --mount=id=downloads,type=cache,target=/opt/downloads \ apk-install.sh openjdk11 && \ DOWNLOAD_CACHE_DIRECTORY="/opt/downloads" && \ - FCREPO_VERSION="6.0.0-alpha-2" && \ + FCREPO_VERSION="6.0.0-beta-1" && \ FCREPO_FILE="fcrepo-webapp-${FCREPO_VERSION}.war" && \ FCREPO_URL="https://github.com/fcrepo/fcrepo/releases/download/fcrepo-${FCREPO_VERSION}/${FCREPO_FILE}" && \ - FCREPO_SHA256="815415a15c607c74c47e18e83180b2a45b11fef47d59105dfabb7ef9ef1a5fbf" && \ + FCREPO_SHA256="33b855bb3d314eb5e4bee41e1c9991978015f8fde3d15d685ef812407b395d5b" && \ download.sh --url "${FCREPO_URL}" --sha256 "${FCREPO_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ install-war-into-tomcat.sh --name "fcrepo" --file "${DOWNLOAD_CACHE_DIRECTORY}/${FCREPO_FILE}" && \ SYN_VERSION="1.1.0" && \ @@ -16,16 +16,16 @@ RUN --mount=id=downloads,type=cache,target=/opt/downloads \ SYN_SHA256="bcad5f872930b1bcc9ea4a176c60e22683297121357336769a21ead9fadcbbd5" && \ download.sh --url "${SYN_URL}" --sha256 "${SYN_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ cp "${DOWNLOAD_CACHE_DIRECTORY}/${SYN_FILE}" /opt/tomcat/lib && \ - IMPORT_EXPORT_VERSION="1.0.0" && \ + IMPORT_EXPORT_VERSION="1.0.1" && \ IMPORT_EXPORT_FILE="fcrepo-import-export-${IMPORT_EXPORT_VERSION}.jar" && \ IMPORT_EXPORT_URL="https://github.com/fcrepo-exts/fcrepo-import-export/releases/download/fcrepo-import-export-${IMPORT_EXPORT_VERSION}/${IMPORT_EXPORT_FILE}" && \ - IMPORT_EXPORT_SHA256="f3103ce03b9ee9e38cf0a762d7b4194fd6c20fa72e19ed7e811ac5de4b890062" && \ + IMPORT_EXPORT_SHA256="89c579d1223c8f3c0da60c4309a06e47f5919c51929d976e60ea525c60cb33d1" && \ download.sh --url "${IMPORT_EXPORT_URL}" --sha256 "${IMPORT_EXPORT_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ cp "${DOWNLOAD_CACHE_DIRECTORY}/${IMPORT_EXPORT_FILE}" /opt/tomcat && \ - UPGRADE_UTILS_VERSION="6.0.0-alpha-2" && \ + UPGRADE_UTILS_VERSION="6.0.0-beta-1" && \ UPGRADE_UTILS_FILE="fcrepo-upgrade-utils-${UPGRADE_UTILS_VERSION}.jar" && \ UPGRADE_UTILS_URL="https://github.com/fcrepo-exts/fcrepo-upgrade-utils/releases/download/fcrepo-upgrade-utils-${UPGRADE_UTILS_VERSION}/${UPGRADE_UTILS_FILE}" && \ - UPGRADE_UTILS_SHA256="b073779538c69e908981646c2262d8261d16ddc52e726e7475b92af02590e300" && \ + UPGRADE_UTILS_SHA256="e8a0bbbabca45ff95b2ffb5c62cad49e02548bc116b80f2747d5215f80d02a0a" && \ download.sh --url "${UPGRADE_UTILS_URL}" --sha256 "${UPGRADE_UTILS_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ cp "${DOWNLOAD_CACHE_DIRECTORY}/${UPGRADE_UTILS_FILE}" /opt/tomcat && \ mkdir -p /opt/keys/jwt && \ diff --git a/recast/Dockerfile b/recast/Dockerfile index 271bd332..a687510f 100644 --- a/recast/Dockerfile +++ b/recast/Dockerfile @@ -7,9 +7,8 @@ RUN --mount=type=cache,target=/root/.composer/cache \ cleanup.sh ENV \ - RECAST_DRUPAL_URL=drupal:80 \ - RECAST_FCREPO_URL=fcrepo/fcrepo/rest \ - RECAST_GEMINI_URL=gemini:8000 \ + RECAST_DRUPAL_URL=islandora.traefik.me \ + RECAST_FCREPO_URL=islandora.traefik.me:8081/fcrepo/rest \ RECAST_LOG_LEVEL=debug COPY /rootfs / diff --git a/recast/rootfs/etc/confd/templates/config.yaml.tmpl b/recast/rootfs/etc/confd/templates/config.yaml.tmpl index 401fb519..a00a4c07 100644 --- a/recast/rootfs/etc/confd/templates/config.yaml.tmpl +++ b/recast/rootfs/etc/confd/templates/config.yaml.tmpl @@ -1,10 +1,11 @@ --- -fedora_base_url: {{ getv "/fcrepo/url" (getenv "RECAST_FCREPO_URL") }} +fedora_resource: + base_url: {{ getv "/fcrepo/url" (getenv "RECAST_FCREPO_URL") }} + # if drupal_base_url contains a path, be sure to include trailing slash # or relative paths will not resolve correctly. drupal_base_url: {{ getv "/drupal/url" (getenv "RECAST_DRUPAL_URL") }} -gemini_base_url: {{ getv "/gemini/url" (getenv "RECAST_GEMINI_URL") }} debug: false From 6c23a9dd86513b5c7215aa2ca55605ddbc702aed Mon Sep 17 00:00:00 2001 From: dannylamb Date: Thu, 11 Mar 2021 14:50:48 -0400 Subject: [PATCH 17/20] Updating crayfish commit --- crayfish/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crayfish/Dockerfile b/crayfish/Dockerfile index c8e3e803..366bd3c3 100644 --- a/crayfish/Dockerfile +++ b/crayfish/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1.2.1 FROM local/nginx:latest -ARG COMMIT=e2fa1df060af23f454c9cc9e84e07177a0183da6 +ARG COMMIT=ae9a35c88d2bdfd0343122a8b5b373d6368cc623 RUN --mount=id=downloads,type=cache,target=/opt/downloads \ DOWNLOAD_CACHE_DIRECTORY="/opt/downloads" && \ From ab03986c1a807d7a3931149ea9a746b1f5eca1a4 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Mon, 15 Mar 2021 14:04:08 -0300 Subject: [PATCH 18/20] Responding to feedback. README updates --- alpaca/Dockerfile | 2 -- drupal/rootfs/etc/islandora/utilities.sh | 14 ++++++------- fcrepo/Dockerfile | 10 ++++++---- fcrepo/README.md | 6 ++++-- fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml | 7 ------- .../rootfs/etc/cont-init.d/03-fcrepo-setup.sh | 9 +++++++++ .../tomcat/bin/setenv.sh} | 6 +++--- fcrepo6/Dockerfile | 8 +++++--- fcrepo6/README.md | 15 +++++++------- .../rootfs/etc/confd/conf.d/setenv.sh.toml | 7 ------- .../rootfs/etc/confd/templates/setenv.sh.tmpl | 16 --------------- .../rootfs/etc/cont-init.d/03-fcrepo-setup.sh | 9 +++++++++ fcrepo6/rootfs/opt/tomcat/bin/setenv.sh | 20 +++++++++++++++++++ 13 files changed, 71 insertions(+), 58 deletions(-) delete mode 100644 fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml rename fcrepo/rootfs/{etc/confd/templates/setenv.sh.tmpl => opt/tomcat/bin/setenv.sh} (73%) delete mode 100644 fcrepo6/rootfs/etc/confd/conf.d/setenv.sh.toml delete mode 100644 fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl create mode 100644 fcrepo6/rootfs/opt/tomcat/bin/setenv.sh diff --git a/alpaca/Dockerfile b/alpaca/Dockerfile index ebe16510..7678bb9b 100644 --- a/alpaca/Dockerfile +++ b/alpaca/Dockerfile @@ -75,5 +75,3 @@ ENV \ JAVA_OPTS="-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:MaxPermSize=128m -Xms512m -Xmx8g" COPY rootfs / - -# bin/client -r 10 -d 5 "feature:install fcrepo-indexing-triplestore" && \ diff --git a/drupal/rootfs/etc/islandora/utilities.sh b/drupal/rootfs/etc/islandora/utilities.sh index 29f9cd75..439a3e1e 100755 --- a/drupal/rootfs/etc/islandora/utilities.sh +++ b/drupal/rootfs/etc/islandora/utilities.sh @@ -238,8 +238,8 @@ function install_site { fi # Ensure the files directory is writable by nginx, as when it is a new volume it is owned by root. - chown -R 100:101 "${files_directory}" - chmod -R ug+rw "${files_directory}" + chown -R 100:101 "${files_directory}" + chmod -R ug+rw "${files_directory}" # Allow changes to settings.php if it exists. if [[ -f "${site_directory}/settings.php" ]]; then @@ -367,7 +367,7 @@ function configure_islandora_module { if drush -l "${site_url}" role:list | grep -q fedoraadmin; then echo "Fedora Admin role already exists. No need to create it." else - drush -l "${site_url}" role:create fedoraadmin fedoraAdmin + drush -l "${site_url}" role:create fedoraadmin fedoraAdmin fi drush -l "${site_url}" -y user:role:add fedoraadmin admin } @@ -375,7 +375,7 @@ function configure_islandora_module { # After enabling and importing features a number of configurations need to be updated. function configure_islandora_default_module { if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q islandora_defaults; then - echo "islandora_defaults is not installed. Skipping configuration" + echo "islandora_defaults is not installed. Skipping configuration" return 0 fi @@ -405,7 +405,7 @@ function configure_search_api_solr_module { # Enables and sets carapace as the default theme. function set_carapace_default_theme { if ! drush pm-list --pipe --type=theme --status=enabled --no-core | grep -q carapace; then - echo "carapace is not available. Skipping configuration." + echo "carapace is not available. Skipping configuration." return 0 fi @@ -458,7 +458,7 @@ function create_solr_core_with_default_config { # Install matomo and configure. function configure_matomo_module { if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q matomo; then - echo "matomo is not installed. Skipping configuration" + echo "matomo is not installed. Skipping configuration" return 0 fi @@ -476,7 +476,7 @@ function configure_matomo_module { # Configure Openseadragon to point use cantaloupe. function configure_openseadragon { if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q openseadragon; then - echo "openseadragon is not installed. Skipping configuration" + echo "openseadragon is not installed. Skipping configuration" return 0 fi diff --git a/fcrepo/Dockerfile b/fcrepo/Dockerfile index 5585de49..8bebf6f2 100644 --- a/fcrepo/Dockerfile +++ b/fcrepo/Dockerfile @@ -15,10 +15,10 @@ RUN --mount=id=downloads,type=cache,target=/opt/downloads \ SYN_SHA256="bcad5f872930b1bcc9ea4a176c60e22683297121357336769a21ead9fadcbbd5" && \ download.sh --url "${SYN_URL}" --sha256 "${SYN_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ cp "${DOWNLOAD_CACHE_DIRECTORY}/${SYN_FILE}" /opt/tomcat/lib && \ - IMPORT_EXPORT_VERSION="1.0.0" && \ + IMPORT_EXPORT_VERSION="1.0.1" && \ IMPORT_EXPORT_FILE="fcrepo-import-export-${IMPORT_EXPORT_VERSION}.jar" && \ IMPORT_EXPORT_URL="https://github.com/fcrepo-exts/fcrepo-import-export/releases/download/fcrepo-import-export-${IMPORT_EXPORT_VERSION}/${IMPORT_EXPORT_FILE}" && \ - IMPORT_EXPORT_SHA256="f3103ce03b9ee9e38cf0a762d7b4194fd6c20fa72e19ed7e811ac5de4b890062" && \ + IMPORT_EXPORT_SHA256="89c579d1223c8f3c0da60c4309a06e47f5919c51929d976e60ea525c60cb33d1" && \ download.sh --url "${IMPORT_EXPORT_URL}" --sha256 "${IMPORT_EXPORT_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \ cp "${DOWNLOAD_CACHE_DIRECTORY}/${IMPORT_EXPORT_FILE}" /opt/tomcat && \ mkdir -p /opt/keys/jwt && \ @@ -33,10 +33,12 @@ ENV \ FCREPO_ACTIVEMQ_QUEUE=fedora \ FCREPO_ACTIVEMQ_TOPIC=fedora \ FCREPO_BINARYSTORAGE_TYPE=file \ - FCREPO_DB_HOST=mariadb \ - FCREPO_DB_PORT=3306 \ + FCREPO_DB_MYSQL_HOST=mariadb \ + FCREPO_DB_MYSQL_PORT=3306 \ FCREPO_DB_NAME=fcrepo \ FCREPO_DB_PASSWORD=password \ + FCREPO_DB_POSTGRESQL_HOST=postgresql \ + FCREPO_DB_POSTGRESQL_PORT=5432 \ FCREPO_DB_ROOT_USER=root \ FCREPO_DB_ROOT_PASSWORD=password \ FCREPO_DB_USER=fcrepo \ diff --git a/fcrepo/README.md b/fcrepo/README.md index 47c2674f..3f03d799 100644 --- a/fcrepo/README.md +++ b/fcrepo/README.md @@ -32,10 +32,12 @@ additional settings, volumes, ports, etc. | FCREPO_ACTIVEMQ_TOPIC | /fcrepo/activemq/topic | fedora | | | FCREPO_BINARYSTORAGE_TYPE | /fcrepo/binarystorage/type | file | | | FCREPO_CATALINA_OPTS | /fcrepo/catalina/opts | | | -| FCREPO_DB_HOST | /fcrepo/db/host | mariadb | | +| FCREPO_DB_MYSQL_HOST | /fcrepo/db/mysql/host | mariadb | | +| FCREPO_DB_MYSQL_PORT | /fcrepo/db/mysql/port | 3306 | | | FCREPO_DB_NAME | /fcrepo/db/name | fcrepo | | | FCREPO_DB_PASSWORD | /fcrepo/db/password | password | | -| FCREPO_DB_PORT | /fcrepo/db/port | 3306 | | +| FCREPO_DB_POSTGRESQL_HOST | /fcrepo/db/postgresql/host | mariadb | | +| FCREPO_DB_POSTGRESQL_PORT | /fcrepo/db/postgresql/port | 3306 | | | FCREPO_DB_ROOT_PASSWORD | /fcrepo/db/root/password | password | | | FCREPO_DB_ROOT_USER | /fcrepo/db/root/user | root | | | FCREPO_DB_USER | /fcrepo/db/user | fcrepo | | diff --git a/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml b/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml deleted file mode 100644 index d27eb375..00000000 --- a/fcrepo/rootfs/etc/confd/conf.d/setenv.sh.toml +++ /dev/null @@ -1,7 +0,0 @@ -[template] -src = "setenv.sh.tmpl" -dest = "/opt/tomcat/bin/setenv.sh" -uid = 100 -gid = 1000 -mode = "0655" -keys = [ "/" ] diff --git a/fcrepo/rootfs/etc/cont-init.d/03-fcrepo-setup.sh b/fcrepo/rootfs/etc/cont-init.d/03-fcrepo-setup.sh index dc3e4ae8..2f85ca42 100755 --- a/fcrepo/rootfs/etc/cont-init.d/03-fcrepo-setup.sh +++ b/fcrepo/rootfs/etc/cont-init.d/03-fcrepo-setup.sh @@ -2,6 +2,15 @@ set -e function execute_sql_file { + local FCREPO_DB_HOST="" + local FCREPO_DB_PORT="" + if [[ "${FCREPO_PERSISTENCE_TYPE}" == "mysql" || "${FCREPO_PERSISTENCE_TYPE}" == "mariadb" ]]; then + FCREPO_DB_HOST="${FCREPO_DB_MYSQL_HOST}" + FCREPO_DB_PORT="${FCREPO_DB_MYSQL_PORT}" + else + FCREPO_DB_HOST="${FCREPO_DB_POSTGRESQL_HOST}" + FCREPO_DB_PORT="${FCREPO_DB_POSTGRESQL_PORT}" + fi execute-sql-file.sh \ --driver "${FCREPO_PERSISTENCE_TYPE}" \ --host "${FCREPO_DB_HOST}" \ diff --git a/fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl b/fcrepo/rootfs/opt/tomcat/bin/setenv.sh similarity index 73% rename from fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl rename to fcrepo/rootfs/opt/tomcat/bin/setenv.sh index c124f299..bf5a65e2 100755 --- a/fcrepo/rootfs/etc/confd/templates/setenv.sh.tmpl +++ b/fcrepo/rootfs/opt/tomcat/bin/setenv.sh @@ -4,6 +4,6 @@ export CATALINA_OPTS="${CANTALOUPE_CATALINA_OPTS}" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.home=/data/home" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log" export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.modeshape.configuration=${FCREPO_MODESHAPE_CONFIGURATION} -Dfcrepo.jms.baseUrl=http://${HOSTNAME}/fcrepo/rest" -{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN")) "true" }} -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" -{{ end }} +if [[ "${FCREPO_DISABLE_SYN}" == "true" ]]; then + export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" +fi diff --git a/fcrepo6/Dockerfile b/fcrepo6/Dockerfile index ce716b4b..06d786a1 100644 --- a/fcrepo6/Dockerfile +++ b/fcrepo6/Dockerfile @@ -40,15 +40,17 @@ ENV \ FCREPO_ACTIVEMQ_QUEUE=fedora \ FCREPO_ACTIVEMQ_TOPIC=fedora \ FCREPO_BINARYSTORAGE_TYPE=file \ - FCREPO_DB_HOST=mariadb \ - FCREPO_DB_PORT=3306 \ + FCREPO_DB_MYSQL_HOST=mariadb \ + FCREPO_DB_MYSQL_PORT=3306 \ FCREPO_DB_NAME=fcrepo \ FCREPO_DB_PASSWORD=password \ + FCREPO_DB_POSTGRESQL_HOST=postgresql \ + FCREPO_DB_POSTGRESQL_PORT=5432 \ FCREPO_DB_ROOT_USER=root \ FCREPO_DB_ROOT_PASSWORD=password \ FCREPO_DB_USER=fcrepo \ FCREPO_DISABLE_SYN=false \ - FCREPO_PERSISTENCE_TYPE=file \ + FCREPO_PERSISTENCE_TYPE=mariadb \ FCREPO_S3_BUCKET= \ FCREPO_S3_PASSWORD= \ FCREPO_S3_USER= \ diff --git a/fcrepo6/README.md b/fcrepo6/README.md index 8056b8a7..993637f4 100644 --- a/fcrepo6/README.md +++ b/fcrepo6/README.md @@ -19,9 +19,9 @@ additional settings, volumes, ports, etc. ## Volumes -| Path | Description | -| :---- | :-------------------------------------------------------------------------------------------------- | -| /data | Fcrepo Object / Binary Store if FCREPO_BINARYSTORAGE_TYPE or FCREPO_PERSISTENCE_TYPE is set to file | +| Path | Description | +| :---- | :---------------| +| /data | OCFL Filesystem | ## Settings @@ -32,17 +32,18 @@ additional settings, volumes, ports, etc. | FCREPO_ACTIVEMQ_TOPIC | /fcrepo/activemq/topic | fedora | | | FCREPO_BINARYSTORAGE_TYPE | /fcrepo/binarystorage/type | file | | | FCREPO_CATALINA_OPTS | /fcrepo/catalina/opts | | | -| FCREPO_DB_HOST | /fcrepo/db/host | mariadb | | +| FCREPO_DB_MYSQL_HOST | /fcrepo/db/mysql/host | mariadb | | +| FCREPO_DB_MYSQL_PORT | /fcrepo/db/mysql/port | 3306 | | | FCREPO_DB_NAME | /fcrepo/db/name | fcrepo | | | FCREPO_DB_PASSWORD | /fcrepo/db/password | password | | -| FCREPO_DB_PORT | /fcrepo/db/port | 3306 | | +| FCREPO_DB_POSTGRESQL_HOST | /fcrepo/db/postgresql/host | mariadb | | +| FCREPO_DB_POSTGRESQL_PORT | /fcrepo/db/postgresql/port | 3306 | | | FCREPO_DB_ROOT_PASSWORD | /fcrepo/db/root/password | password | | | FCREPO_DB_ROOT_USER | /fcrepo/db/root/user | root | | | FCREPO_DB_USER | /fcrepo/db/user | fcrepo | | | FCREPO_JAVA_OPTS | /fcrepo/java/opts | | | | FCREPO_JWT_ADMIN_TOKEN | /fcrepo/jwt/admin/token | islandora | | -| FCREPO_MODESHAPE_CONFIGURATION | /fcrepo/modeshape/configuration | classpath:/config/repository.json | | -| FCREPO_PERSISTENCE_TYPE | /fcrepo/persistence/type | file | | +| FCREPO_PERSISTENCE_TYPE | /fcrepo/persistence/type | mariadb | | | FCREPO_QUEUE | /fcrepo/queue | fedora | | | FCREPO_S3_BUCKET | /fcrepo/s3/bucket | | | | FCREPO_S3_PASSWORD | /fcrepo/s3/password | | | diff --git a/fcrepo6/rootfs/etc/confd/conf.d/setenv.sh.toml b/fcrepo6/rootfs/etc/confd/conf.d/setenv.sh.toml deleted file mode 100644 index d27eb375..00000000 --- a/fcrepo6/rootfs/etc/confd/conf.d/setenv.sh.toml +++ /dev/null @@ -1,7 +0,0 @@ -[template] -src = "setenv.sh.tmpl" -dest = "/opt/tomcat/bin/setenv.sh" -uid = 100 -gid = 1000 -mode = "0655" -keys = [ "/" ] diff --git a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl b/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl deleted file mode 100644 index 334c2af6..00000000 --- a/fcrepo6/rootfs/etc/confd/templates/setenv.sh.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -export JAVA_OPTS="{{ getv "/java/opts" "" }}" -export CATALINA_OPTS="{{ getv "/catalina/opts" (getenv "FCREPO_CATALINA_OPTS") }}" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.home=/data/home" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.jms.baseUrl=http://{{ index (lookupIP (getenv "HOSTNAME")) 0 }}/fcrepo/rest" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.external.content.allowed=/opt/tomcat/conf/allowed-external-content.txt" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.autoversioning.enabled=false" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:{{ getv "/persistence/type" (getenv "FCREPO_PERSISTENCE_TYPE") }}://{{ getv "/db/host" (getenv "FCREPO_DB_HOST") }}:{{ getv "/db/port" (getenv "FCREPO_DB_PORT") }}/fcrepo" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.user={{ getv "/db/user" (getenv "FCREPO_DB_USER") }}" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password={{ getv "/db/password" (getenv "FCREPO_DB_PASSWORD") }}" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.directory=file:///data/home/data/Activemq" -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.configuration=file:///opt/tomcat/conf/activemq.xml" -{{ if eq (getv "/disable/syn" (getenv "FCREPO_DISABLE_SYN")) "true" }} -export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" -{{ end }} diff --git a/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh b/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh index de8f359a..045b4207 100755 --- a/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh +++ b/fcrepo6/rootfs/etc/cont-init.d/03-fcrepo-setup.sh @@ -2,6 +2,15 @@ set -e function execute_sql_file { + local FCREPO_DB_HOST="" + local FCREPO_DB_PORT="" + if [[ "${FCREPO_PERSISTENCE_TYPE}" == "mysql" || "${FCREPO_PERSISTENCE_TYPE}" == "mariadb" ]]; then + FCREPO_DB_HOST="${FCREPO_DB_MYSQL_HOST}" + FCREPO_DB_PORT="${FCREPO_DB_MYSQL_PORT}" + else + FCREPO_DB_HOST="${FCREPO_DB_POSTGRESQL_HOST}" + FCREPO_DB_PORT="${FCREPO_DB_POSTGRESQL_PORT}" + fi execute-sql-file.sh \ --driver "${FCREPO_PERSISTENCE_TYPE}" \ --host "${FCREPO_DB_HOST}" \ diff --git a/fcrepo6/rootfs/opt/tomcat/bin/setenv.sh b/fcrepo6/rootfs/opt/tomcat/bin/setenv.sh new file mode 100644 index 00000000..47d171c9 --- /dev/null +++ b/fcrepo6/rootfs/opt/tomcat/bin/setenv.sh @@ -0,0 +1,20 @@ +#!/bin/sh +export JAVA_OPTS="${FCREPO_JAVA_OPTS}" +export CATALINA_OPTS="${FCREPO_CATALINA_OPTS}" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.home=/data/home" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.velocity.runtime.log=/opt/tomcat/logs/velocity.log" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.jms.baseUrl=http://${HOSTNAME}/fcrepo/rest" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.external.content.allowed=/opt/tomcat/conf/allowed-external-content.txt" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.autoversioning.enabled=false" +if [[ "${FCREPO_PERSISTENCE_TYPE}" == "mysql" ]] || [[ "${FCREPO_PERSISTENCE_TYPE}" == "mariadb" ]]; then + export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:${FCREPO_PERSISTENCE_TYPE}://${FCREPO_DB_MYSQL_HOST}:${FCREPO_DB_MYSQL_PORT}/fcrepo" +else + export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.url=jdbc:${FCREPO_PERSISTENCE_TYPE}://${FCREPO_DB_POSTGRESQL_HOST}:${FCREPO_DB_POSTGRESQL_PORT}/fcrepo" +fi +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.user=${FCREPO_DB_USER}" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.db.password=${FCREPO_DB_PASSWORD}" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.directory=file:///data/home/data/Activemq" +export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.configuration=file:///opt/tomcat/conf/activemq.xml" +if [[ "${FCREPO_DISABLE_SYN}" == "true" ]]; then + export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed" +fi From 21a28a8fff9d60b64f3ff7accdcfc7d99bb958cf Mon Sep 17 00:00:00 2001 From: dannylamb Date: Mon, 15 Mar 2021 15:04:05 -0300 Subject: [PATCH 19/20] Touching up utilities.sh --- drupal/rootfs/etc/islandora/utilities.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drupal/rootfs/etc/islandora/utilities.sh b/drupal/rootfs/etc/islandora/utilities.sh index 439a3e1e..8e04d792 100755 --- a/drupal/rootfs/etc/islandora/utilities.sh +++ b/drupal/rootfs/etc/islandora/utilities.sh @@ -450,6 +450,11 @@ function create_solr_core { # Generate solr config and create a core for it. function create_solr_core_with_default_config { + if ! drush pm-list --pipe --type=module --status=enabled --no-core | grep -q search_api_solr; then + echo "search_api_solr is not installed. Skipping core setup." + return 0 + fi + local site="${1}"; shift generate_solr_config "${site}" create_solr_core "${site}" From b6f7e4e8b91c56db2a1b78b2513aa40bfb034a16 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Mon, 15 Mar 2021 16:38:35 -0300 Subject: [PATCH 20/20] Attempting to fix deploying on remote instance without traefik.me --- .../rootfs/etc/confd/conf.d/allowed-external-content.txt.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcrepo6/rootfs/etc/confd/conf.d/allowed-external-content.txt.toml b/fcrepo6/rootfs/etc/confd/conf.d/allowed-external-content.txt.toml index 0688c9f6..ce78946b 100644 --- a/fcrepo6/rootfs/etc/confd/conf.d/allowed-external-content.txt.toml +++ b/fcrepo6/rootfs/etc/confd/conf.d/allowed-external-content.txt.toml @@ -4,4 +4,4 @@ dest = "/opt/tomcat/conf/allowed-external-content.txt" uid = 100 gid = 1000 mode = "0640" -keys = [ "/allow/external" ] +keys = [ "/" ]