RokFrelsi Linux Print Agent 2.0

For Linux Mint 21+, Ubuntu 22.04+, Debian 12+. Printers must already be installed
in CUPS. USB and network printers both use their CUPS queue and installed driver.
The agent makes outbound HTTPS requests only. It does not open a network port.

INSTALL
  sudo apt install ./rokfrelsi-print-agent_2.0.0_all.deb
  sudo install -m 0640 -o root -g rokfrelsi-print /usr/share/doc/rokfrelsi-print-agent/config.example.json /etc/rokfrelsi-print/config.json
  sudoedit /etc/rokfrelsi-print/config.json

In RokFrelsi Settings > Printing create an agent. Put its one-time token and
the HTTPS server origin in config.json. Set enabled to true. Keep tokens private.
  sudo systemctl start rokfrelsi-print
  sudo systemctl status rokfrelsi-print
  journalctl -u rokfrelsi-print -f

Assign label, receipt and document roles on the WEBSITE. There are no local
printer routes. Driver defaults are used unless the server explicitly chooses
paper, copies or duplex. If CUPS cannot report paper dimensions, choose an
explicit server paper size. Never select a virtual printer requiring a dialog.

The service is enabled at boot by package installation. It runs without a desktop
login, restarts on failure and keeps its durable journal in /var/lib/rokfrelsi-print.
The config is not overwritten on upgrades. Package removal preserves config and
journal. Revoke the agent in Settings before permanently removing those files.

RECOVERY
'Submitted' means CUPS accepted the document, not that paper physically printed.
A crash during submission produces 'uncertain'. Check the printer and CUPS jobs,
then use the server's explicit Retry or Reprint action. Lost server acknowledgments
retry the SAME result and never automatically print the document again.
If the journal is unreadable, restore it; do not delete it to force a retry.

DIAGNOSTICS (no physical printing)
  sudo -u rokfrelsi-print /usr/bin/python3 /opt/rokfrelsi-print/agent.py --discover
  lpstat -p -d
Changing a CUPS queue name may create a new printer identity. Review its role on
the website; missing printers are retained as unavailable for history.

ROLLBACK
Stop the agent, resolve all dispatched/uncertain jobs, then install the previous
package. Keep the journal and configuration. Do not run old and new agents with
the same token simultaneously.
