Skip to content

Commit

Permalink
Merge branch '24.07.00' into 24.08.00
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Jul 16, 2024
2 parents 610e40a + ec76783 commit 83f9055
Show file tree
Hide file tree
Showing 12 changed files with 157 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,10 @@ public void getFormatFromLeader(AbstractGroupedWorkSolr groupedWork, Set<String>
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':
Expand Down
11 changes: 9 additions & 2 deletions code/web/cron/createSiteTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -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");
Expand Down
5 changes: 5 additions & 0 deletions code/web/release_notes/24.07.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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*)
Expand Down Expand Up @@ -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
Expand All @@ -107,6 +111,7 @@
- PTFS-Europe
- Pedro Amorim (PA)
- Alexander Blanchard (AB)
- Chloe Zermatten (CZ)

- Theke Solutions
- Lucas Montoya (LM)
8 changes: 8 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.07.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down
5 changes: 5 additions & 0 deletions install/aspen_limits.conf
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions install/createSite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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) > ");
Expand Down Expand Up @@ -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(), "/");
Expand Down
2 changes: 2 additions & 0 deletions install/createSiteTemplate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion install/installer_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions install/updateAllSideloadPermissions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
require_once __DIR__ . '/../code/web/bootstrap.php';
require_once __DIR__ . '/../code/web/bootstrap_aspen.php';

global $configArray;

if (count($_SERVER['argv']) > 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");
}
}
57 changes: 35 additions & 22 deletions install/updateSitePermissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,53 @@ 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
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
61 changes: 39 additions & 22 deletions install/updateSitePermissions_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,57 @@ 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
# Friendly URLs
<IfModule mod_rewrite.c>
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]
Expand Down

0 comments on commit 83f9055

Please sign in to comment.