From f7e6b4a6aa724e7ce2099ad880a57aec1e9419b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Thu, 11 Jul 2024 16:36:18 +0100 Subject: [PATCH 01/18] feat: user prompted to enter supporting company --- install/createSite.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install/createSite.php b/install/createSite.php index 40a765db69..3aed43ec46 100644 --- a/install/createSite.php +++ b/install/createSite.php @@ -92,6 +92,11 @@ $variables['library'] = readline("Enter the library or consortium name, e.g., Aspen Public Library > "); } + $variables['supportingCompany'] = readline("Enter the name of the supporting company (default: ByWater Solutions) > "); + if (empty($variables['supportingCompany'])) { + $variables['supportingCompany'] = "ByWater Solutions"; + } + $variables['title'] = ''; while (empty($variables['title'])) { $variables['title'] = readline("Enter the title of the site, e.g., Aspen Demo (may be same as library name) > "); From ec3a1c10038655963d49509e14b773d9f8d8d07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Thu, 11 Jul 2024 16:48:58 +0100 Subject: [PATCH 02/18] feat: save supportingCompany into db Uses a pre-established connection to the database to update the supportingCompany variable in the db. --- install/createSite.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install/createSite.php b/install/createSite.php index 3aed43ec46..d58327c293 100644 --- a/install/createSite.php +++ b/install/createSite.php @@ -320,6 +320,10 @@ $updateUserStmt = $aspen_db->prepare("UPDATE user set cat_password=" . $aspen_db->quote($variables['aspenAdminPwd']) . ", password=" . $aspen_db->quote($variables['aspenAdminPwd']) . " where username = 'aspen_admin'"); $updateUserStmt->execute(); +//Assign supportingCompany in the db +$postSupportingCompanyStmt = $aspen_db->prepare("UPDATE system_variables set supportingCompany=" . $aspen_db->quote($variables['supportingCompany'])); +$postSupportingCompanyStmt->execute(); + if ($variables['ils'] == 'Koha'){ // Attempt to get the system's temp directory $tmp_dir = rtrim(sys_get_temp_dir(), "/"); From 1ab33e67a2cae5a4b71a301570080b745c7fddfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Thu, 11 Jul 2024 16:56:17 +0100 Subject: [PATCH 03/18] feat: add supportingCompany to createSiteTemplate Add the supportingCompany variable to createSiteTemplate.ini --- install/createSite.php | 1 + install/createSiteTemplate.ini | 2 ++ 2 files changed, 3 insertions(+) diff --git a/install/createSite.php b/install/createSite.php index d58327c293..93bb667ef7 100644 --- a/install/createSite.php +++ b/install/createSite.php @@ -34,6 +34,7 @@ $variables = [ 'sitename' => $sitename, 'cleanSitename' => $cleanSitename, + 'supportingCompany' => $configArray['Site']['supportingCompany'], 'library' => $configArray['Site']['sitename'], 'title' => $configArray['Site']['title'], 'url' => $configArray['Site']['url'], diff --git a/install/createSiteTemplate.ini b/install/createSiteTemplate.ini index 8c9cb3b6ba..a738a0a36b 100644 --- a/install/createSiteTemplate.ini +++ b/install/createSiteTemplate.ini @@ -19,6 +19,8 @@ solrPort = 8080 ils = ; timezone of the library (e.g. America/Los_Angeles, check http://www.php.net/manual/en/timezones.php) timezone = +; name of the supporting company (is set to ByWater Solutions by default) +supportingCompany = [Aspen] ; Database host for Aspen From 3ef3480a421517cb3c1a6e8338e782c24f5b0f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Fri, 12 Jul 2024 10:04:48 +0000 Subject: [PATCH 04/18] docs: update changelog --- code/web/release_notes/24.07.00.MD | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/web/release_notes/24.07.00.MD b/code/web/release_notes/24.07.00.MD index 226d3af979..7f5baddd7e 100644 --- a/code/web/release_notes/24.07.00.MD +++ b/code/web/release_notes/24.07.00.MD @@ -93,6 +93,10 @@ - Add a utility to generate a site template to aid in migrating servers. (*MDN*) - Update updateSitePermissions scripts to include all directories. (*MDN*) +// Chloe PTFS-Europe +### Other Updates +- Add the ability to change the supporting company name on site creation. (*CZ*) + ## This release includes code contributions from - ByWater Solutions - Mark Noble (MDN) @@ -106,6 +110,7 @@ - PTFS-Europe - Pedro Amorim (PA) - Alexander Blanchard (AB) + - Chloe Zermatten (CZ) - Theke Solutions - Lucas Montoya (LM) \ No newline at end of file From 9c07848bdd7cf6813ee004a00305f5ca48b2df00 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 12:12:01 -0600 Subject: [PATCH 05/18] When updating site permissions also update sideload permissions. --- install/updateAllSideloadPermissions.php | 33 ++++++++++++++++++++++++ install/updateSitePermissions.sh | 2 ++ install/updateSitePermissions_debian.sh | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 install/updateAllSideloadPermissions.php diff --git a/install/updateAllSideloadPermissions.php b/install/updateAllSideloadPermissions.php new file mode 100644 index 0000000000..bb010245af --- /dev/null +++ b/install/updateAllSideloadPermissions.php @@ -0,0 +1,33 @@ + 2) { + $serverName = $_SERVER['argv'][1]; + $operatingSystem = $_SERVER['argv'][2]; +}else{ + echo("Please provide 2 parameters, the first should be the name of the server to update and the second should be the operating system centos/debian\n"); + die(); +} + +require_once ROOT_DIR . '/sys/Indexing/SideLoad.php'; +$sideLoad = new SideLoad(); +$sideLoads = $sideLoad->fetchAll('name', 'marcPath'); +foreach ($sideLoads as $name => $marcPath) { + echo("Updating permissions for $name\n"); + if ($operatingSystem == 'centos') { + exec("chown aspen:aspen_apache ' . $marcPath/..)"); + exec("chmod 775 ' . $marcPath/..)"); + + exec("chown -R apache:aspen_apache ' . $marcPath)"); + exec("chmod 775 ' . $marcPath)"); + }else{ + exec("chown aspen:aspen_apache ' . $marcPath/..)"); + exec("chmod 775 ' . $marcPath/..)"); + + exec("chown -R www-data:aspen_apache ' . $marcPath)"); + exec("chmod 775 ' . $marcPath)"); + } +} \ No newline at end of file diff --git a/install/updateSitePermissions.sh b/install/updateSitePermissions.sh index 1db2fb57c5..3c173f7a8c 100755 --- a/install/updateSitePermissions.sh +++ b/install/updateSitePermissions.sh @@ -42,3 +42,5 @@ chown -R aspen:aspen_apache /usr/local/aspen-discovery/code/web/sitemaps chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-7.6.0 chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-8.11.2 chown -R solr:solr /data/aspen-discovery/$1/solr7 + +php updateAllSideloadPermissions.php $1 centos \ No newline at end of file diff --git a/install/updateSitePermissions_debian.sh b/install/updateSitePermissions_debian.sh index 21b99e5c96..c672d19727 100755 --- a/install/updateSitePermissions_debian.sh +++ b/install/updateSitePermissions_debian.sh @@ -42,3 +42,5 @@ chown -R aspen:aspen_apache /usr/local/aspen-discovery/code/web/sitemaps chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-7.6.0 chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-8.11.2 chown -R solr:solr /data/aspen-discovery/$1/solr7 + +php updateAllSideloadPermissions.php $1 debian \ No newline at end of file From 2daa3bf9216c5acad020592101b295f956152856 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 12:36:02 -0600 Subject: [PATCH 06/18] Update site permissions --- install/updateSitePermissions.sh | 3 +++ install/updateSitePermissions_debian.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/install/updateSitePermissions.sh b/install/updateSitePermissions.sh index 3c173f7a8c..18bb25436b 100755 --- a/install/updateSitePermissions.sh +++ b/install/updateSitePermissions.sh @@ -5,6 +5,9 @@ if [ -z "$1" ] echo "Please provide the server name to update as the first argument." exit 1 fi +chown root:root /data +chown -R aspen:aspen_apache /data/aspen-discovery + chown -R aspen:aspen_apache /data/aspen-discovery/$1 chmod -R 775 /data/aspen-discovery/$1 chgrp -R aspen_apache /data/aspen-discovery/accelerated_reader diff --git a/install/updateSitePermissions_debian.sh b/install/updateSitePermissions_debian.sh index c672d19727..3f3290103a 100755 --- a/install/updateSitePermissions_debian.sh +++ b/install/updateSitePermissions_debian.sh @@ -5,6 +5,9 @@ if [ -z "$1" ] echo "Please provide the server name to update as the first argument." exit 1 fi +chown root:root /data +chown -R aspen:aspen_apache /data/aspen-discovery + chown -R aspen:aspen_apache /data/aspen-discovery/$1 chmod -R 775 /data/aspen-discovery/$1 chgrp -R aspen_apache /data/aspen-discovery/accelerated_reader From 55adaacd775484a5468d98a4657464e7e9de8db0 Mon Sep 17 00:00:00 2001 From: Kodi Date: Mon, 15 Jul 2024 12:20:42 -0700 Subject: [PATCH 07/18] Small Bug Fixes Add logic for assigning the format 'Physical Object' if position 6 of the Leader is 'R' and the record has no 008 field Increase column length for format in user_hold table to accommodate concatenated OverDrive/Libby formats Updated release notes Tested on my local --- .../format_classification/MarcRecordFormatClassifier.java | 4 ++++ code/web/release_notes/24.07.00.MD | 2 ++ code/web/sys/DBMaintenance/version_updates/24.07.00.php | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/code/reindexer/src/org/aspen_discovery/format_classification/MarcRecordFormatClassifier.java b/code/reindexer/src/org/aspen_discovery/format_classification/MarcRecordFormatClassifier.java index 475b624e89..f49d1c6a55 100644 --- a/code/reindexer/src/org/aspen_discovery/format_classification/MarcRecordFormatClassifier.java +++ b/code/reindexer/src/org/aspen_discovery/format_classification/MarcRecordFormatClassifier.java @@ -948,6 +948,10 @@ public void getFormatFromLeader(AbstractGroupedWorkSolr groupedWork, Set result.add("PhysicalObject"); break; } + } else { + if (groupedWork != null && groupedWork.isDebugEnabled()) {groupedWork.addDebugMessage("Adding bib level format PhysicalObject based on Leader and no 008 field", 2);} + result.add("PhysicalObject"); + break; } break; case 'T': diff --git a/code/web/release_notes/24.07.00.MD b/code/web/release_notes/24.07.00.MD index 226d3af979..ac2501bbc6 100644 --- a/code/web/release_notes/24.07.00.MD +++ b/code/web/release_notes/24.07.00.MD @@ -46,6 +46,7 @@ - Correct loading Days Since Added Facet for item items at libraries where the display status is not "On Order". (Tickets 134372, 134501, 134543, 134618) (*MDN*) - Check the fallback format if the only format detected with earlier rules is "Book" as well as checking fallback format if no formats are found. (Ticket 134503) (*MDN*) - Check for null formats when determining inclusion of records. (*MDN*) +- Add logic for assigning the format 'Physical Object' if position 6 of the Leader is 'R' and the record has no 008 field (Ticket 134996) (*KL*) ### Koha Updates - Add control over whether holidays and hours are automatically loaded from Koha for each library and location. (Tickets 130879, 132358) (*MDN*) @@ -92,6 +93,7 @@ - Delete old tables in the database while initializing the database for unit test. (*MDN*) - Add a utility to generate a site template to aid in migrating servers. (*MDN*) - Update updateSitePermissions scripts to include all directories. (*MDN*) +- Increase column length for format in user_hold table to accommodate concatenated OverDrive/Libby formats (Ticket 134832) (*KL*) ## This release includes code contributions from - ByWater Solutions diff --git a/code/web/sys/DBMaintenance/version_updates/24.07.00.php b/code/web/sys/DBMaintenance/version_updates/24.07.00.php index eb239b0516..19ee0bae13 100644 --- a/code/web/sys/DBMaintenance/version_updates/24.07.00.php +++ b/code/web/sys/DBMaintenance/version_updates/24.07.00.php @@ -56,6 +56,14 @@ function getUpdates24_07_00(): array { ) ENGINE INNODB', ], ], // self_registration_form_carlx + 'overdrive_format_length' => [ + 'title' => 'Format Length', + 'description' => 'Increase column length for format in user_hold table to accomodate concatenated OverDrive/Libby formats', + 'sql' => [ + 'ALTER TABLE user_hold CHANGE COLUMN format format VARCHAR(150)', + ], + ],//overdrive_format_length + //katherine - ByWater //greenhouseMonitoring 'greenhouseSlackIntegration2' => [ From 4ea6b684e3319775cbb4b255613e4807e37acbde Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 15:19:24 -0600 Subject: [PATCH 08/18] Update httpd-aspencat.production-le-ssl.conf --- .../httpd-aspencat.production-le-ssl.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf b/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf index 3f6dc1cfb3..7c0a4abd94 100644 --- a/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf +++ b/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf @@ -117,6 +117,11 @@ # Friendly URLs RewriteEngine On + + # Bot Blocking + Include /usr/local/aspen-discovery/sites/aspencat.production/conf/badBotsLocal.conf + Include /usr/local/aspen-discovery/sites/default/conf/badBotsDefault.conf + RewriteRule ^robots\.txt$ /robots.php [NC,L] RewriteRule ^sitemapindex\.xml$ /sitemapindex.php [NC,L] RewriteRule ^grouped_work_site_map(.+)$ /sitemaps/grouped_work_site_map$1 [NC,L] From 73d3af018d02c7ff68e0c257fac154628d81dc70 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 15:57:51 -0600 Subject: [PATCH 09/18] Update httpd-aspencat.production-le-ssl.conf --- sites/aspencat.production/httpd-aspencat.production-le-ssl.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf b/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf index 7c0a4abd94..0b55339fef 100644 --- a/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf +++ b/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf @@ -117,7 +117,7 @@ # Friendly URLs RewriteEngine On - + # Bot Blocking Include /usr/local/aspen-discovery/sites/aspencat.production/conf/badBotsLocal.conf Include /usr/local/aspen-discovery/sites/default/conf/badBotsDefault.conf From 6f96fd6c8b63f85c036f3de5f3eeb648a9e54c46 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 15:58:07 -0600 Subject: [PATCH 10/18] Update script to update site permissions --- install/updateSitePermissions.sh | 57 ++++++++++++++----------- install/updateSitePermissions_debian.sh | 57 ++++++++++++++----------- 2 files changed, 66 insertions(+), 48 deletions(-) diff --git a/install/updateSitePermissions.sh b/install/updateSitePermissions.sh index 18bb25436b..dc53f6dac4 100755 --- a/install/updateSitePermissions.sh +++ b/install/updateSitePermissions.sh @@ -5,27 +5,41 @@ if [ -z "$1" ] echo "Please provide the server name to update as the first argument." exit 1 fi + +# /data directory chown root:root /data chown -R aspen:aspen_apache /data/aspen-discovery - +chown -R root:aspen_apache /data/aspen-discovery/accelerated_reader +chmod -R 775 /data/aspen-discovery/accelerated_reader chown -R aspen:aspen_apache /data/aspen-discovery/$1 chmod -R 775 /data/aspen-discovery/$1 -chgrp -R aspen_apache /data/aspen-discovery/accelerated_reader -chmod -R 775 /data/aspen-discovery/accelerated_reader -chmod -R 755 /usr/local/aspen-discovery/code/web/files -chown -R apache:aspen_apache /usr/local/aspen-discovery/code/web/fonts -chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf +chown -R aspen:aspen_apache /data/aspen-discovery/$1/covers +chmod -R g+w /data/aspen-discovery/$1/covers chown -R aspen:aspen_apache /data/aspen-discovery/$1/ils -chmod -R 755 /var/log/aspen-discovery/$1 -chmod -R 755 /var/log/aspen-discovery/$1/logs -chown -R aspen:aspen /var/log/aspen-discovery/$1/logs +chown -R aspen:aspen_apache /data/aspen-discovery/$1/uploads +chmod -R g+w /data/aspen-discovery/$1/uploads +chown -R solr:aspen /data/aspen-discovery/$1/solr7 +chown -R root:root /data/aspen-discovery/$1/sql_backup -chown root:root /usr/local/aspen-discovery/sites/$1/httpd-$1.conf -chown root:root /usr/local/aspen-discovery/sites/$1/conf/crontab_settings.txt -chmod 0644 /usr/local/aspen-discovery/sites/$1/conf/crontab_settings.txt +# /usr/local directory +chown -R root:root /usr/local/aspen-discovery +chown -R aspen:aspen /usr/local/aspen-discovery/code +chown -R apache:aspen_apache /usr/local/aspen-discovery/code/web +chmod -R 755 /usr/local/aspen-discovery/code/web/files +chmod -R 755 /usr/local/aspen-discovery/code/web/fonts +chown -R aspen:aspen_apache /usr/local/aspen-discovery/code/web/sitemaps +chown -R root:root /usr/local/aspen-discovery/docker +chown -R apache:aspen_apache /usr/local/aspen-discovery/sites +chown -R aspen:aspen_apache /usr/local/aspen-discovery/default +chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-7.6.0 +chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-8.11.2 +chown root:root /usr/local/aspen-discovery/sites/$1 +chown root:root /usr/local/aspen-discovery/sites/$1/httpd-*.conf chown aspen:aspen /usr/local/aspen-discovery/sites/$1/$1.sh chmod +x /usr/local/aspen-discovery/sites/$1/$1.sh - +chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf +chown root:root /usr/local/aspen-discovery/sites/$1/conf/crontab_settings.txt +chmod 0644 /usr/local/aspen-discovery/sites/$1/conf/crontab_settings.txt if [ -f "/usr/local/aspen-discovery/sites/$1/conf/log4j" ]; then chown aspen:aspen /usr/local/aspen-discovery/sites/$1/conf/log4j* fi @@ -33,17 +47,12 @@ if [ -f "/usr/local/aspen-discovery/sites/$1/conf/passkey" ]; then chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf/passkey fi chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf/config* -chown -R aspen:aspen_apache /data/aspen-discovery/$1/covers -chmod -R g+w /data/aspen-discovery/$1/covers -chown -R aspen:aspen_apache /data/aspen-discovery/$1/uploads -chmod -R g+w /data/aspen-discovery/$1/uploads -chown -R solr:aspen /data/aspen-discovery/$1/solr7 -chown -R root:root /data/aspen-discovery/$1/sql_backup -chown apache:aspen_apache /var/log/aspen-discovery/$1/* -chown -R aspen:aspen_apache /usr/local/aspen-discovery/code/web/sitemaps +chown -R apache:aspen_apache /usr/local/aspen-discovery/tmp -chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-7.6.0 -chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-8.11.2 -chown -R solr:solr /data/aspen-discovery/$1/solr7 +## /var/log directory +chmod -R 755 /var/log/aspen-discovery/$1 +chmod -R 755 /var/log/aspen-discovery/$1/logs +chown -R aspen:aspen /var/log/aspen-discovery/$1/logs +chown apache:aspen_apache /var/log/aspen-discovery/$1/* php updateAllSideloadPermissions.php $1 centos \ No newline at end of file diff --git a/install/updateSitePermissions_debian.sh b/install/updateSitePermissions_debian.sh index 3f3290103a..f99534f9ce 100755 --- a/install/updateSitePermissions_debian.sh +++ b/install/updateSitePermissions_debian.sh @@ -5,27 +5,41 @@ if [ -z "$1" ] echo "Please provide the server name to update as the first argument." exit 1 fi + +# /data directory chown root:root /data chown -R aspen:aspen_apache /data/aspen-discovery - +chown -R root:aspen_apache /data/aspen-discovery/accelerated_reader +chmod -R 775 /data/aspen-discovery/accelerated_reader chown -R aspen:aspen_apache /data/aspen-discovery/$1 chmod -R 775 /data/aspen-discovery/$1 -chgrp -R aspen_apache /data/aspen-discovery/accelerated_reader -chmod -R 775 /data/aspen-discovery/accelerated_reader -chmod -R 755 /usr/local/aspen-discovery/code/web/files -chown -R www-data:aspen_apache /usr/local/aspen-discovery/code/web/fonts -chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf +chown -R aspen:aspen_apache /data/aspen-discovery/$1/covers +chmod -R g+w /data/aspen-discovery/$1/covers chown -R aspen:aspen_apache /data/aspen-discovery/$1/ils -chmod -R 755 /var/log/aspen-discovery/$1 -chmod -R 755 /var/log/aspen-discovery/$1/logs -chown -R aspen:aspen /var/log/aspen-discovery/$1/logs +chown -R aspen:aspen_apache /data/aspen-discovery/$1/uploads +chmod -R g+w /data/aspen-discovery/$1/uploads +chown -R solr:aspen /data/aspen-discovery/$1/solr7 +chown -R root:root /data/aspen-discovery/$1/sql_backup -chown root:root /usr/local/aspen-discovery/sites/$1/httpd-$1.conf -chown root:root /usr/local/aspen-discovery/sites/$1/conf/crontab_settings.txt -chmod 0644 /usr/local/aspen-discovery/sites/$1/conf/crontab_settings.txt +# /usr/local directory +chown -R root:root /usr/local/aspen-discovery +chown -R aspen:aspen /usr/local/aspen-discovery/code +chown -R www-data:aspen_apache /usr/local/aspen-discovery/code/web +chmod -R 755 /usr/local/aspen-discovery/code/web/files +chmod -R 755 /usr/local/aspen-discovery/code/web/fonts +chown -R aspen:aspen_apache /usr/local/aspen-discovery/code/web/sitemaps +chown -R root:root /usr/local/aspen-discovery/docker +chown -R www-data:aspen_apache /usr/local/aspen-discovery/sites +chown -R aspen:aspen_apache /usr/local/aspen-discovery/default +chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-7.6.0 +chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-8.11.2 +chown root:root /usr/local/aspen-discovery/sites/$1 +chown root:root /usr/local/aspen-discovery/sites/$1/httpd-*.conf chown aspen:aspen /usr/local/aspen-discovery/sites/$1/$1.sh chmod +x /usr/local/aspen-discovery/sites/$1/$1.sh - +chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf +chown root:root /usr/local/aspen-discovery/sites/$1/conf/crontab_settings.txt +chmod 0644 /usr/local/aspen-discovery/sites/$1/conf/crontab_settings.txt if [ -f "/usr/local/aspen-discovery/sites/$1/conf/log4j" ]; then chown aspen:aspen /usr/local/aspen-discovery/sites/$1/conf/log4j* fi @@ -33,17 +47,12 @@ if [ -f "/usr/local/aspen-discovery/sites/$1/conf/passkey" ]; then chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf/passkey fi chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf/config* -chown -R aspen:aspen_apache /data/aspen-discovery/$1/covers -chmod -R g+w /data/aspen-discovery/$1/covers -chown -R aspen:aspen_apache /data/aspen-discovery/$1/uploads -chmod -R g+w /data/aspen-discovery/$1/uploads -chown -R solr:aspen /data/aspen-discovery/$1/solr7 -chown -R root:root /data/aspen-discovery/$1/sql_backup -chown www-data:aspen_apache /var/log/aspen-discovery/$1/* -chown -R aspen:aspen_apache /usr/local/aspen-discovery/code/web/sitemaps +chown -R www-data:aspen_apache /usr/local/aspen-discovery/tmp -chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-7.6.0 -chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-8.11.2 -chown -R solr:solr /data/aspen-discovery/$1/solr7 +## /var/log directory +chmod -R 755 /var/log/aspen-discovery/$1 +chmod -R 755 /var/log/aspen-discovery/$1/logs +chown -R aspen:aspen /var/log/aspen-discovery/$1/logs +chown www-data:aspen_apache /var/log/aspen-discovery/$1/* php updateAllSideloadPermissions.php $1 debian \ No newline at end of file From 6e453c138466544924629ee5af648a522a9b76d3 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 16:07:25 -0600 Subject: [PATCH 11/18] Update permissions script --- install/updateSitePermissions.sh | 5 ++--- install/updateSitePermissions_debian.sh | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/install/updateSitePermissions.sh b/install/updateSitePermissions.sh index dc53f6dac4..86ee0f38c7 100755 --- a/install/updateSitePermissions.sh +++ b/install/updateSitePermissions.sh @@ -30,8 +30,7 @@ chmod -R 755 /usr/local/aspen-discovery/code/web/fonts chown -R aspen:aspen_apache /usr/local/aspen-discovery/code/web/sitemaps chown -R root:root /usr/local/aspen-discovery/docker chown -R apache:aspen_apache /usr/local/aspen-discovery/sites -chown -R aspen:aspen_apache /usr/local/aspen-discovery/default -chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-7.6.0 +chown -R aspen:aspen_apache /usr/local/aspen-discovery/sites/default chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-8.11.2 chown root:root /usr/local/aspen-discovery/sites/$1 chown root:root /usr/local/aspen-discovery/sites/$1/httpd-*.conf @@ -55,4 +54,4 @@ chmod -R 755 /var/log/aspen-discovery/$1/logs chown -R aspen:aspen /var/log/aspen-discovery/$1/logs chown apache:aspen_apache /var/log/aspen-discovery/$1/* -php updateAllSideloadPermissions.php $1 centos \ No newline at end of file +php /usr/local/aspen-discovery/install/updateAllSideloadPermissions.php $1 centos \ No newline at end of file diff --git a/install/updateSitePermissions_debian.sh b/install/updateSitePermissions_debian.sh index f99534f9ce..65f28941d3 100755 --- a/install/updateSitePermissions_debian.sh +++ b/install/updateSitePermissions_debian.sh @@ -30,8 +30,7 @@ chmod -R 755 /usr/local/aspen-discovery/code/web/fonts chown -R aspen:aspen_apache /usr/local/aspen-discovery/code/web/sitemaps chown -R root:root /usr/local/aspen-discovery/docker chown -R www-data:aspen_apache /usr/local/aspen-discovery/sites -chown -R aspen:aspen_apache /usr/local/aspen-discovery/default -chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-7.6.0 +chown -R aspen:aspen_apache /usr/local/aspen-discovery/sites/default chown -R solr:solr /usr/local/aspen-discovery/sites/default/solr-8.11.2 chown root:root /usr/local/aspen-discovery/sites/$1 chown root:root /usr/local/aspen-discovery/sites/$1/httpd-*.conf @@ -55,4 +54,4 @@ chmod -R 755 /var/log/aspen-discovery/$1/logs chown -R aspen:aspen /var/log/aspen-discovery/$1/logs chown www-data:aspen_apache /var/log/aspen-discovery/$1/* -php updateAllSideloadPermissions.php $1 debian \ No newline at end of file +php /usr/local/aspen-discovery/install/updateAllSideloadPermissions.php $1 debian \ No newline at end of file From 651a6068323e8b252bd7c8287ab23acffeb69632 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 16:15:34 -0600 Subject: [PATCH 12/18] Fix typos --- install/updateAllSideloadPermissions.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install/updateAllSideloadPermissions.php b/install/updateAllSideloadPermissions.php index bb010245af..dfef6a6558 100644 --- a/install/updateAllSideloadPermissions.php +++ b/install/updateAllSideloadPermissions.php @@ -18,16 +18,16 @@ foreach ($sideLoads as $name => $marcPath) { echo("Updating permissions for $name\n"); if ($operatingSystem == 'centos') { - exec("chown aspen:aspen_apache ' . $marcPath/..)"); - exec("chmod 775 ' . $marcPath/..)"); + exec("chown aspen:aspen_apache ' . $marcPath/.."); + exec("chmod 775 ' . $marcPath/.."); exec("chown -R apache:aspen_apache ' . $marcPath)"); - exec("chmod 775 ' . $marcPath)"); + exec("chmod 775 ' . $marcPath"); }else{ - exec("chown aspen:aspen_apache ' . $marcPath/..)"); - exec("chmod 775 ' . $marcPath/..)"); + exec("chown aspen:aspen_apache ' . $marcPath/.."); + exec("chmod 775 ' . $marcPath/.."); - exec("chown -R www-data:aspen_apache ' . $marcPath)"); - exec("chmod 775 ' . $marcPath)"); + exec("chown -R www-data:aspen_apache ' . $marcPath"); + exec("chmod 775 ' . $marcPath"); } } \ No newline at end of file From 65a77205da6fd2f0c2fbf4708ea6e055dbc7f472 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 16:21:10 -0600 Subject: [PATCH 13/18] Update updateSitePermissions_debian.sh --- install/updateSitePermissions_debian.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install/updateSitePermissions_debian.sh b/install/updateSitePermissions_debian.sh index 65f28941d3..0ec8a5c143 100755 --- a/install/updateSitePermissions_debian.sh +++ b/install/updateSitePermissions_debian.sh @@ -7,6 +7,7 @@ if [ -z "$1" ] fi # /data directory +echo "Updating /data directory" chown root:root /data chown -R aspen:aspen_apache /data/aspen-discovery chown -R root:aspen_apache /data/aspen-discovery/accelerated_reader @@ -22,6 +23,7 @@ chown -R solr:aspen /data/aspen-discovery/$1/solr7 chown -R root:root /data/aspen-discovery/$1/sql_backup # /usr/local directory +echo "Updating /usr/local directory" chown -R root:root /usr/local/aspen-discovery chown -R aspen:aspen /usr/local/aspen-discovery/code chown -R www-data:aspen_apache /usr/local/aspen-discovery/code/web @@ -49,9 +51,11 @@ chown aspen:aspen_apache /usr/local/aspen-discovery/sites/$1/conf/config* chown -R www-data:aspen_apache /usr/local/aspen-discovery/tmp ## /var/log directory +echo "Updating /var/log directory" chmod -R 755 /var/log/aspen-discovery/$1 chmod -R 755 /var/log/aspen-discovery/$1/logs chown -R aspen:aspen /var/log/aspen-discovery/$1/logs chown www-data:aspen_apache /var/log/aspen-discovery/$1/* +echo "Updating sideload permissions" php /usr/local/aspen-discovery/install/updateAllSideloadPermissions.php $1 debian \ No newline at end of file From b8a974e989d2445ff9afab475e77fbee2f49308d Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Mon, 15 Jul 2024 16:22:25 -0600 Subject: [PATCH 14/18] Update updateAllSideloadPermissions.php --- install/updateAllSideloadPermissions.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install/updateAllSideloadPermissions.php b/install/updateAllSideloadPermissions.php index dfef6a6558..214b641787 100644 --- a/install/updateAllSideloadPermissions.php +++ b/install/updateAllSideloadPermissions.php @@ -18,16 +18,16 @@ foreach ($sideLoads as $name => $marcPath) { echo("Updating permissions for $name\n"); if ($operatingSystem == 'centos') { - exec("chown aspen:aspen_apache ' . $marcPath/.."); - exec("chmod 775 ' . $marcPath/.."); + exec("chown aspen:aspen_apache $marcPath/.."); + exec("chmod 775 $marcPath/.."); - exec("chown -R apache:aspen_apache ' . $marcPath)"); - exec("chmod 775 ' . $marcPath"); + exec("chown -R apache:aspen_apache $marcPath"); + exec("chmod 775 $marcPath"); }else{ - exec("chown aspen:aspen_apache ' . $marcPath/.."); - exec("chmod 775 ' . $marcPath/.."); + exec("chown aspen:aspen_apache $marcPath/.."); + exec("chmod 775 $marcPath/.."); - exec("chown -R www-data:aspen_apache ' . $marcPath"); - exec("chmod 775 ' . $marcPath"); + exec("chown -R www-data:aspen_apache $marcPath"); + exec("chmod 775 $marcPath"); } } \ No newline at end of file From 4a3a60e9fb19af10d1c16df8179cfacbd600d55c Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Tue, 16 Jul 2024 07:33:18 -0600 Subject: [PATCH 15/18] Update createSiteTemplate.php --- code/web/cron/createSiteTemplate.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/web/cron/createSiteTemplate.php b/code/web/cron/createSiteTemplate.php index a1baf04664..05ffe55710 100644 --- a/code/web/cron/createSiteTemplate.php +++ b/code/web/cron/createSiteTemplate.php @@ -7,6 +7,9 @@ //Create a template for $serverName $templateName = "$serverName.ini"; +if (!file_exists($configArray['Site']['local'] . "/../../install/templates/")){ + mkdir($configArray['Site']['local'] . "/../../install/templates/"); +} $fhnd = fopen($configArray['Site']['local'] . "/../../install/templates/$templateName", 'w'); $dbHost = empty($configArray['Database']['database_aspen_host']) ? 'localhost' : $configArray['Database']['database_aspen_host']; $dbPort = empty($configArray['Database']['database_aspen_dbport']) ? '3306' : $configArray['Database']['database_aspen_dbport']; From a985115e0e073fafd38dafd2a871ba2437685b54 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Tue, 16 Jul 2024 07:34:45 -0600 Subject: [PATCH 16/18] Update createSiteTemplate.php --- code/web/cron/createSiteTemplate.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/web/cron/createSiteTemplate.php b/code/web/cron/createSiteTemplate.php index 05ffe55710..84061ef67f 100644 --- a/code/web/cron/createSiteTemplate.php +++ b/code/web/cron/createSiteTemplate.php @@ -30,9 +30,13 @@ fwrite($fhnd, ";Which host should Solr run on (typically localhost)\n"); fwrite($fhnd, "solrHost = {$configArray['Index']['solrHost']}\n"); fwrite($fhnd, "; Which port should Solr run on (typically 8080)\n"); -fwrite($fhnd, "solrPort = {$configArray['Index']['solrPort']}\n"); +if (array_key_exists('solrPort', $configArray['Index'])) { + fwrite($fhnd, "solrPort = {$configArray['Index']['solrPort']}\n"); +}else{ + fwrite($fhnd, "solrPort = 8080\n"); +} fwrite($fhnd, "; Which ILS does the library use?\n"); -fwrite($fhnd, "ils = {$configArray['Index']['solrHost']}\n"); +fwrite($fhnd, "ils = {$configArray['Index']['driver']}\n"); fwrite($fhnd, "; timezone of the library (e.g. America/Los_Angeles, check http://www.php.net/manual/en/timezones.php)\n"); fwrite($fhnd, "timezone = {$configArray['Site']['timezone']}\n"); fwrite($fhnd, "\n"); From 0b1034cd9edaae583ca09dbec7e48595f05ee07f Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Tue, 16 Jul 2024 07:35:41 -0600 Subject: [PATCH 17/18] Update createSiteTemplate.php --- code/web/cron/createSiteTemplate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/web/cron/createSiteTemplate.php b/code/web/cron/createSiteTemplate.php index 84061ef67f..4fe8d1daad 100644 --- a/code/web/cron/createSiteTemplate.php +++ b/code/web/cron/createSiteTemplate.php @@ -36,7 +36,7 @@ fwrite($fhnd, "solrPort = 8080\n"); } fwrite($fhnd, "; Which ILS does the library use?\n"); -fwrite($fhnd, "ils = {$configArray['Index']['driver']}\n"); +fwrite($fhnd, "ils = {$configArray['Catalog']['driver']}\n"); fwrite($fhnd, "; timezone of the library (e.g. America/Los_Angeles, check http://www.php.net/manual/en/timezones.php)\n"); fwrite($fhnd, "timezone = {$configArray['Site']['timezone']}\n"); fwrite($fhnd, "\n"); From ec76783c9f1c05f38ee706cdd6904853ede20065 Mon Sep 17 00:00:00 2001 From: Mark Noble Date: Tue, 16 Jul 2024 08:15:55 -0600 Subject: [PATCH 18/18] Set limits for Aspen user within Debian --- code/web/release_notes/24.07.00.MD | 4 +--- install/aspen_limits.conf | 5 +++++ install/installer_debian.sh | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 install/aspen_limits.conf diff --git a/code/web/release_notes/24.07.00.MD b/code/web/release_notes/24.07.00.MD index 2c8550dfba..ee846ccf9e 100644 --- a/code/web/release_notes/24.07.00.MD +++ b/code/web/release_notes/24.07.00.MD @@ -95,9 +95,7 @@ - Update updateSitePermissions scripts to include all directories. (*MDN*) - Increase column length for format in user_hold table to accommodate concatenated OverDrive/Libby formats (Ticket 134832) (*KL*) - Correct the number of requests made on the success screen after submitting a request. (Ticket 128760) (*MDN*) - -// Chloe PTFS-Europe -### Other Updates +- Set limits for Aspen user within Debian. (*MDN*) - Add the ability to change the supporting company name on site creation. (*CZ*) ## This release includes code contributions from diff --git a/install/aspen_limits.conf b/install/aspen_limits.conf new file mode 100644 index 0000000000..5cc3c1430a --- /dev/null +++ b/install/aspen_limits.conf @@ -0,0 +1,5 @@ +# Increase process and file limits for aspen user +aspen soft nproc 65000 +aspen soft nofile 65000 +aspen hard nproc 65000 +aspen hard nofile 65000 diff --git a/install/installer_debian.sh b/install/installer_debian.sh index 51d6428929..7df83000cc 100755 --- a/install/installer_debian.sh +++ b/install/installer_debian.sh @@ -44,8 +44,9 @@ mkdir -p /usr/local/aspen-discovery/tmp chown -R www-data:www-data /usr/local/aspen-discovery/tmp chmod -R 755 /usr/local/aspen-discovery/tmp -# Raise process and open file limits for the solr user +# Raise process and open file limits for the aspen and solr users cp solr_limits.conf /etc/security/limits.d/solr.conf +cp aspen_limits.conf /etc/security/limits.d/aspen.conf # Create aspen MySQL superuser printf "Please enter the username for the Aspen MySQL superuser (cannot be root) : " >&2