Deploying cold on a remote system requires manual setup. You will need the following software to successfully build and deploy.
My current recommendation is the following.
/Sites/cold
and
change into the repository directorysetup
(if the collections don’t exist)
and build
to build the binary for the cold servicecold.service-example
to cold.service
,
edit it and move to /etc/systemd/system/
cold_api.service-example
to
cold_api.service
, edit it and and move to
/etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable cold.service
sudo systemctl enable cold_api.service
systemctl
in the usual way
sudo systemctl start cold.service
sudo systemctl start cold_api.service
You can configure Apache to reverse proxy to the cold service running on port 8111 where it should enforce access control.
For a good description of how to setup new systemd services the Debian (works with Ubuntu too) way see https://wiki.debian.org/systemd/Services.
Here’s an example of the shell session based on the above list. I’m assuming the user/group you’re running things under is “www-data”.
ssh apps.example.edu
sudo mkdir -p /Sites/
sudo chgrp www-data /Sites/
sudo chmod 775 /Sites/
cd /Sites
git clone git@github.com:caltechlibrary/cold
cd cold
deno task setup
deno task build
cp cold.service-example cold.service
nano cold.service
sudo mv cold.service /etc/systemd/system/
cp cold_api.service-example cold_api.service
nano cold_api.service
sudo mv cold_api.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable cold.service
sudo systemctl enable cold_api.service
sudo systemctl start cold.service
sudo systemctl start cold_api.service
elinks http://localhost:8111
NOTE: The TypeScript services need to be compile before running them with Systemd.
COLD is designed to be a reverse proxy target. Using Apache you need to to include the following code in the main host definition.
#<!-- cold -->
ProxyPreserveHost On
Redirect "/cold" "/cold/"
ProxyPassMatch "^/cold/(.*)" "http://localhost:8111/$1"
ProxyPassReverse "/cold/" "http://localhost:8111/"
#<!-- cold admin -->
<Location /cold/>
AuthType shibboleth
ShibRequestSetting requireSession 1
require user rsdoiel@caltech.edu sdavison@caltech.edu tmorrell@caltech.edu tkeswick@caltech.edu kjohnson@caltech.edu melray@library.caltech.edu
#require valid-user
</Location>
#<!-- end cold -->
This is a note for migrating data from our historic spreadsheet for
CaltechPEOPLE. Once cold is installed and you’ve created the empty
dataset collections (e.g. people.ds) you can use two tools to populate
the collection and set the include_in_feeds
property.
Steps:
people_final.csv
and
groups_final.csv
. Copy edit the files if necessary
(e.g. remove duplicate rows)clpid
.people.ds
with SQLite3 cli.ds_importer
set_include_in_feeds
FEEDS_BASE_DIR="/Sites/feeds"
scp "library.example.edu:$FEEDS_BASE_DIR/people.csv" people_final.csv
echo "clpid" >in_feeds.csv
ssh library.example.edu "ls -1 -d $FEEDS_BASE_DIR/htdocs/people/* | cut -d / -f 6" >>in_feeds.csv
./bin/ds_importer people.ds people_final.csv
./bin/set_include_in_feeds people.ds in_feeds.csv