← Documentation index

SPPENTRY

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
CONFIGURATION
PAGES
SIGNALS
FILES
EXIT STATUS
EXAMPLES
SEE ALSO
AUTHOR
COPYRIGHT

NAME

sppentry - the entry module of sapupra: pages to settle by hand what the worker could not, to enter items without code, and to import CSV files or the history of Binary Eye

SYNOPSIS

sppentry [-c|--config FILE] [-s|--syslog] [-d|--debug |-q|--quiet]
sppentry -h
|--help
sppentry -V
|--version

DESCRIPTION

sppentry serves HTML pages, with forms and no script, to any browser of the local network (the methods GET, HEAD and POST), the phone’s included. It lists the scans that need attention (not found, not an ISBN, several records, not a code), and settles each by the ISBN typed, by a search by author and title or by a card number of the Library of Congress, or by a description entered by hand; it decides the scans of books already in the catalogue (another copy, or the same one scanned again). It enters an item that has no code, sets the current location of a scan device, and imports the history that Binary Eye kept of the scans it could not send, and CSV files of ISBNs or of described documents. It makes, renames, merges and deletes the places where items are kept, removes a copy from the catalogue (with a reason) and puts it back, moves a copy to another place, corrects the description of a book, and an item entered by hand can be given a place of its own, which does not become the location of the scan device. It also shows the catalogue, read-only: a simple search and an advanced one, with a field for each attribute of an edition (title, author, publisher, subject, ISBN, ...) that takes an extended regular expression tried on that attribute alone, a year from and to, the copies, the days of entry; the counts by location and medium, the page of a copy, and a CSV file (/catalogue, /catalogue/advanced, /catalogue/item/ID, /catalogue.csv, /catalogue/export). The headings of the columns of an answer order it (sort= and order=desc in the address: title, author, publisher, year, medium, location, entered), in the alphabet of the language of the pages; the counts by location are a folded tree.

It publishes inputs on the MQTT broker, on the topic of the scan device (kinds isbn, record, location, label, remove, restore, correct and place and, for an import, scan), and follows their receipts and verdicts as the gateway does. It never writes the database: it opens it to read, so that it runs under the account of the worker (sapupra), and the worker alone records what it sends.

It runs in the foreground, and is put in the background by the service manager: systemd on Debian (the unit sppentry.service), daemon(8) in an rc script on FreeBSD (the script sppentry). A broker out of reach is not an error: it tries again every 5 seconds, and the pages say that nothing can be sent. A database that is not there yet (the worker has never run) is not one either: the pages open it when it is.

OPTIONS

-c, --config FILE

The configuration file; by default /usr/local/etc/sapupra.ini (the sysconfdir of the installation).

-s, --syslog

Log to syslog, facility daemon, instead of standard error.

-d, --debug

Log the debugging messages too: each publication and each request (method, path, client, status).

-q, --quiet

Log only the warnings and the errors.

-h, --help

Print the usage and exit.

-V, --version

Print the version and exit.

CONFIGURATION

The file is in the INI form, the same as the other programs’; a value left out takes its default.
[broker] host
, port

The broker: by default localhost and 1883.

[entry] listen

The address and the port to listen on: ADDRESS:PORT, or :PORT for every address; by default :8081. ADDRESS may be a name that the machine resolves, as for sppgate(8).

[entry] user, password

The entry module’s account at the broker; its name is also the client identifier. The account may publish on sapupra/v1/input/# and read sapupra/v1/#.

[entry] receipt_timeout

Seconds before an input without receipt is published again; 5 to 3600, by default 30.

[entry] max_upload

The largest file that the import takes, in MiB; 1 to 64, by default 4 (some ten thousand scans).

[entry] default_device

The scan device that the pages use for an item entered by hand and preselect in their lists; the pages call it "manual entry"; by default entry.

[entry] log_level

quiet, normal or debug; the options win.

[database] file

The catalogue, the same file as the worker’s; it is opened to read. Left out, the same default as the worker’s (sppwork(8)).

[interface] language

The language of the pages (of the one sentence that the phone shows, for the gateway): en, the default, or a language with a catalogue installed, as fr. A language without catalogue keeps the English, and the log says which file was looked for.

