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/cron/createSiteTemplate.php b/code/web/cron/createSiteTemplate.php index a1baf04664..4fe8d1daad 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']; @@ -27,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['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"); diff --git a/code/web/release_notes/24.07.00.MD b/code/web/release_notes/24.07.00.MD index 64de293c80..ee846ccf9e 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,7 +93,10 @@ - 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*) - Correct the number of requests made on the success screen after submitting a request. (Ticket 128760) (*MDN*) +- 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 - ByWater Solutions @@ -107,6 +111,7 @@ - PTFS-Europe - Pedro Amorim (PA) - Alexander Blanchard (AB) + - Chloe Zermatten (CZ) - Theke Solutions - Lucas Montoya (LM) \ No newline at end of file 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' => [ 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/createSite.php b/install/createSite.php index 40a765db69..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'], @@ -92,6 +93,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) > "); @@ -315,6 +321,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(), "/"); 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 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 diff --git a/install/updateAllSideloadPermissions.php b/install/updateAllSideloadPermissions.php new file mode 100644 index 0000000000..214b641787 --- /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..86ee0f38c7 100755 --- a/install/updateSitePermissions.sh +++ b/install/updateSitePermissions.sh @@ -5,24 +5,40 @@ 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/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 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 @@ -30,15 +46,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 -R apache:aspen_apache /usr/local/aspen-discovery/tmp + +## /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/* -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 /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 21b99e5c96..0ec8a5c143 100755 --- a/install/updateSitePermissions_debian.sh +++ b/install/updateSitePermissions_debian.sh @@ -5,24 +5,42 @@ if [ -z "$1" ] echo "Please provide the server name to update as the first argument." exit 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 +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 +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 +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/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 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 @@ -30,15 +48,14 @@ 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 -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/* -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 +echo "Updating sideload permissions" +php /usr/local/aspen-discovery/install/updateAllSideloadPermissions.php $1 debian \ No newline at end of file diff --git a/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf b/sites/aspencat.production/httpd-aspencat.production-le-ssl.conf index 3f6dc1cfb3..0b55339fef 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]