Watchdog service

Pocket Archive comes with a small utility that watches a drop box, which can enable remote submissions.

The pkar_watch utility is a server running on the machine that hosts Pocket Archive. Users interact with the drop box by uploading files to trigger specific actions, and/or by downloading files generated by Pocket Archive.

pkar_watch watches a local folder, specified on startup, for new files. Any time a file with a specific name pattern is added to that folder, it triggers a particular event. More information about the supported action is in the remote submission guide.

Note: currently, pkar_watch relies on inotify, a Linux utility. Unless a POSIX compatible solution is implemented at a later time, the program can only be run on Linux.

Transfer protocols

The watched folder is local to the Pocket Archive operating system. Pocket Archive itself does not provide a network service that allows remote users to upload their contents. However, setting up a SFTP, FTPS, WebDav, or other transfer service mapping directly to a local file system is a quite standard and straightforward way to expose a deposit endpoint and manage its permissions.

On a more capable system, a collaboration tool such as Nextcloud (ideally running on a separate server) using one or more Pocket Archive drop box folders as storage back ends can be employed to enable a multi-tenant archive service with a pleasant user interface.

Note on S3

S3 is not a good choice for this setup because it complicates things significantly, at least in the MinIO implementation of S3 that was tested. MinIO remaps the file and folder structure on disk in a way that it doesn't match what is seen on the S3 end, and what was uploaded by the depositor. As a consequence, the files uploaded from S3 cannot be easily utilized straight from the underlying storage (and they probably shouldn't, either). A separate process to monior S3 events and a second S3 transfer would be required to fetch the SIP, which is not in line with the minimalistic and low-bandwidth philosophy of Pocket Archive.

You will not be turned away from the gates of heaven just because you haven't always used S3 in your life.

Running the service

Remote submissions are enabled by running the pkar_watch service in the background:

pkar_watch [options] path

path points the folder to watch. It must be a local folder or a locally mounted network folder [WIP note: the latter is not yet tested].

Other options include:

``` -l, --loglevel (default: 3) Log level: 1 = error, 2 = warning, 3 = info [default], 4 = debug.

See pkar_watch --help for up to date information.