diff --git a/Dockerfile b/Dockerfile index 961b5c08a..dd269858e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,11 +22,13 @@ COPY --chown=nginx:www-data codebase /var/www/drupal/ COPY --chown=0:0 rootfs / RUN \ /bin/rm -f /etc/cont-init.d/99-custom-setup.sh && \ + for dirname in web/sites/default/files/tmp /tmp/private ; do \ + /bin/mkdir -m 0775 -p "$dirname" && \ + /bin/chown -R nginx:www-data "$dirname" ; done && \ for dirname in /var/www/drupal/{vendor,web} ; do \ if [ -d "$dirname" ] ; then \ find "$dirname" \! -user nginx -exec chown -v nginx:www-data {} \; ; \ - fi ; \ - done && \ + fi ; done && \ chmod 0750 /var/www/drupal/fix_permissions.sh && \ /var/www/drupal/fix_permissions.sh /var/www/drupal/web nginx diff --git a/codebase/composer.json b/codebase/composer.json index 79ba978a9..bb2f19432 100644 --- a/codebase/composer.json +++ b/codebase/composer.json @@ -15,6 +15,10 @@ "type": "composer", "url": "https://packages.drupal.org/8" }, + { + "type": "vcs", + "url": "https://git.drupal.org/project/title_length.git" + }, { "type": "vcs", "url": "git@github.com:Islandora/islandora.git" @@ -151,7 +155,7 @@ "drupal/s3fs": "^3.0@alpha", "drupal/search_api_solr": "^4.1", "drupal/simplesamlphp_auth": "^3.2", - "drupal/title_length": "^1.1", + "drupal/title_length": "1.1.0", "drupal/transliterate_filenames": "^1.3", "drupal/views_data_export": "^1.0", "drupal/workbench": "^1.3", @@ -199,7 +203,8 @@ "drupal/core-project-message": true, "drupal/core-vendor-hardening": true, "zaporylie/composer-drupal-optimizations": true, - "wikimedia/composer-merge-plugin": true + "wikimedia/composer-merge-plugin": true, + "dealerdirect/phpcodesniffer-composer-installer": false } }, "autoload": { @@ -265,6 +270,10 @@ "Media Source Serivce": "patches/mediasourceservice.patch", "Media Source Controller": "patches/mediasourcecontroller.patch" }, + "drupal/title_length": { + "Node title length 1: Apply user config override": "patches/node_title_length_fix-hook-install.patch", + "Node title length 2: Taxonomy name length": "patches/node_title_length_termNameCharLength-3041979-8.patch" + }, "drupal/search_api_solr": { "search_api_solr_defaults_post_update_uninstall_module": "patches/search_api_solr_defaults_post_update_uninstall_module.patch" } diff --git a/codebase/composer.lock b/codebase/composer.lock index d33f9f200..328d0660c 100644 --- a/codebase/composer.lock +++ b/codebase/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "81d89ce30a3e6e40021d650127fbf0c5", + "content-hash": "0acfb7a8206efeeed45e2987323049ba", "packages": [ { "name": "alchemy/zippy", @@ -182,16 +182,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.254.0", + "version": "3.254.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "9e07cddf9be6ab241c241344ca2e9cf33e32a22e" + "reference": "c020b283360bd802ee24959ffb63d70603f8b408" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9e07cddf9be6ab241c241344ca2e9cf33e32a22e", - "reference": "9e07cddf9be6ab241c241344ca2e9cf33e32a22e", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c020b283360bd802ee24959ffb63d70603f8b408", + "reference": "c020b283360bd802ee24959ffb63d70603f8b408", "shasum": "" }, "require": { @@ -270,9 +270,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.254.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.254.1" }, - "time": "2022-12-19T19:23:23+00:00" + "time": "2022-12-20T19:28:05+00:00" }, { "name": "chi-teck/drupal-code-generator", @@ -6741,17 +6741,17 @@ }, { "name": "drupal/title_length", - "version": "1.2.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/title_length.git", - "reference": "8.x-1.2" + "reference": "8.x-1.1" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/title_length-8.x-1.2.zip", - "reference": "8.x-1.2", - "shasum": "22a19724c3807b6847a84ae0a38df80eebe69360" + "url": "https://ftp.drupal.org/files/projects/title_length-8.x-1.1.zip", + "reference": "8.x-1.1", + "shasum": "f8a961bcc4cde1bf7c0f57c0a7b6248ea9d92bd4" }, "require": { "drupal/core": "^8 || ^9" @@ -6759,8 +6759,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.2", - "datestamp": "1631721151", + "version": "8.x-1.1", + "datestamp": "1591431505", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -19833,16 +19833,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.15.2", + "version": "1.15.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "5941477f100993652218928039d530b75a13a9ca" + "reference": "61800f71a5526081d1b5633766aa88341f1ade76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/5941477f100993652218928039d530b75a13a9ca", - "reference": "5941477f100993652218928039d530b75a13a9ca", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/61800f71a5526081d1b5633766aa88341f1ade76", + "reference": "61800f71a5526081d1b5633766aa88341f1ade76", "shasum": "" }, "require": { @@ -19872,9 +19872,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.15.2" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.15.3" }, - "time": "2022-12-16T06:42:48+00:00" + "time": "2022-12-20T20:56:55+00:00" }, { "name": "phpstan/phpstan", diff --git a/idc.Makefile b/idc.Makefile index 3492ca88e..ebb867e6c 100644 --- a/idc.Makefile +++ b/idc.Makefile @@ -18,7 +18,7 @@ bootstrap: snapshot-empty default destroy-state up install \ # Rebuilds the Drupal cache .PHONY: cache-rebuild .SILENT: cache-rebuild -cache-rebuild: set-tmp +cache-rebuild: echo "rebuilding Drupal cache..." docker-compose exec -T drupal drush cr -y @@ -200,7 +200,7 @@ static-drupal-image: EXISTING=`docker images -q $$IMAGE` ; \ if test -z "$$EXISTING" ; then \ echo "Building Drupal image with base: $${REPOSITORY}/drupal:$${TAG} " ; \ - docker build --build-arg REPOSITORY=$${REPOSITORY} --build-arg TAG=$${TAG} -t $${IMAGE} .; \ + docker build --build-arg REPOSITORY=$${REPOSITORY} --build-arg TAG=$${TAG} -t $${IMAGE} . && \ docker tag $${IMAGE} ${REPOSITORY}/drupal-static:static ; \ else \ echo "Using existing Drupal image $${EXISTING}" ; \ diff --git a/rootfs/etc/cont-init.d/.999-startup.sh.swp b/rootfs/etc/cont-init.d/.999-startup.sh.swp deleted file mode 100644 index e0fe199d8..000000000 Binary files a/rootfs/etc/cont-init.d/.999-startup.sh.swp and /dev/null differ diff --git a/rootfs/etc/cont-init.d/991-custom-setup.sh b/rootfs/etc/cont-init.d/991-custom-setup.sh index 982863b39..048c3674f 100755 --- a/rootfs/etc/cont-init.d/991-custom-setup.sh +++ b/rootfs/etc/cont-init.d/991-custom-setup.sh @@ -134,7 +134,23 @@ function main { local db_count=0 $(installed_local) || db_count=$? - # IDC: Removed composer install (should be done during image build phase) + # IDC: modified composer install section to avoid running composer install as part of startup + # Install Composer modules if necessary. + if [ ! -d vendor ] ; then + printf "\nNo $(pwd)/vendor directory found\n" + if [ ! -f composer.lock ] ; then + printf "\nNo $(pwd)/composer.lock found. Exiting startup script; cannot continue (but not error state).\n" + exit 0 + fi + + # No vendor/ but we do have composer.lock file: + if [ -n "${DRUPAL_INSTANCE}" ] && [ "${DRUPAL_INSTANCE}" != "dev" ] ; + then + COMPOSER_MEMORY_LIMIT=-1 composer install + else + COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-install=auto + fi + fi if [ -z "${db_count}" ] || [ "${db_count}" -lt 1 ] ; then printf "\n\nERROR: Drupal is not installed, no pre-existing state found\n\n" diff --git a/rootfs/etc/cont-init.d/999-startup.sh b/rootfs/etc/cont-init.d/999-startup.sh index bc72e18b6..90abd931d 100755 --- a/rootfs/etc/cont-init.d/999-startup.sh +++ b/rootfs/etc/cont-init.d/999-startup.sh @@ -14,13 +14,6 @@ MKDIR="/bin/mkdir" set +e -echo "Creating tmp and private directories" -for d in $DRUPAL_DIR/web/sites/default/files/tmp /tmp/private ; do - echo " directory: '$d'" - $MKDIR -m 0775 -p "$d" - $CHOWN -R nginx:nginx "$d" -done - drush -y state:set system.maintenance_mode 1 --input-format=integer # This is a workaround for a bug.