From 4212c749330346621dff89f7aecf77382eb0e94f Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Wed, 21 Dec 2022 07:37:22 -0700 Subject: [PATCH 1/5] remove .swp file --- rootfs/etc/cont-init.d/.999-startup.sh.swp | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 rootfs/etc/cont-init.d/.999-startup.sh.swp 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 e0fe199d80bdba414aff71d16b8df1c2fe109aff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2O>Y}T7{@1Ecr76M0eHHJ>K0f}T3S_cF(R_vHqa!xTYJ!Ic9GaJWJ zRn8z(1Ye*MSGWM5f&&~lpn?Pk5JE^CIKzei+H0qcT7pDX2{fzxve}*4*?E35^Egqa zyLf43m6ocD49C-q-FWt+;EUg`vd?cZW>p*uZB^JGwi}Jr<;JlS)hG=_ zbhql)XAN?r1OC<^=UQf|;mSlJ2~#b2FV&keMXSlQh57NZ?Dp9r? z@};FE-&k}n&#Go{x7WFQ&VVy;hk*m^#pB1uOMTuuLI0MdrGvEw31I~am;0!ne&VV!U zA2c9B#{7pFJNXDYkN^Kq|Nj5!DaL*T-+`~eb?_Yc=1IoB0$+m9z)kQT7=azI1v1bC zbKsW)s1H5`pMZ}+AM`*I%z<~GVC)_60{G!^#=ZwPK@ZfyOW-&-2>yJGu|L4C;9GDD zY=LF)3aEhJA7$)A@IJT!UIi;)87zUH5$gw_4vM%>0CzY8&VV!E3^)VMz&-|KFi6Ss z*yK$9eLHBkP1^Tprit9Q68X2adH?%4?XSmJsB<$Qe?-`oXl2bvOJ-!OjH|IwiIs^+ z0@;bvP|_llsU*v-kNu9Zu=S$6FExJUQH&_a$Q#NowmWLc@jxC)!($mL!Bs5!xKP*$ zX?R~IQmdevC4F!5gi#iyq3nq~vb?8?2k)rGRFB@IL*)0Uc*8#R=_;KjJCI2^(v375 z(b>sc=?q#&*poTX$hDSIV|#AY7miHC z1)2^Yrt)V5UTp5Pxq+#kl2K^tC_>YI*)(0FAh+a)S8536I4+G0sbV;B-me^;4M#X0 zj@*>}yfALGTCL6oEC`ASW9e(zSH|kmG@?j~WKYrfxp`_7MR_)Thmk@D17BpSre!x* zQRrJOf=#LE+BLE|m*w2pt>~LH(lwPJ#whY*WsFMtlR)h#lVWRLHa6byNNSy8I!$zDgUpxP7#8nJb1bn|+mxeABFg2F zN;yYO012XU)PFgYk+dklyiDV?a@3o3=HIlYWt>{sfnX`(&QOaillu0?+5Dt=vlaPU zxzr=_nyvG#jTW70udfn1+(8Jrq|4`8?G^=T6v@D1lGXQwK+9`QN<=JCFdmr>My68; z@01I}R8H>(RlYVr*l1MCs@%a^EoLuGmR|Kb~g@*4SVO8P3^Bp|S@0A;DoDs)2o@up>EQjsrUc@ From 72a21ec88d5a196ee9478ac0a17f3fef45279d4d Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Wed, 21 Dec 2022 11:00:24 -0700 Subject: [PATCH 2/5] revert drupal/title_length to version matching patch file --- codebase/composer.json | 13 +++++++++++-- codebase/composer.lock | 40 ++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 22 deletions(-) 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", From e5099351c5529f0ddc6e27ded84327959b96b8a6 Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Wed, 21 Dec 2022 11:01:00 -0700 Subject: [PATCH 3/5] allow for missing vendor/ directory at startup, triggering composer install --- rootfs/etc/cont-init.d/991-custom-setup.sh | 18 +++++++++++++++++- rootfs/etc/cont-init.d/999-startup.sh | 7 ------- 2 files changed, 17 insertions(+), 8 deletions(-) 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. From 9f19a2f7498def974d09a1183a7bebd86e8dccad Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Wed, 21 Dec 2022 11:01:39 -0700 Subject: [PATCH 4/5] add private directories to image rather than during 999 startup script --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 From 19b04b5ee31b8fb249def739738ceaae31da00c4 Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Wed, 21 Dec 2022 11:02:12 -0700 Subject: [PATCH 5/5] remove set-tmp target since these directories are established in image build --- idc.Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}" ; \