[locations] prefix

The start of the code of a location label; by default LOC:. What follows it is a path, the parts separated by a slash (LOC:salon/bookcase 2/shelf 4).

[items] prefix

The start of the code of the label of an item, which the page of an item shows with the command of spplabel(1) that prints it; by default ITM:. It must not begin like the location prefix, nor the reverse: the program refuses to start otherwise.

PAGES

/

The first page of the site: it leads (a redirection, status 303) to the catalogue, /catalogue.

/todo

The to-do list: the scans to settle, the scans waiting for a source to answer, and the latest inputs; a code typed in the field finds the waiting input. (Until 0.34.1 this was the page /.)

/input/ID

A scan: what was read, the scans before and after it by the same device, and the forms to settle it.

/new

An item that has no code to scan, described by hand; with like=ITEM the form is filled with the description of that item, to change what differs; the next volume is proposed when the volume of that item is a number. The volume, as on the book (3, III, 1-2), has a field of its own.

/search

Looks a book up in the sources, by its ISBN or by words (a title, an author), for a scan or without one. When nothing is found the page comes back with the answer at the top and the fields as typed.

/places

The places, with the number of items at and below each.

/places/manage

Makes, renames, merges and deletes places (the worker does it, on an order of kind place). The answer of the worker, or what the form got wrong, is said at the top of the same page, so that the next order can follow. A place is made on purpose: a scan of a label of a place that is not made is refused. A place is deleted only if nothing depends on it.

/places/devices

The current location of each scan device, which it sets among the places made, and the place of the browser: a place, among those made, that the browser remembers (POST to /places/browser; a cookie named sapupra_place, kept a year, which only this program reads) and that the forms of the items typed by hand offer first, whatever the location of the manual entry. A form of those sent with a place makes the browser remember it. The cookie is a suggestion: a place that is not made is ignored.

/places/labels

For each place, the command of spplabel(1) that prints its label.

/location

Leads to /places/devices.

/removed

The copies removed from the catalogue, the latest first, with their reason.

/catalogue/item/ID/remove
/catalogue/item/
ID/restore
/catalogue/item/
ID/move

POST: remove a copy (reason: donated, sold, lost, mistake or other), put it back, or put it at a place made.

/catalogue/item/ID/correct

GET: the form of the description, filled with what is stored. POST: correct it, for all the copies of the book (the ISBN only of a description entered by hand).

/import

A CSV file (a list of ISBNs to look up, or a list of described documents; the names of the columns on its first line say which), or the history of Binary Eye, exported as a JSON file: what would be sent is shown, and sent when confirmed. Every row of a CSV file makes a copy.

/result/ID

The verdict of the worker on an input that was sent; the page loads again by itself until it comes. An order given on a page leads back to it once answered, the answer being said at the top; what asks to choose (a list of books) stays here.

SIGNALS

SIGTERM, SIGINT

Stop.

SIGHUP

Ignored: restart the service to read the configuration again.

FILES

/usr/local/etc/sapupra.ini

The configuration, owned by root, mode 0644: every account reads it.

/usr/local/etc/sapupra.secret.ini

The secrets (the broker’s password of the entry module), owned by root, group sapupra, mode 0640: the services read it, and its values win over the configuration’s. Its name is that of the configuration file with .secret before the .ini.

/var/db/sapupra/catalogue.db

The catalogue on FreeBSD (/var/lib/sapupra on Debian), read.

EXIT STATUS

0

Stopped by a signal.

1

The configuration cannot be read or holds an invalid value, or the port cannot be listened on.

2

A usage error.

EXAMPLES

Run it by hand, from the account of the worker:

sudo -u sapupra sppentry --debug --config ./sapupra.ini

then open http://localhost:8081/ in a browser.

SEE ALSO

sppgate(8), sppwork(8), mosquitto(8), Design.org, section "The entry module"; Manual.org, section "The entry module".

AUTHOR

Péter Felecan, assisted by Claude Opus 5.5 (Anthropic).

COPYRIGHT

Copyright (C) 2026 Péter Felecan. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.