From cf63dd5661ab6a9e7e725acbbd414a37f0e9e61a Mon Sep 17 00:00:00 2001 From: "Noah W. Smith" Date: Tue, 24 May 2022 12:02:39 -0400 Subject: [PATCH 1/6] Updates to work on Noah's local --- .gitignore | 1 + Vagrantfile | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 85669854..4b09d283 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ roles/external .DS_Store .project .github +islandora-repo diff --git a/Vagrantfile b/Vagrantfile index aa0eeefa..0f48654f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -36,10 +36,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Configure sync directory config.vm.synced_folder ".", home_dir + "/islandora" + config.vm.synced_folder "./islandora-repo", "/var/www/html/drupal", owner: "vagrant", group: "www-data", mode: 0777 # config.vm.synced_folder "./claw-app/web/sites/default/files", home_dir + "/islandora/claw-app/web/sites/default/files", owner: "www-data", group: "www-data", mode: 0777, disabled: false # config.vm.synced_folder "./islandora", "/var/www/html/drupal/web/modules/contrib/islandora", disabled: true - config.vm.synced_folder "./islandora-repo/web/themes/custom/asulib_barrio", "/var/www/html/drupal/web/themes/custom/asulib_barrio" - config.vm.synced_folder "./islandora-repo/web/modules/custom", "/var/www/html/drupal/web/modules/custom", owner: "vagrant", group: "vagrant", mode: 0755 + #config.vm.synced_folder "./islandora-repo/web/themes/custom/asulib_barrio", "/var/www/html/drupal/web/themes/custom/asulib_barrio" + #config.vm.synced_folder "./islandora-repo/web/modules/custom", "/var/www/html/drupal/web/modules/custom", owner: "vagrant", group: "vagrant", mode: 0755 config.vm.boot_timeout = 99999999 config.vm.network :forwarded_port, guest: 8000, host: 8000 # Apache From 8147b3283368f376d94aa3c26c938fa7282b5ef1 Mon Sep 17 00:00:00 2001 From: "Noah W. Smith" Date: Fri, 3 Jun 2022 14:53:37 -0400 Subject: [PATCH 2/6] Makefile to make setup easier --- Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..6f90d3a2 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +local_setup: + vagrant ssh -c "cd /var/www/html/drupal && composer install" + vagrant ssh -c "cd /var/www/html/drupal && git submodule init" + vagrant ssh -c "cd /var/www/html/drupal && git submodule update" + $(MAKE) update-settings-php + vagrant ssh -c "cd /var/www/html/drupal && git clone https://github.com/mjordan/islandora_bagger_integration.git web/sites/all/modules/islandora_bagger_integration" + vagrant ssh -c "cd /var/www/html/drupal && drush pm:en -y islandora_bagger_integration" + vagrant ssh -c "cd /var/www/html/drupal && drush cset -y asu_default_fields.settings disable_handle_generation 1" + vagrant ssh -c "cd /var/www/html/drupal && drush updb -y" + +update-settings-php: + vagrant ssh -c "echo '$$'\"databases['default']['default'] = ['database' => 'drupal8', 'username' => 'root', 'password' => 'islandora', 'host' => 'localhost', 'port' => '3306', 'driver' => 'mysql', 'prefix' => '', 'collation' => 'utf8mb4_general_ci'];\" >> /var/www/html/drupal/web/sites/default/settings.php" + vagrant ssh -c "echo '$$'\"settings['hash_salt'] = 'bc32ffdbba9cb51a7886fd3f5d8e2ff6';\" >> /var/www/html/drupal/web/sites/default/settings.php" + +xhprof: + vagrant ssh -c "sudo apt-get update && sudo apt-get install php-pear --fix-missing" + -vagrant ssh -c "sudo pecl install xhprof" + vagrant ssh -c "sudo chmod 777 /etc/php/7.4/cli/php.ini && echo \"extension=xhprof.so\" >> /etc/php/7.4/cli/php.ini" + vagrant ssh -c "sudo service apache2 restart" + vagrant ssh -c "php -i | grep xhprof" + vagrant ssh -c "cd /var/www/html/drupal && composer require drupal/xhprof" \ No newline at end of file From 3a47673c527297cf0176351845c688f9deab26f8 Mon Sep 17 00:00:00 2001 From: "Noah W. Smith" Date: Fri, 10 Jun 2022 15:20:26 -0400 Subject: [PATCH 3/6] ignore vscode --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4b09d283..62330cfd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ roles/external .project .github islandora-repo +.vscode From 8656bab78891b8ec13b42efef1be654141b3f3eb Mon Sep 17 00:00:00 2001 From: "Noah W. Smith" Date: Fri, 10 Jun 2022 16:53:24 -0400 Subject: [PATCH 4/6] another round of Makefile updates --- .gitignore | 1 + Makefile | 22 +++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 62330cfd..80969656 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ roles/external .github islandora-repo .vscode +.asurepo_vault_pass diff --git a/Makefile b/Makefile index 6f90d3a2..1ed50725 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,27 @@ local_setup: + vagrant plugin install vagrant-vbguest + touch .asurepo_vault_pass + @echo -n "Please ensure the file .asurepo_vault_pass has the password in it and press 'y': [y/N] " && read ans && [ $${ans:-N} = y ] vagrant ssh -c "cd /var/www/html/drupal && composer install" vagrant ssh -c "cd /var/www/html/drupal && git submodule init" vagrant ssh -c "cd /var/www/html/drupal && git submodule update" + echo "increasing php memory limit so we can do the config install later" + vagrant ssh -c "sudo chmod 777 /etc/php/7.4/cli/php.ini && sudo chmod 777 /etc/php/7.4/cli && sed -i 's/memory_limit = 256M/memory_limit = 512M/' /etc/php/7.4/cli/php.ini" + vagrant ssh -c "sudo service apache2 restart" + echo "setting up a fake 'hdl' module because we can't find the real one" + -vagrant ssh -c "cd /var/www/html/drupal && mkdir web/modules/custom/hdl && printf 'name: Nothing to see here\ncore: 8.x\ntype: module' > web/modules/custom/hdl/hdl.info.yml && printf ' web/modules/custom/hdl/hdl.module" + echo "fix some other missing modules" + vagrant ssh -c "cd /var/www/html/drupal && composer require 'drupal/contextual_range_filter:^1.0'" + -vagrant ssh -c "cd /var/www/html/drupal && git clone https://github.com/mjordan/islandora_riprap.git web/modules/custom/islandora_riprap" + -vagrant ssh -c "cd /var/www/html/drupal && git clone https://github.com/mjordan/persistent_identifiers.git web/modules/custom/persistent_identifiers" + -vagrant ssh -c "cd /var/www/html/drupal && git clone https://github.com/mjordan/islandora_bagger_integration.git web/modules/custom/islandora_bagger_integration" + vagrant ssh -c "cd /var/www/html/drupal && drush pm:en -y islandora_riprap islandora_bagger_integration layout_builder contextual_range_filter" + vagrant ssh -c "cd /var/www/html/drupal && drupal config:import --directory /var/www/html/drupal/config/sync" + vagrant ssh -c "cd /var/www/html/drupal && drush config:import --partial --source /var/www/html/drupal/config/dev -y" + vagrant ssh -c "cd /var/www/html/drupal && drush pm:un -y asu_deposit_methods && drush pm:en -y asu_deposit_methods" $(MAKE) update-settings-php - vagrant ssh -c "cd /var/www/html/drupal && git clone https://github.com/mjordan/islandora_bagger_integration.git web/sites/all/modules/islandora_bagger_integration" - vagrant ssh -c "cd /var/www/html/drupal && drush pm:en -y islandora_bagger_integration" vagrant ssh -c "cd /var/www/html/drupal && drush cset -y asu_default_fields.settings disable_handle_generation 1" + vagrant ssh -c "cd /var/www/html/drupal && drush cset -y islandora.settings fedora_url http://127.0.0.1:8080/fcrepo/rest" vagrant ssh -c "cd /var/www/html/drupal && drush updb -y" update-settings-php: @@ -18,4 +34,4 @@ xhprof: vagrant ssh -c "sudo chmod 777 /etc/php/7.4/cli/php.ini && echo \"extension=xhprof.so\" >> /etc/php/7.4/cli/php.ini" vagrant ssh -c "sudo service apache2 restart" vagrant ssh -c "php -i | grep xhprof" - vagrant ssh -c "cd /var/www/html/drupal && composer require drupal/xhprof" \ No newline at end of file + vagrant ssh -c "cd /var/www/html/drupal && composer require drupal/xhprof" From 67a4cf2ffcaa981818efec94bd0977f9935ebe36 Mon Sep 17 00:00:00 2001 From: "Noah W. Smith" Date: Tue, 21 Jun 2022 16:28:09 -0400 Subject: [PATCH 5/6] merge conflict and xdebug config --- Makefile | 1 + Vagrantfile | 1 + assets/drupal/00_xdebug.ini | 1 + 3 files changed, 3 insertions(+) create mode 100644 assets/drupal/00_xdebug.ini diff --git a/Makefile b/Makefile index 1ed50725..a4da41df 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ local_setup: vagrant ssh -c "cd /var/www/html/drupal && drush cset -y asu_default_fields.settings disable_handle_generation 1" vagrant ssh -c "cd /var/www/html/drupal && drush cset -y islandora.settings fedora_url http://127.0.0.1:8080/fcrepo/rest" vagrant ssh -c "cd /var/www/html/drupal && drush updb -y" + # fedora_url: 'http://127.0.0.1:8080/fcrepo/rest' update-settings-php: vagrant ssh -c "echo '$$'\"databases['default']['default'] = ['database' => 'drupal8', 'username' => 'root', 'password' => 'islandora', 'host' => 'localhost', 'port' => '3306', 'driver' => 'mysql', 'prefix' => '', 'collation' => 'utf8mb4_general_ci'];\" >> /var/www/html/drupal/web/sites/default/settings.php" diff --git a/Vagrantfile b/Vagrantfile index 0f48654f..7dbbc30c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -37,6 +37,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Configure sync directory config.vm.synced_folder ".", home_dir + "/islandora" config.vm.synced_folder "./islandora-repo", "/var/www/html/drupal", owner: "vagrant", group: "www-data", mode: 0777 + config.vm.synced_folder "./assets/drupal", "/etc/php7/conf.d", type: "rsync", rsync__args: ["-r", "--include=00_xdebug.ini", "--exclude=*"], owner: "www-data", group: "www-data", mode: 0600 # config.vm.synced_folder "./claw-app/web/sites/default/files", home_dir + "/islandora/claw-app/web/sites/default/files", owner: "www-data", group: "www-data", mode: 0777, disabled: false # config.vm.synced_folder "./islandora", "/var/www/html/drupal/web/modules/contrib/islandora", disabled: true #config.vm.synced_folder "./islandora-repo/web/themes/custom/asulib_barrio", "/var/www/html/drupal/web/themes/custom/asulib_barrio" diff --git a/assets/drupal/00_xdebug.ini b/assets/drupal/00_xdebug.ini new file mode 100644 index 00000000..51fd0433 --- /dev/null +++ b/assets/drupal/00_xdebug.ini @@ -0,0 +1 @@ +extension=xhprof.so From 43cbefe41c81de813f45c65bc6721a32892009e8 Mon Sep 17 00:00:00 2001 From: "Noah W. Smith" Date: Fri, 24 Jun 2022 17:10:21 -0400 Subject: [PATCH 6/6] further settings.php updates --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index a4da41df..fe83775f 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,16 @@ local_setup: update-settings-php: vagrant ssh -c "echo '$$'\"databases['default']['default'] = ['database' => 'drupal8', 'username' => 'root', 'password' => 'islandora', 'host' => 'localhost', 'port' => '3306', 'driver' => 'mysql', 'prefix' => '', 'collation' => 'utf8mb4_general_ci'];\" >> /var/www/html/drupal/web/sites/default/settings.php" vagrant ssh -c "echo '$$'\"settings['hash_salt'] = 'bc32ffdbba9cb51a7886fd3f5d8e2ff6';\" >> /var/www/html/drupal/web/sites/default/settings.php" + #$settings['flysystem']['fedora']['driver'] = 'fedora'; + vagrant ssh -c "echo '$$'\"settings['flysystem']['fedora']['driver'] = 'fedora';\" >> /var/www/html/drupal/web/sites/default/settings.php" + #$settings['flysystem']['fedora']['config']['root'] = 'http://localhost:8081/fcrepo/rest/'; + vagrant ssh -c "echo '$$'\"settings['flysystem']['fedora']['config']['root'] = 'http://localhost:8081/fcrepo/rest/';\" >> /var/www/html/drupal/web/sites/default/settings.php" + #$settings['reverse_proxy'] = true; + vagrant ssh -c "echo '$$'\"settings['reverse_proxy'] = true;\" >> /var/www/html/drupal/web/sites/default/settings.php" + #$settings['reverse_proxy_addresses'] = array ( 0 => '', ); + vagrant ssh -c "echo '$$'\"settings['reverse_proxy_addresses'] = array ( 0 => '', );\" >> /var/www/html/drupal/web/sites/default/settings.php" + #$settings['file_private_path'] = '/var/www/html/private'; + vagrant ssh -c "echo '$$'\"settings['file_private_path'] = '/var/www/html/private';\" >> /var/www/html/drupal/web/sites/default/settings.php" xhprof: vagrant ssh -c "sudo apt-get update && sudo apt-get install php-pear --fix-missing"