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/Drivers/Koha.php b/code/web/Drivers/Koha.php index 91357f0733..e6b6725270 100644 --- a/code/web/Drivers/Koha.php +++ b/code/web/Drivers/Koha.php @@ -3596,14 +3596,36 @@ function processEmailResetPinForm() { ]; $catalogUrl = $this->accountProfile->vendorOpacUrl; + + $kohaVersion = $this->getKohaVersion(); + $csrfToken = ''; + if ($kohaVersion >= 24.05) { + //First get the page to get the csrf token + $getResults = $this->getKohaPage($catalogUrl . '/cgi-bin/koha/opac-password-recovery.pl'); + if (preg_match('//', $getResults, $matches)) { + $csrfToken = $matches[1]; + } + } + + $username = isset($_REQUEST['username']) ? strip_tags($_REQUEST['username']) : ''; $email = isset($_REQUEST['email']) ? strip_tags($_REQUEST['email']) : ''; - $postVariables = [ - 'koha_login_context' => 'opac', - 'username' => $username, - 'email' => $email, - 'sendEmail' => 'Submit', - ]; + if ($kohaVersion >= 24.05) { + $postVariables = [ + 'koha_login_context' => 'opac', + 'username' => $username, + 'email' => $email, + 'op' => 'cud-sendEmail', + 'csrf_token' => $csrfToken + ]; + }else{ + $postVariables = [ + 'koha_login_context' => 'opac', + 'username' => $username, + 'email' => $email, + 'sendEmail' => 'Submit', + ]; + } if (isset($_REQUEST['resendEmail'])) { $postVariables['resendEmail'] = strip_tags($_REQUEST['resendEmail']); } diff --git a/code/web/Drivers/Nashville.php b/code/web/Drivers/Nashville.php index e990cb6181..5f4c790377 100644 --- a/code/web/Drivers/Nashville.php +++ b/code/web/Drivers/Nashville.php @@ -466,6 +466,7 @@ public function getCollectionReportData($location, $date): array { public function getHoldsReportData($location): array { $this->initDatabaseConnection(); $sql = <<dbConnection, $sql); // consider using oci_set_prefetch to improve performance 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/index.php b/code/web/index.php index 8937943dde..9ea939436d 100644 --- a/code/web/index.php +++ b/code/web/index.php @@ -1173,6 +1173,7 @@ function loadModuleActionId() { $basicPageLibrary = new LibraryBasicPage(); $basicPageLibrary->libraryId = $library->libraryId; $basicPage->joinAdd($basicPageLibrary, 'INNER', 'libraryFilter', 'id', 'basicPageId'); + $pageExists = false; if ($basicPage->find(true)) { $_GET['module'] = 'WebBuilder'; $_GET['action'] = 'BasicPage'; @@ -1180,6 +1181,7 @@ function loadModuleActionId() { $_REQUEST['module'] = 'WebBuilder'; $_REQUEST['action'] = 'BasicPage'; $_REQUEST['id'] = $basicPage->id; + $pageExists = true; } else { require_once ROOT_DIR . '/sys/WebBuilder/PortalPage.php'; $portalPage = new PortalPage(); @@ -1194,6 +1196,7 @@ function loadModuleActionId() { $_REQUEST['module'] = 'WebBuilder'; $_REQUEST['action'] = 'PortalPage'; $_REQUEST['id'] = $portalPage->id; + $pageExists = true; } else { require_once ROOT_DIR . '/sys/WebBuilder/CustomForm.php'; $form = new CustomForm(); @@ -1208,6 +1211,7 @@ function loadModuleActionId() { $_REQUEST['module'] = 'WebBuilder'; $_REQUEST['action'] = 'Form'; $_REQUEST['id'] = $form->id; + $pageExists = true; } else { require_once ROOT_DIR . '/sys/WebBuilder/QuickPoll.php'; $quickPoll = new QuickPoll(); @@ -1222,10 +1226,14 @@ function loadModuleActionId() { $_REQUEST['module'] = 'WebBuilder'; $_REQUEST['action'] = 'QuickPoll'; $_REQUEST['id'] = $quickPoll->id; + $pageExists = true; } } } } + if ($pageExists && $_SERVER['REDIRECT_STATUS'] == '404') { + http_response_code('200'); + } } } catch (Exception $e) { //This happens if web builder is not fully installed, ignore the error. diff --git a/code/web/interface/themes/responsive/MyAccount/libraryCard.tpl b/code/web/interface/themes/responsive/MyAccount/libraryCard.tpl index 9d64dcfb30..18d41449d4 100644 --- a/code/web/interface/themes/responsive/MyAccount/libraryCard.tpl +++ b/code/web/interface/themes/responsive/MyAccount/libraryCard.tpl @@ -28,6 +28,11 @@ {if !empty($showCardExpirationDate) && !empty($expirationDate)} {translate text="Expires %1%" 1=$expirationDate|date_format:"%b %d, %Y" isPublicFacing=true} {/if} + {if $showRenewalLink} + + {/if} diff --git a/code/web/interface/themes/responsive/Search/explore-more-bar.tpl b/code/web/interface/themes/responsive/Search/explore-more-bar.tpl index 96ec4a1f11..eae13b7fd2 100644 --- a/code/web/interface/themes/responsive/Search/explore-more-bar.tpl +++ b/code/web/interface/themes/responsive/Search/explore-more-bar.tpl @@ -35,7 +35,7 @@ {translate text=
- + {$exploreMoreCategory.label|truncate:30}
diff --git a/code/web/release_notes/24.06.01.MD b/code/web/release_notes/24.06.01.MD index b52e81b27c..fa3a41cff3 100644 --- a/code/web/release_notes/24.06.01.MD +++ b/code/web/release_notes/24.06.01.MD @@ -1,6 +1,7 @@ ## Aspen Discovery Updates ### Koha Updates - Fix issues related to loading ILL requests and holds for Koha version 24.05. (*MDN*) +- Update Aspen so emailing PIN reset information works properly with Koha version 24.05. (*MDN*) ### OverDrive Updates - Error message when returning Kindle books is now translatable. (Tickets 133671, 133815, 133663, 133982) (*KP*) diff --git a/code/web/release_notes/24.07.00.MD b/code/web/release_notes/24.07.00.MD index 2d761c7c15..fcfeda17e9 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*) @@ -93,6 +94,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 +112,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/release_notes/24.08.00.MD b/code/web/release_notes/24.08.00.MD new file mode 100644 index 0000000000..ebe9e23da9 --- /dev/null +++ b/code/web/release_notes/24.08.00.MD @@ -0,0 +1,50 @@ +## Aspen LiDA Updates +- + +## Aspen Discovery Updates +// mark +### Account Updates +- Show account renewal links on the Library Card page when applicable. (Ticket 134192) (*MDN*) + +### Search Updates +- Add a new option within Show Hold and Copy Counts to always show hold and copy counts. (Ticket 128625) (*MDN*) + +// kirstien + +// kodi + +// katherine +### Other Updates +- Fixed bug with unexpected 404 errors on Web Builder pages. (Ticket 123122) (*KP*) + +// alexander + +// jacob + +// pedro + +// lucas + +// James Staub +### Reports +- Nashville-specific: Circulation Holds Report now includes item-level holds (*JStaub*) + +// other + +## This release includes code contributions from +- ByWater Solutions + - Mark Noble (MDN) + - Kirstien Kroeger (KK) + - Kodi Lein (KL) + - Katherine Perdue (KP) + +- Nashville Public Library + - James Staub (JStaub) + +- PTFS-Europe + - Pedro Amorim (PA) + - Alexander Blanchard (AB) + - Jacob O'Mara (JOM) + +- Theke Solutions + - Lucas Montoya (LM) \ No newline at end of file diff --git a/code/web/services/MyAccount/LibraryCard.php b/code/web/services/MyAccount/LibraryCard.php index 709b6a2078..43fb2ad899 100644 --- a/code/web/services/MyAccount/LibraryCard.php +++ b/code/web/services/MyAccount/LibraryCard.php @@ -19,6 +19,27 @@ function launch() { $interface->assign('showCardExpirationDate', $library->showCardExpirationDate); $interface->assign('expirationDate', $user->getAccountSummary()->expirationDate); + $interface->assign('showRenewalLink', false); + if ($user->hasIlsConnection()) { + $ilsSummary = $user->getCatalogDriver()->getAccountSummary($user); + $showRenewalLink = $user->showRenewalLink($ilsSummary); + $interface->assign('showRenewalLink', $showRenewalLink); + if ($showRenewalLink) { + $userLibrary = $user->getHomeLibrary(); + if ($userLibrary->enableCardRenewal == 2) { + if (!empty($userLibrary->cardRenewalUrl)) { + $interface->assign('cardRenewalLink', $userLibrary->cardRenewalUrl); + } + } elseif ($userLibrary->enableCardRenewal == 3) { + require_once ROOT_DIR . '/sys/Enrichment/QuipuECardSetting.php'; + $quipuECardSettings = new QuipuECardSetting(); + if ($quipuECardSettings->find(true) && $quipuECardSettings->hasERenew) { + $interface->assign('cardRenewalLink', "/MyAccount/eRENEW"); + } + } + } + } + $linkedUsers = $user->getLinkedUsers(); $linkedCards = []; foreach ($linkedUsers as $tmpUser) { 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/code/web/sys/DBMaintenance/version_updates/24.08.00.php b/code/web/sys/DBMaintenance/version_updates/24.08.00.php new file mode 100644 index 0000000000..09fd104e32 --- /dev/null +++ b/code/web/sys/DBMaintenance/version_updates/24.08.00.php @@ -0,0 +1,30 @@ + [ + 'title' => '', + 'description' => '', + 'continueOnError' => false, + 'sql' => [ + '' + ] + ], //name*/ + + //mark - ByWater + + //kirstien - ByWater + + //kodi - ByWater + + //katherine - ByWater + + //alexander - PTFS-Europe + + //pedro - PTFS-Europe + + //other + + ]; +} \ No newline at end of file diff --git a/code/web/sys/Grouping/StatusInformation.php b/code/web/sys/Grouping/StatusInformation.php index 9385314007..b08739bc07 100644 --- a/code/web/sys/Grouping/StatusInformation.php +++ b/code/web/sys/Grouping/StatusInformation.php @@ -277,7 +277,15 @@ function getNumberOfCopiesMessage() { $numberOfCopiesMessage .= '%1% copies available'; } } - if (($this->getNumHolds() > 0 && $this->getHoldableCopies() > 0) && ($this->getAvailableCopies() == 0 && !$this->isAvailableOnline())) { + + if ($library->showGroupedHoldCopiesCount == 2) { + $showWaitList = true; + }else if ($library->showGroupedHoldCopiesCount == 1) { + $showWaitList = $this->getAvailableCopies() == 0 && !$this->isAvailableOnline(); + }else{ + $showWaitList = false; + } + if (($this->getNumHolds() > 0 && $this->getHoldableCopies() > 0) && ($showWaitList)) { if ($this->getCopies() == 1) { $numberOfCopiesMessage .= '1 copy'; } elseif ($this->getCopies() > 1) { diff --git a/code/web/sys/LibraryLocation/Library.php b/code/web/sys/LibraryLocation/Library.php index d3ab1b455a..06b5fcbe81 100644 --- a/code/web/sys/LibraryLocation/Library.php +++ b/code/web/sys/LibraryLocation/Library.php @@ -3139,7 +3139,12 @@ static function getObjectStructure($context = ''): array { ], 'showGroupedHoldCopiesCount' => [ 'property' => 'showGroupedHoldCopiesCount', - 'type' => 'checkbox', + 'type' => 'enum', + 'values' => [ + 0 => 'Never', + 1 => 'Only for unavailable titles', + 2 => 'Always' + ], 'label' => 'Show Hold and Copy Counts', 'description' => 'Whether or not the hold count and copies counts should be visible for grouped works when summarizing formats.', 'hideInLists' => true, diff --git a/code/web/sys/SolrConnector/Solr.php b/code/web/sys/SolrConnector/Solr.php index ac33efce64..6dd5487dc6 100644 --- a/code/web/sys/SolrConnector/Solr.php +++ b/code/web/sys/SolrConnector/Solr.php @@ -660,6 +660,7 @@ private function _buildMungeValues($lookfor, $custom = null, $basic = true) { $cleanedQuery = str_replace('–', '\-\-', $cleanedQuery); $cleanedQuery = str_replace('+', '\+', $cleanedQuery); $cleanedQuery = str_replace('?', '\?', $cleanedQuery); + $cleanedQuery = str_replace('/', '\/', $cleanedQuery); require_once ROOT_DIR . '/sys/Utils/StringUtils.php'; $noTrailingPunctuation = StringUtils::removeTrailingPunctuation($cleanedQuery); @@ -732,6 +733,7 @@ private function _buildMungeValues($lookfor, $custom = null, $basic = true) { $cleanedQuery = str_replace('”', '"', $cleanedQuery); $cleanedQuery = str_replace('+', '\+', $cleanedQuery); $cleanedQuery = str_replace('?', '\?', $cleanedQuery); + $cleanedQuery = str_replace('/', '\/', $cleanedQuery); // Fix for ordinal numbers $cleanedQuery = preg_replace("/([0-9])([a-zA-Z])/", "$1 $2", $cleanedQuery); if (strlen($cleanedQuery) > 0 && $cleanedQuery[0] == '(') { @@ -1894,9 +1896,11 @@ public function validateInput($input) { //Remove any semi-colons that Solr will handle incorrectly. $input = str_replace(';', ' ', $input); - //Remove any slashes that Solr will handle incorrectly. - $input = str_replace('\\', ' ', $input); - $input = str_replace('/', ' ', $input); + //Remove slashes occur in the middle of a word that Solr will handle incorrectly. + $input = preg_replace("/([0-9a-zA-Z])([\/])([0-9a-zA-Z])/", "$1 $3", $input); + $input = preg_replace("/([0-9a-zA-Z])([\\\\])([0-9a-zA-Z])/", "$1 $3", $input); + $input = str_replace('\\', '\\\\', $input); + //$input = preg_replace('/\\\\(?![&:])/', ' ', $input); //Look for any colons that are not identifying fields 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 7c5578faf9..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 apsen: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 71a3d65436..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 apsen: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]